reservation plugin - unbound request (unclean netmode
authorChrysa Papagianni <chrisap@noc.ntua.gr>
Fri, 17 Apr 2015 15:29:50 +0000 (18:29 +0300)
committerChrysa Papagianni <chrisap@noc.ntua.gr>
Fri, 17 Apr 2015 15:29:50 +0000 (18:29 +0300)
284 files changed:
portal/static/unbound_reservation_static/css/bootstrap-switch.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/bootstrap-switch.min.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/bootstrap-theme.min.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/bootstrap.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/bootstrap.min.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/dhtmlx.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/dhtmlxform.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/ext/dhxupload.xap [new file with mode: 0644]
portal/static/unbound_reservation_static/css/ext/swfobject.js [new file with mode: 0644]
portal/static/unbound_reservation_static/css/ext/uploader.swf [new file with mode: 0644]
portal/static/unbound_reservation_static/css/images/gradient.png [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_chbxrd.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_buttons.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_uploading.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/css/node-network.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/rmenu_styles.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/slider.css [new file with mode: 0644]
portal/static/unbound_reservation_static/css/workflow.css [new file with mode: 0644]
portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.eot [new file with mode: 0644]
portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.svg [new file with mode: 0644]
portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.ttf [new file with mode: 0644]
portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.woff [new file with mode: 0644]
portal/static/unbound_reservation_static/img/any.jpg [new file with mode: 0644]
portal/static/unbound_reservation_static/img/close.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/openflow.jpg [new file with mode: 0644]
portal/static/unbound_reservation_static/img/target-32.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/vm.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/wireless.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/actor.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/bg-editor.jpg [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/diagrama.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/icons/calendar.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/icons/flag_blue.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/icons/flag_green.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/icons/flag_magenta.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/icons/flag_red.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/images.jpg [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/open_flow.jpeg [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/open_flow.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/open_flow_icon.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/persona.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/vm.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/vm_icon.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/vm_icons.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/wireless.png [new file with mode: 0644]
portal/static/unbound_reservation_static/img/workflow/wireless_icon.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/bootstrap-slider.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/bootstrap-switch.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/bootstrap-switch.min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/bootstrap.min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/contextmenu/bower.json [new file with mode: 0644]
portal/static/unbound_reservation_static/js/contextmenu/contextMenu.css [new file with mode: 0644]
portal/static/unbound_reservation_static/js/contextmenu/contextMenu.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/contextmenu/contextMenu.js.jquery.json [new file with mode: 0644]
portal/static/unbound_reservation_static/js/contextmenu/contextMenu.min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/createpost.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/createpost_.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/createpost__.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/dhtmlx.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/jquery-1.11.1.min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/main.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/main_.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/main_1.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/Thumbs.db [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/cut.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/door.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/page_white_add.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/page_white_copy.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/page_white_delete.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/page_white_edit.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/images/page_white_paste.png [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/jquery.contextMenu.css [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/jquery.contextMenu.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/menu/jquery.ui.position.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/node-network.js [new file with mode: 0644]
portal/static/unbound_reservation_static/js/script.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/dhtmlx.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/dhtmlx_deprecated.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/dhtmlxform.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/ext/dhxupload.xap [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/ext/swfobject.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/ext/uploader.swf [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_btns.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_cell_progress.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_colors.png [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_icon_save.png [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector.png [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_cells.png [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_lines.png [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/marker.png [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_center.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_justify.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_left.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_right.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/bold.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/buttons.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/clear.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_dec.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_inc.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/italic.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_bullet.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_number.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_sub.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_super.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/strike.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/underline.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_chbxrd.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_buttons.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_uploading.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/blank.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/combo_select_dhx_skyblue.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_down.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_up.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/imageloaderror.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/minus.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_page.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_pages.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_rows.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/plus.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_asc.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_desc.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/blank.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/folder.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/leaf.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus5.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus5.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_btns.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_progress.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_h.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_v.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_chrd.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_loader.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_subar.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_bottom.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_left.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_right.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_top.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_arrow.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_down.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_up.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_cell_progress.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_arrows.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_button_close.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_cell_progress.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow_dis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/blank.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/but_cut.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderClosed.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderOpen.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckAll.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckDis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckGray.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckAll.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckDis.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/leaf.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/lock.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus1.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5_rtl.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_off.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_on.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_buttons.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_icon.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_progress.gif [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/jquery-1.9.0-min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/jquery-1.9.0.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/jquery-ui-1.9.2-min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/jsBezier-0.6-min.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/jsBezier-0.6.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/jsplumb-geom-0.1.js [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/thirdparty/excanvas/AUTHORS [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/thirdparty/excanvas/COPYING [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/thirdparty/excanvas/README [new file with mode: 0644]
portal/static/unbound_reservation_static/lib/thirdparty/excanvas/excanvas.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/anchors.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/connection.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/connector-editors.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/connectors-bezier.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/connectors-flowchart.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/connectors-statemachine.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/defaults.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/dom-adapter.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/dom.jsPlumb.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/drag.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/endpoint.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/jquery.jsPlumb.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/jsPlumb.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/mootools.jsPlumb.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/overlays-guidelines.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/renderers-canvas.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/renderers-svg.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/renderers-vml.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/util.js [new file with mode: 0644]
portal/static/unbound_reservation_static/src/yui.jsPlumb.js [new file with mode: 0644]
portal/templates/workflow_b.html [new file with mode: 0644]
portal/unboundreservationview_b.py [new file with mode: 0644]
portal/urls.py

diff --git a/portal/static/unbound_reservation_static/css/bootstrap-switch.css b/portal/static/unbound_reservation_static/css/bootstrap-switch.css
new file mode 100644 (file)
index 0000000..bf18035
--- /dev/null
@@ -0,0 +1,202 @@
+/* ========================================================================
+ * bootstrap-switch - v3.0.1
+ * http://www.bootstrap-switch.org
+ * ========================================================================
+ * Copyright 2012-2013 Mattia Larentis
+ *
+ * ========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================================
+ */
+
+.bootstrap-switch {
+  display: inline-block;
+  cursor: pointer;
+  border-radius: 4px;
+  border: 1px solid;
+  border-color: #cccccc;
+  position: relative;
+  text-align: left;
+  overflow: hidden;
+  line-height: 8px;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+  vertical-align: middle;
+  min-width: 100px;
+  -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+}
+.bootstrap-switch.bootstrap-switch-mini {
+  min-width: 71px;
+}
+.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
+.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
+.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
+  padding-bottom: 4px;
+  padding-top: 4px;
+  font-size: 10px;
+  line-height: 9px;
+}
+.bootstrap-switch.bootstrap-switch-small {
+  min-width: 79px;
+}
+.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
+.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
+.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
+  padding-bottom: 3px;
+  padding-top: 3px;
+  font-size: 12px;
+  line-height: 18px;
+}
+.bootstrap-switch.bootstrap-switch-large {
+  min-width: 120px;
+}
+.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
+.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
+.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
+  padding-bottom: 9px;
+  padding-top: 9px;
+  font-size: 16px;
+  line-height: normal;
+}
+.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
+  -webkit-transition: margin-left 0.5s;
+  transition: margin-left 0.5s;
+}
+.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container {
+  margin-left: 0%;
+}
+.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label {
+  border-bottom-right-radius: 3px;
+  border-top-right-radius: 3px;
+}
+.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container {
+  margin-left: -50%;
+}
+.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label {
+  border-bottom-left-radius: 3px;
+  border-top-left-radius: 3px;
+}
+.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-container {
+  margin-left: -25%;
+}
+.bootstrap-switch.bootstrap-switch-disabled,
+.bootstrap-switch.bootstrap-switch-readonly,
+.bootstrap-switch.bootstrap-switch-indeterminate {
+  opacity: 0.5;
+  filter: alpha(opacity=50);
+  cursor: default !important;
+}
+.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
+.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
+.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
+.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
+.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
+.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
+.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
+.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
+.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
+  cursor: default !important;
+}
+.bootstrap-switch.bootstrap-switch-focused {
+  border-color: #66afe9;
+  outline: 0;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
+  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
+}
+.bootstrap-switch .bootstrap-switch-container {
+  display: inline-block;
+  width: 150%;
+  top: 0;
+  border-radius: 4px;
+  -webkit-transform: translate3d(0, 0, 0);
+  transform: translate3d(0, 0, 0);
+}
+.bootstrap-switch .bootstrap-switch-handle-on,
+.bootstrap-switch .bootstrap-switch-handle-off,
+.bootstrap-switch .bootstrap-switch-label {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+  cursor: pointer;
+  display: inline-block !important;
+  height: 100%;
+  padding-bottom: 4px;
+  padding-top: 4px;
+  font-size: 14px;
+  line-height: 20px;
+}
+.bootstrap-switch .bootstrap-switch-handle-on,
+.bootstrap-switch .bootstrap-switch-handle-off {
+  text-align: center;
+  z-index: 1;
+  width: 33.333333333%;
+}
+.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
+.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
+  color: #fff;
+  background: #428bca;
+}
+.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
+.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
+  color: #fff;
+  background: #5bc0de;
+}
+.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
+.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
+  color: #fff;
+  background: #5cb85c;
+}
+.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
+.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
+  background: #f0ad4e;
+  color: #fff;
+}
+.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
+.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
+  color: #fff;
+  background: #d9534f;
+}
+.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
+.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
+  color: #000;
+  background: #eeeeee;
+}
+.bootstrap-switch .bootstrap-switch-handle-on {
+  border-bottom-left-radius: 3px;
+  border-top-left-radius: 3px;
+}
+.bootstrap-switch .bootstrap-switch-handle-off {
+  border-bottom-right-radius: 3px;
+  border-top-right-radius: 3px;
+}
+.bootstrap-switch .bootstrap-switch-label {
+  text-align: center;
+  margin-top: -1px;
+  margin-bottom: -1px;
+  z-index: 100;
+  width: 33.333333333%;
+  color: #333333;
+  background: #ffffff;
+}
+.bootstrap-switch input[type='radio'],
+.bootstrap-switch input[type='checkbox'] {
+  position: absolute !important;
+  top: 0;
+  left: 0;
+  opacity: 0;
+  filter: alpha(opacity=0);
+  z-index: -1;
+}
diff --git a/portal/static/unbound_reservation_static/css/bootstrap-switch.min.css b/portal/static/unbound_reservation_static/css/bootstrap-switch.min.css
new file mode 100644 (file)
index 0000000..b5f05e5
--- /dev/null
@@ -0,0 +1,22 @@
+/* ========================================================================
+ * bootstrap-switch - v3.0.1
+ * http://www.bootstrap-switch.org
+ * ========================================================================
+ * Copyright 2012-2013 Mattia Larentis
+ *
+ * ========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================================
+ */
+
+.bootstrap-switch{display:inline-block;cursor:pointer;border-radius:4px;border:1px solid;border-color:#ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;min-width:100px;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.bootstrap-switch.bootstrap-switch-mini{min-width:71px}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding-bottom:4px;padding-top:4px;font-size:10px;line-height:9px}.bootstrap-switch.bootstrap-switch-small{min-width:79px}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding-bottom:3px;padding-top:3px;font-size:12px;line-height:18px}.bootstrap-switch.bootstrap-switch-large{min-width:120px}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding-bottom:9px;padding-top:9px;font-size:16px;line-height:normal}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left .5s;transition:margin-left .5s}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container{margin-left:0}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container{margin-left:-50%}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-container{margin-left:-25%}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-readonly,.bootstrap-switch.bootstrap-switch-indeterminate{opacity:.5;filter:alpha(opacity=50);cursor:default!important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label{cursor:default!important}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.bootstrap-switch .bootstrap-switch-container{display:inline-block;width:150%;top:0;border-radius:4px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:inline-block!important;height:100%;padding-bottom:4px;padding-top:4px;font-size:14px;line-height:20px}.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-handle-off{text-align:center;z-index:1;width:33.33333333%}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary{color:#fff;background:#428bca}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info{color:#fff;background:#5bc0de}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success{color:#fff;background:#5cb85c}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning{background:#f0ad4e;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger{color:#fff;background:#d9534f}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default{color:#000;background:#eee}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;width:33.33333333%;color:#333;background:#fff}.bootstrap-switch input[type=radio],.bootstrap-switch input[type=checkbox]{position:absolute!important;top:0;left:0;opacity:0;filter:alpha(opacity=0);z-index:-1}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/bootstrap-theme.min.css b/portal/static/unbound_reservation_static/css/bootstrap-theme.min.css
new file mode 100644 (file)
index 0000000..ba4bd28
--- /dev/null
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v3.1.1 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/bootstrap.css b/portal/static/unbound_reservation_static/css/bootstrap.css
new file mode 100644 (file)
index 0000000..377dff3
--- /dev/null
@@ -0,0 +1,7118 @@
+/*!
+ * Bootstrap v3.0.3 (http://getbootstrap.com)
+ * Copyright 2013 Twitter, Inc.
+ * Licensed under http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+nav,
+section,
+summary {
+  display: block;
+}
+
+audio,
+canvas,
+video {
+  display: inline-block;
+}
+
+audio:not([controls]) {
+  display: none;
+  height: 0;
+}
+
+[hidden],
+template {
+  display: none;
+}
+
+html {
+  font-family: sans-serif;
+  -webkit-text-size-adjust: 100%;
+      -ms-text-size-adjust: 100%;
+}
+
+body {
+  margin: 0;
+}
+
+a {
+  background: transparent;
+}
+
+a:focus {
+  outline: thin dotted;
+}
+
+a:active,
+a:hover {
+  outline: 0;
+}
+
+h1 {
+  margin: 0.67em 0;
+  font-size: 2em;
+}
+
+abbr[title] {
+  border-bottom: 1px dotted;
+}
+
+b,
+strong {
+  font-weight: bold;
+}
+
+dfn {
+  font-style: italic;
+}
+
+hr {
+  height: 0;
+  -moz-box-sizing: content-box;
+       box-sizing: content-box;
+}
+
+mark {
+  color: #000;
+  background: #ff0;
+}
+
+code,
+kbd,
+pre,
+samp {
+  font-family: monospace, serif;
+  font-size: 1em;
+}
+
+pre {
+  white-space: pre-wrap;
+}
+
+q {
+  quotes: "\201C" "\201D" "\2018" "\2019";
+}
+
+small {
+  font-size: 80%;
+}
+
+sub,
+sup {
+  position: relative;
+  font-size: 75%;
+  line-height: 0;
+  vertical-align: baseline;
+}
+
+sup {
+  top: -0.5em;
+}
+
+sub {
+  bottom: -0.25em;
+}
+
+img {
+  border: 0;
+}
+
+svg:not(:root) {
+  overflow: hidden;
+}
+
+figure {
+  margin: 0;
+}
+
+fieldset {
+  padding: 0.35em 0.625em 0.75em;
+  margin: 0 2px;
+  border: 1px solid #c0c0c0;
+}
+
+legend {
+  padding: 0;
+  border: 0;
+}
+
+button,
+input,
+select,
+textarea {
+  margin: 0;
+  font-family: inherit;
+  font-size: 100%;
+}
+
+button,
+input {
+  line-height: normal;
+}
+
+button,
+select {
+  text-transform: none;
+}
+
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+  cursor: pointer;
+  -webkit-appearance: button;
+}
+
+button[disabled],
+html input[disabled] {
+  cursor: default;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+  padding: 0;
+  box-sizing: border-box;
+}
+
+input[type="search"] {
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+  -webkit-appearance: textfield;
+}
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+  -webkit-appearance: none;
+}
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+  padding: 0;
+  border: 0;
+}
+
+textarea {
+  overflow: auto;
+  vertical-align: top;
+}
+
+table {
+  border-collapse: collapse;
+  border-spacing: 0;
+}
+
+@media print {
+  * {
+    color: #000 !important;
+    text-shadow: none !important;
+    background: transparent !important;
+    box-shadow: none !important;
+  }
+  a,
+  a:visited {
+    text-decoration: underline;
+  }
+  a[href]:after {
+    content: " (" attr(href) ")";
+  }
+  abbr[title]:after {
+    content: " (" attr(title) ")";
+  }
+  a[href^="javascript:"]:after,
+  a[href^="#"]:after {
+    content: "";
+  }
+  pre,
+  blockquote {
+    border: 1px solid #999;
+    page-break-inside: avoid;
+  }
+  thead {
+    display: table-header-group;
+  }
+  tr,
+  img {
+    page-break-inside: avoid;
+  }
+  img {
+    max-width: 100% !important;
+  }
+  @page  {
+    margin: 2cm .5cm;
+  }
+  p,
+  h2,
+  h3 {
+    orphans: 3;
+    widows: 3;
+  }
+  h2,
+  h3 {
+    page-break-after: avoid;
+  }
+  select {
+    background: #fff !important;
+  }
+  .navbar {
+    display: none;
+  }
+  .table td,
+  .table th {
+    background-color: #fff !important;
+  }
+  .btn > .caret,
+  .dropup > .btn > .caret {
+    border-top-color: #000 !important;
+  }
+  .label {
+    border: 1px solid #000;
+  }
+  .table {
+    border-collapse: collapse !important;
+  }
+  .table-bordered th,
+  .table-bordered td {
+    border: 1px solid #ddd !important;
+  }
+}
+
+*,
+*:before,
+*:after {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+
+html {
+  font-size: 62.5%;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+body {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 14px;
+  line-height: 1.428571429;
+  color: #333333;
+  background-color: #ffffff;
+}
+
+input,
+button,
+select,
+textarea {
+  font-family: inherit;
+  font-size: inherit;
+  line-height: inherit;
+}
+
+a {
+  color: #428bca;
+  text-decoration: none;
+}
+
+a:hover,
+a:focus {
+  color: #2a6496;
+  text-decoration: underline;
+}
+
+a:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+
+img {
+  vertical-align: middle;
+}
+
+.img-responsive {
+  display: block;
+  height: auto;
+  max-width: 100%;
+}
+
+.img-rounded {
+  border-radius: 6px;
+}
+
+.img-thumbnail {
+  display: inline-block;
+  height: auto;
+  max-width: 100%;
+  padding: 4px;
+  line-height: 1.428571429;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+  border-radius: 4px;
+  -webkit-transition: all 0.2s ease-in-out;
+          transition: all 0.2s ease-in-out;
+}
+
+.img-circle {
+  border-radius: 50%;
+}
+
+hr {
+  margin-top: 20px;
+  margin-bottom: 20px;
+  border: 0;
+  border-top: 1px solid #eeeeee;
+}
+
+.sr-only {
+  position: absolute;
+  width: 1px;
+  height: 1px;
+  padding: 0;
+  margin: -1px;
+  overflow: hidden;
+  clip: rect(0, 0, 0, 0);
+  border: 0;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+.h1,
+.h2,
+.h3,
+.h4,
+.h5,
+.h6 {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-weight: 500;
+  line-height: 1.1;
+  color: inherit;
+}
+
+h1 small,
+h2 small,
+h3 small,
+h4 small,
+h5 small,
+h6 small,
+.h1 small,
+.h2 small,
+.h3 small,
+.h4 small,
+.h5 small,
+.h6 small,
+h1 .small,
+h2 .small,
+h3 .small,
+h4 .small,
+h5 .small,
+h6 .small,
+.h1 .small,
+.h2 .small,
+.h3 .small,
+.h4 .small,
+.h5 .small,
+.h6 .small {
+  font-weight: normal;
+  line-height: 1;
+  color: #999999;
+}
+
+h1,
+h2,
+h3 {
+  margin-top: 20px;
+  margin-bottom: 10px;
+}
+
+h1 small,
+h2 small,
+h3 small,
+h1 .small,
+h2 .small,
+h3 .small {
+  font-size: 65%;
+}
+
+h4,
+h5,
+h6 {
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+
+h4 small,
+h5 small,
+h6 small,
+h4 .small,
+h5 .small,
+h6 .small {
+  font-size: 75%;
+}
+
+h1,
+.h1 {
+  font-size: 36px;
+}
+
+h2,
+.h2 {
+  font-size: 30px;
+}
+
+h3,
+.h3 {
+  font-size: 24px;
+}
+
+h4,
+.h4 {
+  font-size: 18px;
+}
+
+h5,
+.h5 {
+  font-size: 14px;
+}
+
+h6,
+.h6 {
+  font-size: 12px;
+}
+
+p {
+  margin: 0 0 10px;
+}
+
+.lead {
+  margin-bottom: 20px;
+  font-size: 16px;
+  font-weight: 200;
+  line-height: 1.4;
+}
+
+@media (min-width: 768px) {
+  .lead {
+    font-size: 21px;
+  }
+}
+
+small,
+.small {
+  font-size: 85%;
+}
+
+cite {
+  font-style: normal;
+}
+
+.text-muted {
+  color: #999999;
+}
+
+.text-primary {
+  color: #428bca;
+}
+
+.text-primary:hover {
+  color: #3071a9;
+}
+
+.text-warning {
+  color: #8a6d3b;
+}
+
+.text-warning:hover {
+  color: #66512c;
+}
+
+.text-danger {
+  color: #a94442;
+}
+
+.text-danger:hover {
+  color: #843534;
+}
+
+.text-success {
+  color: #3c763d;
+}
+
+.text-success:hover {
+  color: #2b542c;
+}
+
+.text-info {
+  color: #31708f;
+}
+
+.text-info:hover {
+  color: #245269;
+}
+
+.text-left {
+  text-align: left;
+}
+
+.text-right {
+  text-align: right;
+}
+
+.text-center {
+  text-align: center;
+}
+
+.page-header {
+  padding-bottom: 9px;
+  margin: 40px 0 20px;
+  border-bottom: 1px solid #eeeeee;
+}
+
+ul,
+ol {
+  margin-top: 0;
+  margin-bottom: 10px;
+}
+
+ul ul,
+ol ul,
+ul ol,
+ol ol {
+  margin-bottom: 0;
+}
+
+.list-unstyled {
+  padding-left: 0;
+  list-style: none;
+}
+
+.list-inline {
+  padding-left: 0;
+  list-style: none;
+}
+
+.list-inline > li {
+  display: inline-block;
+  padding-right: 5px;
+  padding-left: 5px;
+}
+
+.list-inline > li:first-child {
+  padding-left: 0;
+}
+
+dl {
+  margin-top: 0;
+  margin-bottom: 20px;
+}
+
+dt,
+dd {
+  line-height: 1.428571429;
+}
+
+dt {
+  font-weight: bold;
+}
+
+dd {
+  margin-left: 0;
+}
+
+@media (min-width: 768px) {
+  .dl-horizontal dt {
+    float: left;
+    width: 160px;
+    overflow: hidden;
+    clear: left;
+    text-align: right;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  .dl-horizontal dd {
+    margin-left: 180px;
+  }
+  .dl-horizontal dd:before,
+  .dl-horizontal dd:after {
+    display: table;
+    content: " ";
+  }
+  .dl-horizontal dd:after {
+    clear: both;
+  }
+  .dl-horizontal dd:before,
+  .dl-horizontal dd:after {
+    display: table;
+    content: " ";
+  }
+  .dl-horizontal dd:after {
+    clear: both;
+  }
+}
+
+abbr[title],
+abbr[data-original-title] {
+  cursor: help;
+  border-bottom: 1px dotted #999999;
+}
+
+.initialism {
+  font-size: 90%;
+  text-transform: uppercase;
+}
+
+blockquote {
+  padding: 10px 20px;
+  margin: 0 0 20px;
+  border-left: 5px solid #eeeeee;
+}
+
+blockquote p {
+  font-size: 17.5px;
+  font-weight: 300;
+  line-height: 1.25;
+}
+
+blockquote p:last-child {
+  margin-bottom: 0;
+}
+
+blockquote small,
+blockquote .small {
+  display: block;
+  line-height: 1.428571429;
+  color: #999999;
+}
+
+blockquote small:before,
+blockquote .small:before {
+  content: '\2014 \00A0';
+}
+
+blockquote.pull-right {
+  padding-right: 15px;
+  padding-left: 0;
+  border-right: 5px solid #eeeeee;
+  border-left: 0;
+}
+
+blockquote.pull-right p,
+blockquote.pull-right small,
+blockquote.pull-right .small {
+  text-align: right;
+}
+
+blockquote.pull-right small:before,
+blockquote.pull-right .small:before {
+  content: '';
+}
+
+blockquote.pull-right small:after,
+blockquote.pull-right .small:after {
+  content: '\00A0 \2014';
+}
+
+blockquote:before,
+blockquote:after {
+  content: "";
+}
+
+address {
+  margin-bottom: 20px;
+  font-style: normal;
+  line-height: 1.428571429;
+}
+
+code,
+kbd,
+pre,
+samp {
+  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+code {
+  padding: 2px 4px;
+  font-size: 90%;
+  color: #c7254e;
+  white-space: nowrap;
+  background-color: #f9f2f4;
+  border-radius: 4px;
+}
+
+pre {
+  display: block;
+  padding: 9.5px;
+  margin: 0 0 10px;
+  font-size: 13px;
+  line-height: 1.428571429;
+  color: #333333;
+  word-break: break-all;
+  word-wrap: break-word;
+  background-color: #f5f5f5;
+  border: 1px solid #cccccc;
+  border-radius: 4px;
+}
+
+pre code {
+  padding: 0;
+  font-size: inherit;
+  color: inherit;
+  white-space: pre-wrap;
+  background-color: transparent;
+  border-radius: 0;
+}
+
+.pre-scrollable {
+  max-height: 340px;
+  overflow-y: scroll;
+}
+
+.container {
+  padding-right: 15px;
+  padding-left: 15px;
+  margin-right: auto;
+  margin-left: auto;
+}
+
+.container:before,
+.container:after {
+  display: table;
+  content: " ";
+}
+
+.container:after {
+  clear: both;
+}
+
+.container:before,
+.container:after {
+  display: table;
+  content: " ";
+}
+
+.container:after {
+  clear: both;
+}
+
+@media (min-width: 768px) {
+  .container {
+    width: 750px;
+  }
+}
+
+@media (min-width: 992px) {
+  .container {
+    width: 970px;
+  }
+}
+
+@media (min-width: 1200px) {
+  .container {
+    width: 1170px;
+  }
+}
+
+.row {
+  margin-right: -15px;
+  margin-left: -15px;
+}
+
+.row:before,
+.row:after {
+  display: table;
+  content: " ";
+}
+
+.row:after {
+  clear: both;
+}
+
+.row:before,
+.row:after {
+  display: table;
+  content: " ";
+}
+
+.row:after {
+  clear: both;
+}
+
+.col-xs-1,
+.col-sm-1,
+.col-md-1,
+.col-lg-1,
+.col-xs-2,
+.col-sm-2,
+.col-md-2,
+.col-lg-2,
+.col-xs-3,
+.col-sm-3,
+.col-md-3,
+.col-lg-3,
+.col-xs-4,
+.col-sm-4,
+.col-md-4,
+.col-lg-4,
+.col-xs-5,
+.col-sm-5,
+.col-md-5,
+.col-lg-5,
+.col-xs-6,
+.col-sm-6,
+.col-md-6,
+.col-lg-6,
+.col-xs-7,
+.col-sm-7,
+.col-md-7,
+.col-lg-7,
+.col-xs-8,
+.col-sm-8,
+.col-md-8,
+.col-lg-8,
+.col-xs-9,
+.col-sm-9,
+.col-md-9,
+.col-lg-9,
+.col-xs-10,
+.col-sm-10,
+.col-md-10,
+.col-lg-10,
+.col-xs-11,
+.col-sm-11,
+.col-md-11,
+.col-lg-11,
+.col-xs-12,
+.col-sm-12,
+.col-md-12,
+.col-lg-12 {
+  position: relative;
+  min-height: 1px;
+  padding-right: 15px;
+  padding-left: 15px;
+}
+
+.col-xs-1,
+.col-xs-2,
+.col-xs-3,
+.col-xs-4,
+.col-xs-5,
+.col-xs-6,
+.col-xs-7,
+.col-xs-8,
+.col-xs-9,
+.col-xs-10,
+.col-xs-11,
+.col-xs-12 {
+  float: left;
+}
+
+.col-xs-12 {
+  width: 100%;
+}
+
+.col-xs-11 {
+  width: 91.66666666666666%;
+}
+
+.col-xs-10 {
+  width: 83.33333333333334%;
+}
+
+.col-xs-9 {
+  width: 75%;
+}
+
+.col-xs-8 {
+  width: 66.66666666666666%;
+}
+
+.col-xs-7 {
+  width: 58.333333333333336%;
+}
+
+.col-xs-6 {
+  width: 50%;
+}
+
+.col-xs-5 {
+  width: 41.66666666666667%;
+}
+
+.col-xs-4 {
+  width: 33.33333333333333%;
+}
+
+.col-xs-3 {
+  width: 25%;
+}
+
+.col-xs-2 {
+  width: 16.666666666666664%;
+}
+
+.col-xs-1 {
+  width: 8.333333333333332%;
+}
+
+.col-xs-pull-12 {
+  right: 100%;
+}
+
+.col-xs-pull-11 {
+  right: 91.66666666666666%;
+}
+
+.col-xs-pull-10 {
+  right: 83.33333333333334%;
+}
+
+.col-xs-pull-9 {
+  right: 75%;
+}
+
+.col-xs-pull-8 {
+  right: 66.66666666666666%;
+}
+
+.col-xs-pull-7 {
+  right: 58.333333333333336%;
+}
+
+.col-xs-pull-6 {
+  right: 50%;
+}
+
+.col-xs-pull-5 {
+  right: 41.66666666666667%;
+}
+
+.col-xs-pull-4 {
+  right: 33.33333333333333%;
+}
+
+.col-xs-pull-3 {
+  right: 25%;
+}
+
+.col-xs-pull-2 {
+  right: 16.666666666666664%;
+}
+
+.col-xs-pull-1 {
+  right: 8.333333333333332%;
+}
+
+.col-xs-pull-0 {
+  right: 0;
+}
+
+.col-xs-push-12 {
+  left: 100%;
+}
+
+.col-xs-push-11 {
+  left: 91.66666666666666%;
+}
+
+.col-xs-push-10 {
+  left: 83.33333333333334%;
+}
+
+.col-xs-push-9 {
+  left: 75%;
+}
+
+.col-xs-push-8 {
+  left: 66.66666666666666%;
+}
+
+.col-xs-push-7 {
+  left: 58.333333333333336%;
+}
+
+.col-xs-push-6 {
+  left: 50%;
+}
+
+.col-xs-push-5 {
+  left: 41.66666666666667%;
+}
+
+.col-xs-push-4 {
+  left: 33.33333333333333%;
+}
+
+.col-xs-push-3 {
+  left: 25%;
+}
+
+.col-xs-push-2 {
+  left: 16.666666666666664%;
+}
+
+.col-xs-push-1 {
+  left: 8.333333333333332%;
+}
+
+.col-xs-push-0 {
+  left: 0;
+}
+
+.col-xs-offset-12 {
+  margin-left: 100%;
+}
+
+.col-xs-offset-11 {
+  margin-left: 91.66666666666666%;
+}
+
+.col-xs-offset-10 {
+  margin-left: 83.33333333333334%;
+}
+
+.col-xs-offset-9 {
+  margin-left: 75%;
+}
+
+.col-xs-offset-8 {
+  margin-left: 66.66666666666666%;
+}
+
+.col-xs-offset-7 {
+  margin-left: 58.333333333333336%;
+}
+
+.col-xs-offset-6 {
+  margin-left: 50%;
+}
+
+.col-xs-offset-5 {
+  margin-left: 41.66666666666667%;
+}
+
+.col-xs-offset-4 {
+  margin-left: 33.33333333333333%;
+}
+
+.col-xs-offset-3 {
+  margin-left: 25%;
+}
+
+.col-xs-offset-2 {
+  margin-left: 16.666666666666664%;
+}
+
+.col-xs-offset-1 {
+  margin-left: 8.333333333333332%;
+}
+
+.col-xs-offset-0 {
+  margin-left: 0;
+}
+
+@media (min-width: 768px) {
+  .col-sm-1,
+  .col-sm-2,
+  .col-sm-3,
+  .col-sm-4,
+  .col-sm-5,
+  .col-sm-6,
+  .col-sm-7,
+  .col-sm-8,
+  .col-sm-9,
+  .col-sm-10,
+  .col-sm-11,
+  .col-sm-12 {
+    float: left;
+  }
+  .col-sm-12 {
+    width: 100%;
+  }
+  .col-sm-11 {
+    width: 91.66666666666666%;
+  }
+  .col-sm-10 {
+    width: 83.33333333333334%;
+  }
+  .col-sm-9 {
+    width: 75%;
+  }
+  .col-sm-8 {
+    width: 66.66666666666666%;
+  }
+  .col-sm-7 {
+    width: 58.333333333333336%;
+  }
+  .col-sm-6 {
+    width: 50%;
+  }
+  .col-sm-5 {
+    width: 41.66666666666667%;
+  }
+  .col-sm-4 {
+    width: 33.33333333333333%;
+  }
+  .col-sm-3 {
+    width: 25%;
+  }
+  .col-sm-2 {
+    width: 16.666666666666664%;
+  }
+  .col-sm-1 {
+    width: 8.333333333333332%;
+  }
+  .col-sm-pull-12 {
+    right: 100%;
+  }
+  .col-sm-pull-11 {
+    right: 91.66666666666666%;
+  }
+  .col-sm-pull-10 {
+    right: 83.33333333333334%;
+  }
+  .col-sm-pull-9 {
+    right: 75%;
+  }
+  .col-sm-pull-8 {
+    right: 66.66666666666666%;
+  }
+  .col-sm-pull-7 {
+    right: 58.333333333333336%;
+  }
+  .col-sm-pull-6 {
+    right: 50%;
+  }
+  .col-sm-pull-5 {
+    right: 41.66666666666667%;
+  }
+  .col-sm-pull-4 {
+    right: 33.33333333333333%;
+  }
+  .col-sm-pull-3 {
+    right: 25%;
+  }
+  .col-sm-pull-2 {
+    right: 16.666666666666664%;
+  }
+  .col-sm-pull-1 {
+    right: 8.333333333333332%;
+  }
+  .col-sm-pull-0 {
+    right: 0;
+  }
+  .col-sm-push-12 {
+    left: 100%;
+  }
+  .col-sm-push-11 {
+    left: 91.66666666666666%;
+  }
+  .col-sm-push-10 {
+    left: 83.33333333333334%;
+  }
+  .col-sm-push-9 {
+    left: 75%;
+  }
+  .col-sm-push-8 {
+    left: 66.66666666666666%;
+  }
+  .col-sm-push-7 {
+    left: 58.333333333333336%;
+  }
+  .col-sm-push-6 {
+    left: 50%;
+  }
+  .col-sm-push-5 {
+    left: 41.66666666666667%;
+  }
+  .col-sm-push-4 {
+    left: 33.33333333333333%;
+  }
+  .col-sm-push-3 {
+    left: 25%;
+  }
+  .col-sm-push-2 {
+    left: 16.666666666666664%;
+  }
+  .col-sm-push-1 {
+    left: 8.333333333333332%;
+  }
+  .col-sm-push-0 {
+    left: 0;
+  }
+  .col-sm-offset-12 {
+    margin-left: 100%;
+  }
+  .col-sm-offset-11 {
+    margin-left: 91.66666666666666%;
+  }
+  .col-sm-offset-10 {
+    margin-left: 83.33333333333334%;
+  }
+  .col-sm-offset-9 {
+    margin-left: 75%;
+  }
+  .col-sm-offset-8 {
+    margin-left: 66.66666666666666%;
+  }
+  .col-sm-offset-7 {
+    margin-left: 58.333333333333336%;
+  }
+  .col-sm-offset-6 {
+    margin-left: 50%;
+  }
+  .col-sm-offset-5 {
+    margin-left: 41.66666666666667%;
+  }
+  .col-sm-offset-4 {
+    margin-left: 33.33333333333333%;
+  }
+  .col-sm-offset-3 {
+    margin-left: 25%;
+  }
+  .col-sm-offset-2 {
+    margin-left: 16.666666666666664%;
+  }
+  .col-sm-offset-1 {
+    margin-left: 8.333333333333332%;
+  }
+  .col-sm-offset-0 {
+    margin-left: 0;
+  }
+}
+
+@media (min-width: 992px) {
+  .col-md-1,
+  .col-md-2,
+  .col-md-3,
+  .col-md-4,
+  .col-md-5,
+  .col-md-6,
+  .col-md-7,
+  .col-md-8,
+  .col-md-9,
+  .col-md-10,
+  .col-md-11,
+  .col-md-12 {
+    float: left;
+  }
+  .col-md-12 {
+    width: 100%;
+  }
+  .col-md-11 {
+    width: 91.66666666666666%;
+  }
+  .col-md-10 {
+    width: 83.33333333333334%;
+  }
+  .col-md-9 {
+    width: 75%;
+  }
+  .col-md-8 {
+    width: 66.66666666666666%;
+  }
+  .col-md-7 {
+    width: 58.333333333333336%;
+  }
+  .col-md-6 {
+    width: 50%;
+  }
+  .col-md-5 {
+    width: 41.66666666666667%;
+  }
+  .col-md-4 {
+    width: 33.33333333333333%;
+  }
+  .col-md-3 {
+    width: 25%;
+  }
+  .col-md-2 {
+    width: 16.666666666666664%;
+  }
+  .col-md-1 {
+    width: 8.333333333333332%;
+  }
+  .col-md-pull-12 {
+    right: 100%;
+  }
+  .col-md-pull-11 {
+    right: 91.66666666666666%;
+  }
+  .col-md-pull-10 {
+    right: 83.33333333333334%;
+  }
+  .col-md-pull-9 {
+    right: 75%;
+  }
+  .col-md-pull-8 {
+    right: 66.66666666666666%;
+  }
+  .col-md-pull-7 {
+    right: 58.333333333333336%;
+  }
+  .col-md-pull-6 {
+    right: 50%;
+  }
+  .col-md-pull-5 {
+    right: 41.66666666666667%;
+  }
+  .col-md-pull-4 {
+    right: 33.33333333333333%;
+  }
+  .col-md-pull-3 {
+    right: 25%;
+  }
+  .col-md-pull-2 {
+    right: 16.666666666666664%;
+  }
+  .col-md-pull-1 {
+    right: 8.333333333333332%;
+  }
+  .col-md-pull-0 {
+    right: 0;
+  }
+  .col-md-push-12 {
+    left: 100%;
+  }
+  .col-md-push-11 {
+    left: 91.66666666666666%;
+  }
+  .col-md-push-10 {
+    left: 83.33333333333334%;
+  }
+  .col-md-push-9 {
+    left: 75%;
+  }
+  .col-md-push-8 {
+    left: 66.66666666666666%;
+  }
+  .col-md-push-7 {
+    left: 58.333333333333336%;
+  }
+  .col-md-push-6 {
+    left: 50%;
+  }
+  .col-md-push-5 {
+    left: 41.66666666666667%;
+  }
+  .col-md-push-4 {
+    left: 33.33333333333333%;
+  }
+  .col-md-push-3 {
+    left: 25%;
+  }
+  .col-md-push-2 {
+    left: 16.666666666666664%;
+  }
+  .col-md-push-1 {
+    left: 8.333333333333332%;
+  }
+  .col-md-push-0 {
+    left: 0;
+  }
+  .col-md-offset-12 {
+    margin-left: 100%;
+  }
+  .col-md-offset-11 {
+    margin-left: 91.66666666666666%;
+  }
+  .col-md-offset-10 {
+    margin-left: 83.33333333333334%;
+  }
+  .col-md-offset-9 {
+    margin-left: 75%;
+  }
+  .col-md-offset-8 {
+    margin-left: 66.66666666666666%;
+  }
+  .col-md-offset-7 {
+    margin-left: 58.333333333333336%;
+  }
+  .col-md-offset-6 {
+    margin-left: 50%;
+  }
+  .col-md-offset-5 {
+    margin-left: 41.66666666666667%;
+  }
+  .col-md-offset-4 {
+    margin-left: 33.33333333333333%;
+  }
+  .col-md-offset-3 {
+    margin-left: 25%;
+  }
+  .col-md-offset-2 {
+    margin-left: 16.666666666666664%;
+  }
+  .col-md-offset-1 {
+    margin-left: 8.333333333333332%;
+  }
+  .col-md-offset-0 {
+    margin-left: 0;
+  }
+}
+
+@media (min-width: 1200px) {
+  .col-lg-1,
+  .col-lg-2,
+  .col-lg-3,
+  .col-lg-4,
+  .col-lg-5,
+  .col-lg-6,
+  .col-lg-7,
+  .col-lg-8,
+  .col-lg-9,
+  .col-lg-10,
+  .col-lg-11,
+  .col-lg-12 {
+    float: left;
+  }
+  .col-lg-12 {
+    width: 100%;
+  }
+  .col-lg-11 {
+    width: 91.66666666666666%;
+  }
+  .col-lg-10 {
+    width: 83.33333333333334%;
+  }
+  .col-lg-9 {
+    width: 75%;
+  }
+  .col-lg-8 {
+    width: 66.66666666666666%;
+  }
+  .col-lg-7 {
+    width: 58.333333333333336%;
+  }
+  .col-lg-6 {
+    width: 50%;
+  }
+  .col-lg-5 {
+    width: 41.66666666666667%;
+  }
+  .col-lg-4 {
+    width: 33.33333333333333%;
+  }
+  .col-lg-3 {
+    width: 25%;
+  }
+  .col-lg-2 {
+    width: 16.666666666666664%;
+  }
+  .col-lg-1 {
+    width: 8.333333333333332%;
+  }
+  .col-lg-pull-12 {
+    right: 100%;
+  }
+  .col-lg-pull-11 {
+    right: 91.66666666666666%;
+  }
+  .col-lg-pull-10 {
+    right: 83.33333333333334%;
+  }
+  .col-lg-pull-9 {
+    right: 75%;
+  }
+  .col-lg-pull-8 {
+    right: 66.66666666666666%;
+  }
+  .col-lg-pull-7 {
+    right: 58.333333333333336%;
+  }
+  .col-lg-pull-6 {
+    right: 50%;
+  }
+  .col-lg-pull-5 {
+    right: 41.66666666666667%;
+  }
+  .col-lg-pull-4 {
+    right: 33.33333333333333%;
+  }
+  .col-lg-pull-3 {
+    right: 25%;
+  }
+  .col-lg-pull-2 {
+    right: 16.666666666666664%;
+  }
+  .col-lg-pull-1 {
+    right: 8.333333333333332%;
+  }
+  .col-lg-pull-0 {
+    right: 0;
+  }
+  .col-lg-push-12 {
+    left: 100%;
+  }
+  .col-lg-push-11 {
+    left: 91.66666666666666%;
+  }
+  .col-lg-push-10 {
+    left: 83.33333333333334%;
+  }
+  .col-lg-push-9 {
+    left: 75%;
+  }
+  .col-lg-push-8 {
+    left: 66.66666666666666%;
+  }
+  .col-lg-push-7 {
+    left: 58.333333333333336%;
+  }
+  .col-lg-push-6 {
+    left: 50%;
+  }
+  .col-lg-push-5 {
+    left: 41.66666666666667%;
+  }
+  .col-lg-push-4 {
+    left: 33.33333333333333%;
+  }
+  .col-lg-push-3 {
+    left: 25%;
+  }
+  .col-lg-push-2 {
+    left: 16.666666666666664%;
+  }
+  .col-lg-push-1 {
+    left: 8.333333333333332%;
+  }
+  .col-lg-push-0 {
+    left: 0;
+  }
+  .col-lg-offset-12 {
+    margin-left: 100%;
+  }
+  .col-lg-offset-11 {
+    margin-left: 91.66666666666666%;
+  }
+  .col-lg-offset-10 {
+    margin-left: 83.33333333333334%;
+  }
+  .col-lg-offset-9 {
+    margin-left: 75%;
+  }
+  .col-lg-offset-8 {
+    margin-left: 66.66666666666666%;
+  }
+  .col-lg-offset-7 {
+    margin-left: 58.333333333333336%;
+  }
+  .col-lg-offset-6 {
+    margin-left: 50%;
+  }
+  .col-lg-offset-5 {
+    margin-left: 41.66666666666667%;
+  }
+  .col-lg-offset-4 {
+    margin-left: 33.33333333333333%;
+  }
+  .col-lg-offset-3 {
+    margin-left: 25%;
+  }
+  .col-lg-offset-2 {
+    margin-left: 16.666666666666664%;
+  }
+  .col-lg-offset-1 {
+    margin-left: 8.333333333333332%;
+  }
+  .col-lg-offset-0 {
+    margin-left: 0;
+  }
+}
+
+table {
+  max-width: 100%;
+  background-color: transparent;
+}
+
+th {
+  text-align: left;
+}
+
+.table {
+  width: 100%;
+  margin-bottom: 20px;
+}
+
+.table > thead > tr > th,
+.table > tbody > tr > th,
+.table > tfoot > tr > th,
+.table > thead > tr > td,
+.table > tbody > tr > td,
+.table > tfoot > tr > td {
+  padding: 8px;
+  line-height: 1.428571429;
+  vertical-align: top;
+  border-top: 1px solid #dddddd;
+}
+
+.table > thead > tr > th {
+  vertical-align: bottom;
+  border-bottom: 2px solid #dddddd;
+}
+
+.table > caption + thead > tr:first-child > th,
+.table > colgroup + thead > tr:first-child > th,
+.table > thead:first-child > tr:first-child > th,
+.table > caption + thead > tr:first-child > td,
+.table > colgroup + thead > tr:first-child > td,
+.table > thead:first-child > tr:first-child > td {
+  border-top: 0;
+}
+
+.table > tbody + tbody {
+  border-top: 2px solid #dddddd;
+}
+
+.table .table {
+  background-color: #ffffff;
+}
+
+.table-condensed > thead > tr > th,
+.table-condensed > tbody > tr > th,
+.table-condensed > tfoot > tr > th,
+.table-condensed > thead > tr > td,
+.table-condensed > tbody > tr > td,
+.table-condensed > tfoot > tr > td {
+  padding: 5px;
+}
+
+.table-bordered {
+  border: 1px solid #dddddd;
+}
+
+.table-bordered > thead > tr > th,
+.table-bordered > tbody > tr > th,
+.table-bordered > tfoot > tr > th,
+.table-bordered > thead > tr > td,
+.table-bordered > tbody > tr > td,
+.table-bordered > tfoot > tr > td {
+  border: 1px solid #dddddd;
+}
+
+.table-bordered > thead > tr > th,
+.table-bordered > thead > tr > td {
+  border-bottom-width: 2px;
+}
+
+.table-striped > tbody > tr:nth-child(odd) > td,
+.table-striped > tbody > tr:nth-child(odd) > th {
+  background-color: #f9f9f9;
+}
+
+.table-hover > tbody > tr:hover > td,
+.table-hover > tbody > tr:hover > th {
+  background-color: #f5f5f5;
+}
+
+table col[class*="col-"] {
+  position: static;
+  display: table-column;
+  float: none;
+}
+
+table td[class*="col-"],
+table th[class*="col-"] {
+  display: table-cell;
+  float: none;
+}
+
+.table > thead > tr > .active,
+.table > tbody > tr > .active,
+.table > tfoot > tr > .active,
+.table > thead > .active > td,
+.table > tbody > .active > td,
+.table > tfoot > .active > td,
+.table > thead > .active > th,
+.table > tbody > .active > th,
+.table > tfoot > .active > th {
+  background-color: #f5f5f5;
+}
+
+.table-hover > tbody > tr > .active:hover,
+.table-hover > tbody > .active:hover > td,
+.table-hover > tbody > .active:hover > th {
+  background-color: #e8e8e8;
+}
+
+.table > thead > tr > .success,
+.table > tbody > tr > .success,
+.table > tfoot > tr > .success,
+.table > thead > .success > td,
+.table > tbody > .success > td,
+.table > tfoot > .success > td,
+.table > thead > .success > th,
+.table > tbody > .success > th,
+.table > tfoot > .success > th {
+  background-color: #dff0d8;
+}
+
+.table-hover > tbody > tr > .success:hover,
+.table-hover > tbody > .success:hover > td,
+.table-hover > tbody > .success:hover > th {
+  background-color: #d0e9c6;
+}
+
+.table > thead > tr > .danger,
+.table > tbody > tr > .danger,
+.table > tfoot > tr > .danger,
+.table > thead > .danger > td,
+.table > tbody > .danger > td,
+.table > tfoot > .danger > td,
+.table > thead > .danger > th,
+.table > tbody > .danger > th,
+.table > tfoot > .danger > th {
+  background-color: #f2dede;
+}
+
+.table-hover > tbody > tr > .danger:hover,
+.table-hover > tbody > .danger:hover > td,
+.table-hover > tbody > .danger:hover > th {
+  background-color: #ebcccc;
+}
+
+.table > thead > tr > .warning,
+.table > tbody > tr > .warning,
+.table > tfoot > tr > .warning,
+.table > thead > .warning > td,
+.table > tbody > .warning > td,
+.table > tfoot > .warning > td,
+.table > thead > .warning > th,
+.table > tbody > .warning > th,
+.table > tfoot > .warning > th {
+  background-color: #fcf8e3;
+}
+
+.table-hover > tbody > tr > .warning:hover,
+.table-hover > tbody > .warning:hover > td,
+.table-hover > tbody > .warning:hover > th {
+  background-color: #faf2cc;
+}
+
+@media (max-width: 767px) {
+  .table-responsive {
+    width: 100%;
+    margin-bottom: 15px;
+    overflow-x: scroll;
+    overflow-y: hidden;
+    border: 1px solid #dddddd;
+    -ms-overflow-style: -ms-autohiding-scrollbar;
+    -webkit-overflow-scrolling: touch;
+  }
+  .table-responsive > .table {
+    margin-bottom: 0;
+  }
+  .table-responsive > .table > thead > tr > th,
+  .table-responsive > .table > tbody > tr > th,
+  .table-responsive > .table > tfoot > tr > th,
+  .table-responsive > .table > thead > tr > td,
+  .table-responsive > .table > tbody > tr > td,
+  .table-responsive > .table > tfoot > tr > td {
+    white-space: nowrap;
+  }
+  .table-responsive > .table-bordered {
+    border: 0;
+  }
+  .table-responsive > .table-bordered > thead > tr > th:first-child,
+  .table-responsive > .table-bordered > tbody > tr > th:first-child,
+  .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+  .table-responsive > .table-bordered > thead > tr > td:first-child,
+  .table-responsive > .table-bordered > tbody > tr > td:first-child,
+  .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+    border-left: 0;
+  }
+  .table-responsive > .table-bordered > thead > tr > th:last-child,
+  .table-responsive > .table-bordered > tbody > tr > th:last-child,
+  .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+  .table-responsive > .table-bordered > thead > tr > td:last-child,
+  .table-responsive > .table-bordered > tbody > tr > td:last-child,
+  .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+    border-right: 0;
+  }
+  .table-responsive > .table-bordered > tbody > tr:last-child > th,
+  .table-responsive > .table-bordered > tfoot > tr:last-child > th,
+  .table-responsive > .table-bordered > tbody > tr:last-child > td,
+  .table-responsive > .table-bordered > tfoot > tr:last-child > td {
+    border-bottom: 0;
+  }
+}
+
+fieldset {
+  padding: 0;
+  margin: 0;
+  border: 0;
+}
+
+legend {
+  display: block;
+  width: 100%;
+  padding: 0;
+  margin-bottom: 20px;
+  font-size: 21px;
+  line-height: inherit;
+  color: #333333;
+  border: 0;
+  border-bottom: 1px solid #e5e5e5;
+}
+
+label {
+  display: inline-block;
+  margin-bottom: 5px;
+  font-weight: bold;
+}
+
+input[type="search"] {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+
+input[type="radio"],
+input[type="checkbox"] {
+  margin: 4px 0 0;
+  margin-top: 1px \9;
+  /* IE8-9 */
+
+  line-height: normal;
+}
+
+input[type="file"] {
+  display: block;
+}
+
+select[multiple],
+select[size] {
+  height: auto;
+}
+
+select optgroup {
+  font-family: inherit;
+  font-size: inherit;
+  font-style: inherit;
+}
+
+input[type="file"]:focus,
+input[type="radio"]:focus,
+input[type="checkbox"]:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+
+input[type="number"]::-webkit-outer-spin-button,
+input[type="number"]::-webkit-inner-spin-button {
+  height: auto;
+}
+
+output {
+  display: block;
+  padding-top: 7px;
+  font-size: 14px;
+  line-height: 1.428571429;
+  color: #555555;
+  vertical-align: middle;
+}
+
+.form-control {
+  display: block;
+  width: 100%;
+  height: 34px;
+  padding: 6px 12px;
+  font-size: 14px;
+  line-height: 1.428571429;
+  color: #555555;
+  vertical-align: middle;
+  background-color: #ffffff;
+  background-image: none;
+  border: 1px solid #cccccc;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
+          transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
+}
+
+.form-control:focus {
+  border-color: #66afe9;
+  outline: 0;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
+}
+
+.form-control:-moz-placeholder {
+  color: #999999;
+}
+
+.form-control::-moz-placeholder {
+  color: #999999;
+  opacity: 1;
+}
+
+.form-control:-ms-input-placeholder {
+  color: #999999;
+}
+
+.form-control::-webkit-input-placeholder {
+  color: #999999;
+}
+
+.form-control[disabled],
+.form-control[readonly],
+fieldset[disabled] .form-control {
+  cursor: not-allowed;
+  background-color: #eeeeee;
+}
+
+textarea.form-control {
+  height: auto;
+}
+
+.form-group {
+  margin-bottom: 15px;
+}
+
+.radio,
+.checkbox {
+  display: block;
+  min-height: 20px;
+  padding-left: 20px;
+  margin-top: 10px;
+  margin-bottom: 10px;
+  vertical-align: middle;
+}
+
+.radio label,
+.checkbox label {
+  display: inline;
+  margin-bottom: 0;
+  font-weight: normal;
+  cursor: pointer;
+}
+
+.radio input[type="radio"],
+.radio-inline input[type="radio"],
+.checkbox input[type="checkbox"],
+.checkbox-inline input[type="checkbox"] {
+  float: left;
+  margin-left: -20px;
+}
+
+.radio + .radio,
+.checkbox + .checkbox {
+  margin-top: -5px;
+}
+
+.radio-inline,
+.checkbox-inline {
+  display: inline-block;
+  padding-left: 20px;
+  margin-bottom: 0;
+  font-weight: normal;
+  vertical-align: middle;
+  cursor: pointer;
+}
+
+.radio-inline + .radio-inline,
+.checkbox-inline + .checkbox-inline {
+  margin-top: 0;
+  margin-left: 10px;
+}
+
+input[type="radio"][disabled],
+input[type="checkbox"][disabled],
+.radio[disabled],
+.radio-inline[disabled],
+.checkbox[disabled],
+.checkbox-inline[disabled],
+fieldset[disabled] input[type="radio"],
+fieldset[disabled] input[type="checkbox"],
+fieldset[disabled] .radio,
+fieldset[disabled] .radio-inline,
+fieldset[disabled] .checkbox,
+fieldset[disabled] .checkbox-inline {
+  cursor: not-allowed;
+}
+
+.input-sm {
+  height: 30px;
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+
+select.input-sm {
+  height: 30px;
+  line-height: 30px;
+}
+
+textarea.input-sm {
+  height: auto;
+}
+
+.input-lg {
+  height: 46px;
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+
+select.input-lg {
+  height: 46px;
+  line-height: 46px;
+}
+
+textarea.input-lg {
+  height: auto;
+}
+
+.has-warning .help-block,
+.has-warning .control-label,
+.has-warning .radio,
+.has-warning .checkbox,
+.has-warning .radio-inline,
+.has-warning .checkbox-inline {
+  color: #8a6d3b;
+}
+
+.has-warning .form-control {
+  border-color: #8a6d3b;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+
+.has-warning .form-control:focus {
+  border-color: #66512c;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
+}
+
+.has-warning .input-group-addon {
+  color: #8a6d3b;
+  background-color: #fcf8e3;
+  border-color: #8a6d3b;
+}
+
+.has-error .help-block,
+.has-error .control-label,
+.has-error .radio,
+.has-error .checkbox,
+.has-error .radio-inline,
+.has-error .checkbox-inline {
+  color: #a94442;
+}
+
+.has-error .form-control {
+  border-color: #a94442;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+
+.has-error .form-control:focus {
+  border-color: #843534;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
+}
+
+.has-error .input-group-addon {
+  color: #a94442;
+  background-color: #f2dede;
+  border-color: #a94442;
+}
+
+.has-success .help-block,
+.has-success .control-label,
+.has-success .radio,
+.has-success .checkbox,
+.has-success .radio-inline,
+.has-success .checkbox-inline {
+  color: #3c763d;
+}
+
+.has-success .form-control {
+  border-color: #3c763d;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+}
+
+.has-success .form-control:focus {
+  border-color: #2b542c;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
+}
+
+.has-success .input-group-addon {
+  color: #3c763d;
+  background-color: #dff0d8;
+  border-color: #3c763d;
+}
+
+.form-control-static {
+  margin-bottom: 0;
+}
+
+.help-block {
+  display: block;
+  margin-top: 5px;
+  margin-bottom: 10px;
+  color: #737373;
+}
+
+@media (min-width: 768px) {
+  .form-inline .form-group {
+    display: inline-block;
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .form-inline .form-control {
+    display: inline-block;
+  }
+  .form-inline select.form-control {
+    width: auto;
+  }
+  .form-inline .radio,
+  .form-inline .checkbox {
+    display: inline-block;
+    padding-left: 0;
+    margin-top: 0;
+    margin-bottom: 0;
+  }
+  .form-inline .radio input[type="radio"],
+  .form-inline .checkbox input[type="checkbox"] {
+    float: none;
+    margin-left: 0;
+  }
+}
+
+.form-horizontal .control-label,
+.form-horizontal .radio,
+.form-horizontal .checkbox,
+.form-horizontal .radio-inline,
+.form-horizontal .checkbox-inline {
+  padding-top: 7px;
+  margin-top: 0;
+  margin-bottom: 0;
+}
+
+.form-horizontal .radio,
+.form-horizontal .checkbox {
+  min-height: 27px;
+}
+
+.form-horizontal .form-group {
+  margin-right: -15px;
+  margin-left: -15px;
+}
+
+.form-horizontal .form-group:before,
+.form-horizontal .form-group:after {
+  display: table;
+  content: " ";
+}
+
+.form-horizontal .form-group:after {
+  clear: both;
+}
+
+.form-horizontal .form-group:before,
+.form-horizontal .form-group:after {
+  display: table;
+  content: " ";
+}
+
+.form-horizontal .form-group:after {
+  clear: both;
+}
+
+.form-horizontal .form-control-static {
+  padding-top: 7px;
+}
+
+@media (min-width: 768px) {
+  .form-horizontal .control-label {
+    text-align: right;
+  }
+}
+
+.btn {
+  display: inline-block;
+  padding: 6px 12px;
+  margin-bottom: 0;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 1.428571429;
+  text-align: center;
+  white-space: nowrap;
+  vertical-align: middle;
+  cursor: pointer;
+  background-image: none;
+  border: 1px solid transparent;
+  border-radius: 4px;
+  -webkit-user-select: none;
+     -moz-user-select: none;
+      -ms-user-select: none;
+       -o-user-select: none;
+          user-select: none;
+}
+
+.btn:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+
+.btn:hover,
+.btn:focus {
+  color: #333333;
+  text-decoration: none;
+}
+
+.btn:active,
+.btn.active {
+  background-image: none;
+  outline: 0;
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+          box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+  pointer-events: none;
+  cursor: not-allowed;
+  opacity: 0.65;
+  filter: alpha(opacity=65);
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+
+.btn-default {
+  color: #333333;
+  background-color: #ffffff;
+  border-color: #cccccc;
+}
+
+.btn-default:hover,
+.btn-default:focus,
+.btn-default:active,
+.btn-default.active,
+.open .dropdown-toggle.btn-default {
+  color: #333333;
+  background-color: #ebebeb;
+  border-color: #adadad;
+}
+
+.btn-default:active,
+.btn-default.active,
+.open .dropdown-toggle.btn-default {
+  background-image: none;
+}
+
+.btn-default.disabled,
+.btn-default[disabled],
+fieldset[disabled] .btn-default,
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled:active,
+.btn-default[disabled]:active,
+fieldset[disabled] .btn-default:active,
+.btn-default.disabled.active,
+.btn-default[disabled].active,
+fieldset[disabled] .btn-default.active {
+  background-color: #ffffff;
+  border-color: #cccccc;
+}
+
+.btn-default .badge {
+  color: #ffffff;
+  background-color: #fff;
+}
+
+.btn-primary {
+  color: #ffffff;
+  background-color: #428bca;
+  border-color: #357ebd;
+}
+
+.btn-primary:hover,
+.btn-primary:focus,
+.btn-primary:active,
+.btn-primary.active,
+.open .dropdown-toggle.btn-primary {
+  color: #ffffff;
+  background-color: #3276b1;
+  border-color: #285e8e;
+}
+
+.btn-primary:active,
+.btn-primary.active,
+.open .dropdown-toggle.btn-primary {
+  background-image: none;
+}
+
+.btn-primary.disabled,
+.btn-primary[disabled],
+fieldset[disabled] .btn-primary,
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled:active,
+.btn-primary[disabled]:active,
+fieldset[disabled] .btn-primary:active,
+.btn-primary.disabled.active,
+.btn-primary[disabled].active,
+fieldset[disabled] .btn-primary.active {
+  background-color: #428bca;
+  border-color: #357ebd;
+}
+
+.btn-primary .badge {
+  color: #428bca;
+  background-color: #fff;
+}
+
+.btn-warning {
+  color: #ffffff;
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+
+.btn-warning:hover,
+.btn-warning:focus,
+.btn-warning:active,
+.btn-warning.active,
+.open .dropdown-toggle.btn-warning {
+  color: #ffffff;
+  background-color: #ed9c28;
+  border-color: #d58512;
+}
+
+.btn-warning:active,
+.btn-warning.active,
+.open .dropdown-toggle.btn-warning {
+  background-image: none;
+}
+
+.btn-warning.disabled,
+.btn-warning[disabled],
+fieldset[disabled] .btn-warning,
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled:active,
+.btn-warning[disabled]:active,
+fieldset[disabled] .btn-warning:active,
+.btn-warning.disabled.active,
+.btn-warning[disabled].active,
+fieldset[disabled] .btn-warning.active {
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+
+.btn-warning .badge {
+  color: #f0ad4e;
+  background-color: #fff;
+}
+
+.btn-danger {
+  color: #ffffff;
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+
+.btn-danger:hover,
+.btn-danger:focus,
+.btn-danger:active,
+.btn-danger.active,
+.open .dropdown-toggle.btn-danger {
+  color: #ffffff;
+  background-color: #d2322d;
+  border-color: #ac2925;
+}
+
+.btn-danger:active,
+.btn-danger.active,
+.open .dropdown-toggle.btn-danger {
+  background-image: none;
+}
+
+.btn-danger.disabled,
+.btn-danger[disabled],
+fieldset[disabled] .btn-danger,
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled:active,
+.btn-danger[disabled]:active,
+fieldset[disabled] .btn-danger:active,
+.btn-danger.disabled.active,
+.btn-danger[disabled].active,
+fieldset[disabled] .btn-danger.active {
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+
+.btn-danger .badge {
+  color: #d9534f;
+  background-color: #fff;
+}
+
+.btn-success {
+  color: #ffffff;
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+
+.btn-success:hover,
+.btn-success:focus,
+.btn-success:active,
+.btn-success.active,
+.open .dropdown-toggle.btn-success {
+  color: #ffffff;
+  background-color: #47a447;
+  border-color: #398439;
+}
+
+.btn-success:active,
+.btn-success.active,
+.open .dropdown-toggle.btn-success {
+  background-image: none;
+}
+
+.btn-success.disabled,
+.btn-success[disabled],
+fieldset[disabled] .btn-success,
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled:active,
+.btn-success[disabled]:active,
+fieldset[disabled] .btn-success:active,
+.btn-success.disabled.active,
+.btn-success[disabled].active,
+fieldset[disabled] .btn-success.active {
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+
+.btn-success .badge {
+  color: #5cb85c;
+  background-color: #fff;
+}
+
+.btn-info {
+  color: #ffffff;
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+
+.btn-info:hover,
+.btn-info:focus,
+.btn-info:active,
+.btn-info.active,
+.open .dropdown-toggle.btn-info {
+  color: #ffffff;
+  background-color: #39b3d7;
+  border-color: #269abc;
+}
+
+.btn-info:active,
+.btn-info.active,
+.open .dropdown-toggle.btn-info {
+  background-image: none;
+}
+
+.btn-info.disabled,
+.btn-info[disabled],
+fieldset[disabled] .btn-info,
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled:active,
+.btn-info[disabled]:active,
+fieldset[disabled] .btn-info:active,
+.btn-info.disabled.active,
+.btn-info[disabled].active,
+fieldset[disabled] .btn-info.active {
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+
+.btn-info .badge {
+  color: #5bc0de;
+  background-color: #fff;
+}
+
+.btn-link {
+  font-weight: normal;
+  color: #428bca;
+  cursor: pointer;
+  border-radius: 0;
+}
+
+.btn-link,
+.btn-link:active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+  background-color: transparent;
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+  border-color: transparent;
+}
+
+.btn-link:hover,
+.btn-link:focus {
+  color: #2a6496;
+  text-decoration: underline;
+  background-color: transparent;
+}
+
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+  color: #999999;
+  text-decoration: none;
+}
+
+.btn-lg {
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+
+.btn-sm {
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+
+.btn-xs {
+  padding: 1px 5px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+
+.btn-block {
+  display: block;
+  width: 100%;
+  padding-right: 0;
+  padding-left: 0;
+}
+
+.btn-block + .btn-block {
+  margin-top: 5px;
+}
+
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+  width: 100%;
+}
+
+.fade {
+  opacity: 0;
+  -webkit-transition: opacity 0.15s linear;
+          transition: opacity 0.15s linear;
+}
+
+.fade.in {
+  opacity: 1;
+}
+
+.collapse {
+  display: none;
+}
+
+.collapse.in {
+  display: block;
+}
+
+.collapsing {
+  position: relative;
+  height: 0;
+  overflow: hidden;
+  -webkit-transition: height 0.35s ease;
+          transition: height 0.35s ease;
+}
+
+@font-face {
+  font-family: 'Glyphicons Halflings';
+  src: url('../fonts/glyphicons-halflings-regular.eot');
+  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
+}
+
+.glyphicon {
+  position: relative;
+  top: 1px;
+  display: inline-block;
+  font-family: 'Glyphicons Halflings';
+  -webkit-font-smoothing: antialiased;
+  font-style: normal;
+  font-weight: normal;
+  line-height: 1;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.glyphicon:empty {
+  width: 1em;
+}
+
+.glyphicon-asterisk:before {
+  content: "\2a";
+}
+
+.glyphicon-plus:before {
+  content: "\2b";
+}
+
+.glyphicon-euro:before {
+  content: "\20ac";
+}
+
+.glyphicon-minus:before {
+  content: "\2212";
+}
+
+.glyphicon-cloud:before {
+  content: "\2601";
+}
+
+.glyphicon-envelope:before {
+  content: "\2709";
+}
+
+.glyphicon-pencil:before {
+  content: "\270f";
+}
+
+.glyphicon-glass:before {
+  content: "\e001";
+}
+
+.glyphicon-music:before {
+  content: "\e002";
+}
+
+.glyphicon-search:before {
+  content: "\e003";
+}
+
+.glyphicon-heart:before {
+  content: "\e005";
+}
+
+.glyphicon-star:before {
+  content: "\e006";
+}
+
+.glyphicon-star-empty:before {
+  content: "\e007";
+}
+
+.glyphicon-user:before {
+  content: "\e008";
+}
+
+.glyphicon-film:before {
+  content: "\e009";
+}
+
+.glyphicon-th-large:before {
+  content: "\e010";
+}
+
+.glyphicon-th:before {
+  content: "\e011";
+}
+
+.glyphicon-th-list:before {
+  content: "\e012";
+}
+
+.glyphicon-ok:before {
+  content: "\e013";
+}
+
+.glyphicon-remove:before {
+  content: "\e014";
+}
+
+.glyphicon-zoom-in:before {
+  content: "\e015";
+}
+
+.glyphicon-zoom-out:before {
+  content: "\e016";
+}
+
+.glyphicon-off:before {
+  content: "\e017";
+}
+
+.glyphicon-signal:before {
+  content: "\e018";
+}
+
+.glyphicon-cog:before {
+  content: "\e019";
+}
+
+.glyphicon-trash:before {
+  content: "\e020";
+}
+
+.glyphicon-home:before {
+  content: "\e021";
+}
+
+.glyphicon-file:before {
+  content: "\e022";
+}
+
+.glyphicon-time:before {
+  content: "\e023";
+}
+
+.glyphicon-road:before {
+  content: "\e024";
+}
+
+.glyphicon-download-alt:before {
+  content: "\e025";
+}
+
+.glyphicon-download:before {
+  content: "\e026";
+}
+
+.glyphicon-upload:before {
+  content: "\e027";
+}
+
+.glyphicon-inbox:before {
+  content: "\e028";
+}
+
+.glyphicon-play-circle:before {
+  content: "\e029";
+}
+
+.glyphicon-repeat:before {
+  content: "\e030";
+}
+
+.glyphicon-refresh:before {
+  content: "\e031";
+}
+
+.glyphicon-list-alt:before {
+  content: "\e032";
+}
+
+.glyphicon-lock:before {
+  content: "\e033";
+}
+
+.glyphicon-flag:before {
+  content: "\e034";
+}
+
+.glyphicon-headphones:before {
+  content: "\e035";
+}
+
+.glyphicon-volume-off:before {
+  content: "\e036";
+}
+
+.glyphicon-volume-down:before {
+  content: "\e037";
+}
+
+.glyphicon-volume-up:before {
+  content: "\e038";
+}
+
+.glyphicon-qrcode:before {
+  content: "\e039";
+}
+
+.glyphicon-barcode:before {
+  content: "\e040";
+}
+
+.glyphicon-tag:before {
+  content: "\e041";
+}
+
+.glyphicon-tags:before {
+  content: "\e042";
+}
+
+.glyphicon-book:before {
+  content: "\e043";
+}
+
+.glyphicon-bookmark:before {
+  content: "\e044";
+}
+
+.glyphicon-print:before {
+  content: "\e045";
+}
+
+.glyphicon-camera:before {
+  content: "\e046";
+}
+
+.glyphicon-font:before {
+  content: "\e047";
+}
+
+.glyphicon-bold:before {
+  content: "\e048";
+}
+
+.glyphicon-italic:before {
+  content: "\e049";
+}
+
+.glyphicon-text-height:before {
+  content: "\e050";
+}
+
+.glyphicon-text-width:before {
+  content: "\e051";
+}
+
+.glyphicon-align-left:before {
+  content: "\e052";
+}
+
+.glyphicon-align-center:before {
+  content: "\e053";
+}
+
+.glyphicon-align-right:before {
+  content: "\e054";
+}
+
+.glyphicon-align-justify:before {
+  content: "\e055";
+}
+
+.glyphicon-list:before {
+  content: "\e056";
+}
+
+.glyphicon-indent-left:before {
+  content: "\e057";
+}
+
+.glyphicon-indent-right:before {
+  content: "\e058";
+}
+
+.glyphicon-facetime-video:before {
+  content: "\e059";
+}
+
+.glyphicon-picture:before {
+  content: "\e060";
+}
+
+.glyphicon-map-marker:before {
+  content: "\e062";
+}
+
+.glyphicon-adjust:before {
+  content: "\e063";
+}
+
+.glyphicon-tint:before {
+  content: "\e064";
+}
+
+.glyphicon-edit:before {
+  content: "\e065";
+}
+
+.glyphicon-share:before {
+  content: "\e066";
+}
+
+.glyphicon-check:before {
+  content: "\e067";
+}
+
+.glyphicon-move:before {
+  content: "\e068";
+}
+
+.glyphicon-step-backward:before {
+  content: "\e069";
+}
+
+.glyphicon-fast-backward:before {
+  content: "\e070";
+}
+
+.glyphicon-backward:before {
+  content: "\e071";
+}
+
+.glyphicon-play:before {
+  content: "\e072";
+}
+
+.glyphicon-pause:before {
+  content: "\e073";
+}
+
+.glyphicon-stop:before {
+  content: "\e074";
+}
+
+.glyphicon-forward:before {
+  content: "\e075";
+}
+
+.glyphicon-fast-forward:before {
+  content: "\e076";
+}
+
+.glyphicon-step-forward:before {
+  content: "\e077";
+}
+
+.glyphicon-eject:before {
+  content: "\e078";
+}
+
+.glyphicon-chevron-left:before {
+  content: "\e079";
+}
+
+.glyphicon-chevron-right:before {
+  content: "\e080";
+}
+
+.glyphicon-plus-sign:before {
+  content: "\e081";
+}
+
+.glyphicon-minus-sign:before {
+  content: "\e082";
+}
+
+.glyphicon-remove-sign:before {
+  content: "\e083";
+}
+
+.glyphicon-ok-sign:before {
+  content: "\e084";
+}
+
+.glyphicon-question-sign:before {
+  content: "\e085";
+}
+
+.glyphicon-info-sign:before {
+  content: "\e086";
+}
+
+.glyphicon-screenshot:before {
+  content: "\e087";
+}
+
+.glyphicon-remove-circle:before {
+  content: "\e088";
+}
+
+.glyphicon-ok-circle:before {
+  content: "\e089";
+}
+
+.glyphicon-ban-circle:before {
+  content: "\e090";
+}
+
+.glyphicon-arrow-left:before {
+  content: "\e091";
+}
+
+.glyphicon-arrow-right:before {
+  content: "\e092";
+}
+
+.glyphicon-arrow-up:before {
+  content: "\e093";
+}
+
+.glyphicon-arrow-down:before {
+  content: "\e094";
+}
+
+.glyphicon-share-alt:before {
+  content: "\e095";
+}
+
+.glyphicon-resize-full:before {
+  content: "\e096";
+}
+
+.glyphicon-resize-small:before {
+  content: "\e097";
+}
+
+.glyphicon-exclamation-sign:before {
+  content: "\e101";
+}
+
+.glyphicon-gift:before {
+  content: "\e102";
+}
+
+.glyphicon-leaf:before {
+  content: "\e103";
+}
+
+.glyphicon-fire:before {
+  content: "\e104";
+}
+
+.glyphicon-eye-open:before {
+  content: "\e105";
+}
+
+.glyphicon-eye-close:before {
+  content: "\e106";
+}
+
+.glyphicon-warning-sign:before {
+  content: "\e107";
+}
+
+.glyphicon-plane:before {
+  content: "\e108";
+}
+
+.glyphicon-calendar:before {
+  content: "\e109";
+}
+
+.glyphicon-random:before {
+  content: "\e110";
+}
+
+.glyphicon-comment:before {
+  content: "\e111";
+}
+
+.glyphicon-magnet:before {
+  content: "\e112";
+}
+
+.glyphicon-chevron-up:before {
+  content: "\e113";
+}
+
+.glyphicon-chevron-down:before {
+  content: "\e114";
+}
+
+.glyphicon-retweet:before {
+  content: "\e115";
+}
+
+.glyphicon-shopping-cart:before {
+  content: "\e116";
+}
+
+.glyphicon-folder-close:before {
+  content: "\e117";
+}
+
+.glyphicon-folder-open:before {
+  content: "\e118";
+}
+
+.glyphicon-resize-vertical:before {
+  content: "\e119";
+}
+
+.glyphicon-resize-horizontal:before {
+  content: "\e120";
+}
+
+.glyphicon-hdd:before {
+  content: "\e121";
+}
+
+.glyphicon-bullhorn:before {
+  content: "\e122";
+}
+
+.glyphicon-bell:before {
+  content: "\e123";
+}
+
+.glyphicon-certificate:before {
+  content: "\e124";
+}
+
+.glyphicon-thumbs-up:before {
+  content: "\e125";
+}
+
+.glyphicon-thumbs-down:before {
+  content: "\e126";
+}
+
+.glyphicon-hand-right:before {
+  content: "\e127";
+}
+
+.glyphicon-hand-left:before {
+  content: "\e128";
+}
+
+.glyphicon-hand-up:before {
+  content: "\e129";
+}
+
+.glyphicon-hand-down:before {
+  content: "\e130";
+}
+
+.glyphicon-circle-arrow-right:before {
+  content: "\e131";
+}
+
+.glyphicon-circle-arrow-left:before {
+  content: "\e132";
+}
+
+.glyphicon-circle-arrow-up:before {
+  content: "\e133";
+}
+
+.glyphicon-circle-arrow-down:before {
+  content: "\e134";
+}
+
+.glyphicon-globe:before {
+  content: "\e135";
+}
+
+.glyphicon-wrench:before {
+  content: "\e136";
+}
+
+.glyphicon-tasks:before {
+  content: "\e137";
+}
+
+.glyphicon-filter:before {
+  content: "\e138";
+}
+
+.glyphicon-briefcase:before {
+  content: "\e139";
+}
+
+.glyphicon-fullscreen:before {
+  content: "\e140";
+}
+
+.glyphicon-dashboard:before {
+  content: "\e141";
+}
+
+.glyphicon-paperclip:before {
+  content: "\e142";
+}
+
+.glyphicon-heart-empty:before {
+  content: "\e143";
+}
+
+.glyphicon-link:before {
+  content: "\e144";
+}
+
+.glyphicon-phone:before {
+  content: "\e145";
+}
+
+.glyphicon-pushpin:before {
+  content: "\e146";
+}
+
+.glyphicon-usd:before {
+  content: "\e148";
+}
+
+.glyphicon-gbp:before {
+  content: "\e149";
+}
+
+.glyphicon-sort:before {
+  content: "\e150";
+}
+
+.glyphicon-sort-by-alphabet:before {
+  content: "\e151";
+}
+
+.glyphicon-sort-by-alphabet-alt:before {
+  content: "\e152";
+}
+
+.glyphicon-sort-by-order:before {
+  content: "\e153";
+}
+
+.glyphicon-sort-by-order-alt:before {
+  content: "\e154";
+}
+
+.glyphicon-sort-by-attributes:before {
+  content: "\e155";
+}
+
+.glyphicon-sort-by-attributes-alt:before {
+  content: "\e156";
+}
+
+.glyphicon-unchecked:before {
+  content: "\e157";
+}
+
+.glyphicon-expand:before {
+  content: "\e158";
+}
+
+.glyphicon-collapse-down:before {
+  content: "\e159";
+}
+
+.glyphicon-collapse-up:before {
+  content: "\e160";
+}
+
+.glyphicon-log-in:before {
+  content: "\e161";
+}
+
+.glyphicon-flash:before {
+  content: "\e162";
+}
+
+.glyphicon-log-out:before {
+  content: "\e163";
+}
+
+.glyphicon-new-window:before {
+  content: "\e164";
+}
+
+.glyphicon-record:before {
+  content: "\e165";
+}
+
+.glyphicon-save:before {
+  content: "\e166";
+}
+
+.glyphicon-open:before {
+  content: "\e167";
+}
+
+.glyphicon-saved:before {
+  content: "\e168";
+}
+
+.glyphicon-import:before {
+  content: "\e169";
+}
+
+.glyphicon-export:before {
+  content: "\e170";
+}
+
+.glyphicon-send:before {
+  content: "\e171";
+}
+
+.glyphicon-floppy-disk:before {
+  content: "\e172";
+}
+
+.glyphicon-floppy-saved:before {
+  content: "\e173";
+}
+
+.glyphicon-floppy-remove:before {
+  content: "\e174";
+}
+
+.glyphicon-floppy-save:before {
+  content: "\e175";
+}
+
+.glyphicon-floppy-open:before {
+  content: "\e176";
+}
+
+.glyphicon-credit-card:before {
+  content: "\e177";
+}
+
+.glyphicon-transfer:before {
+  content: "\e178";
+}
+
+.glyphicon-cutlery:before {
+  content: "\e179";
+}
+
+.glyphicon-header:before {
+  content: "\e180";
+}
+
+.glyphicon-compressed:before {
+  content: "\e181";
+}
+
+.glyphicon-earphone:before {
+  content: "\e182";
+}
+
+.glyphicon-phone-alt:before {
+  content: "\e183";
+}
+
+.glyphicon-tower:before {
+  content: "\e184";
+}
+
+.glyphicon-stats:before {
+  content: "\e185";
+}
+
+.glyphicon-sd-video:before {
+  content: "\e186";
+}
+
+.glyphicon-hd-video:before {
+  content: "\e187";
+}
+
+.glyphicon-subtitles:before {
+  content: "\e188";
+}
+
+.glyphicon-sound-stereo:before {
+  content: "\e189";
+}
+
+.glyphicon-sound-dolby:before {
+  content: "\e190";
+}
+
+.glyphicon-sound-5-1:before {
+  content: "\e191";
+}
+
+.glyphicon-sound-6-1:before {
+  content: "\e192";
+}
+
+.glyphicon-sound-7-1:before {
+  content: "\e193";
+}
+
+.glyphicon-copyright-mark:before {
+  content: "\e194";
+}
+
+.glyphicon-registration-mark:before {
+  content: "\e195";
+}
+
+.glyphicon-cloud-download:before {
+  content: "\e197";
+}
+
+.glyphicon-cloud-upload:before {
+  content: "\e198";
+}
+
+.glyphicon-tree-conifer:before {
+  content: "\e199";
+}
+
+.glyphicon-tree-deciduous:before {
+  content: "\e200";
+}
+
+.caret {
+  display: inline-block;
+  width: 0;
+  height: 0;
+  margin-left: 2px;
+  vertical-align: middle;
+  border-top: 4px solid;
+  border-right: 4px solid transparent;
+  border-left: 4px solid transparent;
+}
+
+.dropdown {
+  position: relative;
+}
+
+.dropdown-toggle:focus {
+  outline: 0;
+}
+
+.dropdown-menu {
+  position: absolute;
+  top: 100%;
+  left: 0;
+  z-index: 1000;
+  display: none;
+  float: left;
+  min-width: 160px;
+  padding: 5px 0;
+  margin: 2px 0 0;
+  font-size: 14px;
+  list-style: none;
+  background-color: #ffffff;
+  border: 1px solid #cccccc;
+  border: 1px solid rgba(0, 0, 0, 0.15);
+  border-radius: 4px;
+  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+          box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+  background-clip: padding-box;
+}
+
+.dropdown-menu.pull-right {
+  right: 0;
+  left: auto;
+}
+
+.dropdown-menu .divider {
+  height: 1px;
+  margin: 9px 0;
+  overflow: hidden;
+  background-color: #e5e5e5;
+}
+
+.dropdown-menu > li > a {
+  display: block;
+  padding: 3px 20px;
+  clear: both;
+  font-weight: normal;
+  line-height: 1.428571429;
+  color: #333333;
+  white-space: nowrap;
+}
+
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+  color: #262626;
+  text-decoration: none;
+  background-color: #f5f5f5;
+}
+
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+  color: #ffffff;
+  text-decoration: none;
+  background-color: #428bca;
+  outline: 0;
+}
+
+.dropdown-menu > .disabled > a,
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+  color: #999999;
+}
+
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+  text-decoration: none;
+  cursor: not-allowed;
+  background-color: transparent;
+  background-image: none;
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+}
+
+.open > .dropdown-menu {
+  display: block;
+}
+
+.open > a {
+  outline: 0;
+}
+
+.dropdown-header {
+  display: block;
+  padding: 3px 20px;
+  font-size: 12px;
+  line-height: 1.428571429;
+  color: #999999;
+}
+
+.dropdown-backdrop {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 990;
+}
+
+.pull-right > .dropdown-menu {
+  right: 0;
+  left: auto;
+}
+
+.dropup .caret,
+.navbar-fixed-bottom .dropdown .caret {
+  border-top: 0;
+  border-bottom: 4px solid;
+  content: "";
+}
+
+.dropup .dropdown-menu,
+.navbar-fixed-bottom .dropdown .dropdown-menu {
+  top: auto;
+  bottom: 100%;
+  margin-bottom: 1px;
+}
+
+@media (min-width: 768px) {
+  .navbar-right .dropdown-menu {
+    right: 0;
+    left: auto;
+  }
+}
+
+.btn-group,
+.btn-group-vertical {
+  position: relative;
+  display: inline-block;
+  vertical-align: middle;
+}
+
+.btn-group > .btn,
+.btn-group-vertical > .btn {
+  position: relative;
+  float: left;
+}
+
+.btn-group > .btn:hover,
+.btn-group-vertical > .btn:hover,
+.btn-group > .btn:focus,
+.btn-group-vertical > .btn:focus,
+.btn-group > .btn:active,
+.btn-group-vertical > .btn:active,
+.btn-group > .btn.active,
+.btn-group-vertical > .btn.active {
+  z-index: 2;
+}
+
+.btn-group > .btn:focus,
+.btn-group-vertical > .btn:focus {
+  outline: none;
+}
+
+.btn-group .btn + .btn,
+.btn-group .btn + .btn-group,
+.btn-group .btn-group + .btn,
+.btn-group .btn-group + .btn-group {
+  margin-left: -1px;
+}
+
+.btn-toolbar:before,
+.btn-toolbar:after {
+  display: table;
+  content: " ";
+}
+
+.btn-toolbar:after {
+  clear: both;
+}
+
+.btn-toolbar:before,
+.btn-toolbar:after {
+  display: table;
+  content: " ";
+}
+
+.btn-toolbar:after {
+  clear: both;
+}
+
+.btn-toolbar .btn-group {
+  float: left;
+}
+
+.btn-toolbar > .btn + .btn,
+.btn-toolbar > .btn-group + .btn,
+.btn-toolbar > .btn + .btn-group,
+.btn-toolbar > .btn-group + .btn-group {
+  margin-left: 5px;
+}
+
+.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
+  border-radius: 0;
+}
+
+.btn-group > .btn:first-child {
+  margin-left: 0;
+}
+
+.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+
+.btn-group > .btn:last-child:not(:first-child),
+.btn-group > .dropdown-toggle:not(:first-child) {
+  border-bottom-left-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.btn-group > .btn-group {
+  float: left;
+}
+
+.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
+  border-radius: 0;
+}
+
+.btn-group > .btn-group:first-child > .btn:last-child,
+.btn-group > .btn-group:first-child > .dropdown-toggle {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+
+.btn-group > .btn-group:last-child > .btn:first-child {
+  border-bottom-left-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.btn-group .dropdown-toggle:active,
+.btn-group.open .dropdown-toggle {
+  outline: 0;
+}
+
+.btn-group-xs > .btn {
+  padding: 1px 5px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+
+.btn-group-sm > .btn {
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+
+.btn-group-lg > .btn {
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+
+.btn-group > .btn + .dropdown-toggle {
+  padding-right: 8px;
+  padding-left: 8px;
+}
+
+.btn-group > .btn-lg + .dropdown-toggle {
+  padding-right: 12px;
+  padding-left: 12px;
+}
+
+.btn-group.open .dropdown-toggle {
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+          box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+
+.btn-group.open .dropdown-toggle.btn-link {
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+
+.btn .caret {
+  margin-left: 0;
+}
+
+.btn-lg .caret {
+  border-width: 5px 5px 0;
+  border-bottom-width: 0;
+}
+
+.dropup .btn-lg .caret {
+  border-width: 0 5px 5px;
+}
+
+.btn-group-vertical > .btn,
+.btn-group-vertical > .btn-group,
+.btn-group-vertical > .btn-group > .btn {
+  display: block;
+  float: none;
+  width: 100%;
+  max-width: 100%;
+}
+
+.btn-group-vertical > .btn-group:before,
+.btn-group-vertical > .btn-group:after {
+  display: table;
+  content: " ";
+}
+
+.btn-group-vertical > .btn-group:after {
+  clear: both;
+}
+
+.btn-group-vertical > .btn-group:before,
+.btn-group-vertical > .btn-group:after {
+  display: table;
+  content: " ";
+}
+
+.btn-group-vertical > .btn-group:after {
+  clear: both;
+}
+
+.btn-group-vertical > .btn-group > .btn {
+  float: none;
+}
+
+.btn-group-vertical > .btn + .btn,
+.btn-group-vertical > .btn + .btn-group,
+.btn-group-vertical > .btn-group + .btn,
+.btn-group-vertical > .btn-group + .btn-group {
+  margin-top: -1px;
+  margin-left: 0;
+}
+
+.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
+  border-radius: 0;
+}
+
+.btn-group-vertical > .btn:first-child:not(:last-child) {
+  border-top-right-radius: 4px;
+  border-bottom-right-radius: 0;
+  border-bottom-left-radius: 0;
+}
+
+.btn-group-vertical > .btn:last-child:not(:first-child) {
+  border-top-right-radius: 0;
+  border-bottom-left-radius: 4px;
+  border-top-left-radius: 0;
+}
+
+.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
+  border-radius: 0;
+}
+
+.btn-group-vertical > .btn-group:first-child > .btn:last-child,
+.btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
+  border-bottom-right-radius: 0;
+  border-bottom-left-radius: 0;
+}
+
+.btn-group-vertical > .btn-group:last-child > .btn:first-child {
+  border-top-right-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.btn-group-justified {
+  display: table;
+  width: 100%;
+  border-collapse: separate;
+  table-layout: fixed;
+}
+
+.btn-group-justified > .btn,
+.btn-group-justified > .btn-group {
+  display: table-cell;
+  float: none;
+  width: 1%;
+}
+
+.btn-group-justified > .btn-group .btn {
+  width: 100%;
+}
+
+[data-toggle="buttons"] > .btn > input[type="radio"],
+[data-toggle="buttons"] > .btn > input[type="checkbox"] {
+  display: none;
+}
+
+.input-group {
+  position: relative;
+  display: table;
+  border-collapse: separate;
+}
+
+.input-group[class*="col-"] {
+  float: none;
+  padding-right: 0;
+  padding-left: 0;
+}
+
+.input-group .form-control {
+  width: 100%;
+  margin-bottom: 0;
+}
+
+.input-group-lg > .form-control,
+.input-group-lg > .input-group-addon,
+.input-group-lg > .input-group-btn > .btn {
+  height: 46px;
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+
+select.input-group-lg > .form-control,
+select.input-group-lg > .input-group-addon,
+select.input-group-lg > .input-group-btn > .btn {
+  height: 46px;
+  line-height: 46px;
+}
+
+textarea.input-group-lg > .form-control,
+textarea.input-group-lg > .input-group-addon,
+textarea.input-group-lg > .input-group-btn > .btn {
+  height: auto;
+}
+
+.input-group-sm > .form-control,
+.input-group-sm > .input-group-addon,
+.input-group-sm > .input-group-btn > .btn {
+  height: 30px;
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+
+select.input-group-sm > .form-control,
+select.input-group-sm > .input-group-addon,
+select.input-group-sm > .input-group-btn > .btn {
+  height: 30px;
+  line-height: 30px;
+}
+
+textarea.input-group-sm > .form-control,
+textarea.input-group-sm > .input-group-addon,
+textarea.input-group-sm > .input-group-btn > .btn {
+  height: auto;
+}
+
+.input-group-addon,
+.input-group-btn,
+.input-group .form-control {
+  display: table-cell;
+}
+
+.input-group-addon:not(:first-child):not(:last-child),
+.input-group-btn:not(:first-child):not(:last-child),
+.input-group .form-control:not(:first-child):not(:last-child) {
+  border-radius: 0;
+}
+
+.input-group-addon,
+.input-group-btn {
+  width: 1%;
+  white-space: nowrap;
+  vertical-align: middle;
+}
+
+.input-group-addon {
+  padding: 6px 12px;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 1;
+  color: #555555;
+  text-align: center;
+  background-color: #eeeeee;
+  border: 1px solid #cccccc;
+  border-radius: 4px;
+}
+
+.input-group-addon.input-sm {
+  padding: 5px 10px;
+  font-size: 12px;
+  border-radius: 3px;
+}
+
+.input-group-addon.input-lg {
+  padding: 10px 16px;
+  font-size: 18px;
+  border-radius: 6px;
+}
+
+.input-group-addon input[type="radio"],
+.input-group-addon input[type="checkbox"] {
+  margin-top: 0;
+}
+
+.input-group .form-control:first-child,
+.input-group-addon:first-child,
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .dropdown-toggle,
+.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+
+.input-group-addon:first-child {
+  border-right: 0;
+}
+
+.input-group .form-control:last-child,
+.input-group-addon:last-child,
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .dropdown-toggle,
+.input-group-btn:first-child > .btn:not(:first-child) {
+  border-bottom-left-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.input-group-addon:last-child {
+  border-left: 0;
+}
+
+.input-group-btn {
+  position: relative;
+  white-space: nowrap;
+}
+
+.input-group-btn:first-child > .btn {
+  margin-right: -1px;
+}
+
+.input-group-btn:last-child > .btn {
+  margin-left: -1px;
+}
+
+.input-group-btn > .btn {
+  position: relative;
+}
+
+.input-group-btn > .btn + .btn {
+  margin-left: -4px;
+}
+
+.input-group-btn > .btn:hover,
+.input-group-btn > .btn:active {
+  z-index: 2;
+}
+
+.nav {
+  padding-left: 0;
+  margin-bottom: 0;
+  list-style: none;
+}
+
+.nav:before,
+.nav:after {
+  display: table;
+  content: " ";
+}
+
+.nav:after {
+  clear: both;
+}
+
+.nav:before,
+.nav:after {
+  display: table;
+  content: " ";
+}
+
+.nav:after {
+  clear: both;
+}
+
+.nav > li {
+  position: relative;
+  display: block;
+}
+
+.nav > li > a {
+  position: relative;
+  display: block;
+  padding: 10px 15px;
+}
+
+.nav > li > a:hover,
+.nav > li > a:focus {
+  text-decoration: none;
+  background-color: #eeeeee;
+}
+
+.nav > li.disabled > a {
+  color: #999999;
+}
+
+.nav > li.disabled > a:hover,
+.nav > li.disabled > a:focus {
+  color: #999999;
+  text-decoration: none;
+  cursor: not-allowed;
+  background-color: transparent;
+}
+
+.nav .open > a,
+.nav .open > a:hover,
+.nav .open > a:focus {
+  background-color: #eeeeee;
+  border-color: #428bca;
+}
+
+.nav .nav-divider {
+  height: 1px;
+  margin: 9px 0;
+  overflow: hidden;
+  background-color: #e5e5e5;
+}
+
+.nav > li > a > img {
+  max-width: none;
+}
+
+.nav-tabs {
+  border-bottom: 1px solid #dddddd;
+}
+
+.nav-tabs > li {
+  float: left;
+  margin-bottom: -1px;
+}
+
+.nav-tabs > li > a {
+  margin-right: 2px;
+  line-height: 1.428571429;
+  border: 1px solid transparent;
+  border-radius: 4px 4px 0 0;
+}
+
+.nav-tabs > li > a:hover {
+  border-color: #eeeeee #eeeeee #dddddd;
+}
+
+.nav-tabs > li.active > a,
+.nav-tabs > li.active > a:hover,
+.nav-tabs > li.active > a:focus {
+  color: #555555;
+  cursor: default;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+  border-bottom-color: transparent;
+}
+
+.nav-tabs.nav-justified {
+  width: 100%;
+  border-bottom: 0;
+}
+
+.nav-tabs.nav-justified > li {
+  float: none;
+}
+
+.nav-tabs.nav-justified > li > a {
+  margin-bottom: 5px;
+  text-align: center;
+}
+
+.nav-tabs.nav-justified > .dropdown .dropdown-menu {
+  top: auto;
+  left: auto;
+}
+
+@media (min-width: 768px) {
+  .nav-tabs.nav-justified > li {
+    display: table-cell;
+    width: 1%;
+  }
+  .nav-tabs.nav-justified > li > a {
+    margin-bottom: 0;
+  }
+}
+
+.nav-tabs.nav-justified > li > a {
+  margin-right: 0;
+  border-radius: 4px;
+}
+
+.nav-tabs.nav-justified > .active > a,
+.nav-tabs.nav-justified > .active > a:hover,
+.nav-tabs.nav-justified > .active > a:focus {
+  border: 1px solid #dddddd;
+}
+
+@media (min-width: 768px) {
+  .nav-tabs.nav-justified > li > a {
+    border-bottom: 1px solid #dddddd;
+    border-radius: 4px 4px 0 0;
+  }
+  .nav-tabs.nav-justified > .active > a,
+  .nav-tabs.nav-justified > .active > a:hover,
+  .nav-tabs.nav-justified > .active > a:focus {
+    border-bottom-color: #ffffff;
+  }
+}
+
+.nav-pills > li {
+  float: left;
+}
+
+.nav-pills > li > a {
+  border-radius: 4px;
+}
+
+.nav-pills > li + li {
+  margin-left: 2px;
+}
+
+.nav-pills > li.active > a,
+.nav-pills > li.active > a:hover,
+.nav-pills > li.active > a:focus {
+  color: #ffffff;
+  background-color: #428bca;
+}
+
+.nav-stacked > li {
+  float: none;
+}
+
+.nav-stacked > li + li {
+  margin-top: 2px;
+  margin-left: 0;
+}
+
+.nav-justified {
+  width: 100%;
+}
+
+.nav-justified > li {
+  float: none;
+}
+
+.nav-justified > li > a {
+  margin-bottom: 5px;
+  text-align: center;
+}
+
+.nav-justified > .dropdown .dropdown-menu {
+  top: auto;
+  left: auto;
+}
+
+@media (min-width: 768px) {
+  .nav-justified > li {
+    display: table-cell;
+    width: 1%;
+  }
+  .nav-justified > li > a {
+    margin-bottom: 0;
+  }
+}
+
+.nav-tabs-justified {
+  border-bottom: 0;
+}
+
+.nav-tabs-justified > li > a {
+  margin-right: 0;
+  border-radius: 4px;
+}
+
+.nav-tabs-justified > .active > a,
+.nav-tabs-justified > .active > a:hover,
+.nav-tabs-justified > .active > a:focus {
+  border: 1px solid #dddddd;
+}
+
+@media (min-width: 768px) {
+  .nav-tabs-justified > li > a {
+    border-bottom: 1px solid #dddddd;
+    border-radius: 4px 4px 0 0;
+  }
+  .nav-tabs-justified > .active > a,
+  .nav-tabs-justified > .active > a:hover,
+  .nav-tabs-justified > .active > a:focus {
+    border-bottom-color: #ffffff;
+  }
+}
+
+.tab-content > .tab-pane {
+  display: none;
+}
+
+.tab-content > .active {
+  display: block;
+}
+
+.nav-tabs .dropdown-menu {
+  margin-top: -1px;
+  border-top-right-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.navbar {
+  position: relative;
+  min-height: 50px;
+  margin-bottom: 20px;
+  border: 1px solid transparent;
+}
+
+.navbar:before,
+.navbar:after {
+  display: table;
+  content: " ";
+}
+
+.navbar:after {
+  clear: both;
+}
+
+.navbar:before,
+.navbar:after {
+  display: table;
+  content: " ";
+}
+
+.navbar:after {
+  clear: both;
+}
+
+@media (min-width: 768px) {
+  .navbar {
+    border-radius: 4px;
+  }
+}
+
+.navbar-header:before,
+.navbar-header:after {
+  display: table;
+  content: " ";
+}
+
+.navbar-header:after {
+  clear: both;
+}
+
+.navbar-header:before,
+.navbar-header:after {
+  display: table;
+  content: " ";
+}
+
+.navbar-header:after {
+  clear: both;
+}
+
+@media (min-width: 768px) {
+  .navbar-header {
+    float: left;
+  }
+}
+
+.navbar-collapse {
+  max-height: 340px;
+  padding-right: 15px;
+  padding-left: 15px;
+  overflow-x: visible;
+  border-top: 1px solid transparent;
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
+  -webkit-overflow-scrolling: touch;
+}
+
+.navbar-collapse:before,
+.navbar-collapse:after {
+  display: table;
+  content: " ";
+}
+
+.navbar-collapse:after {
+  clear: both;
+}
+
+.navbar-collapse:before,
+.navbar-collapse:after {
+  display: table;
+  content: " ";
+}
+
+.navbar-collapse:after {
+  clear: both;
+}
+
+.navbar-collapse.in {
+  overflow-y: auto;
+}
+
+@media (min-width: 768px) {
+  .navbar-collapse {
+    width: auto;
+    border-top: 0;
+    box-shadow: none;
+  }
+  .navbar-collapse.collapse {
+    display: block !important;
+    height: auto !important;
+    padding-bottom: 0;
+    overflow: visible !important;
+  }
+  .navbar-collapse.in {
+    overflow-y: visible;
+  }
+  .navbar-fixed-top .navbar-collapse,
+  .navbar-static-top .navbar-collapse,
+  .navbar-fixed-bottom .navbar-collapse {
+    padding-right: 0;
+    padding-left: 0;
+  }
+}
+
+.container > .navbar-header,
+.container > .navbar-collapse {
+  margin-right: -15px;
+  margin-left: -15px;
+}
+
+@media (min-width: 768px) {
+  .container > .navbar-header,
+  .container > .navbar-collapse {
+    margin-right: 0;
+    margin-left: 0;
+  }
+}
+
+.navbar-static-top {
+  z-index: 1000;
+  border-width: 0 0 1px;
+}
+
+@media (min-width: 768px) {
+  .navbar-static-top {
+    border-radius: 0;
+  }
+}
+
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  position: fixed;
+  right: 0;
+  left: 0;
+  z-index: 1030;
+}
+
+@media (min-width: 768px) {
+  .navbar-fixed-top,
+  .navbar-fixed-bottom {
+    border-radius: 0;
+  }
+}
+
+.navbar-fixed-top {
+  top: 0;
+  border-width: 0 0 1px;
+}
+
+.navbar-fixed-bottom {
+  bottom: 0;
+  margin-bottom: 0;
+  border-width: 1px 0 0;
+}
+
+.navbar-brand {
+  float: left;
+  padding: 15px 15px;
+  font-size: 18px;
+  line-height: 20px;
+}
+
+.navbar-brand:hover,
+.navbar-brand:focus {
+  text-decoration: none;
+}
+
+@media (min-width: 768px) {
+  .navbar > .container .navbar-brand {
+    margin-left: -15px;
+  }
+}
+
+.navbar-toggle {
+  position: relative;
+  float: right;
+  padding: 9px 10px;
+  margin-top: 8px;
+  margin-right: 15px;
+  margin-bottom: 8px;
+  background-color: transparent;
+  background-image: none;
+  border: 1px solid transparent;
+  border-radius: 4px;
+}
+
+.navbar-toggle .icon-bar {
+  display: block;
+  width: 22px;
+  height: 2px;
+  border-radius: 1px;
+}
+
+.navbar-toggle .icon-bar + .icon-bar {
+  margin-top: 4px;
+}
+
+@media (min-width: 768px) {
+  .navbar-toggle {
+    display: none;
+  }
+}
+
+.navbar-nav {
+  margin: 7.5px -15px;
+}
+
+.navbar-nav > li > a {
+  padding-top: 10px;
+  padding-bottom: 10px;
+  line-height: 20px;
+}
+
+@media (max-width: 767px) {
+  .navbar-nav .open .dropdown-menu {
+    position: static;
+    float: none;
+    width: auto;
+    margin-top: 0;
+    background-color: transparent;
+    border: 0;
+    box-shadow: none;
+  }
+  .navbar-nav .open .dropdown-menu > li > a,
+  .navbar-nav .open .dropdown-menu .dropdown-header {
+    padding: 5px 15px 5px 25px;
+  }
+  .navbar-nav .open .dropdown-menu > li > a {
+    line-height: 20px;
+  }
+  .navbar-nav .open .dropdown-menu > li > a:hover,
+  .navbar-nav .open .dropdown-menu > li > a:focus {
+    background-image: none;
+  }
+}
+
+@media (min-width: 768px) {
+  .navbar-nav {
+    float: left;
+    margin: 0;
+  }
+  .navbar-nav > li {
+    float: left;
+  }
+  .navbar-nav > li > a {
+    padding-top: 15px;
+    padding-bottom: 15px;
+  }
+  .navbar-nav.navbar-right:last-child {
+    margin-right: -15px;
+  }
+}
+
+@media (min-width: 768px) {
+  .navbar-left {
+    float: left !important;
+  }
+  .navbar-right {
+    float: right !important;
+  }
+}
+
+.navbar-form {
+  padding: 10px 15px;
+  margin-top: 8px;
+  margin-right: -15px;
+  margin-bottom: 8px;
+  margin-left: -15px;
+  border-top: 1px solid transparent;
+  border-bottom: 1px solid transparent;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
+}
+
+@media (min-width: 768px) {
+  .navbar-form .form-group {
+    display: inline-block;
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .navbar-form .form-control {
+    display: inline-block;
+  }
+  .navbar-form select.form-control {
+    width: auto;
+  }
+  .navbar-form .radio,
+  .navbar-form .checkbox {
+    display: inline-block;
+    padding-left: 0;
+    margin-top: 0;
+    margin-bottom: 0;
+  }
+  .navbar-form .radio input[type="radio"],
+  .navbar-form .checkbox input[type="checkbox"] {
+    float: none;
+    margin-left: 0;
+  }
+}
+
+@media (max-width: 767px) {
+  .navbar-form .form-group {
+    margin-bottom: 5px;
+  }
+}
+
+@media (min-width: 768px) {
+  .navbar-form {
+    width: auto;
+    padding-top: 0;
+    padding-bottom: 0;
+    margin-right: 0;
+    margin-left: 0;
+    border: 0;
+    -webkit-box-shadow: none;
+            box-shadow: none;
+  }
+  .navbar-form.navbar-right:last-child {
+    margin-right: -15px;
+  }
+}
+
+.navbar-nav > li > .dropdown-menu {
+  margin-top: 0;
+  border-top-right-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
+  border-bottom-right-radius: 0;
+  border-bottom-left-radius: 0;
+}
+
+.navbar-nav.pull-right > li > .dropdown-menu,
+.navbar-nav > li > .dropdown-menu.pull-right {
+  right: 0;
+  left: auto;
+}
+
+.navbar-btn {
+  margin-top: 8px;
+  margin-bottom: 8px;
+}
+
+.navbar-btn.btn-sm {
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+
+.navbar-btn.btn-xs {
+  margin-top: 14px;
+  margin-bottom: 14px;
+}
+
+.navbar-text {
+  margin-top: 15px;
+  margin-bottom: 15px;
+}
+
+@media (min-width: 768px) {
+  .navbar-text {
+    float: left;
+    margin-right: 15px;
+    margin-left: 15px;
+  }
+  .navbar-text.navbar-right:last-child {
+    margin-right: 0;
+  }
+}
+
+.navbar-default {
+  background-color: #f8f8f8;
+  border-color: #e7e7e7;
+}
+
+.navbar-default .navbar-brand {
+  color: #777777;
+}
+
+.navbar-default .navbar-brand:hover,
+.navbar-default .navbar-brand:focus {
+  color: #5e5e5e;
+  background-color: transparent;
+}
+
+.navbar-default .navbar-text {
+  color: #777777;
+}
+
+.navbar-default .navbar-nav > li > a {
+  color: #777777;
+}
+
+.navbar-default .navbar-nav > li > a:hover,
+.navbar-default .navbar-nav > li > a:focus {
+  color: #333333;
+  background-color: transparent;
+}
+
+.navbar-default .navbar-nav > .active > a,
+.navbar-default .navbar-nav > .active > a:hover,
+.navbar-default .navbar-nav > .active > a:focus {
+  color: #555555;
+  background-color: #e7e7e7;
+}
+
+.navbar-default .navbar-nav > .disabled > a,
+.navbar-default .navbar-nav > .disabled > a:hover,
+.navbar-default .navbar-nav > .disabled > a:focus {
+  color: #cccccc;
+  background-color: transparent;
+}
+
+.navbar-default .navbar-toggle {
+  border-color: #dddddd;
+}
+
+.navbar-default .navbar-toggle:hover,
+.navbar-default .navbar-toggle:focus {
+  background-color: #dddddd;
+}
+
+.navbar-default .navbar-toggle .icon-bar {
+  background-color: #cccccc;
+}
+
+.navbar-default .navbar-collapse,
+.navbar-default .navbar-form {
+  border-color: #e7e7e7;
+}
+
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .open > a:hover,
+.navbar-default .navbar-nav > .open > a:focus {
+  color: #555555;
+  background-color: #e7e7e7;
+}
+
+@media (max-width: 767px) {
+  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
+    color: #777777;
+  }
+  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
+  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
+    color: #333333;
+    background-color: transparent;
+  }
+  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
+  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
+  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
+    color: #555555;
+    background-color: #e7e7e7;
+  }
+  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
+  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+    color: #cccccc;
+    background-color: transparent;
+  }
+}
+
+.navbar-default .navbar-link {
+  color: #777777;
+}
+
+.navbar-default .navbar-link:hover {
+  color: #333333;
+}
+
+.navbar-inverse {
+  background-color: #222222;
+  border-color: #080808;
+}
+
+.navbar-inverse .navbar-brand {
+  color: #999999;
+}
+
+.navbar-inverse .navbar-brand:hover,
+.navbar-inverse .navbar-brand:focus {
+  color: #ffffff;
+  background-color: transparent;
+}
+
+.navbar-inverse .navbar-text {
+  color: #999999;
+}
+
+.navbar-inverse .navbar-nav > li > a {
+  color: #999999;
+}
+
+.navbar-inverse .navbar-nav > li > a:hover,
+.navbar-inverse .navbar-nav > li > a:focus {
+  color: #ffffff;
+  background-color: transparent;
+}
+
+.navbar-inverse .navbar-nav > .active > a,
+.navbar-inverse .navbar-nav > .active > a:hover,
+.navbar-inverse .navbar-nav > .active > a:focus {
+  color: #ffffff;
+  background-color: #080808;
+}
+
+.navbar-inverse .navbar-nav > .disabled > a,
+.navbar-inverse .navbar-nav > .disabled > a:hover,
+.navbar-inverse .navbar-nav > .disabled > a:focus {
+  color: #444444;
+  background-color: transparent;
+}
+
+.navbar-inverse .navbar-toggle {
+  border-color: #333333;
+}
+
+.navbar-inverse .navbar-toggle:hover,
+.navbar-inverse .navbar-toggle:focus {
+  background-color: #333333;
+}
+
+.navbar-inverse .navbar-toggle .icon-bar {
+  background-color: #ffffff;
+}
+
+.navbar-inverse .navbar-collapse,
+.navbar-inverse .navbar-form {
+  border-color: #101010;
+}
+
+.navbar-inverse .navbar-nav > .open > a,
+.navbar-inverse .navbar-nav > .open > a:hover,
+.navbar-inverse .navbar-nav > .open > a:focus {
+  color: #ffffff;
+  background-color: #080808;
+}
+
+@media (max-width: 767px) {
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
+    border-color: #080808;
+  }
+  .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
+    background-color: #080808;
+  }
+  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
+    color: #999999;
+  }
+  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
+  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
+    color: #ffffff;
+    background-color: transparent;
+  }
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
+    color: #ffffff;
+    background-color: #080808;
+  }
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+    color: #444444;
+    background-color: transparent;
+  }
+}
+
+.navbar-inverse .navbar-link {
+  color: #999999;
+}
+
+.navbar-inverse .navbar-link:hover {
+  color: #ffffff;
+}
+
+.breadcrumb {
+  padding: 8px 15px;
+  margin-bottom: 20px;
+  list-style: none;
+  background-color: #f5f5f5;
+  border-radius: 4px;
+}
+
+.breadcrumb > li {
+  display: inline-block;
+}
+
+.breadcrumb > li + li:before {
+  padding: 0 5px;
+  color: #cccccc;
+  content: "/\00a0";
+}
+
+.breadcrumb > .active {
+  color: #999999;
+}
+
+.pagination {
+  display: inline-block;
+  padding-left: 0;
+  margin: 20px 0;
+  border-radius: 4px;
+}
+
+.pagination > li {
+  display: inline;
+}
+
+.pagination > li > a,
+.pagination > li > span {
+  position: relative;
+  float: left;
+  padding: 6px 12px;
+  margin-left: -1px;
+  line-height: 1.428571429;
+  text-decoration: none;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+}
+
+.pagination > li:first-child > a,
+.pagination > li:first-child > span {
+  margin-left: 0;
+  border-bottom-left-radius: 4px;
+  border-top-left-radius: 4px;
+}
+
+.pagination > li:last-child > a,
+.pagination > li:last-child > span {
+  border-top-right-radius: 4px;
+  border-bottom-right-radius: 4px;
+}
+
+.pagination > li > a:hover,
+.pagination > li > span:hover,
+.pagination > li > a:focus,
+.pagination > li > span:focus {
+  background-color: #eeeeee;
+}
+
+.pagination > .active > a,
+.pagination > .active > span,
+.pagination > .active > a:hover,
+.pagination > .active > span:hover,
+.pagination > .active > a:focus,
+.pagination > .active > span:focus {
+  z-index: 2;
+  color: #ffffff;
+  cursor: default;
+  background-color: #428bca;
+  border-color: #428bca;
+}
+
+.pagination > .disabled > span,
+.pagination > .disabled > span:hover,
+.pagination > .disabled > span:focus,
+.pagination > .disabled > a,
+.pagination > .disabled > a:hover,
+.pagination > .disabled > a:focus {
+  color: #999999;
+  cursor: not-allowed;
+  background-color: #ffffff;
+  border-color: #dddddd;
+}
+
+.pagination-lg > li > a,
+.pagination-lg > li > span {
+  padding: 10px 16px;
+  font-size: 18px;
+}
+
+.pagination-lg > li:first-child > a,
+.pagination-lg > li:first-child > span {
+  border-bottom-left-radius: 6px;
+  border-top-left-radius: 6px;
+}
+
+.pagination-lg > li:last-child > a,
+.pagination-lg > li:last-child > span {
+  border-top-right-radius: 6px;
+  border-bottom-right-radius: 6px;
+}
+
+.pagination-sm > li > a,
+.pagination-sm > li > span {
+  padding: 5px 10px;
+  font-size: 12px;
+}
+
+.pagination-sm > li:first-child > a,
+.pagination-sm > li:first-child > span {
+  border-bottom-left-radius: 3px;
+  border-top-left-radius: 3px;
+}
+
+.pagination-sm > li:last-child > a,
+.pagination-sm > li:last-child > span {
+  border-top-right-radius: 3px;
+  border-bottom-right-radius: 3px;
+}
+
+.pager {
+  padding-left: 0;
+  margin: 20px 0;
+  text-align: center;
+  list-style: none;
+}
+
+.pager:before,
+.pager:after {
+  display: table;
+  content: " ";
+}
+
+.pager:after {
+  clear: both;
+}
+
+.pager:before,
+.pager:after {
+  display: table;
+  content: " ";
+}
+
+.pager:after {
+  clear: both;
+}
+
+.pager li {
+  display: inline;
+}
+
+.pager li > a,
+.pager li > span {
+  display: inline-block;
+  padding: 5px 14px;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+  border-radius: 15px;
+}
+
+.pager li > a:hover,
+.pager li > a:focus {
+  text-decoration: none;
+  background-color: #eeeeee;
+}
+
+.pager .next > a,
+.pager .next > span {
+  float: right;
+}
+
+.pager .previous > a,
+.pager .previous > span {
+  float: left;
+}
+
+.pager .disabled > a,
+.pager .disabled > a:hover,
+.pager .disabled > a:focus,
+.pager .disabled > span {
+  color: #999999;
+  cursor: not-allowed;
+  background-color: #ffffff;
+}
+
+.label {
+  display: inline;
+  padding: .2em .6em .3em;
+  font-size: 75%;
+  font-weight: bold;
+  line-height: 1;
+  color: #ffffff;
+  text-align: center;
+  white-space: nowrap;
+  vertical-align: baseline;
+  border-radius: .25em;
+}
+
+.label[href]:hover,
+.label[href]:focus {
+  color: #ffffff;
+  text-decoration: none;
+  cursor: pointer;
+}
+
+.label:empty {
+  display: none;
+}
+
+.btn .label {
+  position: relative;
+  top: -1px;
+}
+
+.label-default {
+  background-color: #999999;
+}
+
+.label-default[href]:hover,
+.label-default[href]:focus {
+  background-color: #808080;
+}
+
+.label-primary {
+  background-color: #428bca;
+}
+
+.label-primary[href]:hover,
+.label-primary[href]:focus {
+  background-color: #3071a9;
+}
+
+.label-success {
+  background-color: #5cb85c;
+}
+
+.label-success[href]:hover,
+.label-success[href]:focus {
+  background-color: #449d44;
+}
+
+.label-info {
+  background-color: #5bc0de;
+}
+
+.label-info[href]:hover,
+.label-info[href]:focus {
+  background-color: #31b0d5;
+}
+
+.label-warning {
+  background-color: #f0ad4e;
+}
+
+.label-warning[href]:hover,
+.label-warning[href]:focus {
+  background-color: #ec971f;
+}
+
+.label-danger {
+  background-color: #d9534f;
+}
+
+.label-danger[href]:hover,
+.label-danger[href]:focus {
+  background-color: #c9302c;
+}
+
+.badge {
+  display: inline-block;
+  min-width: 10px;
+  padding: 3px 7px;
+  font-size: 12px;
+  font-weight: bold;
+  line-height: 1;
+  color: #ffffff;
+  text-align: center;
+  white-space: nowrap;
+  vertical-align: baseline;
+  background-color: #999999;
+  border-radius: 10px;
+}
+
+.badge:empty {
+  display: none;
+}
+
+.btn .badge {
+  position: relative;
+  top: -1px;
+}
+
+a.badge:hover,
+a.badge:focus {
+  color: #ffffff;
+  text-decoration: none;
+  cursor: pointer;
+}
+
+a.list-group-item.active > .badge,
+.nav-pills > .active > a > .badge {
+  color: #428bca;
+  background-color: #ffffff;
+}
+
+.nav-pills > li > a > .badge {
+  margin-left: 3px;
+}
+
+.jumbotron {
+  padding: 30px;
+  margin-bottom: 30px;
+  font-size: 21px;
+  font-weight: 200;
+  line-height: 2.1428571435;
+  color: inherit;
+  background-color: #eeeeee;
+}
+
+.jumbotron h1,
+.jumbotron .h1 {
+  line-height: 1;
+  color: inherit;
+}
+
+.jumbotron p {
+  line-height: 1.4;
+}
+
+.container .jumbotron {
+  border-radius: 6px;
+}
+
+.jumbotron .container {
+  max-width: 100%;
+}
+
+@media screen and (min-width: 768px) {
+  .jumbotron {
+    padding-top: 48px;
+    padding-bottom: 48px;
+  }
+  .container .jumbotron {
+    padding-right: 60px;
+    padding-left: 60px;
+  }
+  .jumbotron h1,
+  .jumbotron .h1 {
+    font-size: 63px;
+  }
+}
+
+.thumbnail {
+  display: block;
+  padding: 4px;
+  margin-bottom: 20px;
+  line-height: 1.428571429;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+  border-radius: 4px;
+  -webkit-transition: all 0.2s ease-in-out;
+          transition: all 0.2s ease-in-out;
+}
+
+.thumbnail > img,
+.thumbnail a > img {
+  display: block;
+  height: auto;
+  max-width: 100%;
+  margin-right: auto;
+  margin-left: auto;
+}
+
+a.thumbnail:hover,
+a.thumbnail:focus,
+a.thumbnail.active {
+  border-color: #428bca;
+}
+
+.thumbnail .caption {
+  padding: 9px;
+  color: #333333;
+}
+
+.alert {
+  padding: 15px;
+  margin-bottom: 20px;
+  border: 1px solid transparent;
+  border-radius: 4px;
+}
+
+.alert h4 {
+  margin-top: 0;
+  color: inherit;
+}
+
+.alert .alert-link {
+  font-weight: bold;
+}
+
+.alert > p,
+.alert > ul {
+  margin-bottom: 0;
+}
+
+.alert > p + p {
+  margin-top: 5px;
+}
+
+.alert-dismissable {
+  padding-right: 35px;
+}
+
+.alert-dismissable .close {
+  position: relative;
+  top: -2px;
+  right: -21px;
+  color: inherit;
+}
+
+.alert-success {
+  color: #3c763d;
+  background-color: #dff0d8;
+  border-color: #d6e9c6;
+}
+
+.alert-success hr {
+  border-top-color: #c9e2b3;
+}
+
+.alert-success .alert-link {
+  color: #2b542c;
+}
+
+.alert-info {
+  color: #31708f;
+  background-color: #d9edf7;
+  border-color: #bce8f1;
+}
+
+.alert-info hr {
+  border-top-color: #a6e1ec;
+}
+
+.alert-info .alert-link {
+  color: #245269;
+}
+
+.alert-warning {
+  color: #8a6d3b;
+  background-color: #fcf8e3;
+  border-color: #faebcc;
+}
+
+.alert-warning hr {
+  border-top-color: #f7e1b5;
+}
+
+.alert-warning .alert-link {
+  color: #66512c;
+}
+
+.alert-danger {
+  color: #a94442;
+  background-color: #f2dede;
+  border-color: #ebccd1;
+}
+
+.alert-danger hr {
+  border-top-color: #e4b9c0;
+}
+
+.alert-danger .alert-link {
+  color: #843534;
+}
+
+@-webkit-keyframes progress-bar-stripes {
+  from {
+    background-position: 40px 0;
+  }
+  to {
+    background-position: 0 0;
+  }
+}
+
+@keyframes progress-bar-stripes {
+  from {
+    background-position: 40px 0;
+  }
+  to {
+    background-position: 0 0;
+  }
+}
+
+.progress {
+  height: 20px;
+  margin-bottom: 20px;
+  overflow: hidden;
+  background-color: #f5f5f5;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
+.progress-bar {
+  float: left;
+  width: 0;
+  height: 100%;
+  font-size: 12px;
+  line-height: 20px;
+  color: #ffffff;
+  text-align: center;
+  background-color: #428bca;
+  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  -webkit-transition: width 0.6s ease;
+          transition: width 0.6s ease;
+}
+
+.progress-striped .progress-bar {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-size: 40px 40px;
+}
+
+.progress.active .progress-bar {
+  -webkit-animation: progress-bar-stripes 2s linear infinite;
+          animation: progress-bar-stripes 2s linear infinite;
+}
+
+.progress-bar-success {
+  background-color: #5cb85c;
+}
+
+.progress-striped .progress-bar-success {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+
+.progress-bar-info {
+  background-color: #5bc0de;
+}
+
+.progress-striped .progress-bar-info {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+
+.progress-bar-warning {
+  background-color: #f0ad4e;
+}
+
+.progress-striped .progress-bar-warning {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+
+.progress-bar-danger {
+  background-color: #d9534f;
+}
+
+.progress-striped .progress-bar-danger {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+}
+
+.media,
+.media-body {
+  overflow: hidden;
+  zoom: 1;
+}
+
+.media,
+.media .media {
+  margin-top: 15px;
+}
+
+.media:first-child {
+  margin-top: 0;
+}
+
+.media-object {
+  display: block;
+}
+
+.media-heading {
+  margin: 0 0 5px;
+}
+
+.media > .pull-left {
+  margin-right: 10px;
+}
+
+.media > .pull-right {
+  margin-left: 10px;
+}
+
+.media-list {
+  padding-left: 0;
+  list-style: none;
+}
+
+.list-group {
+  padding-left: 0;
+  margin-bottom: 20px;
+}
+
+.list-group-item {
+  position: relative;
+  display: block;
+  padding: 10px 15px;
+  margin-bottom: -1px;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+}
+
+.list-group-item:first-child {
+  border-top-right-radius: 4px;
+  border-top-left-radius: 4px;
+}
+
+.list-group-item:last-child {
+  margin-bottom: 0;
+  border-bottom-right-radius: 4px;
+  border-bottom-left-radius: 4px;
+}
+
+.list-group-item > .badge {
+  float: right;
+}
+
+.list-group-item > .badge + .badge {
+  margin-right: 5px;
+}
+
+a.list-group-item {
+  color: #555555;
+}
+
+a.list-group-item .list-group-item-heading {
+  color: #333333;
+}
+
+a.list-group-item:hover,
+a.list-group-item:focus {
+  text-decoration: none;
+  background-color: #f5f5f5;
+}
+
+a.list-group-item.active,
+a.list-group-item.active:hover,
+a.list-group-item.active:focus {
+  z-index: 2;
+  color: #ffffff;
+  background-color: #428bca;
+  border-color: #428bca;
+}
+
+a.list-group-item.active .list-group-item-heading,
+a.list-group-item.active:hover .list-group-item-heading,
+a.list-group-item.active:focus .list-group-item-heading {
+  color: inherit;
+}
+
+a.list-group-item.active .list-group-item-text,
+a.list-group-item.active:hover .list-group-item-text,
+a.list-group-item.active:focus .list-group-item-text {
+  color: #e1edf7;
+}
+
+.list-group-item-heading {
+  margin-top: 0;
+  margin-bottom: 5px;
+}
+
+.list-group-item-text {
+  margin-bottom: 0;
+  line-height: 1.3;
+}
+
+.panel {
+  margin-bottom: 20px;
+  background-color: #ffffff;
+  border: 1px solid transparent;
+  border-radius: 4px;
+  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+}
+
+.panel-body {
+  padding: 15px;
+}
+
+.panel-body:before,
+.panel-body:after {
+  display: table;
+  content: " ";
+}
+
+.panel-body:after {
+  clear: both;
+}
+
+.panel-body:before,
+.panel-body:after {
+  display: table;
+  content: " ";
+}
+
+.panel-body:after {
+  clear: both;
+}
+
+.panel > .list-group {
+  margin-bottom: 0;
+}
+
+.panel > .list-group .list-group-item {
+  border-width: 1px 0;
+}
+
+.panel > .list-group .list-group-item:first-child {
+  border-top-right-radius: 0;
+  border-top-left-radius: 0;
+}
+
+.panel > .list-group .list-group-item:last-child {
+  border-bottom: 0;
+}
+
+.panel-heading + .list-group .list-group-item:first-child {
+  border-top-width: 0;
+}
+
+.panel > .table,
+.panel > .table-responsive > .table {
+  margin-bottom: 0;
+}
+
+.panel > .panel-body + .table,
+.panel > .panel-body + .table-responsive {
+  border-top: 1px solid #dddddd;
+}
+
+.panel > .table > tbody:first-child th,
+.panel > .table > tbody:first-child td {
+  border-top: 0;
+}
+
+.panel > .table-bordered,
+.panel > .table-responsive > .table-bordered {
+  border: 0;
+}
+
+.panel > .table-bordered > thead > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
+.panel > .table-bordered > tbody > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
+.panel > .table-bordered > tfoot > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+.panel > .table-bordered > thead > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
+.panel > .table-bordered > tbody > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
+.panel > .table-bordered > tfoot > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+  border-left: 0;
+}
+
+.panel > .table-bordered > thead > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
+.panel > .table-bordered > tbody > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
+.panel > .table-bordered > tfoot > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+.panel > .table-bordered > thead > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
+.panel > .table-bordered > tbody > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
+.panel > .table-bordered > tfoot > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+  border-right: 0;
+}
+
+.panel > .table-bordered > thead > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > thead > tr:last-child > th,
+.panel > .table-bordered > tbody > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
+.panel > .table-bordered > tfoot > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th,
+.panel > .table-bordered > thead > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > thead > tr:last-child > td,
+.panel > .table-bordered > tbody > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
+.panel > .table-bordered > tfoot > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td {
+  border-bottom: 0;
+}
+
+.panel > .table-responsive {
+  margin-bottom: 0;
+  border: 0;
+}
+
+.panel-heading {
+  padding: 10px 15px;
+  border-bottom: 1px solid transparent;
+  border-top-right-radius: 3px;
+  border-top-left-radius: 3px;
+}
+
+.panel-heading > .dropdown .dropdown-toggle {
+  color: inherit;
+}
+
+.panel-title {
+  margin-top: 0;
+  margin-bottom: 0;
+  font-size: 16px;
+  color: inherit;
+}
+
+.panel-title > a {
+  color: inherit;
+}
+
+.panel-footer {
+  padding: 10px 15px;
+  background-color: #f5f5f5;
+  border-top: 1px solid #dddddd;
+  border-bottom-right-radius: 3px;
+  border-bottom-left-radius: 3px;
+}
+
+.panel-group .panel {
+  margin-bottom: 0;
+  overflow: hidden;
+  border-radius: 4px;
+}
+
+.panel-group .panel + .panel {
+  margin-top: 5px;
+}
+
+.panel-group .panel-heading {
+  border-bottom: 0;
+}
+
+.panel-group .panel-heading + .panel-collapse .panel-body {
+  border-top: 1px solid #dddddd;
+}
+
+.panel-group .panel-footer {
+  border-top: 0;
+}
+
+.panel-group .panel-footer + .panel-collapse .panel-body {
+  border-bottom: 1px solid #dddddd;
+}
+
+.panel-default {
+  border-color: #dddddd;
+}
+
+.panel-default > .panel-heading {
+  color: #333333;
+  background-color: #f5f5f5;
+  border-color: #dddddd;
+}
+
+.panel-default > .panel-heading + .panel-collapse .panel-body {
+  border-top-color: #dddddd;
+}
+
+.panel-default > .panel-footer + .panel-collapse .panel-body {
+  border-bottom-color: #dddddd;
+}
+
+.panel-primary {
+  border-color: #428bca;
+}
+
+.panel-primary > .panel-heading {
+  color: #ffffff;
+  background-color: #428bca;
+  border-color: #428bca;
+}
+
+.panel-primary > .panel-heading + .panel-collapse .panel-body {
+  border-top-color: #428bca;
+}
+
+.panel-primary > .panel-footer + .panel-collapse .panel-body {
+  border-bottom-color: #428bca;
+}
+
+.panel-success {
+  border-color: #d6e9c6;
+}
+
+.panel-success > .panel-heading {
+  color: #3c763d;
+  background-color: #dff0d8;
+  border-color: #d6e9c6;
+}
+
+.panel-success > .panel-heading + .panel-collapse .panel-body {
+  border-top-color: #d6e9c6;
+}
+
+.panel-success > .panel-footer + .panel-collapse .panel-body {
+  border-bottom-color: #d6e9c6;
+}
+
+.panel-warning {
+  border-color: #faebcc;
+}
+
+.panel-warning > .panel-heading {
+  color: #8a6d3b;
+  background-color: #fcf8e3;
+  border-color: #faebcc;
+}
+
+.panel-warning > .panel-heading + .panel-collapse .panel-body {
+  border-top-color: #faebcc;
+}
+
+.panel-warning > .panel-footer + .panel-collapse .panel-body {
+  border-bottom-color: #faebcc;
+}
+
+.panel-danger {
+  border-color: #ebccd1;
+}
+
+.panel-danger > .panel-heading {
+  color: #a94442;
+  background-color: #f2dede;
+  border-color: #ebccd1;
+}
+
+.panel-danger > .panel-heading + .panel-collapse .panel-body {
+  border-top-color: #ebccd1;
+}
+
+.panel-danger > .panel-footer + .panel-collapse .panel-body {
+  border-bottom-color: #ebccd1;
+}
+
+.panel-info {
+  border-color: #bce8f1;
+}
+
+.panel-info > .panel-heading {
+  color: #31708f;
+  background-color: #d9edf7;
+  border-color: #bce8f1;
+}
+
+.panel-info > .panel-heading + .panel-collapse .panel-body {
+  border-top-color: #bce8f1;
+}
+
+.panel-info > .panel-footer + .panel-collapse .panel-body {
+  border-bottom-color: #bce8f1;
+}
+
+.well {
+  min-height: 20px;
+  padding: 19px;
+  margin-bottom: 20px;
+  background-color: #f5f5f5;
+  border: 1px solid #e3e3e3;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+}
+
+.well blockquote {
+  border-color: #ddd;
+  border-color: rgba(0, 0, 0, 0.15);
+}
+
+.well-lg {
+  padding: 24px;
+  border-radius: 6px;
+}
+
+.well-sm {
+  padding: 9px;
+  border-radius: 3px;
+}
+
+.close {
+  float: right;
+  font-size: 21px;
+  font-weight: bold;
+  line-height: 1;
+  color: #000000;
+  text-shadow: 0 1px 0 #ffffff;
+  opacity: 0.2;
+  filter: alpha(opacity=20);
+}
+
+.close:hover,
+.close:focus {
+  color: #000000;
+  text-decoration: none;
+  cursor: pointer;
+  opacity: 0.5;
+  filter: alpha(opacity=50);
+}
+
+button.close {
+  padding: 0;
+  cursor: pointer;
+  background: transparent;
+  border: 0;
+  -webkit-appearance: none;
+}
+
+.modal-open {
+  overflow: hidden;
+}
+
+.modal {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 1040;
+  display: none;
+  overflow: auto;
+  overflow-y: scroll;
+}
+
+.modal.fade .modal-dialog {
+  -webkit-transform: translate(0, -25%);
+      -ms-transform: translate(0, -25%);
+          transform: translate(0, -25%);
+  -webkit-transition: -webkit-transform 0.3s ease-out;
+     -moz-transition: -moz-transform 0.3s ease-out;
+       -o-transition: -o-transform 0.3s ease-out;
+          transition: transform 0.3s ease-out;
+}
+
+.modal.in .modal-dialog {
+  -webkit-transform: translate(0, 0);
+      -ms-transform: translate(0, 0);
+          transform: translate(0, 0);
+}
+
+.modal-dialog {
+  position: relative;
+  z-index: 1050;
+  width: auto;
+  margin: 10px;
+}
+
+.modal-content {
+  position: relative;
+  background-color: #ffffff;
+  border: 1px solid #999999;
+  border: 1px solid rgba(0, 0, 0, 0.2);
+  border-radius: 6px;
+  outline: none;
+  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
+          box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
+  background-clip: padding-box;
+}
+
+.modal-backdrop {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 1030;
+  background-color: #000000;
+}
+
+.modal-backdrop.fade {
+  opacity: 0;
+  filter: alpha(opacity=0);
+}
+
+.modal-backdrop.in {
+  opacity: 0.5;
+  filter: alpha(opacity=50);
+}
+
+.modal-header {
+  min-height: 16.428571429px;
+  padding: 15px;
+  border-bottom: 1px solid #e5e5e5;
+}
+
+.modal-header .close {
+  margin-top: -2px;
+}
+
+.modal-title {
+  margin: 0;
+  line-height: 1.428571429;
+}
+
+.modal-body {
+  position: relative;
+  padding: 20px;
+}
+
+.modal-footer {
+  padding: 19px 20px 20px;
+  margin-top: 15px;
+  text-align: right;
+  border-top: 1px solid #e5e5e5;
+}
+
+.modal-footer:before,
+.modal-footer:after {
+  display: table;
+  content: " ";
+}
+
+.modal-footer:after {
+  clear: both;
+}
+
+.modal-footer:before,
+.modal-footer:after {
+  display: table;
+  content: " ";
+}
+
+.modal-footer:after {
+  clear: both;
+}
+
+.modal-footer .btn + .btn {
+  margin-bottom: 0;
+  margin-left: 5px;
+}
+
+.modal-footer .btn-group .btn + .btn {
+  margin-left: -1px;
+}
+
+.modal-footer .btn-block + .btn-block {
+  margin-left: 0;
+}
+
+@media screen and (min-width: 768px) {
+  .modal-dialog {
+    width: 600px;
+    margin: 30px auto;
+  }
+  .modal-content {
+    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
+            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
+  }
+}
+
+.tooltip {
+  position: absolute;
+  z-index: 1030;
+  display: block;
+  font-size: 12px;
+  line-height: 1.4;
+  opacity: 0;
+  filter: alpha(opacity=0);
+  visibility: visible;
+}
+
+.tooltip.in {
+  opacity: 0.9;
+  filter: alpha(opacity=90);
+}
+
+.tooltip.top {
+  padding: 5px 0;
+  margin-top: -3px;
+}
+
+.tooltip.right {
+  padding: 0 5px;
+  margin-left: 3px;
+}
+
+.tooltip.bottom {
+  padding: 5px 0;
+  margin-top: 3px;
+}
+
+.tooltip.left {
+  padding: 0 5px;
+  margin-left: -3px;
+}
+
+.tooltip-inner {
+  max-width: 200px;
+  padding: 3px 8px;
+  color: #ffffff;
+  text-align: center;
+  text-decoration: none;
+  background-color: #000000;
+  border-radius: 4px;
+}
+
+.tooltip-arrow {
+  position: absolute;
+  width: 0;
+  height: 0;
+  border-color: transparent;
+  border-style: solid;
+}
+
+.tooltip.top .tooltip-arrow {
+  bottom: 0;
+  left: 50%;
+  margin-left: -5px;
+  border-top-color: #000000;
+  border-width: 5px 5px 0;
+}
+
+.tooltip.top-left .tooltip-arrow {
+  bottom: 0;
+  left: 5px;
+  border-top-color: #000000;
+  border-width: 5px 5px 0;
+}
+
+.tooltip.top-right .tooltip-arrow {
+  right: 5px;
+  bottom: 0;
+  border-top-color: #000000;
+  border-width: 5px 5px 0;
+}
+
+.tooltip.right .tooltip-arrow {
+  top: 50%;
+  left: 0;
+  margin-top: -5px;
+  border-right-color: #000000;
+  border-width: 5px 5px 5px 0;
+}
+
+.tooltip.left .tooltip-arrow {
+  top: 50%;
+  right: 0;
+  margin-top: -5px;
+  border-left-color: #000000;
+  border-width: 5px 0 5px 5px;
+}
+
+.tooltip.bottom .tooltip-arrow {
+  top: 0;
+  left: 50%;
+  margin-left: -5px;
+  border-bottom-color: #000000;
+  border-width: 0 5px 5px;
+}
+
+.tooltip.bottom-left .tooltip-arrow {
+  top: 0;
+  left: 5px;
+  border-bottom-color: #000000;
+  border-width: 0 5px 5px;
+}
+
+.tooltip.bottom-right .tooltip-arrow {
+  top: 0;
+  right: 5px;
+  border-bottom-color: #000000;
+  border-width: 0 5px 5px;
+}
+
+.popover {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 1010;
+  display: none;
+  max-width: 276px;
+  padding: 1px;
+  text-align: left;
+  white-space: normal;
+  background-color: #ffffff;
+  border: 1px solid #cccccc;
+  border: 1px solid rgba(0, 0, 0, 0.2);
+  border-radius: 6px;
+  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+          box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  background-clip: padding-box;
+}
+
+.popover.top {
+  margin-top: -10px;
+}
+
+.popover.right {
+  margin-left: 10px;
+}
+
+.popover.bottom {
+  margin-top: 10px;
+}
+
+.popover.left {
+  margin-left: -10px;
+}
+
+.popover-title {
+  padding: 8px 14px;
+  margin: 0;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 18px;
+  background-color: #f7f7f7;
+  border-bottom: 1px solid #ebebeb;
+  border-radius: 5px 5px 0 0;
+}
+
+.popover-content {
+  padding: 9px 14px;
+}
+
+.popover .arrow,
+.popover .arrow:after {
+  position: absolute;
+  display: block;
+  width: 0;
+  height: 0;
+  border-color: transparent;
+  border-style: solid;
+}
+
+.popover .arrow {
+  border-width: 11px;
+}
+
+.popover .arrow:after {
+  border-width: 10px;
+  content: "";
+}
+
+.popover.top .arrow {
+  bottom: -11px;
+  left: 50%;
+  margin-left: -11px;
+  border-top-color: #999999;
+  border-top-color: rgba(0, 0, 0, 0.25);
+  border-bottom-width: 0;
+}
+
+.popover.top .arrow:after {
+  bottom: 1px;
+  margin-left: -10px;
+  border-top-color: #ffffff;
+  border-bottom-width: 0;
+  content: " ";
+}
+
+.popover.right .arrow {
+  top: 50%;
+  left: -11px;
+  margin-top: -11px;
+  border-right-color: #999999;
+  border-right-color: rgba(0, 0, 0, 0.25);
+  border-left-width: 0;
+}
+
+.popover.right .arrow:after {
+  bottom: -10px;
+  left: 1px;
+  border-right-color: #ffffff;
+  border-left-width: 0;
+  content: " ";
+}
+
+.popover.bottom .arrow {
+  top: -11px;
+  left: 50%;
+  margin-left: -11px;
+  border-bottom-color: #999999;
+  border-bottom-color: rgba(0, 0, 0, 0.25);
+  border-top-width: 0;
+}
+
+.popover.bottom .arrow:after {
+  top: 1px;
+  margin-left: -10px;
+  border-bottom-color: #ffffff;
+  border-top-width: 0;
+  content: " ";
+}
+
+.popover.left .arrow {
+  top: 50%;
+  right: -11px;
+  margin-top: -11px;
+  border-left-color: #999999;
+  border-left-color: rgba(0, 0, 0, 0.25);
+  border-right-width: 0;
+}
+
+.popover.left .arrow:after {
+  right: 1px;
+  bottom: -10px;
+  border-left-color: #ffffff;
+  border-right-width: 0;
+  content: " ";
+}
+
+.carousel {
+  position: relative;
+}
+
+.carousel-inner {
+  position: relative;
+  width: 100%;
+  overflow: hidden;
+}
+
+.carousel-inner > .item {
+  position: relative;
+  display: none;
+  -webkit-transition: 0.6s ease-in-out left;
+          transition: 0.6s ease-in-out left;
+}
+
+.carousel-inner > .item > img,
+.carousel-inner > .item > a > img {
+  display: block;
+  height: auto;
+  max-width: 100%;
+  line-height: 1;
+}
+
+.carousel-inner > .active,
+.carousel-inner > .next,
+.carousel-inner > .prev {
+  display: block;
+}
+
+.carousel-inner > .active {
+  left: 0;
+}
+
+.carousel-inner > .next,
+.carousel-inner > .prev {
+  position: absolute;
+  top: 0;
+  width: 100%;
+}
+
+.carousel-inner > .next {
+  left: 100%;
+}
+
+.carousel-inner > .prev {
+  left: -100%;
+}
+
+.carousel-inner > .next.left,
+.carousel-inner > .prev.right {
+  left: 0;
+}
+
+.carousel-inner > .active.left {
+  left: -100%;
+}
+
+.carousel-inner > .active.right {
+  left: 100%;
+}
+
+.carousel-control {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  width: 15%;
+  font-size: 20px;
+  color: #ffffff;
+  text-align: center;
+  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
+  opacity: 0.5;
+  filter: alpha(opacity=50);
+}
+
+.carousel-control.left {
+  background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0), color-stop(rgba(0, 0, 0, 0.0001) 100%));
+  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
+}
+
+.carousel-control.right {
+  right: 0;
+  left: auto;
+  background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0), color-stop(rgba(0, 0, 0, 0.5) 100%));
+  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
+}
+
+.carousel-control:hover,
+.carousel-control:focus {
+  color: #ffffff;
+  text-decoration: none;
+  outline: none;
+  opacity: 0.9;
+  filter: alpha(opacity=90);
+}
+
+.carousel-control .icon-prev,
+.carousel-control .icon-next,
+.carousel-control .glyphicon-chevron-left,
+.carousel-control .glyphicon-chevron-right {
+  position: absolute;
+  top: 50%;
+  z-index: 5;
+  display: inline-block;
+}
+
+.carousel-control .icon-prev,
+.carousel-control .glyphicon-chevron-left {
+  left: 50%;
+}
+
+.carousel-control .icon-next,
+.carousel-control .glyphicon-chevron-right {
+  right: 50%;
+}
+
+.carousel-control .icon-prev,
+.carousel-control .icon-next {
+  width: 20px;
+  height: 20px;
+  margin-top: -10px;
+  margin-left: -10px;
+  font-family: serif;
+}
+
+.carousel-control .icon-prev:before {
+  content: '\2039';
+}
+
+.carousel-control .icon-next:before {
+  content: '\203a';
+}
+
+.carousel-indicators {
+  position: absolute;
+  bottom: 10px;
+  left: 50%;
+  z-index: 15;
+  width: 60%;
+  padding-left: 0;
+  margin-left: -30%;
+  text-align: center;
+  list-style: none;
+}
+
+.carousel-indicators li {
+  display: inline-block;
+  width: 10px;
+  height: 10px;
+  margin: 1px;
+  text-indent: -999px;
+  cursor: pointer;
+  background-color: #000 \9;
+  background-color: rgba(0, 0, 0, 0);
+  border: 1px solid #ffffff;
+  border-radius: 10px;
+}
+
+.carousel-indicators .active {
+  width: 12px;
+  height: 12px;
+  margin: 0;
+  background-color: #ffffff;
+}
+
+.carousel-caption {
+  position: absolute;
+  right: 15%;
+  bottom: 20px;
+  left: 15%;
+  z-index: 10;
+  padding-top: 20px;
+  padding-bottom: 20px;
+  color: #ffffff;
+  text-align: center;
+  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
+}
+
+.carousel-caption .btn {
+  text-shadow: none;
+}
+
+@media screen and (min-width: 768px) {
+  .carousel-control .glyphicons-chevron-left,
+  .carousel-control .glyphicons-chevron-right,
+  .carousel-control .icon-prev,
+  .carousel-control .icon-next {
+    width: 30px;
+    height: 30px;
+    margin-top: -15px;
+    margin-left: -15px;
+    font-size: 30px;
+  }
+  .carousel-caption {
+    right: 20%;
+    left: 20%;
+    padding-bottom: 30px;
+  }
+  .carousel-indicators {
+    bottom: 20px;
+  }
+}
+
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: " ";
+}
+
+.clearfix:after {
+  clear: both;
+}
+
+.center-block {
+  display: block;
+  margin-right: auto;
+  margin-left: auto;
+}
+
+.pull-right {
+  float: right !important;
+}
+
+.pull-left {
+  float: left !important;
+}
+
+.hide {
+  display: none !important;
+}
+
+.show {
+  display: block !important;
+}
+
+.invisible {
+  visibility: hidden;
+}
+
+.text-hide {
+  font: 0/0 a;
+  color: transparent;
+  text-shadow: none;
+  background-color: transparent;
+  border: 0;
+}
+
+.hidden {
+  display: none !important;
+  visibility: hidden !important;
+}
+
+.affix {
+  position: fixed;
+}
+
+@-ms-viewport {
+  width: device-width;
+}
+
+.visible-xs,
+tr.visible-xs,
+th.visible-xs,
+td.visible-xs {
+  display: none !important;
+}
+
+@media (max-width: 767px) {
+  .visible-xs {
+    display: block !important;
+  }
+  table.visible-xs {
+    display: table;
+  }
+  tr.visible-xs {
+    display: table-row !important;
+  }
+  th.visible-xs,
+  td.visible-xs {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .visible-xs.visible-sm {
+    display: block !important;
+  }
+  table.visible-xs.visible-sm {
+    display: table;
+  }
+  tr.visible-xs.visible-sm {
+    display: table-row !important;
+  }
+  th.visible-xs.visible-sm,
+  td.visible-xs.visible-sm {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .visible-xs.visible-md {
+    display: block !important;
+  }
+  table.visible-xs.visible-md {
+    display: table;
+  }
+  tr.visible-xs.visible-md {
+    display: table-row !important;
+  }
+  th.visible-xs.visible-md,
+  td.visible-xs.visible-md {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .visible-xs.visible-lg {
+    display: block !important;
+  }
+  table.visible-xs.visible-lg {
+    display: table;
+  }
+  tr.visible-xs.visible-lg {
+    display: table-row !important;
+  }
+  th.visible-xs.visible-lg,
+  td.visible-xs.visible-lg {
+    display: table-cell !important;
+  }
+}
+
+.visible-sm,
+tr.visible-sm,
+th.visible-sm,
+td.visible-sm {
+  display: none !important;
+}
+
+@media (max-width: 767px) {
+  .visible-sm.visible-xs {
+    display: block !important;
+  }
+  table.visible-sm.visible-xs {
+    display: table;
+  }
+  tr.visible-sm.visible-xs {
+    display: table-row !important;
+  }
+  th.visible-sm.visible-xs,
+  td.visible-sm.visible-xs {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .visible-sm {
+    display: block !important;
+  }
+  table.visible-sm {
+    display: table;
+  }
+  tr.visible-sm {
+    display: table-row !important;
+  }
+  th.visible-sm,
+  td.visible-sm {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .visible-sm.visible-md {
+    display: block !important;
+  }
+  table.visible-sm.visible-md {
+    display: table;
+  }
+  tr.visible-sm.visible-md {
+    display: table-row !important;
+  }
+  th.visible-sm.visible-md,
+  td.visible-sm.visible-md {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .visible-sm.visible-lg {
+    display: block !important;
+  }
+  table.visible-sm.visible-lg {
+    display: table;
+  }
+  tr.visible-sm.visible-lg {
+    display: table-row !important;
+  }
+  th.visible-sm.visible-lg,
+  td.visible-sm.visible-lg {
+    display: table-cell !important;
+  }
+}
+
+.visible-md,
+tr.visible-md,
+th.visible-md,
+td.visible-md {
+  display: none !important;
+}
+
+@media (max-width: 767px) {
+  .visible-md.visible-xs {
+    display: block !important;
+  }
+  table.visible-md.visible-xs {
+    display: table;
+  }
+  tr.visible-md.visible-xs {
+    display: table-row !important;
+  }
+  th.visible-md.visible-xs,
+  td.visible-md.visible-xs {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .visible-md.visible-sm {
+    display: block !important;
+  }
+  table.visible-md.visible-sm {
+    display: table;
+  }
+  tr.visible-md.visible-sm {
+    display: table-row !important;
+  }
+  th.visible-md.visible-sm,
+  td.visible-md.visible-sm {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .visible-md {
+    display: block !important;
+  }
+  table.visible-md {
+    display: table;
+  }
+  tr.visible-md {
+    display: table-row !important;
+  }
+  th.visible-md,
+  td.visible-md {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .visible-md.visible-lg {
+    display: block !important;
+  }
+  table.visible-md.visible-lg {
+    display: table;
+  }
+  tr.visible-md.visible-lg {
+    display: table-row !important;
+  }
+  th.visible-md.visible-lg,
+  td.visible-md.visible-lg {
+    display: table-cell !important;
+  }
+}
+
+.visible-lg,
+tr.visible-lg,
+th.visible-lg,
+td.visible-lg {
+  display: none !important;
+}
+
+@media (max-width: 767px) {
+  .visible-lg.visible-xs {
+    display: block !important;
+  }
+  table.visible-lg.visible-xs {
+    display: table;
+  }
+  tr.visible-lg.visible-xs {
+    display: table-row !important;
+  }
+  th.visible-lg.visible-xs,
+  td.visible-lg.visible-xs {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .visible-lg.visible-sm {
+    display: block !important;
+  }
+  table.visible-lg.visible-sm {
+    display: table;
+  }
+  tr.visible-lg.visible-sm {
+    display: table-row !important;
+  }
+  th.visible-lg.visible-sm,
+  td.visible-lg.visible-sm {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .visible-lg.visible-md {
+    display: block !important;
+  }
+  table.visible-lg.visible-md {
+    display: table;
+  }
+  tr.visible-lg.visible-md {
+    display: table-row !important;
+  }
+  th.visible-lg.visible-md,
+  td.visible-lg.visible-md {
+    display: table-cell !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .visible-lg {
+    display: block !important;
+  }
+  table.visible-lg {
+    display: table;
+  }
+  tr.visible-lg {
+    display: table-row !important;
+  }
+  th.visible-lg,
+  td.visible-lg {
+    display: table-cell !important;
+  }
+}
+
+.hidden-xs {
+  display: block !important;
+}
+
+table.hidden-xs {
+  display: table;
+}
+
+tr.hidden-xs {
+  display: table-row !important;
+}
+
+th.hidden-xs,
+td.hidden-xs {
+  display: table-cell !important;
+}
+
+@media (max-width: 767px) {
+  .hidden-xs,
+  tr.hidden-xs,
+  th.hidden-xs,
+  td.hidden-xs {
+    display: none !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .hidden-xs.hidden-sm,
+  tr.hidden-xs.hidden-sm,
+  th.hidden-xs.hidden-sm,
+  td.hidden-xs.hidden-sm {
+    display: none !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .hidden-xs.hidden-md,
+  tr.hidden-xs.hidden-md,
+  th.hidden-xs.hidden-md,
+  td.hidden-xs.hidden-md {
+    display: none !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .hidden-xs.hidden-lg,
+  tr.hidden-xs.hidden-lg,
+  th.hidden-xs.hidden-lg,
+  td.hidden-xs.hidden-lg {
+    display: none !important;
+  }
+}
+
+.hidden-sm {
+  display: block !important;
+}
+
+table.hidden-sm {
+  display: table;
+}
+
+tr.hidden-sm {
+  display: table-row !important;
+}
+
+th.hidden-sm,
+td.hidden-sm {
+  display: table-cell !important;
+}
+
+@media (max-width: 767px) {
+  .hidden-sm.hidden-xs,
+  tr.hidden-sm.hidden-xs,
+  th.hidden-sm.hidden-xs,
+  td.hidden-sm.hidden-xs {
+    display: none !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .hidden-sm,
+  tr.hidden-sm,
+  th.hidden-sm,
+  td.hidden-sm {
+    display: none !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .hidden-sm.hidden-md,
+  tr.hidden-sm.hidden-md,
+  th.hidden-sm.hidden-md,
+  td.hidden-sm.hidden-md {
+    display: none !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .hidden-sm.hidden-lg,
+  tr.hidden-sm.hidden-lg,
+  th.hidden-sm.hidden-lg,
+  td.hidden-sm.hidden-lg {
+    display: none !important;
+  }
+}
+
+.hidden-md {
+  display: block !important;
+}
+
+table.hidden-md {
+  display: table;
+}
+
+tr.hidden-md {
+  display: table-row !important;
+}
+
+th.hidden-md,
+td.hidden-md {
+  display: table-cell !important;
+}
+
+@media (max-width: 767px) {
+  .hidden-md.hidden-xs,
+  tr.hidden-md.hidden-xs,
+  th.hidden-md.hidden-xs,
+  td.hidden-md.hidden-xs {
+    display: none !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .hidden-md.hidden-sm,
+  tr.hidden-md.hidden-sm,
+  th.hidden-md.hidden-sm,
+  td.hidden-md.hidden-sm {
+    display: none !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .hidden-md,
+  tr.hidden-md,
+  th.hidden-md,
+  td.hidden-md {
+    display: none !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .hidden-md.hidden-lg,
+  tr.hidden-md.hidden-lg,
+  th.hidden-md.hidden-lg,
+  td.hidden-md.hidden-lg {
+    display: none !important;
+  }
+}
+
+.hidden-lg {
+  display: block !important;
+}
+
+table.hidden-lg {
+  display: table;
+}
+
+tr.hidden-lg {
+  display: table-row !important;
+}
+
+th.hidden-lg,
+td.hidden-lg {
+  display: table-cell !important;
+}
+
+@media (max-width: 767px) {
+  .hidden-lg.hidden-xs,
+  tr.hidden-lg.hidden-xs,
+  th.hidden-lg.hidden-xs,
+  td.hidden-lg.hidden-xs {
+    display: none !important;
+  }
+}
+
+@media (min-width: 768px) and (max-width: 991px) {
+  .hidden-lg.hidden-sm,
+  tr.hidden-lg.hidden-sm,
+  th.hidden-lg.hidden-sm,
+  td.hidden-lg.hidden-sm {
+    display: none !important;
+  }
+}
+
+@media (min-width: 992px) and (max-width: 1199px) {
+  .hidden-lg.hidden-md,
+  tr.hidden-lg.hidden-md,
+  th.hidden-lg.hidden-md,
+  td.hidden-lg.hidden-md {
+    display: none !important;
+  }
+}
+
+@media (min-width: 1200px) {
+  .hidden-lg,
+  tr.hidden-lg,
+  th.hidden-lg,
+  td.hidden-lg {
+    display: none !important;
+  }
+}
+
+.visible-print,
+tr.visible-print,
+th.visible-print,
+td.visible-print {
+  display: none !important;
+}
+
+@media print {
+  .visible-print {
+    display: block !important;
+  }
+  table.visible-print {
+    display: table;
+  }
+  tr.visible-print {
+    display: table-row !important;
+  }
+  th.visible-print,
+  td.visible-print {
+    display: table-cell !important;
+  }
+  .hidden-print,
+  tr.hidden-print,
+  th.hidden-print,
+  td.hidden-print {
+    display: none !important;
+  }
+}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/bootstrap.min.css b/portal/static/unbound_reservation_static/css/bootstrap.min.css
new file mode 100644 (file)
index 0000000..679272d
--- /dev/null
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v3.1.1 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#999}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-muted{color:#999}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#999}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date]{line-height:34px}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px}.radio label,.checkbox label{display:inline;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.has-feedback .form-control-feedback{position:absolute;top:25px;right:0;display:block;width:34px;height:34px;line-height:34px;text-align:center}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{float:none;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#428bca;font-weight:400;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{float:none;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#428bca;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:gray}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.5) 0),color-stop(rgba(0,0,0,.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.0001) 0),color-stop(rgba(0,0,0,.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}@media print{.hidden-print{display:none!important}}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/dhtmlx.css b/portal/static/unbound_reservation_static/css/dhtmlx.css
new file mode 100644 (file)
index 0000000..80d9fb1
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Product Name: dhtmlxSuite 
+Version: 4.0.3 
+Edition: Standard 
+License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
+Copyright UAB Dinamenta http://www.dhtmlx.com
+*/
+
+.dhtmlxcalendar_ifr{position:absolute;overflow:hidden;background-color:white;}.dhtmlxcalendar_dhx_skyblue{position:absolute;display:block;background-color:white;font-family:Tahoma;font-size:11px;color:black;}.dhtmlxcalendar_dhx_skyblue ul.dhtmlxcalendar_line{position:relative;display:block;clear:both;margin:0;padding:0;overflow:hidden;width:211px;}.dhtmlxcalendar_dhx_skyblue ul.dhtmlxcalendar_line li{float:left;position:relative;list-style-type:none;list-style-image:none;text-align:center;vertical-align:middle;cursor:default;overflow:hidden;margin:0;padding:0;}.dhtmlxcalendar_dhx_skyblue.dhtmlxcalendar_in_input{box-shadow:0 0 6px rgba(0,0,0,0.25);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont{position:relative;display:block;width:211px;height:25px;margin:0;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border:1px solid #a4bed4;overflow:hidden;color:black;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;-ms-user-select:text;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr{width:211px;height:25px;line-height:25px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow{position:absolute;top:0;width:18px;height:25px;text-align:center;color:inherit;background-position:center center;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_left{left:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");opacity:.8;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_left_hover{left:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_right{right:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");opacity:.8;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_right_hover{right:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr span.dhtmlxcalendar_month_label_month,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr span.dhtmlxcalendar_month_label_year{position:relative;font-weight:bold;color:#34404b;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont{position:relative;display:block;width:211px;margin:0;padding-bottom:1px;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #cbd9e4;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;-ms-user-select:text;overflow:hidden;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line{border-top:1px solid white;padding-left:1px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li{width:29px;height:19px;line-height:19px;margin-right:1px;font-size:9px;background-color:#ecf4ff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_day_weekday_cell,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_day_weekday_cell_first{color:#c66200;background-color:#ffe6ae;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont{position:relative;display:block;width:211px;margin:0;padding-bottom:1px;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line{border-top:1px solid white;padding-left:1px;height:26px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li{color:#909090;background-color:white;border:1px solid white;width:27px;height:24px;line-height:23px;margin-right:1px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li div.dhtmlxcalendar_label{width:100%;height:100%;text-align:center;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend{border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_dis{color:#b2b2b2;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_holiday,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_holiday{color:red;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_holiday,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_holiday{color:red;border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_holiday_dis{color:red;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_hover{border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_holiday_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_holiday_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_holiday_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_holiday_hover{color:red;border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month{color:black;background-color:#ecf4ff;border-color:#ecf4ff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend{color:#c66200;background-color:#fff0d2;border-color:#fff0d2;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date{color:black;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend{color:#c66200;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_dis{color:#b2b2b2;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_holiday{color:red;background-color:#ecf4ff;border-color:#ecf4ff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_holiday{color:red;background-color:#fff0d2;border-color:#fff0d2;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_holiday{color:red;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_holiday{color:red;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_holiday_dis{color:red;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_hover{color:black;background-color:#d9eeff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_hover{color:#c66200;background-color:#ffe9bb;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_hover{color:black;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_hover{color:#c66200;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_holiday_hover{color:red;background-color:#d9eeff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_holiday_hover{color:red;background-color:#ffe9bb;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_holiday_hover{color:red;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_holiday_hover{color:red;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line div.dhtmlxcalendar_label.dhtmlxcalendar_label_title{background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif");background-position:top right;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_time_cont{position:relative;display:block;width:211px;height:25px;margin:0;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_time_cont ul.dhtmlxcalendar_line li{width:211px;height:25px;line-height:24px;color:#34404b;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_time_cont ul.dhtmlxcalendar_line li div.dhtmlxcalendar_time_img{position:absolute;left:66px;top:6px;width:13px;height:13px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif");background-position:center center;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_cover{position:absolute;left:1px;background-color:white;opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj{position:absolute;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_selector_obj_arrow{position:absolute;bottom:auto;top:0;left:0;width:100%;height:9px;overflow:hidden;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif");background-position:top center;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table{border:1px solid #a4bed4;background-color:white;border-top:none;margin-top:9px;box-shadow:0 0 3px rgba(0,0,0,0.35);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left{width:17px;text-align:center;border-top:1px solid white;padding:0;margin:0;background-color:#ecf4ff;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");background-position:center center;background-repeat:no-repeat;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left.dhtmlxcalendar_selector_cell_left_hover{background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle{border-top:white 1px solid;border-width:1px 0 0 0;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right{width:17px;text-align:center;border-top:1px solid white;border-width:1px 0 0 0;background-color:#ecf4ff;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");background-position:center center;background-repeat:no-repeat;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right.dhtmlxcalendar_selector_cell_right_hover{background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul{display:block;clear:both;margin:0 0 0 1px;padding:0;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul li{float:left;font-family:Tahoma;font-size:10px;color:black;list-style-type:none;list-style-image:none;text-align:center;vertical-align:middle;margin:0 1px 0 0;padding:0;background-color:#e9f3ff;border:1px solid #e9f3ff;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul li.dhtmlxcalendar_selector_cell_active{background-color:#b5deff;border-color:#a1ceed;color:black;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul li.dhtmlxcalendar_selector_cell_hover{background-color:#d9eeff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_month table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_month table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right{display:none;width:0;border:0 solid white;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line{height:22px;border-top:none;border-bottom:1px solid white;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line li.dhtmlxcalendar_selector_cell{width:33px;height:20px;line-height:19px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours div.dhtmlxcalendar_selector_obj_arrow,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_selector_obj_arrow{top:auto;bottom:0;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif");}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line{height:19px;border-top:none;border-bottom:1px solid white;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line li.dhtmlxcalendar_selector_cell,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line li.dhtmlxcalendar_selector_cell{width:21px;height:17px;line-height:16px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right{display:none;width:0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table{margin-top:0;margin-bottom:9px;border-top:1px solid #a4bed4;border-bottom:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_month,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_year,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_hours,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_minutes,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_minutes4,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_minutes5{display:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_month div.dhtmlxcalendar_area_selector_month,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_year div.dhtmlxcalendar_area_selector_year,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours div.dhtmlxcalendar_area_selector_hours,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_area_selector_minutes,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_area_selector_minutes4,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_area_selector_minutes5{display:block;}.dhtmlxcalendar_dhx_skyblue span.dhtmlxcalendar_label_minutes span.dhtmlxcalendar_selected_date{border-bottom:2px solid red;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn{display:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell{width:26px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell{width:24px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_first,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell{width:26px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn{display:block;width:21px;color:#638eb1;background-color:#d9eaff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn{display:block;width:19px;color:#638eb1;background-color:#d9eaff;border-color:#d9eaff;font-size:10px;}div.dhtmlxcalendar_skin_detect{position:absolute;display:block;visibility:hidden;left:-100px;top:0;width:10px;height:10px;margin:0;padding:0;border:none;overflow:hidden;}div.dhxcombo_dhx_skyblue{position:relative;border:1px solid #a4bed4;overflow:hidden;vertical-align:middle;background-color:white;font-size:1px;height:22px;}div.dhxcombo_dhx_skyblue input.dhxcombo_input{position:relative;top:0;left:1px;height:22px;line-height:21px;*height:20px;*line-height:19px;border:0 solid white;outline:0 solid white;padding:0;margin:0 0 0 2px;background-color:white;font-family:Tahoma;font-size:12px;color:black;vertical-align:middle;}div.dhxcombo_dhx_skyblue div.dhxcombo_select_button{position:absolute;width:18px;height:18px;top:1px;right:1px;font-size:1px;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border-radius:2px;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;}div.dhxcombo_dhx_skyblue div.dhxcombo_select_button div.dhxcombo_select_img{position:relative;width:100%;height:100%;background-image:url("imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif");background-repeat:no-repeat;background-position:center center;}div.dhxcombo_dhx_skyblue div.dhxcombo_top_image{position:absolute;left:0;top:0;width:26px;height:22px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;cursor:default;}div.dhxcombolist_dhx_skyblue{position:absolute;font-family:Tahoma;font-size:12px;color:black;border:1px solid #a4bed4;box-shadow:0 2px 3px #ccc;background-color:#e7f1ff;border-bottom-left-radius:2px;border-bottom-right-radius:2px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow-x:none;overflow-y:auto;-moz-transition:height .15s ease 0s;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option{position:relative;font-size:inherit;height:20px;line-height:19px;border-top:1px solid #e7f1ff;border-bottom:1px solid #e7f1ff;vertical-align:middle;overflow:hidden;cursor:default;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option.dhxcombo_option_selected{background-color:#b5deff!important;border-top:1px solid #a1ceed!important;border-bottom:1px solid #a1ceed!important;color:black;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_option_text{position:relative;padding:0 4px;white-space:nowrap;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_option_text.dhxcombo_option_text_chbx{position:relative;padding:0 4px 0 4px;margin-left:20px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;white-space:nowrap;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_checkbox{position:absolute;left:1px;top:1px;width:20px;height:20px;background-image:url("imgs/dhxcombo_skyblue/dhxcombo_chbx.gif");background-repeat:no-repeat;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;cursor:default;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_checkbox.dhxcombo_chbx_0{background-position:0 0;}div.dhxcombolist_dhx_skyblue .dhxcombo_option div.dhxcombo_checkbox.dhxcombo_chbx_1{background-position:-18px 0;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_option_text.dhxcombo_option_text_image{position:relative;padding:0 4px 0 4px;margin-left:20px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;white-space:nowrap;}div.dhxcombo_dhx_skyblue div.dhxcombo_top_image div.dhxcombo_image,div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_image{position:absolute;left:3px;top:1px;width:20px;height:20px;background-repeat:no-repeat;background-position:center center;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;cursor:default;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled{border:1px solid #ccc;background-color:#fafafa;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled input.dhxcombo_input{color:#b2b2b2;background-color:#fafafa;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled div.dhxcombo_select_button{border-color:#ccc;background-color:#fefefe;background:linear-gradient(#fefefe,#f4f4f4);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#fefefe,endColorStr=#f4f4f4) progid:DXImageTransform.Microsoft.Alpha(opacity=100);cursor:default;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled div.dhxcombo_select_button div.dhxcombo_select_img{background-image:url("imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif");}.dhxgrid_combo_icon{position:absolute;z-index:1;top:0;right:0;}div.dhxcombo_dhx_skyblue.dhxcombo_in_grid{border-top:1px solid white;border-bottom:0 solid white;border-left:1px solid white;border-right:1px solid white;margin-left:-4px;}div.dhxcombo_dhx_skyblue.dhxcombo_in_grid input.dhxcombo_input{height:18px;border-left:2px solid white;line-height:17px;}div.dhxcombo_dhx_skyblue.dhxcombo_in_grid div.dhxcombo_select_button{top:0;}.dhxcombo_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhxcolorpicker_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhtmlxcp_dhx_skyblue .dhxcp_g_area{position:absolute;width:254px;height:272px;border:1px solid #a4bed4;background-color:#e7f1ff;}.dhtmlxcp_dhx_skyblue .dhxcp_add_memory{height:317px!important;}.dhtmlxcp_dhx_skyblue .dhxcp_sub_area{margin:1px;width:252px;height:270px;background-color:#e7f1ff;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxcp_dhx_skyblue .dhxcp_add_memory .dhxcp_sub_area{height:229px!important;}.dhtmlxcp_dhx_skyblue .dhxcp_g_color_area{padding:10px;width:232px;height:122px;margin:0;}.dhtmlxcp_dhx_skyblue .dhxcp_color_selector{position:absolute;width:210px;height:120px;background-image:url("imgs/dhxcp_skyblue/dhxcp_colors.png");background-repeat:no-repeat;border:1px solid #a4bed4;cursor:pointer;float:left;}.dhtmlxcp_dhx_skyblue .dhxcp_contrast_area{border:1px solid #a4bed4;position:relative;height:120px;width:10px;cursor:pointer;float:right;}.dhtmlxcp_dhx_skyblue .dhxcp_ie_gradient{height:120px;width:10px;margin:0;}.dhtmlxcp_dhx_skyblue .dhxcp_color_selector .dhxcp_v_line{position:absolute;width:0;height:120px;border-left:1px solid #fff;cursor:pointer;overflow:hidden;}.dhtmlxcp_dhx_skyblue .dhxcp_color_selector .dhxcp_h_line,.dhtmlxcp_dhx_skyblue .dhxcp_contrast_area .dhxcp_h_line{position:absolute;height:0;border-top:1px solid #fff;cursor:pointer;overflow:hidden;}.dhtmlxcp_dhx_skyblue .dhxcp_color_selector .dhxcp_h_line{width:210px;}.dhtmlxcp_dhx_skyblue .dhxcp_contrast_area .dhxcp_h_line{width:10px;}.dhtmlxcp_dhx_skyblue .dhxcp_g_input_area{padding:0 10px;width:232px;height:78px;margin:0;}.dhtmlxcp_dhx_skyblue .dhxcp_value_cont{width:60px;height:82px;float:left;}.dhtmlxcp_dhx_skyblue .dhxcp_value_color{width:56px;height:30px;border:1px solid #a4bed4;}.dhtmlxcp_dhx_skyblue .dhxcp_value{width:49px;height:20px;border:1px solid #a4bed4;border-radius:0;background-color:white;margin:5px 0 0 0;padding:1px 3px;font-family:Tahoma;font-size:11px;color:black;text-align:left;}.dhtmlxcp_dhx_skyblue .dhxcp_inputs_cont{border:none;border-spacing:0;width:161px;height:78px;float:right;}.dhtmlxcp_dhx_skyblue .dhxcp_label_hsl,.dhtmlxcp_dhx_skyblue .dhxcp_label_rgb{font-family:Tahoma;font-size:11px;color:black;text-align:right;padding:0 3px 0 0;}.dhtmlxcp_dhx_skyblue td.dhxcp_input_hsl,.dhtmlxcp_dhx_skyblue td.dhxcp_input_rgb{width:27px;border:none;padding:3px 0;margin:0;}.dhtmlxcp_dhx_skyblue input.dhxcp_input_hsl,.dhtmlxcp_dhx_skyblue input.dhxcp_input_rgb{width:25px;height:19px;border:1px solid #a4bed4;border-radius:0;background-color:white;font-family:Tahoma;font-size:11px;color:black;text-align:right;padding:0 3px;line-height:18px;}.dhtmlxcp_dhx_skyblue .dhxcp_g_memory_area{width:232px;height:0;overflow:hidden;border-top:1px solid #fff;margin:10px;}.dhtmlxcp_dhx_skyblue .dhxcp_memory_button_cont{width:232px;margin:0;height:24px;}.dhtmlxcp_dhx_skyblue button{outline:none;border-radius:2px;border:1px solid #a4bed4;font-family:Tahoma;font-size:11px;color:black;padding:0;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxcp_dhx_skyblue button:hover{background-color:#f1f7ff;background:linear-gradient(#f1f7ff,#e2efff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f1f7ff,endColorStr=#e2efff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxcp_dhx_skyblue button:active{background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 3px #ccc inset;}.dhtmlxcp_dhx_skyblue .dhxcp_save_to_memory{width:232px;height:24px;}.dhtmlxcp_dhx_skyblue .dhxcp_save_to_memory .dhxcp_label_bm{background-image:url("imgs/dhxcp_skyblue/dhxcp_icon_save.png");background-repeat:no-repeat;display:inherit;padding-left:15px;background-position:0 4px;height:18px;line-height:18px;width:80px;margin:1px auto;white-space:nowrap;text-align:left;}.dhtmlxcp_dhx_skyblue .dhxcp_memory_els_cont{width:232px;height:25px;margin-top:3px;text-align:center;}.dhtmlxcp_dhx_skyblue .dhxcp_memory_el{width:24px;height:24px;background-color:#fff;border:1px solid #a4bed4;display:inline-block;margin:0 1px;}.dhtmlxcp_dhx_skyblue .dhxcp_memory_el_select{border:1px dashed black!important;}.dhtmlxcp_dhx_skyblue .dhxcp_memory_el_next{border:1px dashed red!important;}.dhtmlxcp_dhx_skyblue .dhxcp_add_memory .dhxcp_g_memory_area{height:55px!important;border-top:none!important;margin:5px 10px 5px 10px;}.dhtmlxcp_dhx_skyblue .dhxcp_buttons_area{padding:0 10px;width:232px;height:26px;text-align:right;margin:0;}.dhtmlxcp_dhx_skyblue .dhx_button_save,.dhtmlxcp_dhx_skyblue .dhx_button_cancel{padding:2px 10px;margin:1px;height:24px;line-height:12px;overflow:hidden;text-align:center;}.dhxcp_colorBox{float:right;}.dhxcp_colorInput{float:left;}.dhxcp_frm{position:absolute;background-color:white;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);width:256px;height:274px;}.dhtmlxcp_dhx_skyblue.dhtmlxcp_in_form .dhxcp_g_area{padding:5px;border:1px solid #a4bed4;box-shadow:0 0 9px rgba(0,0,0,0.35);}.dhxslider_skin_detect{position:absolute;left:0;top:-100px;border:0 solid white;width:10px;height:10px;margin:0;padding:0;overflow:hidden;}.dhtmlxslider_dhx_skyblue .dhxsl_hidden{display:none;}.dhtmlxslider_dhx_skyblue .dhxsl_container{position:relative;float:left;clear:left;margin:0;padding:1px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxslider_dhx_skyblue .dhxsl_container.dhxsl_cont_hr{margin-top:6px;}.dhtmlxslider_dhx_skyblue .dhxsl_container.dhxsl_cont_vr{margin-left:6px;}.dhtmlxslider_dhx_skyblue .dhxsl_runner{position:absolute;margin:0;padding:0;overflow:hidden;width:16px;height:16px;border:1px solid #a4bed4;border-radius:2px;background-color:#f1f7ff;background:linear-gradient(#f1f7ff,#e2efff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f1f7ff,endColorStr=#e2efff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxslider_dhx_skyblue .dhxsl_runner_dis{border-color:#c9c9c9;background-color:#e8e8e8;background:linear-gradient(#e8e8e8,#dedede);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e8e8e8,endColorStr=#dedede) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxslider_dhx_skyblue .dhxsl_track{border:1px solid #a4bed4;border-radius:2px;background-color:white;margin:0;padding:0;overflow:hidden;}.dhtmlxslider_dhx_skyblue .dhxsl_cont_vr .dhxsl_track{height:100%;width:3px;}.dhtmlxslider_dhx_skyblue .dhxsl_cont_hr .dhxsl_track{width:100%;height:3px;}.dhtmlxslider_dhx_skyblue .dhxsl_track_dis{border:1px solid #c9c9c9;background-color:#f0f0f0;}div.dhx_popup_dhx_skyblue{position:absolute;}div.dhx_popup_dhx_skyblue div.dhx_popup_area{position:relative;margin:10px;padding:3px 0;border:1px solid #a4bed4;box-shadow:0 0 3px #ccc;background-color:#e7f1ff;border-radius:2px;}div.dhx_popup_dhx_skyblue div.dhx_popup_area td.dhx_popup_td{font-family:Tahoma;font-size:11px;color:black;text-align:left;vertical-align:middle;padding:0 8px;height:24px;line-height:23px;border-top:1px solid #e7f1ff;border-bottom:1px solid #e7f1ff;white-space:nowrap;cursor:default;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}div.dhx_popup_dhx_skyblue div.dhx_popup_area td.dhx_popup_td div.dhtmlxcalendar_dhx_skyblue{position:relative;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhx_popup_sep td.dhx_popup_sep{font-size:1px;padding:2px 0;position:relative;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhx_popup_sep td.dhx_popup_sep div.dhx_popup_sep{position:relative;font-size:1px;line-height:1px;height:0;width:100%;border-top:1px solid #a4bed5;overflow:hidden;}div.dhx_popup_dhx_skyblue div.dhx_popup_area td.dhx_popup_td:first-child{padding-left:16px;}div.dhx_popup_dhx_skyblue div.dhx_popup_area td.dhx_popup_td:last-child{padding-right:16px;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr:hover td.dhx_popup_td{background-color:#b5d8ff;border-top:1px solid #8dcef4;border-bottom:1px solid #8dcef4;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode:hover td.dhx_popup_td{background:none;border-top:1px solid #e7f1ff;border-bottom:1px solid #e7f1ff;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode td.dhx_popup_td{padding-top:8px!important;padding-bottom:8px!important;height:auto;line-height:inherit;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;-ms-user-select:text;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode td.dhx_popup_td .dhtmlxcalendar_container.dhtmlxcalendar_skin_dhx_skyblue{position:relative!important;background-image:none;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode td.dhx_popup_td div.dhxtree_dhx_skyblue{background:none;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode td.dhx_popup_td div.dhxeditor_dhx_skyblue{border:1px solid #a4bed4;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode td.dhx_popup_td div.dhtmlxcp_dhx_skyblue div.dhxcp_g_area{position:relative;background-color:#e7f1ff;border:0 solid white;}div.dhx_popup_dhx_skyblue div.dhx_popup_area tr.dhxnode td.dhx_popup_td div.dhtmlxcp_dhx_skyblue div.dhxcp_g_area div.dhxcp_sub_area{background:#e7f1ff;}div.dhx_popup_dhx_skyblue div.dhx_popup_area.dhx_popup_area_ie{box-shadow:0 0 6px #ccc;}div.dhx_popup_dhx_skyblue div.dhx_popup_area.dhx_popup_area_ie tr.dhxnode td.dhx_popup_td{height:1em;line-height:1em;}div.dhx_popup_dhx_skyblue div.dhx_popup_area.dhx_popup_area_ie td.dhx_popup_td.dhx_popup_td_single{padding-left:16px;padding-right:16px;}div.dhx_popup_dhx_skyblue div.dhx_popup_area.dhx_popup_area_ie td.dhx_popup_td.dhx_popup_td_first{padding-left:16px;}div.dhx_popup_dhx_skyblue div.dhx_popup_area.dhx_popup_area_ie td.dhx_popup_td.dhx_popup_td_last{padding-right:16px;}div.dhx_popup_dhx_skyblue div.dhx_popup_area.dhx_popup_area_ie tr.tr_hover td.dhx_popup_td{background-color:#b5d8ff;border-top:1px solid #8dcef4;border-bottom:1px solid #8dcef4;}div.dhx_popup_dhx_skyblue div.dhx_popup_arrow{position:absolute;background-repeat:no-repeat;}div.dhx_popup_dhx_skyblue div.dhx_popup_arrow.dhx_popup_arrow_bottom{width:19px;height:16px;background-image:url("imgs/dhxpopup_skyblue/dhxpopup_arrow_bottom.gif");background-position:top center;}div.dhx_popup_dhx_skyblue div.dhx_popup_arrow.dhx_popup_arrow_top{width:19px;height:16px;background-image:url("imgs/dhxpopup_skyblue/dhxpopup_arrow_top.gif");background-position:bottom center;}div.dhx_popup_dhx_skyblue div.dhx_popup_arrow.dhx_popup_arrow_right{width:16px;height:19px;background-image:url("imgs/dhxpopup_skyblue/dhxpopup_arrow_right.gif");background-position:center left;}div.dhx_popup_dhx_skyblue div.dhx_popup_arrow.dhx_popup_arrow_left{width:16px;height:19px;background-image:url("imgs/dhxpopup_skyblue/dhxpopup_arrow_left.gif");background-position:center right;}div.dhx_popup_skin_detect{position:absolute;display:block;visibility:hidden;left:-100px;top:0;width:10px;height:10px;margin:0;padding:0;border:none;overflow:hidden;}.dhxmenu_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhtmlxMenu_dhx_skyblue_Middle{position:relative;height:30px;border:none;overflow:hidden;background-color:#ebebeb;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxMenu_dhx_skyblue_Middle div.top_sep{float:left;position:relative;height:22px;width:0;border-left:1px solid #ddd;margin:4px 2px 0 0;line-height:1px;font-size:1px;overflow:hidden;cursor:default;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxMenu_dhx_skyblue_Middle img.dhtmlxMenu_TopLevel_Item_Icon{float:left;margin:2px 3px 0 3px;width:18px;height:18px;}.dhtmlxMenu_dhx_skyblue_Middle div.dhtmlxMenu_TopLevel_Text_right{position:absolute;top:8px;left:none;right:8px;font-family:Tahoma;font-size:11px;color:black;cursor:default;}.dhtmlxMenu_dhx_skyblue_Middle div.dhtmlxMenu_TopLevel_Text_left{position:absolute;top:8px;right:none;left:8px;font-family:Tahoma;font-size:11px;color:black;cursor:default;}.dhtmlxMenu_dhx_skyblue_Middle.dir_left div.align_left{float:left;}.dhtmlxMenu_dhx_skyblue_Middle.dir_left div.align_right{float:right;}div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Normal,div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Disabled,div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Selected{position:relative;float:left;font-family:Tahoma;font-size:11px;color:black;cursor:default;white-space:nowrap;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;height:22px;line-height:22px;vertical-align:middle;margin:3px 2px 0 0;padding:0 3px;}div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Normal div.top_level_text,div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Disabled div.top_level_text,div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Selected div.top_level_text{float:left;margin:0 3px;}div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Normal,div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Disabled{border:1px solid #ebebeb;}div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Disabled{color:#999!important;}div.dhtmlxMenu_dhx_skyblue_TopLevel_Item_Selected{border:1px solid #a1ceed;background-color:#b5deff;color:black;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon{position:absolute;border:1px solid #a4bed4;box-shadow:0 0 3px #ccc;padding:3px 0;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top-right-radius:2px;background-color:#e7f1ff;overflow:hidden;cursor:default;line-height:normal;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl td{font-family:Tahoma;font-size:11px;color:black;line-height:normal;padding:0 3px;border-top:1px solid #e7f1ff;border-bottom:1px solid #e7f1ff;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_selected td{background-color:#b5deff;border-top:1px solid #a1ceed;border-bottom:1px solid #a1ceed;color:black;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_selected div.sub_item_hk{color:#333!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl td.sub_item_icon{width:18px;text-align:center;vertical-align:middle;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl td.sub_item_icon img.sub_icon{float:left;margin:0;width:18px;height:18px;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.sub_item_text{padding:0 12px 0 1px;height:22px;line-height:21px;white-space:nowrap;text-align:left;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis div.sub_item_text{color:#999!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl td.sub_item_hk{padding-left:8px;padding-right:8px;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl td.sub_item_hk div.sub_item_hk{font-family:Tahoma;font-size:10px;color:#4d4d4d;text-align:right;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis td.sub_item_hk div.sub_item_hk{color:#9b9b9b!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.complex_arrow{width:4px;margin:0 2px 0 5px;height:22px;background-image:url("imgs/dhxmenu_skyblue/dhxmenu_subar.gif");background-repeat:no-repeat;background-position:0 0;overflow:hidden;font-size:1px;float:right;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_selected div.complex_arrow{background-position:-4px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis div.complex_arrow{background-position:-8px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.complex_arrow_loading{width:11px;height:22px;background-position:center center;background-repeat:no-repeat;background-image:url("imgs/dhxmenu_skyblue/dhxmenu_loader.gif");float:right;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.sub_icon{float:left;margin:0;width:18px;height:18px;background-position:top right;background-repeat:no-repeat;background-image:url("imgs/dhxmenu_skyblue/dhxmenu_chrd.gif");}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.sub_icon.chbx_0{background-position:0 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.sub_icon.chbx_1{background-position:-18px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis div.sub_icon.chbx_0{background-position:-36px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis div.sub_icon.chbx_1{background-position:-54px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.sub_icon.rdbt_0{background-position:-72px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl div.sub_icon.rdbt_1{background-position:-90px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis div.sub_icon.rdbt_0{background-position:-108px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon table.dhtmlxMebu_SubLevelArea_Tbl tr.sub_item_dis div.sub_icon.rdbt_1{background-position:-126px 0!important;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon tr.sub_sep td{padding:2px 0;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_Polygon div.sub_sep{position:static;font-size:1px;line-height:1px;height:1px;width:100%;border-top:1px solid #a4bed4;}iframe.dhtmlxMenu_IE6CoverFix_dhx_skyblue{position:absolute;border:none;background:#000;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowUp,div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowUp_Over,div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowUp_Disabled{position:relative;font-size:1px;border-bottom:1px solid #a4bed4;background-image:url("imgs/dhxmenu_skyblue/dhxmenu_arrow_up.gif");background-repeat:no-repeat;background-position:center center;padding:8px 0;margin-bottom:3px;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowUp_Disabled{background-image:url("imgs/dhxmenu_skyblue/dhxmenu_arrow_up_dis.gif");}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowDown,div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowDown_Over,div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowDown_Disabled{position:relative;font-size:1px;border-top:1px solid #a4bed4;background-image:url("imgs/dhxmenu_skyblue/dhxmenu_arrow_down.gif");background-repeat:no-repeat;background-position:center center;padding:8px 0;margin-top:3px;}div.dhtmlxMenu_dhx_skyblue_SubLevelArea_ArrowDown_Disabled{background-image:url("imgs/dhxmenu_skyblue/dhxmenu_arrow_down_dis.gif");}.dhtmlxribbon_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar{background-color:#fff;border:1px solid #a4bed4;}.dhtmlxribbon_dhx_skyblue{overflow:hidden;width:100%;background-color:#e7f1ff;}.dhtmlxribbon_dhx_skyblue .dhxrb_background_area{height:115px;background-color:#e7f1ff;margin:1px;}.dhtmlxribbon_dhx_skyblue .dhxrb_with_tabbar{height:145px;}.dhtmlxribbon_dhx_skyblue div.dhx_cell_tabbar{background-color:#e7f1ff!important;}.dhtmlxribbon_dhx_skyblue .dhxrb_g_area{height:115px;float:left;clear:left;overflow:hidden;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_base{margin:3px;float:left;border:1px solid #a4bed4;background-color:#ddebff;border-radius:2px;height:106px;overflow:hidden;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_base .dhxrb_block_items{height:84px;float:left;padding:2px 0;overflow:hidden;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_base>.dhxrb_block_label{height:18px;line-height:17px;*height:auto;*line-height:1em;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_base .dhxrb_block_label{text-align:center;clear:left;font-family:Tahoma;font-size:11px;color:#5f85bb;background-color:#d3e7ff;*padding:1px 3px 4px;*font-size:11px;*font-family:Tahoma,FreeSans;}.dhtmlxribbon_dhx_skyblue .dhxrb_big_button{margin:0 2px 5px;float:left;text-align:center;padding:4px 6px;height:72px;border-radius:2px;border:1px solid #ddebff;font-family:Tahoma;font-size:11px;color:black;background-color:#ddebff;}.dhtmlxribbon_dhx_skyblue .dhxrb_big_button .dhxrb_image{width:48px;height:48px;border:none;}.dhtmlxribbon_dhx_skyblue .dhxrb_big_button .dhxrb_label_button{margin:0 auto;cursor:default;font-family:Tahoma;font-size:11px;color:black;line-height:10px;}.dhtmlxribbon_dhx_skyblue .dhxrb_big_button .dhxrb_invisible{visibility:hidden;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_block{float:left;margin:0 2px 5px;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_block .dhxrb_invisible{display:none;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_button{height:21px;margin:1px 3px;float:left;clear:left;padding:3px 4px 0 4px;border-radius:2px;border:1px solid #ddebff;font-family:Tahoma;font-size:11px;color:black;background-color:#ddebff;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_row{height:20px;margin:1px 3px;float:left;padding:3px 4px 1px;white-space:nowrap;overflow:hidden;border-radius:2px;border:1px solid #ddebff;font-family:Tahoma;font-size:11px;color:black;background-color:#ddebff;}.dhtmlxribbon_dhx_skyblue .dhxrb_group .dhxrb_buttoncombo_cont{height:22px;padding:0 2px!important;overflow:hidden;white-space:nowrap;float:left;}.dhtmlxribbon_dhx_skyblue .dhxrb_buttoncombo_cont{height:24px;padding:1px 2px!important;}.dhtmlxribbon_dhx_skyblue .dhxrb_buttoncombo{float:left;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_row .dhxrb_slider,.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_button .dhxrb_slider{float:left;margin-right:5px;margin-top:6px;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_row center,.dhtmlxribbon_dhx_skyblue .dhxrb_in_group center,.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_button center{float:left;margin:0;padding:0;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_group .dhxrb_slider{float:left;margin-right:5px;margin-top:5px;}.dhtmlxribbon_dhx_skyblue .dhxrb_big_button .dhxrb_slider{width:16px;margin:2px 0;height:50px;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_group{height:19px;float:left;padding:2px 4px 1px;border:1px solid #fff;}.dhtmlxribbon_dhx_skyblue .dhxrb_input{float:left;border:1px solid #a4bed4;height:14px;width:80px;font-family:Tahoma;font-size:11px;color:black;padding:1px 2px;}.dhtmlxribbon_dhx_skyblue .dhxrb_input:disabled{border:1px solid #ccc;background-color:#fafafa;color:#b2b2b2;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_button .dhxrb_image,.dhtmlxribbon_dhx_skyblue .dhxrb_in_row .dhxrb_image,.dhtmlxribbon_dhx_skyblue .dhxrb_in_group .dhxrb_image{width:18px;height:18px;float:left;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_button .dhxrb_label_button,.dhtmlxribbon_dhx_skyblue .dhxrb_in_row .dhxrb_label_button,.dhtmlxribbon_dhx_skyblue .dhxrb_in_group .dhxrb_label_button{float:left;cursor:default;margin:2px 4px 2px 6px;font-family:Tahoma;font-size:11px;color:black;}.dhtmlxribbon_dhx_skyblue .dhxrb_buttoncombo_cont .dhxrb_label_button{float:left;margin-left:3px;height:18px;line-height:18px;cursor:default;font-family:Tahoma;font-size:11px;color:black;}.dhtmlxribbon_dhx_skyblue .dhxrb_label_checkbox{float:left;margin:2px 4px;cursor:default;font-family:Tahoma;font-size:11px;color:black;}.dhtmlxribbon_dhx_skyblue .dhxrb_disable_text_style,.dhtmlxribbon_dhx_skyblue .dhxrb_item_disable .dhxrb_label_checkbox{color:#999!important;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxribbon_dhx_skyblue .dhxrb_highlight0{border:1px solid #a4bed4;background-color:#f1f7ff;background:linear-gradient(#f1f7ff,#e2efff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f1f7ff,endColorStr=#e2efff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxribbon_dhx_skyblue .dhxrb_highlight1{border:1px solid #a4bed4;background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 3px #afc1d4 inset;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxribbon_dhx_skyblue .dhxrb_group .dhxrb_highlight0{border:1px solid #ddedff;}.dhtmlxribbon_dhx_skyblue .dhxrb_group .dhxrb_highlight1{background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 3px #afc1d4 inset;border:0;padding:3px 5px 2px 5px;}.dhtmlxribbon_dhx_skyblue .dhxrb_item_hide{display:none!important;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_rows{float:left;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_row{float:left;clear:left;margin:0 2px;height:28px;overflow:hidden;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_arrow{padding:0 5px;margin-left:2px;background:url("imgs/dhxribbon_skyblue/dhxribbon_arrow.gif") no-repeat 50%;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_block .dhxrb_group{border:1px solid #a4bed4;background:#e7f1ff;height:24px;border-radius:2px;float:left;clear:left;margin:1px 3px;overflow:hidden;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_block_row .dhxrb_group{border:1px solid #a4bed4;background:#e7f1ff;height:24px;border-radius:2px;float:left;margin:1px 3px;overflow:hidden;position:relative;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_group .dhxrb_label_hide{display:none;}.dhtmlxribbon_dhx_skyblue .dhxrb_separator_groupp{height:24px;width:0;border-left:1px solid #c4deff;overflow:hidden;float:left;}.dhtmlxribbon_dhx_skyblue .dhxrb_checked.dhxrb_item_disable>.dhxrb_checkbox{background-image:url("imgs/dhxribbon_skyblue/dhxribbon_checked_dis.gif");background-repeat:no-repeat;}.dhtmlxribbon_dhx_skyblue .dhxrb_checked .dhxrb_checkbox{background-image:url("imgs/dhxribbon_skyblue/dhxribbon_checked.gif");background-repeat:no-repeat;}.dhtmlxribbon_dhx_skyblue .dhxrb_item_disable .dhxrb_checkbox{border:1px solid #aaa;background-color:#eee;}.dhtmlxribbon_dhx_skyblue .dhxrb_checkbox{border:1px solid #a4bed4;background-color:#fff;float:left;width:12px;height:12px;margin-top:2px;overflow:hidden;}.dhtmlxribbon_dhx_skyblue .dhxrb_item_text{font-family:Tahoma;font-size:13px;color:#256488;}.dhtmlxribbon_dhx_skyblue .dhxrb_in_group .dhxrb_item_text{height:19px;line-height:18px;*float:left;*clear:left;}.dhtmlxribbon_dhx_skyblue .dhxrb_3rows_button .dhxrb_item_text,.dhtmlxribbon_dhx_skyblue .dhxrb_in_row .dhxrb_item_text{font-family:Tahoma;font-size:14px;color:#256488;}.dhtmlxribbon_dhx_skyblue .dhxrb_big_button .dhxrb_item_text{font-family:Tahoma;font-size:30px;color:#256488;line-height:72px;height:72px;float:left;clear:left;}.dhxtoolbar_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhx_toolbar_dhx_skyblue{border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);position:relative;padding:0 5px;height:30px;line-height:normal;cursor:default;overflow:hidden;font-family:Tahoma;font-size:11px;color:black;}.dhx_toolbar_dhx_skyblue div.dhxtoolbar_float_left{float:left;}.dhx_toolbar_dhx_skyblue div.dhxtoolbar_float_right{float:right;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw{position:relative;float:left;margin-top:2px;padding:2px 3px;*padding-bottom:4px;margin-right:1px;line-height:normal;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:default;height:22px;*height:20px;overflow:hidden;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_dis,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw.dhxtoolbar_btn_dis{color:#999;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_over,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw.dhxtoolbar_btn_over{border:1px solid #a4bed4;border-radius:2px;padding:1px 2px;*padding-bottom:3px;background-color:#f1f7ff;background:linear-gradient(#f1f7ff,#e2efff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f1f7ff,endColorStr=#e2efff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_pres,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw.dhxtoolbar_btn_pres{border:1px solid #a4bed4;border-radius:2px;padding:1px 2px;*padding-bottom:3px;background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 5px rgba(127,127,127,0.15) inset;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_pres_dis{color:#999;border:1px solid #c9c9c9;border-radius:2px;padding:1px 2px;*padding-bottom:3px;background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 5px rgba(127,127,127,0.15) inset;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn img{float:left;margin:2px;width:18px;height:18px;cursor:default;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn .dhxtoolbar_input{position:relative;float:left;border:1px solid #a4bed4;background-color:white;margin:1px;padding:2px 4px 3px 4px;font-family:Tahoma;font-size:11px;color:black;line-height:normal;direction:ltr;outline:none;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn .dhxtoolbar_input:disabled{background-color:#e7eef8;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn div.dhxtoolbar_text,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw div.arwimg{float:left;font:inherit;height:18px;line-height:17px;margin:2px 4px;padding:0;cursor:default;overflow:hidden;white-space:nowrap;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw{margin-left:-3px;z-index:1;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw div.arwimg{margin:2px 0;padding:0 3px;background-image:url("imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow.gif");background-position:center center;background-repeat:no-repeat;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_arw.dhxtoolbar_btn_dis div.arwimg{background-image:url("imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow_dis.gif");}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_sep{float:left;border-left:1px solid #c0d9ec;height:20px;margin:5px 6px 0 5px;overflow:hidden;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_text{float:left;vertical-align:middle;margin-top:3px;padding:3px 5px;line-height:17px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_bg_l,.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_bg_m,.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_bg_r{float:left;height:5px;line-height:1px;margin:8px 0 6px 0;padding:0;width:2px;font-size:1px;border-top:1px solid #a4bed5;border-bottom:1px solid #a4bed5;background-color:#e7f1ff;overflow:hidden;}.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_bg_l{margin-left:4px;border-left:1px solid #a4bed5;border-top-left-radius:2px;border-bottom-left-radius:2px;}.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_bg_r{margin-right:4px;border-right:1px solid #a4bed5;border-top-right-radius:2px;border-bottom-right-radius:2px;}.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_pen,.dhx_toolbar_dhx_skyblue div.dhxtoolbar_sl_pen.dhxtoolbar_over{position:absolute;top:5px;width:7px;height:14px;border:1px solid #a4bed4;background-color:#e1eeff;background:linear-gradient(#e1eeff,#d4e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e1eeff,endColorStr=#d4e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border-radius:1px;cursor:default;font-size:1px;line-height:1px;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_dis div.dhxtoolbar_sl_pen{border-color:#c9c9c9;background-color:#e5e5e5;background:linear-gradient(#e5e5e5,#e0e0e0);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e5e5e5,endColorStr=#e0e0e0) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_dis div.dhxtoolbar_sl_bg_l,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_dis div.dhxtoolbar_sl_bg_m,.dhx_toolbar_dhx_skyblue div.dhx_toolbar_btn.dhxtoolbar_btn_dis div.dhxtoolbar_sl_bg_r{border-color:#c9c9c9;background-color:#e9e9e9;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24{height:36px!important;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_btn,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_arw{height:28px;*height:26px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_btn img{width:24px;height:24px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_btn div.dhxtoolbar_text,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_arw div.arwimg{height:24px;line-height:23px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_text{padding-top:6px;padding-bottom:6px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_sep{height:26px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhxtoolbar_sl_bg_l,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhxtoolbar_sl_bg_m,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhxtoolbar_sl_bg_r{margin-top:11px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhxtoolbar_sl_pen{top:8px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_24 div.dhx_toolbar_btn .dhxtoolbar_input{margin-top:4px;margin-bottom:4px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32{height:44px!important;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_btn,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_arw{height:36px;*height:34px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_btn img{width:32px;height:32px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_btn div.dhxtoolbar_text,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_arw div.arwimg{height:32px;line-height:31px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_text{padding-top:10px;padding-bottom:10px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_sep{height:34px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhxtoolbar_sl_bg_l,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhxtoolbar_sl_bg_m,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhxtoolbar_sl_bg_r{margin-top:15px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhxtoolbar_sl_pen{top:12px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_32 div.dhx_toolbar_btn .dhxtoolbar_input{margin-top:8px;margin-bottom:8px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48{height:60px!important;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_btn,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_arw{height:52px;*height:50px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_btn img{width:48px;height:48px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_btn div.dhxtoolbar_text,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_arw div.arwimg{height:48px;line-height:47px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_text{padding-top:18px;padding-bottom:18px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_sep{height:50px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhxtoolbar_sl_bg_l,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhxtoolbar_sl_bg_m,.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhxtoolbar_sl_bg_r{margin-top:23px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhxtoolbar_sl_pen{top:20px;}.dhx_toolbar_dhx_skyblue.dhxtoolbar_icons_48 div.dhx_toolbar_btn .dhxtoolbar_input{margin-top:16px;margin-bottom:16px;}div.dhx_toolbar_poly_dhx_skyblue{position:absolute;border:1px solid #a4bed4;box-shadow:0 0 3px #ccc;padding:3px 0;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top-right-radius:2px;background-color:#e7f1ff;overflow:hidden;cursor:default;line-height:normal;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}div.dhx_toolbar_poly_dhx_skyblue td{font-family:Tahoma;font-size:11px;color:black;line-height:normal;padding:0 3px;border-top:1px solid #e7f1ff;border-bottom:1px solid #e7f1ff;}div.dhx_toolbar_poly_dhx_skyblue .tr_btn_over td,div.dhx_toolbar_poly_dhx_skyblue .tr_btn_selected td{background-color:#b5deff;border-top:1px solid #a1cef4;border-bottom:1px solid #a1cef4;}div.dhx_toolbar_poly_dhx_skyblue .tr_btn_disabled td{color:#999;}div.dhx_toolbar_poly_dhx_skyblue td.td_btn_img{width:18px;text-align:center;}div.dhx_toolbar_poly_dhx_skyblue td.td_btn_img img.btn_sel_img{width:18px;height:18px;}div.dhx_toolbar_poly_dhx_skyblue td.td_btn_txt div.btn_sel_text{padding:0 12px 0 1px;height:22px;line-height:21px;}div.dhx_toolbar_poly_dhx_skyblue tr.tr_sep td{padding:2px 0;}div.dhx_toolbar_poly_dhx_skyblue div.btn_sep{position:relative;font-size:1px;line-height:1px;height:0;width:100%;border-top:1px solid #a4bed5;}div.dhx_toolbar_slider_label_dhx_skyblue{position:absolute;border:1px solid #a4bed4;box-shadow:0 0 3px #ccc;background-color:#e7f1ff;padding:5px 8px;border-radius:2px;overflow:hidden;cursor:default;line-height:normal;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;font-family:Tahoma;font-size:11px;color:black;}.dhxtoolbar_maxopen_test{position:absolute;width:200px;height:50px;overflow-x:none;overflow-y:auto;left:-300px;top:100px;border:1px solid white;visibility:hidden;}.dhxtoolbar_maxopen_test2{height:200px;}.dhxeditor_dhx_skyblue{position:relative;}.dhxeditor_dhx_skyblue iframe.dhxeditor_mainiframe{position:absolute;overflow:hidden;top:0;left:0;width:100%;height:100%;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb{position:relative;height:30px;padding:0 5px;border-bottom:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb div.dhx_cell_stb_button{float:left;position:relative;width:18px;height:18px;font-size:2px;margin-left:5px;margin-top:7px;cursor:pointer;background-image:url("imgs/dhxeditor_skyblue/buttons.gif");}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb div.dhx_cell_stb_button.btn_bold{margin-left:5px;background-position:0 0;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb div.dhx_cell_stb_button.btn_italic{background-position:-18px 0;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb div.dhx_cell_stb_button.btn_underline{background-position:-36px 0;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb div.dhx_cell_stb_button.btn_clearformat{background-position:-54px 0;}.dhxeditor_dhx_skyblue div.dhx_cell_editor{position:absolute;background-color:white;margin:0;padding:0;overflow:hidden;cursor:default;z-index:0;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_cont_editor{position:absolute;overflow:hidden;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_toolbar_def{position:relative;overflow:hidden;}.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_toolbar_def div.dhx_toolbar_dhx_skyblue{border-top-width:0;border-left-width:0;border-right-width:0;}.dhxwins_vp_dhx_skyblue div.dhx_cell_cont_wins div.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;}.dhxwins_vp_dhx_skyblue div.dhx_cell_cont_wins div.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_cont_editor{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;}.dhxwins_vp_dhx_skyblue div.dhx_cell_cont_wins div.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_toolbar_def{padding:0;border-top:1px solid #a4bed4;}.dhxeditor_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhx_tooltip{display:none;position:absolute;font-family:Tahoma;color:#626262;font-size:11px;z-index:10000;padding:4px 10px 4px 10px;border:1px solid #fff;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;-moz-box-shadow:0 0 3px #d9d9d9;-webkit-box-shadow:0 0 3px #d9d9d9;text-shadow:0 1px 1px #fff;box-shadow:0 0 5px #d9d9d9;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#efefef),color-stop(0.5,#f6f6f6),color-stop(1,#efefef));background:-o-linear-gradient(#efefef 0,#f6f6f6 50%,#efefef 100%);background:-ms-linear-gradient(#efefef 0,#f6f6f6 50%,#efefef 100%);background:-moz-linear-gradient(#efefef 0,#f6f6f6 50%,#efefef 100%);background:#efefef;}.dhx_chart{position:relative;font-family:Tahoma;font-size:11px;color:black;overflow:hidden;}.dhx_chart canvas{position:absolute;left:0;top:0;}.dhx_canvas_text{position:absolute;text-align:center;overflow:hidden;white-space:nowrap;z-index:1000;}.dhx_map_img{width:100%;height:100%;position:absolute;top:0;left:0;border:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);opacity:0;}.dhx_axis_item_y{position:absolute;height:18px;line-height:18px;margin-top:-4px;text-align:right;}.dhx_axis_title_x{text-align:center;}.dhx_axis_title_y{text-align:center;font-family:Tahoma;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-o-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);height:18px;line-height:18px;font-size:11px;}.dhx_ie_filter{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);zoom:1;font-family:serif;}.dhx_chart_legend{position:absolute;z-index:1000;}.dhx_chart_legend_item{height:18px;line-height:18px;padding:2px;cursor:pointer;}.dhx_chart_legend_item.hidden{color:#aaa;}.dhx_axis_item_y.dhx_radar{color:#666;font-size:12px;padding-right:3px;height:13px;line-height:13px;margin-top:0;}.dhx_canvas_text.dhx_axis_radar_title{margin-top:0;padding-top:0;}.dhx_axis_item_y,.dhx_axis_item_x{color:#666;}.dhx_axis_item_x{padding-top:2px;}.dhx_tooltip{display:none;position:absolute;font-family:Tahoma;color:#626262;font-size:11px;z-index:10000;padding:4px 10px 4px 10px;border:1px solid #fff;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;-moz-box-shadow:0 0 3px #d9d9d9;-webkit-box-shadow:0 0 3px #d9d9d9;text-shadow:0 1px 1px #fff;box-shadow:0 0 5px #d9d9d9;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#efefef),color-stop(0.5,#f6f6f6),color-stop(1,#efefef));background:-o-linear-gradient(#efefef 0,#f6f6f6 50%,#efefef 100%);background:-ms-linear-gradient(#efefef 0,#f6f6f6 50%,#efefef 100%);background:-moz-linear-gradient(#efefef 0,#f6f6f6 50%,#efefef 100%);background:#efefef;}.dhx_noselect{-moz-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;}.dhx_allow_selection{-moz-user-select:text;-user-select:text;}.dhx_dataview{overflow-y:auto;-webkit-overflow-scrolling:touch;overflow-x:hidden;-moz-user-select:none;-moz-user-select:-moz-none;-khtml-select:none;}.dhx_drag_zone{position:absolute;border:1px solid #A4BED4;z-index:8000;-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_dataview_default_item,.dhx_dataview_default_item_selected{cursor:pointer;background-color:#fff;}.dhx_dataview .dhx_dataview_default_item,.dhx_dataview .dhx_dataview_default_item_selected{border-right:1px solid #a4bed4;border-bottom:1px dotted #a4bed4;}.dhx_dataview_default_item_selected{background-color:#a1ceed;color:#b5deff;border-color:#a1ceed;background-repeat:repeat-x;}.dhx_dataview_item{font-family:Tahoma;font-size:11px;color:black;}.dhx_dataview_item .dhx_strong{font-weight:bold;display:block;padding-bottom:6px;}.dhx_dataview_default_item_selected .dhx_light{color:#C3C3C3;}.dhx_dataview_item .dhx_light{color:#919191;}.dhx_drag_over{background-color:#faf768;background-image:url("imgs/dhxdataview_skyblue/marker.png");background-repeat:repeat-x;}.dhx_pager_item,.dhx_pager_item_selected{float:left;text-align:center;height:16px;font-family:Tahoma;font-size:10pt;border:1px solid gray;padding:2px 4px;margin-left:5px;cursor:pointer;background-color:white;}.dhx_pager_item_selected{background-color:lightgrey;color:white;cursor:default;font-weight:bold;}.defaultTreeTable{margin:0;padding:0;border:0;}.containerTableStyle{overflow:auto;-webkit-overflow-scrolling:touch;position:relative;top:0;font-size:12px;-khtml-user-select:none;}.containerTableStyleRTL span{direction:rtl;unicode-bidi:bidi-override;}.containerTableStyleRTL{direction:rtl;overflow:auto;position:relative;top:0;font-size:12px;}.standartTreeRow{font-family:Tahoma;font-size:12px;-moz-user-select:none;}.selectedTreeRow{background-color:navy;color:white;font-family:Tahoma;font-size:12px;-moz-user-select:none;}.dragAndDropRow{background-color:navy;color:white;}.standartTreeRow_lor{text-decoration:underline;background-color:#fff;font-family:Tahoma;font-size:12px;-moz-user-select:none;}.selectedTreeRow_lor{text-decoration:underline;background-color:navy;color:white;font-family:Tahoma;font-size:12px;-moz-user-select:none;}.standartTreeImage{width:18px;height:18px;overflow:hidden;border:0;padding:0;margin:0;font-size:1px;}.hiddenRow{width:1px;overflow:hidden;}.dragSpanDiv,.dragSpanDiv td{font-size:12px;background-color:#fff;z-index:999;}.a_dhx_hidden_input{position:absolute;top:-1px;left:-1px;width:1px;height:1px;border:none;background:none;}.a_dhx_hidden_input{position:absolute;top:-1px;left:-1px;width:1px;height:1px;border:none;background:none;}.selectionBox{background-color:#FFC;}.selectionBar{top:0;background-color:black;position:absolute;overflow:hidden;height:2px;z-index:11;}.intreeeditRow{font-size:8pt;height:16px;border:1px solid silver;padding:0;margin:0;margin-left:4px;-moz-user-select:text;-khtml-user-select:text;}.dhx_tree_textSign{font-size:8pt;font-family:monospace;width:21px;color:black;padding:0;margin:0;cursor:pointer;text-align:center;}.dhx_tree_opacity{opacity:0;-moz-opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);-webkit-user-select:none;-moz-user-select:none;user-select:none;}.dhx_bg_img_fix{width:18px;height:18px;background-repeat:no-repeat;background-position:center;background-position-x:center;background-position-y:center;}.dhxtree_dhx_black,.dhxtree_dhx_skyblue{background:#fff;color:black;}*html .dhxtree_dhx_skyblue .standartTreeRow,*html .dhxtree_dhx_skyblue .standartTreeRow_lor{border-right:0 solid red;border-left:0 solid red;}*html .dhxtree_dhx_skyblue span.standartTreeRow,*html .dhxtree_dhx_skyblue span.standartTreeRow_lor{margin-left:1px;}.dhxtree_dhx_skyblue .standartTreeRow,.dhxtree_dhx_skyblue .standartTreeRow_lor{border-right:1px solid transparent;border-left:1px solid transparent;font-family:Tahoma;font-size:12px;overflow:hidden;padding:0;}.dhxtree_dhx_skyblue .selectedTreeRow_lor,.dhxtree_dhx_skyblue .selectedTreeRow{background-color:#b5deff;background-repeat:repeat-x;border:1px solid #a1ceed;color:black;line-height:17px;font-family:Tahoma;font-size:12px;overflow:hidden;}html>body .dhxtree_dhx_skyblue .selectedTreeRow,html>body .dhxtree_dhx_skyblue .selectedTreeRow_lor{padding:1px 0 1px 0;line-height:normal;*display:inline-block;height:13px;}body:nth-of-type(1) .dhxtree_dhx_skyblue span.selectedTreeRow,body:nth-of-type(1) .dhxtree_dhx_skyblue span.selectedTreeRow_lor{padding:1px 0 1px 0;padding-top:0;box-sizing:border-box;line-height:12px;height:13px;}.dhxtree_dhx_web .selectedTreeRow_lor,.dhxtree_dhx_web .selectedTreeRow{background-color:transparent;}.dhxtree_dhx_web span.selectedTreeRow_lor,.dhxtree_dhx_web span.selectedTreeRow{background-color:#b5deff;color:black;}.dhxtree_dhx_web td.standartTreeRow,.dhxtree_dhx_web td.selectedTreeRow{padding-left:2px;}.dhxtree_dhx_web span.standartTreeRow,.dhxtree_dhx_web span.selectedTreeRow{padding-left:3px!important;}.dhxtree_dhx_web .standartTreeRow,.dhxtree_dhx_web .standartTreeRow,.dhxtree_dhx_web .selectedTreeRow_lor,.dhxtree_dhx_web .selectedTreeRow{font-family:Tahoma;font-size:12px;overflow:hidden;}.dhxtree_dhx_terrace .standartTreeRow,.dhxtree_dhx_terrace .standartTreeRow,.dhxtree_dhx_terrace .selectedTreeRow_lor,.dhxtree_dhx_terrace .selectedTreeRow{font-family:Tahoma;font-size:12px;padding:3px 1px 4px 2px;}.dhxtree_dhx_terrace .standartTreeImage{padding-left:3px;}.dhxtree_dhx_terrace .selectedTreeRow_lor,.dhxtree_dhx_terrace .selectedTreeRow{background-color:transparent;}.dhxtree_dhx_terrace span.selectedTreeRow_lor,.dhxtree_dhx_terrace span.selectedTreeRow{background-color:#b5deff;color:black;}div.gridbox{overflow:hidden;text-align:left;}.dhx_sub_row{background-color:#fff;}div.gridbox .xhdr{background-color:#D4D0C8;}div.gridbox table.obj{height:1px;}div.gridbox table.hdr td{line-height:normal;font-family:arial;font-size:12px;background-color:#D4D0C8;border:1px solid;border-color:#fff Gray Gray #fff;text-align:center;margin:0;padding:7px 0 7px 0;font-weight:normal;-moz-user-select:none;-moz-user-select:-moz-none;overflow:hidden;empty-cells:show;}div.gridbox table.hdr td div.hdrcell{overflow:hidden;}div.gridbox table.obj td{border:1px solid;border-color:#fff Gray Gray #fff;font-family:Arial;font-size:12px;-moz-user-select:none;-moz-user-select:-moz-none;overflow:hidden;padding-top:0;padding-bottom:0;empty-cells:show;}div.gridbox table.obj th,div.gridbox table.hdr th{padding:0;margin:0;}div.gridbox table.row20px tr td{height:20px;white-space:nowrap;padding:0;}div.gridbox .objbox{background-color:#fff;position:relative;-webkit-overflow-scrolling:touch;}div.gridbox table.obj td span.space,div.gridbox table.obj td img.space{width:18px;}div.gridbox table.obj tr.rowselected td.cellselected,div.gridbox table.obj td.cellselected{background-color:#d8d8d8;color:black;}div.gridbox table.obj tr.rowselected td{background-color:#e1e0d7;color:black;}div.gridbox table.obj td.editable{-moz-user-select:text;}div.gridbox table.obj td.group_row{vertical-align:middle;font-family:Tahoma;font-size:10pt;font-weight:bold;height:30px;border:0;border-bottom:2px solid navy;}.dragSpanDiv{font-size:12px;border:1px gray solid;background-color:#fff;z-index:999;}.dhx_combo_select{font-family:arial;font-size:12px;border:1px solid;border-color:black silver silver black;background-color:#fff;overflow:hidden;cursor:default;position:absolute;height:auto;z-index:600;}.dhx_combo_edit{width:100%;border:0;padding:0;padding-right:1px!ie;margin:0;font:12px arial;overflow:hidden;}.dhx_textarea{border:1px solid;border-color:black silver silver black;position:absolute;height:100px;z-index:600;}.dhx_clist{background-color:#fff;border:1px solid black;padding:2px 2px 2px 2px;z-index:300;}.gridDragLine{position:absolute;top:10px;left:0;width:100%;height:2px;background-color:black;overflow:hidden;}div.pagingBlock{font-size:12px;font-family:verdana,arial;}div.pagingBlock .pagingCurrentPage{font-weight:bold;cursor:default;}div.pagingBlock .pagingPage{cursor:pointer;text-decoration:underline;}span.recordsInfoBlock{font-size:12px;font-family:verdana,arial;}div.pagingBlock a{text-decoration:none;padding-right:2px;color:black;cursor:pointer;}div.pagingBlock a.dhx_not_active{text-decoration:none;cursor:default;}.toolbar_select{font-size:10px;}.dhtmlxGrid_selection{-moz-opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);background-color:yellow;opacity:.5;border:1px dotted black;}div.gridbox div.ftr{position:absolute;left:0;bottom:1px;width:100%;overflow:hidden;}div.gridbox div.ftr td{padding:0;padding-left:10px;padding-right:5px;border-top:1px solid gray;border-right:1px solid gray;background-color:#ffc;font-style:italic;font-family:arial;font-size:12px;overflow:hidden;}div.gridbox table.hdr td.columnTargetR div.hdrcell{border-right:3px double #F60;border-left:3px solid #D4D0C8;}div.gridbox table.hdr td.columnTargetL div.hdrcell{border-right:3px solid #D4D0C8;border-left:3px double #F60;}.dhx_dragColDiv{font-family:Arial;font-size:12px;background-color:#D4D0C8;border:1px solid;border-color:#fff Gray Gray #fff;text-align:center;margin:0;padding:5px 20px 5px 20px;font-weight:normal;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=75);-moz-opacity:.75;opacity:.75;}.dhtmlx_live_validation_error{background-color:#FFE0E0!important;}.dhtmlx_validation_error{border-bottom:2px solid red!important;}.dhx_header_cmenu{background-color:#fff;border:2px outset silver;z-index:2;}.dhx_header_cmenu_item{white-space:nowrap;}div.gridboxgridbox_dhx_skyblue div.ftr td{text-align:right;color:black;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border-color:#a4bed4;}div.gridbox td.filter input,div.gridbox td.filter select{width:90%;font-size:8pt;font-family:Tahoma;-moz-user-select:text;}div.gridbox_dhx_skyblue.gridbox .ftr,div.gridbox_dhx_skyblue.gridbox .xhdr{color:black;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}div.gridbox_dhx_skyblue.isModern table.hdr tr td{color:black;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}div.gridbox_dhx_skyblue.isIE table.hdr tr{color:black;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}div.gridbox_dhx_skyblue.gridbox table.obj tr td{border-width:0;padding-right:4px;padding-left:4px;}div.gridbox_dhx_skyblue.gridbox table.hdr td div.hdrcell{padding-left:10px;width:auto;}div.gridbox_dhx_skyblue.gridbox table.hdr td{border-width:1px 1px 1px 1px;border-color:#e7f1ff #a4bed4 #a4bed4 #e7f1ff;background-color:transparent;font-family:Tahoma;font-size:12px;color:black;vertical-align:top;text-align:left;}div.gridbox_dhx_skyblue.gridbox{border:1px solid #a4bed4;}div.gridbox_dhx_skyblue.gridbox table.obj{font-family:Tahoma;font-size:12px;color:black;}div.gridbox_dhx_skyblue.gridbox table.obj tr td{padding-top:3px;padding-bottom:3px;}* html .gridbox_dhx_skyblue.gridbox .obj td{height:auto;padding-top:3px;padding-bottom:3px;}div.gridbox_dhx_skyblue.gridbox table.obj.row20px tr td{padding-top:1px;padding-bottom:1px;height:23px;border-right:1px solid #fff;border-top:1px solid #fff;border-bottom:1px solid #fff;}div.gridbox_dhx_skyblue.isModern table.obj.row20px tr td{line-height:23px;}div.gridbox_dhx_skyblue table.obj.row20px tr td.editable .treegrid_cell{margin-top:-2px;height:21px;}div.gridbox_dhx_skyblue.gridbox table.obj tr td.editable div.treegrid_cell{padding:1px 4px!important;}div.gridbox_dhx_skyblue.gridbox table.obj tr.rowselected{background-color:#b5deff;}div.gridbox_dhx_skyblue.gridbox table.obj tr.rowselected td{background-color:#b5deff;color:black;}div.gridbox_dhx_skyblue.gridbox table.obj.row20px tr.rowselected td,div.gridbox_dhx_skyblue.gridbox table.obj.row20px tr.odd_dhx_skyblue.rowselected td{background-color:#b5deff;border-top:1px solid #a1ceed;border-bottom:1px solid #a1ceed;border-right:1px solid #b5deff;}div.gridbox_dhx_skyblue.gridbox table.obj tr.rowselected td.cellselected{background-color:#b5deff;}div.gridbox_dhx_skyblue.gridbox table.obj.row20px tr.odd_dhx_skyblue{background:#ebf3ff;border-top:1px solid #ebf3ff;border-bottom:1px solid #ebf3ff;}div.gridbox_dhx_skyblue.gridbox table.obj tr.odd_dhx_skyblue{background:#ebf3ff;}.dhx_combo_select,.gridbox_dhx_skyblue.gridbox .dhx_combo_edit,.gridbox_dhx_skyblue.gridbox .dhx_textarea{font-family:Tahoma;font-size:12px;}.gridbox_dhx_skyblue .dhx_combo_edit{padding:1px 0 1px 1px;}.gridbox_dhx_skyblue.isIE .dhx_combo_edit{padding:0 0 0 1px;}.gridbox_dhx_skyblue.gridbox .dhx_sub_row{background-color:transparent;}.dhx_header_cmenu{background-color:#fff;border:2px outset silver;z-index:2;}.dhx_header_cmenu_item{white-space:nowrap;}.dhx_pbox{margin-top:3px;border:1px solid #D4D0C8;border-top:0;font-size:10px;}.dhx_pline{background-color:white;margin:-15px 10px 10px 10px;padding:0 5px 0 5px;float:left;}.dhx_page,.dhx_pager_info{margin:3px;text-align:center;font-family:tahoma;font-size:12px;float:left;cursor:pointer;color:black;background-color:gray;padding:1px;}.dhx_pager_info{white-space:nowrap;background-color:white;margin:-8px 10px 10px 10px;padding:0 5px 0 5px;cursor:default;}.dhx_page div{background-color:white;width:16px;height:17px;vertical-align:middle;}div.dhx_page_active{font-weight:bold;background-color:lightgrey;cursor:default;color:white;}.dhx_pbox_modern{margin-top:3px;border:1px solid #D6D6D6;border-top:0;font-size:10px;}.dhx_pline_modern{background-color:white;margin:-15px 10px 10px 10px;padding:0 5px 0 5px;float:left;}.dhx_page_modern,.dhx_pager_info_modern{margin:3px;text-align:center;font-family:tahoma;font-size:12px;float:left;cursor:pointer;color:#055A78;background-color:#D6D6D6;padding:1px;}.dhx_pager_info_modern{white-space:nowrap;background-color:white;margin:-8px 10px 10px 10px;padding:0 5px 0 5px;cursor:default;}.dhx_page_modern div{background-color:white;width:16px;height:17px;vertical-align:middle;}div.dhx_page_active_modern{font-weight:bold;background-color:#055A78;cursor:default;color:white;}.dhx_pbox_light{margin-top:3px;border:1px solid #C2D5DC;border-top:0;font-size:10px;}.dhx_pline_light{background-color:white;margin:-15px 10px 10px 10px;padding:0 5px 0 5px;float:left;}.dhx_page_light,.dhx_pager_info_light{margin:3px;text-align:center;font-family:tahoma;font-size:12px;float:left;cursor:pointer;color:#055A78;background-color:#93AFBA;padding:1px;}.dhx_pager_info_light{white-space:nowrap;background-color:white;margin:-8px 10px 10px 10px;padding:0 5px 0 5px;cursor:default;}.dhx_page_light div{background-color:white;width:16px;height:17px;vertical-align:middle;}div.dhx_page_active_light{font-weight:bold;background-color:#D1DFE3;cursor:default;color:white;}.dhx_pbox_skyblue{margin-top:3px;border:1px solid #C2D5DC;border-top:0;font-size:10px;}.dhx_pline_skyblue{background-color:white;margin:-15px 10px 10px 10px;padding:0 5px 0 5px;float:left;}.dhx_page_skyblue,.dhx_pager_info_skyblue{margin:3px;text-align:center;font-family:tahoma;font-size:12px;float:left;cursor:pointer;color:#055A78;background-color:#93AFBA;padding:1px;}.dhx_pager_info_skyblue{white-space:nowrap;background-color:white;margin:-8px 10px 10px 10px;padding:0 5px 0 5px;cursor:default;}.dhx_page_skyblue div{background-color:white;width:16px;height:17px;vertical-align:middle;}div.dhx_page_active_skyblue{font-weight:bold;color:black;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border:1px solid #a4bed4;padding:0;cursor:default;}div.dhx_page_active_skyblue div.dhx_page_active_skyblue{border:0 solid #a4bed4;}.calcTable{width:100px;background-color:silver;border:1px black solid;}.calcButton{height:20px;cursor:pointer;text-align:center;background-color:gray;color:white;font-size:10px;font-weight:bold;border-top:1px solid silver;border-right:1px solid silver;}.calcPressed{height:20px;cursor:pointer;text-align:center;background-color:gray;color:white;font-size:10px;font-weight:bold;border-top:1px solid black;border-right:1px solid black;}.calcInput{background-color:white;font-size:10px;font-weight:bold;font-family:tahoma,arial;}.calkSubmit{padding:2px;cursor:pointer;text-align:center;background-color:silver;color:white;font-size:10px;font-weight:bold;border-top:1px solid white;border-right:1px solid white;}.dhxgrid_sort_desc,.dhxgrid_sort_asc{width:9px;height:8px;background-image:url("imgs/dhxgrid_skyblue/sort_desc.gif");background-repeat:no-repeat;}.dhxgrid_sort_asc{background-image:url("imgs/dhxgrid_skyblue/sort_asc.gif");background-repeat:no-repeat;}.dhxform_obj_dhx_skyblue{font-family:Tahoma;float:left;line-height:normal;}.dhxform_obj_dhx_skyblue div.dhxform_base{position:relative;float:left;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_base{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_base_nested{padding:0;clear:both;*display:inline-block;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_base_nested{padding:0;}.dhxform_obj_dhx_skyblue.dhxform_block{clear:both;}.dhxform_obj_dhx_skyblue div.block_dhxform_item_label_left{display:block;clear:both;*clear:none;}.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link,.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:visited,.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:active,.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:hover{outline:none;text-decoration:none;color:inherit;cursor:default;overflow:hidden;white-space:normal;apadding-top:1px;}.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:focus{color:#305f87;}.dhxform_obj_dhx_skyblue div.disabled span.nav_link{color:inherit;}.dhxform_obj_dhx_skyblue div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_actv_r{width:18px;height:18px;font-size:1px;}.dhxform_obj_dhx_skyblue div.dhxform_img.chbx0,.dhxform_obj_dhx_skyblue div.dhxform_img.chbx1,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx0,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx1,.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt0,.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt1,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt0,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt1,.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx0,.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx1,.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt0,.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt1{background-image:url("imgs/dhxform_skyblue/dhxform_chbxrd.gif");background-repeat:no-repeat;}.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx0{background-position:-162px 0;}.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx1{background-position:-144px 0;}.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt0{background-position:-198px 0;}.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt1{background-position:-180px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.chbx0{background-position:-18px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.chbx1{background-position:0 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx0{background-position:-54px 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx1{background-position:-36px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt0{background-position:-90px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt1{background-position:-72px 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt0{background-position:-126px 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt1{background-position:-108px 0;}.dhxform_obj_dhx_skyblue div.dhxform_label{font-family:inherit;font-size:inherit;color:black;overflow-x:hidden;overflow:hidden;white-space:normal;}.dhxform_obj_dhx_skyblue div.dhxform_label.dhxform_label_align_left{text-align:left;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_label.dhxform_label_align_left{text-align:right;}.dhxform_obj_dhx_skyblue div.dhxform_label.dhxform_label_align_center{text-align:center;}.dhxform_obj_dhx_skyblue div.dhxform_label.dhxform_label_align_right{text-align:right;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_label.dhxform_label_align_right{text-align:left;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_label,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_label div.dhxform_label_nav_link,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_label span.dhxform_item_required{color:#b2b2b2;}.dhxform_obj_dhx_skyblue div.dhxform_label span.dhxform_item_required{margin-left:5px;margin-right:0;color:red;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_label span.dhxform_item_required{margin-left:0;margin-right:5px;}.dhxform_obj_dhx_skyblue input.dhxform_textarea{padding:4px 3px!important;margin:0;font-size:1em;}.dhxform_obj_dhx_skyblue textarea.dhxform_textarea{padding:4px 3px!important;}.dhxform_obj_dhx_skyblue .dhxform_textarea{border:1px solid #a4bed4;font-family:Tahoma;font-size:1em;color:black;resize:none;}.dhxform_obj_dhx_skyblue div.disabled .dhxform_textarea{color:#b2b2b2;background-color:white;border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue.dhxform_rtl .dhxform_textarea{text-align:right;direction:rtl;}.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node{position:relative;}.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node .dhxform_textarea{border:1px solid white;background-color:white;color:white;visibility:hidden;*height:1px;*line-height:1px;*display:inline;}.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node div.dhxform_actv_r{float:none;top:2px;left:2px;position:absolute;margin:0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_control.dhxform_img_node div.dhxform_img{float:none;top:2px;left:0;position:absolute;margin:0;}.dhxform_obj_dhx_skyblue .dhxform_select{border:1px solid #a4bed4;background-color:#fff;margin:0;padding:3px 2px 3px 0;font-family:Tahoma;font-size:1em;color:black;}.dhxform_obj_dhx_skyblue .dhxform_select option{padding-left:2px;}.dhxform_obj_dhx_skyblue div.disabled .dhxform_select{color:#b2b2b2;background-color:#fff;border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue.dhxform_rtl select,.dhxform_obj_dhx_skyblue.dhxform_rtl option{direction:rtl;}.dhxform_obj_dhx_skyblue div.fs_dhxform_item_label_left{padding:5px 0 5px 0;}.dhxform_obj_dhx_skyblue div.fs_dhxform_item_label_left fieldset.dhxform_fs div.dhxform_base_nested.dhxform_fs_nested{margin-right:19px;margin-left:5px;}.dhxform_obj_dhx_skyblue fieldset.dhxform_fs{border:1px solid #a4bed4;margin:0;padding:5px 0 12px 0;clear:left;width:100%;}.dhxform_obj_dhx_skyblue div.disabled fieldset.dhxform_fs{border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue fieldset.dhxform_fs legend.fs_legend{font-family:Tahoma;font-size:inherit;color:#7099bb;font-weight:normal;padding:0 4px 1px 4px;margin-left:5px;text-align:left;}.dhxform_obj_dhx_skyblue.dhxform_rtl fieldset.dhxform_fs legend.fs_legend{text-align:right;}.dhxform_obj_dhx_skyblue div.disabled fieldset.dhxform_fs legend.fs_legend{color:#b2b2b2;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right{clear:both;padding-top:6px;cursor:default;*float:left;*display:inline-block;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_actv_r{float:left;margin:0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_right div.dhxform_img{float:right;margin:0;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_label{float:left;padding:2px 0 2px 0;margin:2px 0 2px 0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_right div.dhxform_label{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_control{float:left;margin-right:3px;margin-left:0;*display:inline;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_right div.dhxform_control{float:right;margin-right:0;margin-left:3px;*display:inline;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left{clear:both;padding-top:6px;cursor:default;*float:left;*display:inline-block;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_actv_r{float:right;amargin:3px 1px 0 5px;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_left div.dhxform_img{float:left;amargin:3px 5px 0 1px;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_label{float:left;padding:2px 0 2px 0;margin:2px 0 2px 0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_left div.dhxform_label{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_control{float:left;padding-left:4px;padding-right:0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_left div.dhxform_control{float:right;padding-right:4px;padding-left:0;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_top{clear:both;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_top div.dhxform_label{float:none;margin-bottom:5px;margin-top:8px;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_top div.dhxform_control{float:none;margin-left:0;margin-bottom:5px;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_top div.dhxform_control{float:none;margin-right:0;}.dhxform_obj_dhx_skyblue div.dhxform_item_absolute{position:absolute;left:0;top:0;cursor:default;}.dhxform_obj_dhx_skyblue div.item_absolute div.dhxform_img,.dhxform_obj_dhx_skyblue div.item_absolute div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.item_absolute div.dhxform_actv_r{position:absolute;}.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_control,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_label,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_control.dhxform_img_node,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_txt_label2,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_btn,.dhxform_obj_dhx_skyblue div.block_item_absolute div.dhxform_block{position:absolute;}.dhxform_obj_dhx_skyblue div.dhxform_txt_label2{font-family:Tahoma;font-size:inherit;color:#7099bb;font-weight:bold;margin:0 3px;padding:5px 0;cursor:default;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_txt_label2{color:#b2b8bc;}.dhxform_obj_dhx_skyblue div.dhxform_btn{font-family:Tahoma;font-size:inherit;color:black;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);margin:5px 2px;border-radius:2px;float:left;cursor:default;clear:both;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_btn{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_btn.dhxform_btn_over{background-color:#f1f7ff;background:linear-gradient(#f1f7ff,#e2efff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f1f7ff,endColorStr=#e2efff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhxform_obj_dhx_skyblue div.dhxform_btn.dhxform_btn_pressed{background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 5px rgba(127,127,127,0.15) inset;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_btn{border-color:#ccc;background-color:#f9f9f9;background:linear-gradient(#f9f9f9,#f1f1f1);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f9f9f9,endColorStr=#f1f1f1) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 5px rgba(127,127,127,0.15) inset;}.dhxform_obj_dhx_skyblue div.dhxform_btn div.dhxform_btn_txt{float:left;margin:0 20px;height:24px;line-height:23px;text-align:center;vertical-align:middle;overflow:hidden;white-space:nowrap;*display:inline;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_btn div.dhxform_btn_txt{color:#999!important;}.dhxform_obj_dhx_skyblue div.dhxform_btn:focus{outline:1px dotted #909090;}.dhxform_obj_dhx_skyblue div.dhxform_control div.dhxform_note{font-family:Tahoma;font-size:.8em;color:#808080;padding-bottom:3px;white-space:normal;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_control div.dhxform_note{color:#b2b2b2;}.dhxform_obj_dhx_skyblue div.dhxform_label span.dhxform_info{font-family:Tahoma;font-size:.6em;color:#808080;margin-left:3px;padding-bottom:2px;line-height:100%;vertical-align:middle;cursor:pointer;}.dhxform_obj_dhx_skyblue .validate_error .dhxform_label,.dhxform_obj_dhx_skyblue .validate_error .dhxform_textarea,.dhxform_obj_dhx_skyblue .validate_error .dhxform_select,.dhxform_obj_dhx_skyblue .validate_error div.dhxform_label_nav_link,.dhxform_obj_dhx_skyblue .validate_error div.dhxform_label div.dhxform_label_nav_link:focus{color:red;}.dhxform_obj_dhx_skyblue div.disabled .dhx_combo_box.dhx_skyblue{border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue div.disabled .dhx_combo_box.dhx_skyblue .dhx_combo_input{color:#b2b2b2;background-color:#fff;}.dhxform_obj_dhx_skyblue div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;}.dhxform_obj_dhx_skyblue div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_cont_editor{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;}.dhxform_obj_dhx_skyblue div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhxcont_content_blocker{display:none;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhxcont_content_blocker{display:inline;position:absolute;width:100%;height:100%;top:0;left:0;background-color:#fefefe;opacity:.7;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);}.dhxform_obj_dhx_skyblue .dhx_file_uploader{position:relative;width:100%;margin-bottom:4px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls{position:relative;width:100%;height:35px;font-size:2px;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button{position:absolute;width:19px;height:19px;top:8px;background-image:url("imgs/dhxform_skyblue/dhxform_upload_buttons.gif");background-repeat:no-repeat;font-size:2px;cursor:pointer;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_info{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_browse{background-position:0 0;right:108px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_upload{background-position:-19px 0;right:79px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_cancel{background-position:-57px 0;right:79px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_clear{background-position:-38px 0;right:50px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls .dhx_uploader_input{position:absolute;left:-1000px;top:0;visibility:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont{position:absolute;width:19px;height:19px;left:0;top:0;cursor:pointer;overflow:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form{position:absolute;top:0;right:0;cursor:pointer;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form .dhx_file_input{opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);cursor:pointer;outline:none;height:19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files{position:relative;width:100%;left:0;top:0;overflow:auto;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file{position:relative;width:100%;height:25px;overflow:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_added,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_uploading{color:black;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_uploaded{color:#30678a;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_fail{color:#e94a4a;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param{position:absolute;font-family:inherit;font-size:inherit;color:inherit;top:0;height:25px;line-height:25px;vertical-align:middle;overflow:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_name{left:20px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_progress{right:50px;width:38px;text-align:right;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_delete{right:30px;width:11px;background-image:url("imgs/dhxform_skyblue/dhxform_upload_buttons.gif");background-position:-76px 0;background-repeat:no-repeat;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_uploading{right:50px;width:38px;text-align:right;background-image:url("imgs/dhxform_skyblue/dhxform_upload_uploading.gif");background-position:center center;background-repeat:no-repeat;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls{height:60px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_files{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_info{display:inline;background-image:none;font-family:Tahoma;font-size:13px;color:#a1a1a1;height:auto;top:0;left:35px;vertical-align:top;padding-top:6px;line-height:20px;cursor:default;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_browse{top:0;width:54px;height:54px;right:35px;background-image:url("imgs/dhxform_skyblue/dhxform_upload_buttons.gif");background-position:0 -38px;background-repeat:no-repeat;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_upload,.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_cancel,.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_clear{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_form_cont{width:54px;height:54px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form .dhx_file_input{height:54px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_info,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_added,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_uploading,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_uploaded,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_fail{color:#b2b2b2;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_browse{background-position:-54px -38px;cursor:default;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_form_cont{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button{cursor:default;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_browse{background-position:0 -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_upload{background-position:-19px -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_cancel{background-position:-57px -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_clear{background-position:-38px -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file_param.dhx_file_delete{background-position:-87px 0;cursor:default;}.dhtmlx_skin_dhx_skyblue div.dhtmlx_wins_body_inner .dhxform_obj_dhx_skyblue{background-color:white;}.dhxform_obj_dhx_skyblue div.dhxform_control .dhx_combo_box.dhx_skyblue .dhx_combo_input,.dhx_combo_list.dhx_skyblue_list div{font-size:1em!important;}div.dhx_form_skin_detect{position:absolute;display:block;visibility:hidden;left:-100px;top:0;width:10px;height:10px;margin:0;padding:0;border:none;overflow:hidden;}.dhxacc_fullscreen{width:100%;height:100%;margin:0;overflow:hidden;}.dhxacc_base_dhx_skyblue{position:relative;cursor:default;overflow:hidden;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc{position:relative;background-color:#fff;margin:0;padding:0;overflow:hidden;cursor:default;box-shadow:0 0 3px #e0e0e0;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_cont_acc{position:absolute;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;border-top:0 solid white;overflow:hidden;z-index:0;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_cont_acc.dhx_cell_cont_no_borders{border-width:0;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_hdr{position:relative;height:27px;line-height:26px;overflow:hidden;font-family:Tahoma;font-size:11px;color:#34404b;font-weight:bold;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);cursor:default;z-index:3;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_hdr div.dhx_cell_hdr_text{position:relative;margin:0 26px 0 5px;overflow:hidden;white-space:nowrap;cursor:default;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_hdr img.dhx_cell_hdr_icon{position:absolute;top:5px;left:4px;width:16px;height:16px;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_icon{margin-left:24px;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_hdr div.dhx_cell_hdr_arrow{position:absolute;top:6px;right:4px;width:16px;height:16px;background-image:url("imgs/dhxacc_skyblue/dhxacc_btns.gif");background-repeat:no-repeat;background-position:0 0;overflow:hidden;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc.dhx_cell_closed div.dhx_cell_hdr div.dhx_cell_hdr_arrow{background-position:-16px 0;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_cont.dhx_cell_cont_not_last{border-bottom:0 solid white;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_menu_def{position:relative;overflow:hidden;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_menu_no_borders{position:relative;overflow:hidden;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_menu_def div.dhtmlxMenu_dhx_skyblue_Middle,.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_menu_no_borders div.dhtmlxMenu_dhx_skyblue_Middle{padding:0 2px;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_toolbar_def div.dhx_toolbar_dhx_skyblue{border-top-width:0;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_ribbon_def div.dhxrb_with_tabbar.dhxtabbar_base_dhx_skyblue{margin-top:-1px;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_ribbon_def div.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar{border-top:0 solid white;width:auto;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_statusbar_def{position:absolute;bottom:0;width:100%;font-family:Tahoma;font-size:11px;color:black;background-color:#ddecff;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_statusbar_def div.dhx_cell_statusbar_text{position:relative;padding:0 4px;height:21px;line-height:21px;border-bottom:1px solid #a4bed4;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;white-space:nowrap;overflow:hidden;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc.acc_cell_dragged{box-shadow:0 0 5px #829cb2;z-index:5!important;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_progress_bar{position:absolute;left:0;top:0;width:100%;height:100%;background-color:white;opacity:.75;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=75);z-index:1;}.dhxacc_base_dhx_skyblue div.dhx_cell_acc div.dhx_cell_progress_img{position:absolute;left:0;top:0;border:1px solid #a4bed4;background-position:center 55%;background-image:url("imgs/dhxacc_skyblue/dhxacc_cell_progress.gif");background-repeat:no-repeat;cursor:progress;z-index:2;}.dhxacc_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhxlayout_base_dhx_skyblue{position:relative;cursor:default;}.dhxlayout_base_dhx_skyblue div.dhxlayout_sep{position:absolute;background-color:#ebebeb;font-size:1px;margin:0;padding:0;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;background-repeat:no-repeat;background-position:center center;z-index:2;}.dhxlayout_base_dhx_skyblue div.dhxlayout_sep.dhxlayout_sep_resize_v{cursor:w-resize;background-image:url('imgs/dhxlayout_skyblue/dhxlayout_sep_v.gif');}.dhxlayout_base_dhx_skyblue div.dhxlayout_sep.dhxlayout_sep_resize_h{cursor:n-resize;background-image:url('imgs/dhxlayout_skyblue/dhxlayout_sep_h.gif');}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout{position:absolute;background-color:#fff;margin:0;padding:0;overflow:hidden;cursor:default;z-index:0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_cont_layout{position:absolute;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;border-top:0 solid #fff;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_cont_layout.dhx_cell_cont_no_borders{border:0 solid #fff!important;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_cont_layout,.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_h div.dhx_cell_cont_layout{display:none;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr{position:relative;height:27px;line-height:26px;overflow:hidden;font-family:Tahoma;font-size:11px;color:#34404b;font-weight:bold;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);cursor:default;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr.dhx_cell_hdr_hidden{height:0;line-height:0;border-bottom-width:0;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr.dhx_cell_hdr_hidden_no_borders{height:0;line-height:0;border-width:0;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr div.dhx_cell_hdr_text{position:relative;margin:0 26px 0 5px;overflow:hidden;white-space:nowrap;cursor:default;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_h div.dhx_cell_hdr{height:18px;line-height:17px;color:#333;font-weight:normal;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr{width:18px;background:-moz-linear-gradient(left,#e2efff,#d3e7ff);background:-webkit-linear-gradient(left,#e2efff,#d3e7ff);background:-o-linear-gradient(left,#e2efff,#d3e7ff);background:-ms-linear-gradient(left,#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#e2efff,endColorStr=#d3e7ff);}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text{position:absolute;left:3px;bottom:0;transform:rotate(270deg);-ms-transform:rotate(270deg);transform-origin:left center;color:#333;font-weight:normal;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_ie8{left:-5px;line-height:17px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_ie8 span{float:left;filter:progid:DXImageTransform.Microsoft.Matrix(M11='6.123031769111886e-17', M12='1', M21='-1', M22='6.123031769111886e-17', sizingMethod='auto expand');margin-bottom:95%;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_ie7{left:-5px;line-height:17px;padding-bottom:10px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_ie7 span{float:left;filter:progid:DXImageTransform.Microsoft.Matrix(M11='6.123031769111886e-17', M12='1', M21='-1', M22='6.123031769111886e-17', sizingMethod='auto expand');}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_ie6{left:-5px;line-height:17px;padding-bottom:10px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_ie6 span{float:left;filter:progid:DXImageTransform.Microsoft.Matrix(M11='6.123031769111886e-17', M12='1', M21='-1', M22='6.123031769111886e-17', sizingMethod='auto expand');}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhx_cell_hdr_text.dhx_cell_hdr_text_chrome{left:5px;-webkit-transform:rotate(270deg);-webkit-transform-origin:left center;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr div.dhxlayout_arrow{position:absolute;right:4px;top:6px;width:16px;height:16px;background-image:url('imgs/dhxlayout_skyblue/dhxlayout_cell_btns.gif');background-repeat:no-repeat;cursor:pointer;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_va{background-position:-16px 0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_vb{background-position:-48px 0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_ha{background-position:-32px 0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_hb{background-position:0 0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_h div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_ha{background-position:0 -5px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_h div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_hb{background-position:-32px -4px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_va{background-position:-45px 0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_hdr div.dhxlayout_arrow.dhxlayout_arrow_vb{background-position:-13px 0;}.dhxlayout_base_dhx_skyblue div.dhxlayout_resize_area{position:absolute;background-color:#a4bed4;opacity:.15;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=15);z-index:1;border:2px dashed black;cursor:inherit;}.dhxlayout_base_dhx_skyblue div.dhxlayout_resize_sep{position:absolute;background-color:#a4bed4;overflow:hidden;display:block;opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);z-index:2;cursor:inherit;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_h div.dhx_cell_statusbar_def,.dhxlayout_base_dhx_skyblue div.dhx_cell_layout.dhxlayout_collapsed_v div.dhx_cell_statusbar_def{display:none;}.dhxlayout_base_dhx_skyblue div.dhxlayout_hdr_attached{position:relative;}.dhxlayout_base_dhx_skyblue div.dhxlayout_ftr_attached{position:absolute;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_menu_def{position:relative;overflow:hidden;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_menu_no_borders{position:relative;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_menu_def div.dhtmlxMenu_dhx_skyblue_Middle,.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_menu_no_borders div.dhtmlxMenu_dhx_skyblue_Middle{padding:0 2px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_toolbar_def{position:relative;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_toolbar_def div.dhx_toolbar_dhx_skyblue{border-top-width:0;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_ribbon_def div.dhxrb_with_tabbar.dhxtabbar_base_dhx_skyblue{margin-top:-1px;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_ribbon_def div.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar{border-top-width:0;width:auto;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_statusbar_def{position:absolute;bottom:0;width:100%;font-family:Tahoma;font-size:11px;color:black;background-color:#ddecff;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_statusbar_def div.dhx_cell_statusbar_text{position:relative;padding:0 4px;height:21px;line-height:21px;border-bottom:1px solid #a4bed4;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;white-space:nowrap;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhxlayout_progress{position:absolute;left:0;top:0;width:100%;height:100%;background-color:white;opacity:.55;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=55);z-index:3;}.dhxlayout_base_dhx_skyblue div.dhxlayout_progress_img{position:absolute;left:0;top:0;width:100%;height:100%;background-image:url('imgs/dhxlayout_skyblue/dhxlayout_cell_progress.gif');background-position:center center;background-repeat:no-repeat;z-index:4;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_progress_bar{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#fff;opacity:.75;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=75);z-index:1;}.dhxlayout_base_dhx_skyblue div.dhx_cell_layout div.dhx_cell_progress_img{position:absolute;left:0;top:0;border:1px solid #a4bed4;background-image:url('imgs/dhxlayout_skyblue/dhxlayout_cell_progress.gif');background-position:center center;background-repeat:no-repeat;z-index:2;}.dhxlayout_base_dhx_skyblue div.dhxlayout_menu{position:relative;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhxlayout_toolbar{position:relative;background-color:#ebebeb;padding-bottom:4px;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhxlayout_ribbon{border-bottom:2px solid #ebebeb;position:relative;}.dhxlayout_base_dhx_skyblue div.dhxlayout_ribbon div.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar{width:auto;}.dhxlayout_base_dhx_skyblue div.dhxlayout_statusbar{position:absolute;background-color:#ebebeb;overflow:hidden;}.dhxlayout_base_dhx_skyblue div.dhxlayout_statusbar div.dhxcont_statusbar{position:relative;margin-top:2px;border:1px solid #a4bed4;background-color:#ddecff;font-family:Tahoma;font-size:11px;color:black;padding:3px 4px;}body.dhxlayout_resize_v *{-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:w-resize!important;}body.dhxlayout_resize_h *{-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:n-resize!important;}div.dhxlayout_sep_sw_dhx_skyblue{position:absolute;left:0;top:-100px;width:5px;height:1px;font-size:1px;margin:0;padding:0;overflow:hidden;}.dhxlayout_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhxtabbar_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhxtabbar_fullscreen{width:100%;height:100%;margin:0;overflow:hidden;}.dhxtabbar_base_dhx_skyblue{position:relative;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs{position:absolute;bottom:auto;height:28px;overflow:hidden;white-space:nowrap;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);z-index:2;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs{top:auto;bottom:0;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_base{position:absolute;top:0;height:28px;overflow:hidden;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_base div.dhxtabbar_tabs_cont_left,.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_base div.dhxtabbar_tabs_cont_right{position:absolute;width:5000px;height:28px;margin:0 1px;top:0;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_base div.dhxtabbar_tabs_line{position:absolute;left:0;bottom:0;top:none;width:100%;height:4px;overflow:hidden;z-index:2;border-top:1px solid #a4bed4;border-bottom:0 solid white;background-color:#d3e7ff;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_ar_left{position:absolute;left:0;top:0;width:15px;height:100%;background-color:#fffeff;background:linear-gradient(#fffeff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#fffeff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:pointer;z-index:4;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_ar_left div.dhxtabbar_arrow_img{position:relative;height:100%;border-right:1px solid #a4bed4;background-image:url("imgs/dhxtabbar_skyblue/dhxtabbar_arrows.gif");background-position:0 11px;background-repeat:no-repeat;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_ar_right{position:absolute;right:0;top:0;width:15px;height:100%;background-color:#fffeff;background:linear-gradient(#fffeff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#fffeff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:pointer;z-index:4;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_ar_right div.dhxtabbar_arrow_img{position:relative;height:100%;border-left:1px solid #a4bed4;background-image:url("imgs/dhxtabbar_skyblue/dhxtabbar_arrows.gif");background-position:-14px 11px;background-repeat:no-repeat;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar{position:absolute;background-color:white;margin:0;padding:0;overflow:hidden;cursor:default;z-index:0;background-image:none!important;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_cont_tabbar{position:absolute;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;border-top:0 solid white;overflow:hidden;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_cont_tabbar.dhx_cell_cont_no_borders{border:0 solid white!important;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab{position:relative;height:24px;background-color:white;font-family:Tahoma;font-size:11px;color:#34404b;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;z-index:1;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_cont_left div.dhxtabbar_tab{float:left;margin-left:-1px;margin-right:0;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tabs_cont_right div.dhxtabbar_tab{float:right;margin-left:0;margin-right:-1px;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_dis{background-color:#ecf5ff;background:linear-gradient(#ecf5ff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ecf5ff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv,.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv_dis{z-index:3;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_hidden{border:none;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab div.dhxtabbar_tab_text{position:relative;height:23px;line-height:22px;vertical-align:middle;top:0;border-top:1px solid #fff;color:#34404b;text-align:center;overflow:hidden;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab div.dhxtabbar_tab_text.dhxtabbar_tab_text_close{padding-right:9px;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv div.dhxtabbar_tab_text,.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv_dis div.dhxtabbar_tab_text{border-left:1px solid #fff;border-right:1px solid #fff;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv div.dhxtabbar_tab_text{color:#34404b;font-weight:bold;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv_dis div.dhxtabbar_tab_text{font-weight:bold;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_dis div.dhxtabbar_tab_text,.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv_dis div.dhxtabbar_tab_text{color:#999;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab div.dhxtabbar_tab_close{position:absolute;top:6px;right:5px;width:11px;height:11px;border:1px solid #b4d3ff;border-radius:2px;background-image:url("imgs/dhxtabbar_skyblue/dhxtabbar_button_close.gif");background-position:0 0;background-repeat:no-repeat;line-height:1px;overflow:hidden;z-index:1;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv div.dhxtabbar_tab_close{border:1px solid #a4bed4;background-position:-11px 0;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_dis div.dhxtabbar_tab_close,.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv_dis div.dhxtabbar_tab_close{border:1px solid #a4bed4;background-position:-22px 0;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhx_cell_tabbar div.dhx_cell_cont_tabbar{border-top:1px solid #a4bed4;border-bottom:0 solid white;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhx_cell_tabbar div.dhx_toolbar_dhx_skyblue{border-bottom-width:0;border-top-width:1px;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs div.dhxtabbar_tab{margin-top:4px;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv,.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs div.dhxtabbar_tab.dhxtabbar_tab_actv_dis{z-index:3;font-weight:bold;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs div.dhxtabbar_tab div.dhxtabbar_tab_text{top:0;border-top:0 solid white;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs div.dhxtabbar_tab div.dhxtabbar_tab_close{top:auto;bottom:5px;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhxtabbar_tabs div.dhxtabbar_tabs_base div.dhxtabbar_tabs_line{top:0;bottom:none;border-bottom:1px solid #a4bed4;border-top:0 solid white;background-color:#e2efff;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_menu_def{position:relative;overflow:hidden;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;border-top:0 solid white;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_menu_def div.dhtmlxMenu_dhx_skyblue_Middle{padding:0 2px;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_menu_no_borders{position:relative;overflow:hidden;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_menu_no_borders div.dhtmlxMenu_dhx_skyblue_Middle{padding:0 2px;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhx_cell_tabbar div.dhx_cell_menu_def{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;border-bottom:0 solid white;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_toolbar_dhx_skyblue{border-bottom-width:1px;border-top-width:0;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar{border-top:0 solid white;width:auto;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhxrb_with_tabbar.dhxtabbar_base_dhx_skyblue{margin-top:-1px;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_statusbar_def{position:absolute;bottom:0;width:100%;font-family:Tahoma;font-size:11px;color:black;background-color:#ddecff;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_statusbar_def div.dhx_cell_statusbar_text{position:relative;padding:0 4px;height:21px;line-height:21px;border-top:0 solid white;border-bottom:1px solid #a4bed4;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;white-space:nowrap;overflow:hidden;}.dhxtabbar_base_dhx_skyblue div.dhxtabbar_tabs_bottom div.dhx_cell_tabbar div.dhx_cell_statusbar_def div.dhx_cell_statusbar_text{border-top:1px solid #a4bed4;border-bottom:0 solid white;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_progress_bar{position:absolute;left:0;top:0;width:100%;height:100%;background-color:white;opacity:.75;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=75);z-index:1;}.dhxtabbar_base_dhx_skyblue div.dhx_cell_tabbar div.dhx_cell_progress_img{position:absolute;left:0;top:0;width:100%;height:100%;background-image:url("imgs/dhxtabbar_skyblue/dhxtabbar_cell_progress.gif");background-position:center center;background-repeat:no-repeat;z-index:2;}span.dhxtabbar_tabs_text_test_dhx_skyblue{position:absolute;visibility:hidden;right:0;top:0;font-weight:bold;font-family:Tahoma;font-size:11px;color:black;}.dhxwins_vp_dhx_skyblue{overflow:hidden;position:relative;cursor:default;}.dhxwins_vp_dhx_skyblue div.dhxwin_active{position:absolute;overflow:hidden;border:1px solid #a4bed4;box-shadow:0 0 3px #cecece;border-radius:3px;background:white;cursor:inherit;}.dhxwins_vp_dhx_skyblue div.dhxwin_inactive{position:absolute;overflow:hidden;border:1px solid #c1d1de;box-shadow:0 0 3px #dedede;border-radius:3px;background:white;cursor:inherit;}.dhxwins_vp_dhx_skyblue div.dhxwin_brd{position:absolute;border-left:5px solid #d3e6fe;border-right:5px solid #d3e6fe;border-bottom:5px solid #d3e6fe;border-bottom-left-radius:2px;border-bottom-right-radius:2px;background:white;z-index:0;}.dhxwins_vp_dhx_skyblue div.dhxwin_brd.dhxwin_hdr_hidden{border-top:5px solid #d3e6fe;border-top-left-radius:2px;border-top-right-radius:2px;}.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhxwin_brd{opacity:.8;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);}.dhxwins_vp_dhx_skyblue div.dhxwin_fr_cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;background-color:white;z-index:1;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);}.dhxwins_vp_dhx_skyblue div.dhxwin_fr_cover .dhxwin_fr_cover_inner{position:absolute;left:0;top:0;width:100%;height:100%;background-color:white;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhxwin_fr_cover{display:none;}.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhxwin_fr_cover{z-index:4;opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhxwin_fr_cover.dhxwin_fr_cover_dnd,.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhxwin_fr_cover.dhxwin_fr_cover_resize{display:block;}.dhxwins_vp_dhx_skyblue iframe.dhxwin_main_fr_cover{position:absolute;background-color:white;border-radius:2px;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr{position:relative;height:30px;line-height:30px;margin:0;padding:0;font-weight:bold;border-top:1px solid white;border-left:1px solid white;border-right:1px solid white;border-top-left-radius:2px;border-top-right-radius:2px;background-color:#e5f0fd;background:linear-gradient(#e5f0fd,#d3e6fe);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e5f0fd,endColorStr=#d3e6fe) progid:DXImageTransform.Microsoft.Alpha(opacity=100);font-family:Tahoma;font-size:11px;color:#34404b;cursor:inherit;overflow:hidden;z-index:3;}.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhxwin_hdr{color:#777;opacity:.8;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e5f0fd,endColorStr=#d3e6fe);}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr.dhxwin_hdr_parked{border-bottom:1px solid white;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr.dhxwin_hdr_hidden{visibility:hidden;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_icon{position:absolute;left:7px;top:7px;width:18px;height:18px;cursor:default;overflow:hidden;background-image:url("imgs/dhxwins_skyblue/dhxwins_icon.gif");background-position:center center;background-repeat:no-repeat;cursor:inherit;z-index:2;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhxwin_hdr div.dhxwin_icon{opacity:.6;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=60);}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_text{position:relative;padding:0;margin:0;overflow:hidden;white-space:nowrap;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:inherit;z-index:1;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_text div.dhxwin_text_inside{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:100%;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns{position:absolute;right:7px;top:6px;height:18px;cursor:default;overflow:hidden;cursor:inherit;z-index:2;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhxwin_hdr div.dhxwin_btns{opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button,.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis{position:relative;float:left;width:15px;height:15px;margin-left:1px;margin-top:2px;border-radius:2px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;background-image:url("imgs/dhxwins_skyblue/dhxwins_buttons.gif");background-repeat:no-repeat;background-position:0 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button:hover{background-color:white;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_close{background-position:-15px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_close_dis{background-position:-15px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_minmax{background-position:-30px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_minmax_dis{background-position:-30px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_minmaxed{background-position:-45px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_minmaxed_dis{background-position:-45px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_park{background-position:-60px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_park_dis{background-position:-60px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_stick{background-position:-75px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_stick_dis{background-position:-75px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_sticked{background-position:-90px 0;background-color:#a4bed4!important;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_sticked_dis{background-position:-90px -15px;background-color:#f0f0f0!important;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_help{background-position:-105px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_help_dis{background-position:-105px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button.dhxwin_button_dock{background-position:-120px 0;}.dhxwins_vp_dhx_skyblue div.dhxwin_hdr div.dhxwin_btns div.dhxwin_button_dis.dhxwin_button_dock_dis{background-position:-120px -15px;}.dhxwins_vp_dhx_skyblue div.dhxwin_active.dhxwin_dnd{box-shadow:0 0 3px #cececf;}.dhxwins_vp_dhx_skyblue.dhxwins_vp_dnd{cursor:move!important;}.dhxwins_vp_dhx_skyblue div.dhxwin_resize{position:absolute;background-color:#d3e6fe;border-radius:3px;opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);}.dhxwins_vp_dhx_skyblue iframe.dhxwin_resize_fr_cover{position:absolute;background-color:white;border-radius:3px;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);}.dhxwins_vp_dhx_skyblue div.dhxwins_mcover{position:absolute;background-color:#e5f0fd;left:0;top:0;width:100%;height:100%;opacity:.53;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=53);}.dhxwins_vp_dhx_skyblue iframe.dhxwins_mcover{position:absolute;background-color:white;left:0;top:0;width:100%;height:100%;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins{position:absolute;background-color:#fff;margin:0;padding:0;overflow:hidden;cursor:default;visibility:visible;z-index:1;opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_cont_wins,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_cont_wins{position:absolute;border:1px solid #fff;background-color:#fff;overflow:hidden;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_cont_wins.dhx_cell_cont_no_borders,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_cont_wins.dhx_cell_cont_no_borders{border:0 solid #fff!important;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_menu_def,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_menu_def{position:relative;overflow:hidden;border-bottom:1px solid #d3e6fe;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_menu_def div.dhtmlxMenu_dhx_skyblue_Middle,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_menu_def div.dhtmlxMenu_dhx_skyblue_Middle{padding:0 2px;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_toolbar_def,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_toolbar_def{position:relative;overflow:hidden;padding:1px 1px 0 1px;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_toolbar_def div.dhx_toolbar_dhx_skyblue,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_toolbar_def div.dhx_toolbar_dhx_skyblue{position:relative;border-top-width:1px;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_toolbar_no_borders div.dhx_toolbar_dhx_skyblue,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_toolbar_no_borders div.dhx_toolbar_dhx_skyblue{position:relative;border-top-width:1px;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_ribbon_def,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_ribbon_def{padding:1px 1px 0 1px;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhtmlxribbon_dhx_skyblue.dhxrb_without_tabbar{width:auto;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_statusbar_def,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_statusbar_def{position:absolute;bottom:0;width:100%;font-family:Tahoma;font-size:11px;color:black;background-color:#d3e6fe;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_statusbar_def div.dhx_cell_statusbar_text,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_statusbar_def div.dhx_cell_statusbar_text{position:relative;padding:0 4px;height:21px;line-height:21px;white-space:nowrap;overflow:hidden;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_cont_wins.dhx_cell_statusbar_attached,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_cont_wins.dhx_cell_statusbar_attached{border-radius:0;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_progress_bar,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_progress_bar{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#fff;opacity:.75;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=75);z-index:1;}.dhxwins_vp_dhx_skyblue div.dhxwin_active div.dhx_cell_wins div.dhx_cell_progress_img,.dhxwins_vp_dhx_skyblue div.dhxwin_inactive div.dhx_cell_wins div.dhx_cell_progress_img{position:absolute;left:0;top:0;width:100%;height:100%;background-image:url("imgs/dhxwins_skyblue/dhxwins_progress.gif");background-position:center center;background-repeat:no-repeat;z-index:2;}.dhxwins_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}div.dhxwins_vp_dhx_skyblue.dhxwins_vp_fs{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;}.dhtmlx_message_area{position:fixed;right:5px;width:250px;z-index:1000;padding:0;}.dhtmlx-info{color:#444;border-radius:4px;min-width:120px;padding:10px 10px 10px 20px;background-color:#FFC;font-size:12px;font-family:Tahoma;z-index:10000;margin:0 5px 5px 5px;border:1px solid #d3d3d3;box-shadow:0 0 5px #ccc;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;}.dhtmlx-info.hidden{height:0;padding-bottom:0;padding-top:0;border-width:0;margin-top:0;margin-bottom:0;overflow:hidden;}.dhtmlx-error{background-color:#f17373;color:#fff;}.dhtmlx_modal_box{overflow:hidden;display:inline-block;min-width:300px;width:300px!important;text-align:center;position:fixed;background-color:#fff;z-index:20000;-moz-box-shadow:0 0 5px #AAA;-webkit-box-shadow:0 0 0 #AAA;box-shadow:0 0 5px #AAA;border:1px solid #a4bed4;border-radius:6px;}.dhtmlx_popup_title{padding:5px 0;font-size:12px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;border-radius-top-right:6px;line-height:16px;font-family:Tahoma;font-weight:bold;}.dhtmlx-info,.dhtmlx_popup_title,.dhtmlx_popup_button{-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-moz-user-select:-moz-none;cursor:pointer;}.dhtmlx_popup_text{font-size:13px;font-family:Tahoma;color:#444;min-height:30px;padding:20px 10px 10px 10px!important;overflow:hidden;}.dhtmlx_popup_controls{font-family:Tahoma;font-weight:bold;padding:10px 10px 17px 10px!important;}.dhtmlx_popup_button{font-size:12px;font-family:Tahoma;font-weight:bold;min-width:120px;width:120px;height:20px;display:inline-block;margin:0 5px;border-radius:4px;}.dhtmlx_popup_button div{line-height:20px;}div.dhx_modal_cover{background-color:#000;cursor:default;opacity:.2;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=20);position:fixed;z-index:19999;left:0;top:0;width:100%;height:100%;border:none;zoom:1;}.dhtmlx_popup_button{color:#2e3947;text-shadow:0 1px 0 #fff;border:1px solid #a4bed4;background-color:#d5e6fc;background-image:-moz-linear-gradient(center bottom,#e1eeff 0,#cce2fe 12%,#ecf2f7 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0.00,#ecf2f7),color-stop(0.88,#cce2fe),color-stop(1.00,#e1eeff));background:-o-linear-gradient(top,#e1eeff,#cce2fe 12%,#ecf2f7);background:linear-gradient(top,#e1eeff,#cce2fe 12%,#ecf2f7);background:-ms-linear-gradient(top,#e1eeff 0,#cce2fe 12%,#ecf2f7 100%);}.dhtmlx_popup_button:active,.dhtmlx_popup_button:focus{box-shadow:inset 0 0 2px #aaa;background:#bdd9fc;background:-moz-linear-gradient(top,#C4DDFF 0,#bdd9fc 88%,#deeaf4 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#C4DDFF),color-stop(88%,#bdd9fc),color-stop(100%,#deeaf4));background:-o-linear-gradient(top,#C4DDFF 0,#bdd9fc 88%,#deeaf4 100%);background:-ms-linear-gradient(top,#C4DDFF 0,#bdd9fc 88%,#deeaf4 100%);background:linear-gradient(top,#C4DDFF 0,#bdd9fc 88%,#deeaf4 100%);}.dhtmlx_popup_title{box-shadow:inset 0 0 2px #fff;display:block;}.dhtmlx-alert-error .dhtmlx_popup_title,.dhtmlx-confirm-error .dhtmlx_popup_title{color:white;border:1px solid #f17373;background:#f17373;background:-webkit-linear-gradient(top,#ff7c7c,#f17373 88%,#ff7361);background:-moz-linear-gradient(top,#ff7c7c,#f17373 88%,#ff7361);background:-o-linear-gradient(top,#ff7c7c,#f17373 88%,#ff7361);background:linear-gradient(top,#ff7c7c,#f17373 88%,#ff7361);background:-ms-linear-gradient(top,#ff7c7c 0,#f17373 88%,#ffbc75 100%);}.dhtmlx-alert-error.dhtmlx_modal_box,.dhtmlx-confirm-error.dhtmlx_modal_box{border:1px solid #f17373;}.dhtmlx-alert-warning .dhtmlx_popup_title,.dhtmlx-confirm-warning .dhtmlx_popup_title{color:#000;border:1px solid #d2b07f;background:#ff9f37;background:-webkit-linear-gradient(top,#ffc786,#ff9523 88%,#ffbc75);background:-moz-linear-gradient(top,#ffc786,#ff9523 88%,#ffbc75);background:-o-linear-gradient(top,#ffc786,#ff9523 88%,#ffbc75);background:linear-gradient(top,#ffc786,#ff9523 88%,#ffbc75);background:-ms-linear-gradient(top,#ffc786 0,#ff9523 88%,#ffbc75 100%);}.dhtmlx-alert-warning .dhtmlx_popup_controls,.dhtmlx-confirm-warning .dhtmlx_popup_controls{border:1px solid #d5d5d5;border-width:0 1px 1px 1px;}.dhtmlx-alert-warning .dhtmlx_popup_text,.dhtmlx-confirm-warning .dhtmlx_popup_text{border:1px solid #d5d5d5;border-width:0 1px 0 1px;}.dhtmlx-alert .dhtmlx_popup_title,.dhtmlx-confirm .dhtmlx_popup_title{color:#000;border:1px solid #a4bed4;background:#d5e6fc;background:-moz-linear-gradient(center bottom,#e1eeff 0,#cce2fe 12%,#ecf2f7 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0.00,#ecf2f7),color-stop(0.88,#cce2fe),color-stop(1.00,#e1eeff));background:-o-linear-gradient(top,#e1eeff,#cce2fe 12%,#ecf2f7);background:linear-gradient(top,#e1eeff,#cce2fe 12%,#ecf2f7);background:-ms-linear-gradient(top,#e1eeff 0,#cce2fe 12%,#ecf2f7 100%);}.dhtmlx-alert .dhtmlx_popup_controls,.dhtmlx-confirm .dhtmlx_popup_controls{border:1px solid #d5d5d5;border-width:0 1px 1px 1px;}.dhtmlx-alert .dhtmlx_popup_text,.dhtmlx-confirm .dhtmlx_popup_text{border:1px solid #d5d5d5;border-width:0 1px 0 1px;}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/dhtmlxform.css b/portal/static/unbound_reservation_static/css/dhtmlxform.css
new file mode 100644 (file)
index 0000000..c33eb09
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Product Name: dhtmlxForm 
+Version: 4.0.3 
+Edition: Standard 
+License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
+Copyright UAB Dinamenta http://www.dhtmlx.com
+*/
+
+.dhtmlxcalendar_ifr{position:absolute;overflow:hidden;background-color:white;}.dhtmlxcalendar_dhx_skyblue{position:absolute;display:block;background-color:white;font-family:Tahoma;font-size:11px;color:black;}.dhtmlxcalendar_dhx_skyblue ul.dhtmlxcalendar_line{position:relative;display:block;clear:both;margin:0;padding:0;overflow:hidden;width:211px;}.dhtmlxcalendar_dhx_skyblue ul.dhtmlxcalendar_line li{float:left;position:relative;list-style-type:none;list-style-image:none;text-align:center;vertical-align:middle;cursor:default;overflow:hidden;margin:0;padding:0;}.dhtmlxcalendar_dhx_skyblue.dhtmlxcalendar_in_input{box-shadow:0 0 6px rgba(0,0,0,0.25);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont{position:relative;display:block;width:211px;height:25px;margin:0;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border:1px solid #a4bed4;overflow:hidden;color:black;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;-ms-user-select:text;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr{width:211px;height:25px;line-height:25px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow{position:absolute;top:0;width:18px;height:25px;text-align:center;color:inherit;background-position:center center;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_left{left:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");opacity:.8;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_left_hover{left:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_right{right:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");opacity:.8;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr div.dhtmlxcalendar_month_arrow.dhtmlxcalendar_month_arrow_right_hover{right:4px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr span.dhtmlxcalendar_month_label_month,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_month_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_month_hdr span.dhtmlxcalendar_month_label_year{position:relative;font-weight:bold;color:#34404b;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont{position:relative;display:block;width:211px;margin:0;padding-bottom:1px;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #cbd9e4;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-o-user-select:text;user-select:text;-ms-user-select:text;overflow:hidden;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line{border-top:1px solid white;padding-left:1px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li{width:29px;height:19px;line-height:19px;margin-right:1px;font-size:9px;background-color:#ecf4ff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_day_weekday_cell,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_day_weekday_cell_first{color:#c66200;background-color:#ffe6ae;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont{position:relative;display:block;width:211px;margin:0;padding-bottom:1px;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line{border-top:1px solid white;padding-left:1px;height:26px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li{color:#909090;background-color:white;border:1px solid white;width:27px;height:24px;line-height:23px;margin-right:1px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li div.dhtmlxcalendar_label{width:100%;height:100%;text-align:center;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend{border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_dis{color:#b2b2b2;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_holiday,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_holiday{color:red;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_holiday,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_holiday{color:red;border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_holiday_dis{color:red;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_hover{border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_holiday_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_weekend_holiday_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_holiday_hover,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_date_weekend_holiday_hover{color:red;border-color:#ccc;background-color:#f7f7f7;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month{color:black;background-color:#ecf4ff;border-color:#ecf4ff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend{color:#c66200;background-color:#fff0d2;border-color:#fff0d2;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date{color:black;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend{color:#c66200;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_dis{color:#b2b2b2;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_holiday{color:red;background-color:#ecf4ff;border-color:#ecf4ff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_holiday{color:red;background-color:#fff0d2;border-color:#fff0d2;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_holiday{color:red;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_holiday{color:red;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_holiday_dis,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_holiday_dis{color:red;background-color:#f0f0f0;border-color:#f0f0f0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_hover{color:black;background-color:#d9eeff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_hover{color:#c66200;background-color:#ffe9bb;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_hover{color:black;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_hover{color:#c66200;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_holiday_hover{color:red;background-color:#d9eeff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_weekend_holiday_hover{color:red;background-color:#ffe9bb;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_holiday_hover{color:red;background-color:#b5deff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell.dhtmlxcalendar_cell_month_date_weekend_holiday_hover{color:red;background-color:#ffdc90;border-color:#ffce65;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line div.dhtmlxcalendar_label.dhtmlxcalendar_label_title{background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif");background-position:top right;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_time_cont{position:relative;display:block;width:211px;height:25px;margin:0;border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_time_cont ul.dhtmlxcalendar_line li{width:211px;height:25px;line-height:24px;color:#34404b;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_time_cont ul.dhtmlxcalendar_line li div.dhtmlxcalendar_time_img{position:absolute;left:66px;top:6px;width:13px;height:13px;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif");background-position:center center;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_cover{position:absolute;left:1px;background-color:white;opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj{position:absolute;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_selector_obj_arrow{position:absolute;bottom:auto;top:0;left:0;width:100%;height:9px;overflow:hidden;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif");background-position:top center;background-repeat:no-repeat;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table{border:1px solid #a4bed4;background-color:white;border-top:none;margin-top:9px;box-shadow:0 0 3px rgba(0,0,0,0.35);}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left{width:17px;text-align:center;border-top:1px solid white;padding:0;margin:0;background-color:#ecf4ff;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");background-position:center center;background-repeat:no-repeat;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left.dhtmlxcalendar_selector_cell_left_hover{background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif");}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle{border-top:white 1px solid;border-width:1px 0 0 0;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right{width:17px;text-align:center;border-top:1px solid white;border-width:1px 0 0 0;background-color:#ecf4ff;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");background-position:center center;background-repeat:no-repeat;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right.dhtmlxcalendar_selector_cell_right_hover{background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif");}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul{display:block;clear:both;margin:0 0 0 1px;padding:0;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul li{float:left;font-family:Tahoma;font-size:10px;color:black;list-style-type:none;list-style-image:none;text-align:center;vertical-align:middle;margin:0 1px 0 0;padding:0;background-color:#e9f3ff;border:1px solid #e9f3ff;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;cursor:default;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul li.dhtmlxcalendar_selector_cell_active{background-color:#b5deff;border-color:#a1ceed;color:black;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul li.dhtmlxcalendar_selector_cell_hover{background-color:#d9eeff;border-color:#a1ceed;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_month table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_month table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right{display:none;width:0;border:0 solid white;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line{height:22px;border-top:none;border-bottom:1px solid white;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line li.dhtmlxcalendar_selector_cell{width:33px;height:20px;line-height:19px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours div.dhtmlxcalendar_selector_obj_arrow,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_selector_obj_arrow{top:auto;bottom:0;background-image:url("imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif");}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line{height:19px;border-top:none;border-bottom:1px solid white;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line li.dhtmlxcalendar_selector_cell,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_middle ul.dhtmlxcalendar_selector_line li.dhtmlxcalendar_selector_cell{width:21px;height:17px;line-height:16px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_left,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table td.dhtmlxcalendar_selector_cell_right{display:none;width:0;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours table.dhtmlxcalendar_selector_table,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes table.dhtmlxcalendar_selector_table{margin-top:0;margin-bottom:9px;border-top:1px solid #a4bed4;border-bottom:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_month,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_year,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_hours,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_minutes,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_minutes4,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj div.dhtmlxcalendar_area_selector_minutes5{display:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_month div.dhtmlxcalendar_area_selector_month,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_year div.dhtmlxcalendar_area_selector_year,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_hours div.dhtmlxcalendar_area_selector_hours,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_area_selector_minutes,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_area_selector_minutes4,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_selector_obj.dhtmlxcalendar_selector_minutes div.dhtmlxcalendar_area_selector_minutes5{display:block;}.dhtmlxcalendar_dhx_skyblue span.dhtmlxcalendar_label_minutes span.dhtmlxcalendar_selected_date{border-bottom:2px solid red;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn{display:none;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell{width:26px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell{width:24px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_first,.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell{width:26px;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_days_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn{display:block;width:21px;color:#638eb1;background-color:#d9eaff;}.dhtmlxcalendar_dhx_skyblue div.dhtmlxcalendar_wn div.dhtmlxcalendar_dates_cont ul.dhtmlxcalendar_line li.dhtmlxcalendar_cell_wn{display:block;width:19px;color:#638eb1;background-color:#d9eaff;border-color:#d9eaff;font-size:10px;}div.dhtmlxcalendar_skin_detect{position:absolute;display:block;visibility:hidden;left:-100px;top:0;width:10px;height:10px;margin:0;padding:0;border:none;overflow:hidden;}div.dhxcombo_dhx_skyblue{position:relative;border:1px solid #a4bed4;overflow:hidden;vertical-align:middle;background-color:white;font-size:1px;height:22px;}div.dhxcombo_dhx_skyblue input.dhxcombo_input{position:relative;top:0;left:1px;height:22px;line-height:21px;*height:20px;*line-height:19px;border:0 solid white;outline:0 solid white;padding:0;margin:0 0 0 2px;background-color:white;font-family:Tahoma;font-size:12px;color:black;vertical-align:middle;}div.dhxcombo_dhx_skyblue div.dhxcombo_select_button{position:absolute;width:18px;height:18px;top:1px;right:1px;font-size:1px;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);border-radius:2px;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;}div.dhxcombo_dhx_skyblue div.dhxcombo_select_button div.dhxcombo_select_img{position:relative;width:100%;height:100%;background-image:url("imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif");background-repeat:no-repeat;background-position:center center;}div.dhxcombo_dhx_skyblue div.dhxcombo_top_image{position:absolute;left:0;top:0;width:26px;height:22px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;cursor:default;}div.dhxcombolist_dhx_skyblue{position:absolute;font-family:Tahoma;font-size:12px;color:black;border:1px solid #a4bed4;box-shadow:0 2px 3px #ccc;background-color:#e7f1ff;border-bottom-left-radius:2px;border-bottom-right-radius:2px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow-x:none;overflow-y:auto;-moz-transition:height .15s ease 0s;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option{position:relative;font-size:inherit;height:20px;line-height:19px;border-top:1px solid #e7f1ff;border-bottom:1px solid #e7f1ff;vertical-align:middle;overflow:hidden;cursor:default;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option.dhxcombo_option_selected{background-color:#b5deff!important;border-top:1px solid #a1ceed!important;border-bottom:1px solid #a1ceed!important;color:black;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_option_text{position:relative;padding:0 4px;white-space:nowrap;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_option_text.dhxcombo_option_text_chbx{position:relative;padding:0 4px 0 4px;margin-left:20px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;white-space:nowrap;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_checkbox{position:absolute;left:1px;top:1px;width:20px;height:20px;background-image:url("imgs/dhxcombo_skyblue/dhxcombo_chbx.gif");background-repeat:no-repeat;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;cursor:default;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_checkbox.dhxcombo_chbx_0{background-position:0 0;}div.dhxcombolist_dhx_skyblue .dhxcombo_option div.dhxcombo_checkbox.dhxcombo_chbx_1{background-position:-18px 0;}div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_option_text.dhxcombo_option_text_image{position:relative;padding:0 4px 0 4px;margin-left:20px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;white-space:nowrap;}div.dhxcombo_dhx_skyblue div.dhxcombo_top_image div.dhxcombo_image,div.dhxcombolist_dhx_skyblue div.dhxcombo_option div.dhxcombo_image{position:absolute;left:3px;top:1px;width:20px;height:20px;background-repeat:no-repeat;background-position:center center;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;overflow:hidden;cursor:default;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled{border:1px solid #ccc;background-color:#fafafa;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled input.dhxcombo_input{color:#b2b2b2;background-color:#fafafa;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled div.dhxcombo_select_button{border-color:#ccc;background-color:#fefefe;background:linear-gradient(#fefefe,#f4f4f4);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#fefefe,endColorStr=#f4f4f4) progid:DXImageTransform.Microsoft.Alpha(opacity=100);cursor:default;}div.dhxcombo_dhx_skyblue.dhxcombo_disabled div.dhxcombo_select_button div.dhxcombo_select_img{background-image:url("imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif");}.dhxgrid_combo_icon{position:absolute;z-index:1;top:0;right:0;}div.dhxcombo_dhx_skyblue.dhxcombo_in_grid{border-top:1px solid white;border-bottom:0 solid white;border-left:1px solid white;border-right:1px solid white;margin-left:-4px;}div.dhxcombo_dhx_skyblue.dhxcombo_in_grid input.dhxcombo_input{height:18px;border-left:2px solid white;line-height:17px;}div.dhxcombo_dhx_skyblue.dhxcombo_in_grid div.dhxcombo_select_button{top:0;}.dhxcombo_skin_detect{position:absolute;left:0;top:-100px;margin:0;padding:0;border:0 solid white;width:10px;height:10px;overflow:hidden;}.dhxform_obj_dhx_skyblue{font-family:Tahoma;float:left;line-height:normal;}.dhxform_obj_dhx_skyblue div.dhxform_base{position:relative;float:left;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_base{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_base_nested{padding:0;clear:both;*display:inline-block;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_base_nested{padding:0;}.dhxform_obj_dhx_skyblue.dhxform_block{clear:both;}.dhxform_obj_dhx_skyblue div.block_dhxform_item_label_left{display:block;clear:both;*clear:none;}.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link,.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:visited,.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:active,.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:hover{outline:none;text-decoration:none;color:inherit;cursor:default;overflow:hidden;white-space:normal;apadding-top:1px;}.dhxform_obj_dhx_skyblue div.dhxform_label div.dhxform_label_nav_link:focus{color:#305f87;}.dhxform_obj_dhx_skyblue div.disabled span.nav_link{color:inherit;}.dhxform_obj_dhx_skyblue div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_actv_r{width:18px;height:18px;font-size:1px;}.dhxform_obj_dhx_skyblue div.dhxform_img.chbx0,.dhxform_obj_dhx_skyblue div.dhxform_img.chbx1,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx0,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx1,.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt0,.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt1,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt0,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt1,.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx0,.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx1,.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt0,.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt1{background-image:url("imgs/dhxform_skyblue/dhxform_chbxrd.gif");background-repeat:no-repeat;}.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx0{background-position:-162px 0;}.dhxform_obj_dhx_skyblue div.dhxform_actv_c.chbx1{background-position:-144px 0;}.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt0{background-position:-198px 0;}.dhxform_obj_dhx_skyblue div.dhxform_actv_r.rdbt1{background-position:-180px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.chbx0{background-position:-18px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.chbx1{background-position:0 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx0{background-position:-54px 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.chbx1{background-position:-36px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt0{background-position:-90px 0;}.dhxform_obj_dhx_skyblue div.dhxform_img.rdbt1{background-position:-72px 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt0{background-position:-126px 0;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_img.rdbt1{background-position:-108px 0;}.dhxform_obj_dhx_skyblue div.dhxform_label{font-family:inherit;font-size:inherit;color:black;overflow-x:hidden;overflow:hidden;white-space:normal;}.dhxform_obj_dhx_skyblue div.dhxform_label.dhxform_label_align_left{text-align:left;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_label.dhxform_label_align_left{text-align:right;}.dhxform_obj_dhx_skyblue div.dhxform_label.dhxform_label_align_center{text-align:center;}.dhxform_obj_dhx_skyblue div.dhxform_label.dhxform_label_align_right{text-align:right;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_label.dhxform_label_align_right{text-align:left;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_label,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_label div.dhxform_label_nav_link,.dhxform_obj_dhx_skyblue div.disabled div.dhxform_label span.dhxform_item_required{color:#b2b2b2;}.dhxform_obj_dhx_skyblue div.dhxform_label span.dhxform_item_required{margin-left:5px;margin-right:0;color:red;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_label span.dhxform_item_required{margin-left:0;margin-right:5px;}.dhxform_obj_dhx_skyblue input.dhxform_textarea{padding:4px 3px!important;margin:0;font-size:1em;}.dhxform_obj_dhx_skyblue textarea.dhxform_textarea{padding:4px 3px!important;}.dhxform_obj_dhx_skyblue .dhxform_textarea{border:1px solid #a4bed4;font-family:Tahoma;font-size:1em;color:black;resize:none;}.dhxform_obj_dhx_skyblue div.disabled .dhxform_textarea{color:#b2b2b2;background-color:white;border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue.dhxform_rtl .dhxform_textarea{text-align:right;direction:rtl;}.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node{position:relative;}.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node .dhxform_textarea{border:1px solid white;background-color:white;color:white;visibility:hidden;*height:1px;*line-height:1px;*display:inline;}.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_control.dhxform_img_node div.dhxform_actv_r{float:none;top:2px;left:2px;position:absolute;margin:0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_control.dhxform_img_node div.dhxform_img{float:none;top:2px;left:0;position:absolute;margin:0;}.dhxform_obj_dhx_skyblue .dhxform_select{border:1px solid #a4bed4;background-color:#fff;margin:0;padding:3px 2px 3px 0;font-family:Tahoma;font-size:1em;color:black;}.dhxform_obj_dhx_skyblue .dhxform_select option{padding-left:2px;}.dhxform_obj_dhx_skyblue div.disabled .dhxform_select{color:#b2b2b2;background-color:#fff;border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue.dhxform_rtl select,.dhxform_obj_dhx_skyblue.dhxform_rtl option{direction:rtl;}.dhxform_obj_dhx_skyblue div.fs_dhxform_item_label_left{padding:5px 0 5px 0;}.dhxform_obj_dhx_skyblue div.fs_dhxform_item_label_left fieldset.dhxform_fs div.dhxform_base_nested.dhxform_fs_nested{margin-right:19px;margin-left:5px;}.dhxform_obj_dhx_skyblue fieldset.dhxform_fs{border:1px solid #a4bed4;margin:0;padding:5px 0 12px 0;clear:left;width:100%;}.dhxform_obj_dhx_skyblue div.disabled fieldset.dhxform_fs{border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue fieldset.dhxform_fs legend.fs_legend{font-family:Tahoma;font-size:inherit;color:#7099bb;font-weight:normal;padding:0 4px 1px 4px;margin-left:5px;text-align:left;}.dhxform_obj_dhx_skyblue.dhxform_rtl fieldset.dhxform_fs legend.fs_legend{text-align:right;}.dhxform_obj_dhx_skyblue div.disabled fieldset.dhxform_fs legend.fs_legend{color:#b2b2b2;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right{clear:both;padding-top:6px;cursor:default;*float:left;*display:inline-block;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_actv_r{float:left;margin:0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_right div.dhxform_img{float:right;margin:0;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_label{float:left;padding:2px 0 2px 0;margin:2px 0 2px 0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_right div.dhxform_label{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_right div.dhxform_control{float:left;margin-right:3px;margin-left:0;*display:inline;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_right div.dhxform_control{float:right;margin-right:0;margin-left:3px;*display:inline;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left{clear:both;padding-top:6px;cursor:default;*float:left;*display:inline-block;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_img,.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_actv_r{float:right;amargin:3px 1px 0 5px;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_left div.dhxform_img{float:left;amargin:3px 5px 0 1px;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_label{float:left;padding:2px 0 2px 0;margin:2px 0 2px 0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_left div.dhxform_label{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_left div.dhxform_control{float:left;padding-left:4px;padding-right:0;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_left div.dhxform_control{float:right;padding-right:4px;padding-left:0;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_top{clear:both;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_top div.dhxform_label{float:none;margin-bottom:5px;margin-top:8px;}.dhxform_obj_dhx_skyblue div.dhxform_item_label_top div.dhxform_control{float:none;margin-left:0;margin-bottom:5px;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_item_label_top div.dhxform_control{float:none;margin-right:0;}.dhxform_obj_dhx_skyblue div.dhxform_item_absolute{position:absolute;left:0;top:0;cursor:default;}.dhxform_obj_dhx_skyblue div.item_absolute div.dhxform_img,.dhxform_obj_dhx_skyblue div.item_absolute div.dhxform_actv_c,.dhxform_obj_dhx_skyblue div.item_absolute div.dhxform_actv_r{position:absolute;}.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_control,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_label,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_control.dhxform_img_node,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_txt_label2,.dhxform_obj_dhx_skyblue div.dhxform_item_absolute div.dhxform_btn,.dhxform_obj_dhx_skyblue div.block_item_absolute div.dhxform_block{position:absolute;}.dhxform_obj_dhx_skyblue div.dhxform_txt_label2{font-family:Tahoma;font-size:inherit;color:#7099bb;font-weight:bold;margin:0 3px;padding:5px 0;cursor:default;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_txt_label2{color:#b2b8bc;}.dhxform_obj_dhx_skyblue div.dhxform_btn{font-family:Tahoma;font-size:inherit;color:black;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;border:1px solid #a4bed4;background-color:#e2efff;background:linear-gradient(#e2efff,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#e2efff,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);margin:5px 2px;border-radius:2px;float:left;cursor:default;clear:both;}.dhxform_obj_dhx_skyblue.dhxform_rtl div.dhxform_btn{float:right;}.dhxform_obj_dhx_skyblue div.dhxform_btn.dhxform_btn_over{background-color:#f1f7ff;background:linear-gradient(#f1f7ff,#e2efff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f1f7ff,endColorStr=#e2efff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);}.dhxform_obj_dhx_skyblue div.dhxform_btn.dhxform_btn_pressed{background-color:#d2e7fe;background:linear-gradient(#d2e7fe,#d3e7ff);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#d2e7fe,endColorStr=#d3e7ff) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 5px rgba(127,127,127,0.15) inset;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_btn{border-color:#ccc;background-color:#f9f9f9;background:linear-gradient(#f9f9f9,#f1f1f1);filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f9f9f9,endColorStr=#f1f1f1) progid:DXImageTransform.Microsoft.Alpha(opacity=100);box-shadow:0 0 5px rgba(127,127,127,0.15) inset;}.dhxform_obj_dhx_skyblue div.dhxform_btn div.dhxform_btn_txt{float:left;margin:0 20px;height:24px;line-height:23px;text-align:center;vertical-align:middle;overflow:hidden;white-space:nowrap;*display:inline;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_btn div.dhxform_btn_txt{color:#999!important;}.dhxform_obj_dhx_skyblue div.dhxform_btn:focus{outline:1px dotted #909090;}.dhxform_obj_dhx_skyblue div.dhxform_control div.dhxform_note{font-family:Tahoma;font-size:.8em;color:#808080;padding-bottom:3px;white-space:normal;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_control div.dhxform_note{color:#b2b2b2;}.dhxform_obj_dhx_skyblue div.dhxform_label span.dhxform_info{font-family:Tahoma;font-size:.6em;color:#808080;margin-left:3px;padding-bottom:2px;line-height:100%;vertical-align:middle;cursor:pointer;}.dhxform_obj_dhx_skyblue .validate_error .dhxform_label,.dhxform_obj_dhx_skyblue .validate_error .dhxform_textarea,.dhxform_obj_dhx_skyblue .validate_error .dhxform_select,.dhxform_obj_dhx_skyblue .validate_error div.dhxform_label_nav_link,.dhxform_obj_dhx_skyblue .validate_error div.dhxform_label div.dhxform_label_nav_link:focus{color:red;}.dhxform_obj_dhx_skyblue div.disabled .dhx_combo_box.dhx_skyblue{border:1px solid #c2d0dd;}.dhxform_obj_dhx_skyblue div.disabled .dhx_combo_box.dhx_skyblue .dhx_combo_input{color:#b2b2b2;background-color:#fff;}.dhxform_obj_dhx_skyblue div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_stb{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;}.dhxform_obj_dhx_skyblue div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhx_cell_editor div.dhx_cell_cont_editor{border-left:1px solid #a4bed4;border-right:1px solid #a4bed4;border-bottom:1px solid #a4bed4;}.dhxform_obj_dhx_skyblue div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhxcont_content_blocker{display:none;}.dhxform_obj_dhx_skyblue div.disabled div.dhxform_item_template.dhxeditor_dhx_skyblue div.dhxcont_content_blocker{display:inline;position:absolute;width:100%;height:100%;top:0;left:0;background-color:#fefefe;opacity:.7;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);}.dhxform_obj_dhx_skyblue .dhx_file_uploader{position:relative;width:100%;margin-bottom:4px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls{position:relative;width:100%;height:35px;font-size:2px;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button{position:absolute;width:19px;height:19px;top:8px;background-image:url("imgs/dhxform_skyblue/dhxform_upload_buttons.gif");background-repeat:no-repeat;font-size:2px;cursor:pointer;overflow:hidden;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_info{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_browse{background-position:0 0;right:108px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_upload{background-position:-19px 0;right:79px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_cancel{background-position:-57px 0;right:79px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_clear{background-position:-38px 0;right:50px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls .dhx_uploader_input{position:absolute;left:-1000px;top:0;visibility:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont{position:absolute;width:19px;height:19px;left:0;top:0;cursor:pointer;overflow:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form{position:absolute;top:0;right:0;cursor:pointer;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form .dhx_file_input{opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);cursor:pointer;outline:none;height:19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files{position:relative;width:100%;left:0;top:0;overflow:auto;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file{position:relative;width:100%;height:25px;overflow:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_added,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_uploading{color:black;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_uploaded{color:#30678a;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_fail{color:#e94a4a;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param{position:absolute;font-family:inherit;font-size:inherit;color:inherit;top:0;height:25px;line-height:25px;vertical-align:middle;overflow:hidden;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_name{left:20px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_progress{right:50px;width:38px;text-align:right;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_delete{right:30px;width:11px;background-image:url("imgs/dhxform_skyblue/dhxform_upload_buttons.gif");background-position:-76px 0;background-repeat:no-repeat;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_uploading{right:50px;width:38px;text-align:right;background-image:url("imgs/dhxform_skyblue/dhxform_upload_uploading.gif");background-position:center center;background-repeat:no-repeat;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;-ms-user-select:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls{height:60px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_files{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_info{display:inline;background-image:none;font-family:Tahoma;font-size:13px;color:#a1a1a1;height:auto;top:0;left:35px;vertical-align:top;padding-top:6px;line-height:20px;cursor:default;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_browse{top:0;width:54px;height:54px;right:35px;background-image:url("imgs/dhxform_skyblue/dhxform_upload_buttons.gif");background-position:0 -38px;background-repeat:no-repeat;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_upload,.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_cancel,.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_clear{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_form_cont{width:54px;height:54px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form .dhx_file_input{height:54px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_info,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_added,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_uploading,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_uploaded,.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_fail{color:#b2b2b2;}.dhxform_obj_dhx_skyblue .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_browse{background-position:-54px -38px;cursor:default;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_form_cont{display:none;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button{cursor:default;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_browse{background-position:0 -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_upload{background-position:-19px -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_cancel{background-position:-57px -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_clear{background-position:-38px -19px;}.dhxform_obj_dhx_skyblue .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file_param.dhx_file_delete{background-position:-87px 0;cursor:default;}.dhtmlx_skin_dhx_skyblue div.dhtmlx_wins_body_inner .dhxform_obj_dhx_skyblue{background-color:white;}.dhxform_obj_dhx_skyblue div.dhxform_control .dhx_combo_box.dhx_skyblue .dhx_combo_input,.dhx_combo_list.dhx_skyblue_list div{font-size:1em!important;}div.dhx_form_skin_detect{position:absolute;display:block;visibility:hidden;left:-100px;top:0;width:10px;height:10px;margin:0;padding:0;border:none;overflow:hidden;}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/ext/dhxupload.xap b/portal/static/unbound_reservation_static/css/ext/dhxupload.xap
new file mode 100644 (file)
index 0000000..f2deecd
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/ext/dhxupload.xap differ
diff --git a/portal/static/unbound_reservation_static/css/ext/swfobject.js b/portal/static/unbound_reservation_static/css/ext/swfobject.js
new file mode 100644 (file)
index 0000000..bf35c07
--- /dev/null
@@ -0,0 +1,777 @@
+/*!    SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+       
+       var UNDEF = "undefined",
+               OBJECT = "object",
+               SHOCKWAVE_FLASH = "Shockwave Flash",
+               SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+               FLASH_MIME_TYPE = "application/x-shockwave-flash",
+               EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+               ON_READY_STATE_CHANGE = "onreadystatechange",
+               
+               win = window,
+               doc = document,
+               nav = navigator,
+               
+               plugin = false,
+               domLoadFnArr = [main],
+               regObjArr = [],
+               objIdArr = [],
+               listenersArr = [],
+               storedAltContent,
+               storedAltContentId,
+               storedCallbackFn,
+               storedCallbackObj,
+               isDomLoaded = false,
+               isExpressInstallActive = false,
+               dynamicStylesheet,
+               dynamicStylesheetMedia,
+               autoHideShow = true,
+       
+       /* Centralized function for browser feature detection
+               - User agent string detection is only used when no good alternative is possible
+               - Is executed directly for optimal performance
+       */      
+       ua = function() {
+               var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+                       u = nav.userAgent.toLowerCase(),
+                       p = nav.platform.toLowerCase(),
+                       windows = p ? /win/.test(p) : /win/.test(u),
+                       mac = p ? /mac/.test(p) : /mac/.test(u),
+                       webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+                       ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+                       playerVersion = [0,0,0],
+                       d = null;
+               if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+                       d = nav.plugins[SHOCKWAVE_FLASH].description;
+                       if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+                               plugin = true;
+                               ie = false; // cascaded feature detection for Internet Explorer
+                               d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+                               playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+                               playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+                               playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+                       }
+               }
+               else if (typeof win.ActiveXObject != UNDEF) {
+                       try {
+                               var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+                               if (a) { // a will return null when ActiveX is disabled
+                                       d = a.GetVariable("$version");
+                                       if (d) {
+                                               ie = true; // cascaded feature detection for Internet Explorer
+                                               d = d.split(" ")[1].split(",");
+                                               playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                                       }
+                               }
+                       }
+                       catch(e) {}
+               }
+               return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+       }(),
+       
+       /* Cross-browser onDomLoad
+               - Will fire an event as soon as the DOM of a web page is loaded
+               - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+               - Regular onload serves as fallback
+       */ 
+       onDomLoad = function() {
+               if (!ua.w3) { return; }
+               if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+                       callDomLoadFunctions();
+               }
+               if (!isDomLoaded) {
+                       if (typeof doc.addEventListener != UNDEF) {
+                               doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+                       }               
+                       if (ua.ie && ua.win) {
+                               doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+                                       if (doc.readyState == "complete") {
+                                               doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+                                               callDomLoadFunctions();
+                                       }
+                               });
+                               if (win == top) { // if not inside an iframe
+                                       (function(){
+                                               if (isDomLoaded) { return; }
+                                               try {
+                                                       doc.documentElement.doScroll("left");
+                                               }
+                                               catch(e) {
+                                                       setTimeout(arguments.callee, 0);
+                                                       return;
+                                               }
+                                               callDomLoadFunctions();
+                                       })();
+                               }
+                       }
+                       if (ua.wk) {
+                               (function(){
+                                       if (isDomLoaded) { return; }
+                                       if (!/loaded|complete/.test(doc.readyState)) {
+                                               setTimeout(arguments.callee, 0);
+                                               return;
+                                       }
+                                       callDomLoadFunctions();
+                               })();
+                       }
+                       addLoadEvent(callDomLoadFunctions);
+               }
+       }();
+       
+       function callDomLoadFunctions() {
+               if (isDomLoaded) { return; }
+               try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+                       var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+                       t.parentNode.removeChild(t);
+               }
+               catch (e) { return; }
+               isDomLoaded = true;
+               var dl = domLoadFnArr.length;
+               for (var i = 0; i < dl; i++) {
+                       domLoadFnArr[i]();
+               }
+       }
+       
+       function addDomLoadEvent(fn) {
+               if (isDomLoaded) {
+                       fn();
+               }
+               else { 
+                       domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+               }
+       }
+       
+       /* Cross-browser onload
+               - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+               - Will fire an event as soon as a web page including all of its assets are loaded 
+        */
+       function addLoadEvent(fn) {
+               if (typeof win.addEventListener != UNDEF) {
+                       win.addEventListener("load", fn, false);
+               }
+               else if (typeof doc.addEventListener != UNDEF) {
+                       doc.addEventListener("load", fn, false);
+               }
+               else if (typeof win.attachEvent != UNDEF) {
+                       addListener(win, "onload", fn);
+               }
+               else if (typeof win.onload == "function") {
+                       var fnOld = win.onload;
+                       win.onload = function() {
+                               fnOld();
+                               fn();
+                       };
+               }
+               else {
+                       win.onload = fn;
+               }
+       }
+       
+       /* Main function
+               - Will preferably execute onDomLoad, otherwise onload (as a fallback)
+       */
+       function main() { 
+               if (plugin) {
+                       testPlayerVersion();
+               }
+               else {
+                       matchVersions();
+               }
+       }
+       
+       /* Detect the Flash Player version for non-Internet Explorer browsers
+               - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+                 a. Both release and build numbers can be detected
+                 b. Avoid wrong descriptions by corrupt installers provided by Adobe
+                 c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+               - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+       */
+       function testPlayerVersion() {
+               var b = doc.getElementsByTagName("body")[0];
+               var o = createElement(OBJECT);
+               o.setAttribute("type", FLASH_MIME_TYPE);
+               var t = b.appendChild(o);
+               if (t) {
+                       var counter = 0;
+                       (function(){
+                               if (typeof t.GetVariable != UNDEF) {
+                                       var d = t.GetVariable("$version");
+                                       if (d) {
+                                               d = d.split(" ")[1].split(",");
+                                               ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                                       }
+                               }
+                               else if (counter < 10) {
+                                       counter++;
+                                       setTimeout(arguments.callee, 10);
+                                       return;
+                               }
+                               b.removeChild(o);
+                               t = null;
+                               matchVersions();
+                       })();
+               }
+               else {
+                       matchVersions();
+               }
+       }
+       
+       /* Perform Flash Player and SWF version matching; static publishing only
+       */
+       function matchVersions() {
+               var rl = regObjArr.length;
+               if (rl > 0) {
+                       for (var i = 0; i < rl; i++) { // for each registered object element
+                               var id = regObjArr[i].id;
+                               var cb = regObjArr[i].callbackFn;
+                               var cbObj = {success:false, id:id};
+                               if (ua.pv[0] > 0) {
+                                       var obj = getElementById(id);
+                                       if (obj) {
+                                               if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+                                                       setVisibility(id, true);
+                                                       if (cb) {
+                                                               cbObj.success = true;
+                                                               cbObj.ref = getObjectById(id);
+                                                               cb(cbObj);
+                                                       }
+                                               }
+                                               else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+                                                       var att = {};
+                                                       att.data = regObjArr[i].expressInstall;
+                                                       att.width = obj.getAttribute("width") || "0";
+                                                       att.height = obj.getAttribute("height") || "0";
+                                                       if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+                                                       if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+                                                       // parse HTML object param element's name-value pairs
+                                                       var par = {};
+                                                       var p = obj.getElementsByTagName("param");
+                                                       var pl = p.length;
+                                                       for (var j = 0; j < pl; j++) {
+                                                               if (p[j].getAttribute("name").toLowerCase() != "movie") {
+                                                                       par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+                                                               }
+                                                       }
+                                                       showExpressInstall(att, par, id, cb);
+                                               }
+                                               else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+                                                       displayAltContent(obj);
+                                                       if (cb) { cb(cbObj); }
+                                               }
+                                       }
+                               }
+                               else {  // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+                                       setVisibility(id, true);
+                                       if (cb) {
+                                               var o = getObjectById(id); // test whether there is an HTML object element or not
+                                               if (o && typeof o.SetVariable != UNDEF) { 
+                                                       cbObj.success = true;
+                                                       cbObj.ref = o;
+                                               }
+                                               cb(cbObj);
+                                       }
+                               }
+                       }
+               }
+       }
+       
+       function getObjectById(objectIdStr) {
+               var r = null;
+               var o = getElementById(objectIdStr);
+               if (o && o.nodeName == "OBJECT") {
+                       if (typeof o.SetVariable != UNDEF) {
+                               r = o;
+                       }
+                       else {
+                               var n = o.getElementsByTagName(OBJECT)[0];
+                               if (n) {
+                                       r = n;
+                               }
+                       }
+               }
+               return r;
+       }
+       
+       /* Requirements for Adobe Express Install
+               - only one instance can be active at a time
+               - fp 6.0.65 or higher
+               - Win/Mac OS only
+               - no Webkit engines older than version 312
+       */
+       function canExpressInstall() {
+               return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+       }
+       
+       /* Show the Adobe Express Install dialog
+               - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+       */
+       function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+               isExpressInstallActive = true;
+               storedCallbackFn = callbackFn || null;
+               storedCallbackObj = {success:false, id:replaceElemIdStr};
+               var obj = getElementById(replaceElemIdStr);
+               if (obj) {
+                       if (obj.nodeName == "OBJECT") { // static publishing
+                               storedAltContent = abstractAltContent(obj);
+                               storedAltContentId = null;
+                       }
+                       else { // dynamic publishing
+                               storedAltContent = obj;
+                               storedAltContentId = replaceElemIdStr;
+                       }
+                       att.id = EXPRESS_INSTALL_ID;
+                       if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+                       if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+                       doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+                       var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+                               fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+                       if (typeof par.flashvars != UNDEF) {
+                               par.flashvars += "&" + fv;
+                       }
+                       else {
+                               par.flashvars = fv;
+                       }
+                       // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+                       // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+                       if (ua.ie && ua.win && obj.readyState != 4) {
+                               var newObj = createElement("div");
+                               replaceElemIdStr += "SWFObjectNew";
+                               newObj.setAttribute("id", replaceElemIdStr);
+                               obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+                               obj.style.display = "none";
+                               (function(){
+                                       if (obj.readyState == 4) {
+                                               obj.parentNode.removeChild(obj);
+                                       }
+                                       else {
+                                               setTimeout(arguments.callee, 10);
+                                       }
+                               })();
+                       }
+                       createSWF(att, par, replaceElemIdStr);
+               }
+       }
+       
+       /* Functions to abstract and display alternative content
+       */
+       function displayAltContent(obj) {
+               if (ua.ie && ua.win && obj.readyState != 4) {
+                       // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+                       // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+                       var el = createElement("div");
+                       obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+                       el.parentNode.replaceChild(abstractAltContent(obj), el);
+                       obj.style.display = "none";
+                       (function(){
+                               if (obj.readyState == 4) {
+                                       obj.parentNode.removeChild(obj);
+                               }
+                               else {
+                                       setTimeout(arguments.callee, 10);
+                               }
+                       })();
+               }
+               else {
+                       obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+               }
+       } 
+
+       function abstractAltContent(obj) {
+               var ac = createElement("div");
+               if (ua.win && ua.ie) {
+                       ac.innerHTML = obj.innerHTML;
+               }
+               else {
+                       var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+                       if (nestedObj) {
+                               var c = nestedObj.childNodes;
+                               if (c) {
+                                       var cl = c.length;
+                                       for (var i = 0; i < cl; i++) {
+                                               if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+                                                       ac.appendChild(c[i].cloneNode(true));
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return ac;
+       }
+       
+       /* Cross-browser dynamic SWF creation
+       */
+       function createSWF(attObj, parObj, id) {
+               var r, el = getElementById(id);
+               if (ua.wk && ua.wk < 312) { return r; }
+               if (el) {
+                       if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+                               attObj.id = id;
+                       }
+                       if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+                               var att = "";
+                               for (var i in attObj) {
+                                       if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+                                               if (i.toLowerCase() == "data") {
+                                                       parObj.movie = attObj[i];
+                                               }
+                                               else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                                       att += ' class="' + attObj[i] + '"';
+                                               }
+                                               else if (i.toLowerCase() != "classid") {
+                                                       att += ' ' + i + '="' + attObj[i] + '"';
+                                               }
+                                       }
+                               }
+                               var par = "";
+                               for (var j in parObj) {
+                                       if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+                                               par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+                                       }
+                               }
+                               el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+                               objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+                               r = getElementById(attObj.id);  
+                       }
+                       else { // well-behaving browsers
+                               var o = createElement(OBJECT);
+                               o.setAttribute("type", FLASH_MIME_TYPE);
+                               for (var m in attObj) {
+                                       if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+                                               if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                                       o.setAttribute("class", attObj[m]);
+                                               }
+                                               else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+                                                       o.setAttribute(m, attObj[m]);
+                                               }
+                                       }
+                               }
+                               for (var n in parObj) {
+                                       if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+                                               createObjParam(o, n, parObj[n]);
+                                       }
+                               }
+                               el.parentNode.replaceChild(o, el);
+                               r = o;
+                       }
+               }
+               return r;
+       }
+       
+       function createObjParam(el, pName, pValue) {
+               var p = createElement("param");
+               p.setAttribute("name", pName);  
+               p.setAttribute("value", pValue);
+               el.appendChild(p);
+       }
+       
+       /* Cross-browser SWF removal
+               - Especially needed to safely and completely remove a SWF in Internet Explorer
+       */
+       function removeSWF(id) {
+               var obj = getElementById(id);
+               if (obj && obj.nodeName == "OBJECT") {
+                       if (ua.ie && ua.win) {
+                               obj.style.display = "none";
+                               (function(){
+                                       if (obj.readyState == 4) {
+                                               removeObjectInIE(id);
+                                       }
+                                       else {
+                                               setTimeout(arguments.callee, 10);
+                                       }
+                               })();
+                       }
+                       else {
+                               obj.parentNode.removeChild(obj);
+                       }
+               }
+       }
+       
+       function removeObjectInIE(id) {
+               var obj = getElementById(id);
+               if (obj) {
+                       for (var i in obj) {
+                               if (typeof obj[i] == "function") {
+                                       obj[i] = null;
+                               }
+                       }
+                       obj.parentNode.removeChild(obj);
+               }
+       }
+       
+       /* Functions to optimize JavaScript compression
+       */
+       function getElementById(id) {
+               var el = null;
+               try {
+                       el = doc.getElementById(id);
+               }
+               catch (e) {}
+               return el;
+       }
+       
+       function createElement(el) {
+               return doc.createElement(el);
+       }
+       
+       /* Updated attachEvent function for Internet Explorer
+               - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+       */      
+       function addListener(target, eventType, fn) {
+               target.attachEvent(eventType, fn);
+               listenersArr[listenersArr.length] = [target, eventType, fn];
+       }
+       
+       /* Flash Player and SWF content version matching
+       */
+       function hasPlayerVersion(rv) {
+               var pv = ua.pv, v = rv.split(".");
+               v[0] = parseInt(v[0], 10);
+               v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+               v[2] = parseInt(v[2], 10) || 0;
+               return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+       }
+       
+       /* Cross-browser dynamic CSS creation
+               - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+       */      
+       function createCSS(sel, decl, media, newStyle) {
+               if (ua.ie && ua.mac) { return; }
+               var h = doc.getElementsByTagName("head")[0];
+               if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+               var m = (media && typeof media == "string") ? media : "screen";
+               if (newStyle) {
+                       dynamicStylesheet = null;
+                       dynamicStylesheetMedia = null;
+               }
+               if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+                       // create dynamic stylesheet + get a global reference to it
+                       var s = createElement("style");
+                       s.setAttribute("type", "text/css");
+                       s.setAttribute("media", m);
+                       dynamicStylesheet = h.appendChild(s);
+                       if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+                               dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+                       }
+                       dynamicStylesheetMedia = m;
+               }
+               // add style rule
+               if (ua.ie && ua.win) {
+                       if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+                               dynamicStylesheet.addRule(sel, decl);
+                       }
+               }
+               else {
+                       if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+                               dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+                       }
+               }
+       }
+       
+       function setVisibility(id, isVisible) {
+               if (!autoHideShow) { return; }
+               var v = isVisible ? "visible" : "hidden";
+               if (isDomLoaded && getElementById(id)) {
+                       getElementById(id).style.visibility = v;
+               }
+               else {
+                       createCSS("#" + id, "visibility:" + v);
+               }
+       }
+
+       /* Filter to avoid XSS attacks
+       */
+       function urlEncodeIfNecessary(s) {
+               var regex = /[\\\"<>\.;]/;
+               var hasBadChars = regex.exec(s) != null;
+               return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+       }
+       
+       /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+       */
+       var cleanup = function() {
+               if (ua.ie && ua.win) {
+                       window.attachEvent("onunload", function() {
+                               // remove listeners to avoid memory leaks
+                               var ll = listenersArr.length;
+                               for (var i = 0; i < ll; i++) {
+                                       listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+                               }
+                               // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+                               var il = objIdArr.length;
+                               for (var j = 0; j < il; j++) {
+                                       removeSWF(objIdArr[j]);
+                               }
+                               // cleanup library's main closures to avoid memory leaks
+                               for (var k in ua) {
+                                       ua[k] = null;
+                               }
+                               ua = null;
+                               for (var l in swfobject) {
+                                       swfobject[l] = null;
+                               }
+                               swfobject = null;
+                       });
+               }
+       }();
+       
+       return {
+               /* Public API
+                       - Reference: http://code.google.com/p/swfobject/wiki/documentation
+               */ 
+               registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+                       if (ua.w3 && objectIdStr && swfVersionStr) {
+                               var regObj = {};
+                               regObj.id = objectIdStr;
+                               regObj.swfVersion = swfVersionStr;
+                               regObj.expressInstall = xiSwfUrlStr;
+                               regObj.callbackFn = callbackFn;
+                               regObjArr[regObjArr.length] = regObj;
+                               setVisibility(objectIdStr, false);
+                       }
+                       else if (callbackFn) {
+                               callbackFn({success:false, id:objectIdStr});
+                       }
+               },
+               
+               getObjectById: function(objectIdStr) {
+                       if (ua.w3) {
+                               return getObjectById(objectIdStr);
+                       }
+               },
+               
+               embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+                       var callbackObj = {success:false, id:replaceElemIdStr};
+                       if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+                               setVisibility(replaceElemIdStr, false);
+                               addDomLoadEvent(function() {
+                                       widthStr += ""; // auto-convert to string
+                                       heightStr += "";
+                                       var att = {};
+                                       if (attObj && typeof attObj === OBJECT) {
+                                               for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+                                                       att[i] = attObj[i];
+                                               }
+                                       }
+                                       att.data = swfUrlStr;
+                                       att.width = widthStr;
+                                       att.height = heightStr;
+                                       var par = {}; 
+                                       if (parObj && typeof parObj === OBJECT) {
+                                               for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+                                                       par[j] = parObj[j];
+                                               }
+                                       }
+                                       if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+                                               for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+                                                       if (typeof par.flashvars != UNDEF) {
+                                                               par.flashvars += "&" + k + "=" + flashvarsObj[k];
+                                                       }
+                                                       else {
+                                                               par.flashvars = k + "=" + flashvarsObj[k];
+                                                       }
+                                               }
+                                       }
+                                       if (hasPlayerVersion(swfVersionStr)) { // create SWF
+                                               var obj = createSWF(att, par, replaceElemIdStr);
+                                               if (att.id == replaceElemIdStr) {
+                                                       setVisibility(replaceElemIdStr, true);
+                                               }
+                                               callbackObj.success = true;
+                                               callbackObj.ref = obj;
+                                       }
+                                       else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+                                               att.data = xiSwfUrlStr;
+                                               showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+                                               return;
+                                       }
+                                       else { // show alternative content
+                                               setVisibility(replaceElemIdStr, true);
+                                       }
+                                       if (callbackFn) { callbackFn(callbackObj); }
+                               });
+                       }
+                       else if (callbackFn) { callbackFn(callbackObj); }
+               },
+               
+               switchOffAutoHideShow: function() {
+                       autoHideShow = false;
+               },
+               
+               ua: ua,
+               
+               getFlashPlayerVersion: function() {
+                       return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+               },
+               
+               hasFlashPlayerVersion: hasPlayerVersion,
+               
+               createSWF: function(attObj, parObj, replaceElemIdStr) {
+                       if (ua.w3) {
+                               return createSWF(attObj, parObj, replaceElemIdStr);
+                       }
+                       else {
+                               return undefined;
+                       }
+               },
+               
+               showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+                       if (ua.w3 && canExpressInstall()) {
+                               showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+                       }
+               },
+               
+               removeSWF: function(objElemIdStr) {
+                       if (ua.w3) {
+                               removeSWF(objElemIdStr);
+                       }
+               },
+               
+               createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+                       if (ua.w3) {
+                               createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+                       }
+               },
+               
+               addDomLoadEvent: addDomLoadEvent,
+               
+               addLoadEvent: addLoadEvent,
+               
+               getQueryParamValue: function(param) {
+                       var q = doc.location.search || doc.location.hash;
+                       if (q) {
+                               if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+                               if (param == null) {
+                                       return urlEncodeIfNecessary(q);
+                               }
+                               var pairs = q.split("&");
+                               for (var i = 0; i < pairs.length; i++) {
+                                       if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+                                               return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+                                       }
+                               }
+                       }
+                       return "";
+               },
+               
+               // For internal usage only
+               expressInstallCallback: function() {
+                       if (isExpressInstallActive) {
+                               var obj = getElementById(EXPRESS_INSTALL_ID);
+                               if (obj && storedAltContent) {
+                                       obj.parentNode.replaceChild(storedAltContent, obj);
+                                       if (storedAltContentId) {
+                                               setVisibility(storedAltContentId, true);
+                                               if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+                                       }
+                                       if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+                               }
+                               isExpressInstallActive = false;
+                       } 
+               }
+       };
+}();
diff --git a/portal/static/unbound_reservation_static/css/ext/uploader.swf b/portal/static/unbound_reservation_static/css/ext/uploader.swf
new file mode 100644 (file)
index 0000000..b64e142
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/ext/uploader.swf differ
diff --git a/portal/static/unbound_reservation_static/css/images/gradient.png b/portal/static/unbound_reservation_static/css/images/gradient.png
new file mode 100644 (file)
index 0000000..8bd8f7f
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/images/gradient.png differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif
new file mode 100644 (file)
index 0000000..f927e47
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif
new file mode 100644 (file)
index 0000000..c2a4835
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif
new file mode 100644 (file)
index 0000000..c3f7391
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif
new file mode 100644 (file)
index 0000000..7390c60
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif
new file mode 100644 (file)
index 0000000..b6f2c4b
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif
new file mode 100644 (file)
index 0000000..090b597
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif
new file mode 100644 (file)
index 0000000..7fdb358
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif
new file mode 100644 (file)
index 0000000..c256a28
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif b/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif
new file mode 100644 (file)
index 0000000..60d880e
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_chbxrd.gif b/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_chbxrd.gif
new file mode 100644 (file)
index 0000000..d176df1
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_chbxrd.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_buttons.gif b/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_buttons.gif
new file mode 100644 (file)
index 0000000..96a9b8a
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_buttons.gif differ
diff --git a/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_uploading.gif b/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_uploading.gif
new file mode 100644 (file)
index 0000000..fbdfbdd
Binary files /dev/null and b/portal/static/unbound_reservation_static/css/imgs/dhxform_skyblue/dhxform_upload_uploading.gif differ
diff --git a/portal/static/unbound_reservation_static/css/node-network.css b/portal/static/unbound_reservation_static/css/node-network.css
new file mode 100644 (file)
index 0000000..0e3abbc
--- /dev/null
@@ -0,0 +1,482 @@
+/* ---------------------------------------------------------------------------
+   (c) Telef�nica I+D, 2013
+   Author: Paulo Villegas
+   ------------------------------------------------------------------------- */
+
+
+body {
+    background-color: #f6f6f6;
+}
+
+/* HREF links */
+
+a {
+    color: blue;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+a:visited {
+    color: blue;
+}
+
+/* .......................................................................*/
+/* Container Class */
+#plugin_container{
+       width:99%;
+       /*max-width:1000px;
+       max-width:1170px;*/     
+       
+}
+
+
+/* Container Class End ................................................... */
+
+
+#area51{
+    display: table;
+    background-color:black;
+    color:white;
+    width:500px;
+    height:400px;
+    clear:both;
+    margin-left:auto;
+    margin-right:auto;
+    margin-top:100px;
+    padding:10px 10px 10px 10px;
+}
+
+/* ....................................................................... */
+/* SidePanel-Left*/
+.sidepanel-left{ 
+       display:inline-block;  
+       min-width:851px; 
+    width:80%;
+ /*    background-color:rgb(255,165,0);*/
+    padding-left:20px;
+    padding-right:20px;
+    padding-top:10px;
+    padding-bottom:20px;
+}
+
+#testbed_bound_text, #unbound_text{
+    background-color:white;
+    text-align:justify;
+    padding: 5px 7px 5px 7px;
+    margin: 5px 5px 5px 5px; 
+}
+
+#node_num_Slider .tooltip, #node_num_Slider2 .tooltip{
+       display:none;
+}
+
+.control-label{
+    display:inline-block;
+    float:left;
+    width:40%;
+   <!-- margin-right:0px;-->
+   margin-left:0px;
+}
+
+.form-control{
+    display:inline-block;
+    margin-left:20px;
+    width:20% !important;
+   <!-- margin-right:16px;-->
+}
+
+#node_numSliderVal, #node_numSliderVal2{
+    display:inline-block;
+    margin-left:20px;
+}
+
+#node_num_Slider, #node_num_Slider2{
+    display:inline-block;
+    margin-top:6px;
+    margin-right:28px;
+    margin-left:-10px;
+    width:100px !important;
+    float:right;
+}
+
+#unbound_req, #testbed_bound{
+    width:325px;
+    border: 1px solid lightgrey;
+    background:lightgrey;
+    color:black !important;
+    
+}
+
+#b_ver .btn-group, #t_ver .btn-group{
+    margin-left:50px;
+    width:100px;
+}
+
+#unbound_text
+{
+       color:black !important;
+}
+/* SidePanel-Left End .......................................................... */
+/* Network Canvas */
+
+
+#netcanvas{
+    display:inline-block;
+    float:right;
+    top:61px;
+    width:100%;
+    left:360px;
+    /*right:0px;*/
+    height:680px;
+    /*min-width:700px;*/
+    min-height:680px;
+    overflow:auto;
+    position:absolute;
+  /*  z-index: -1;*/
+    
+    
+}
+
+/* ....................................................................... */
+/* The top-right side panel and its title child */
+
+div#sidepanel {
+    position: absolute;
+    pointer-events: none;
+    top: 0px;
+    right: 200px;
+}
+
+div#title {
+    margin: 4px 2px 6px 0px;
+    border-width: 0px;
+    padding: 0px;
+    text-align: right;
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 18px;    
+    line-height: 18px;
+    color: #5D1D4D;
+    font-weight: bold;
+    pointer-events: none;
+}
+
+div#title img {
+    border-width: 0px;
+    margin: 0px;
+}
+
+
+img#helpIcon {
+    position: absolute; 
+    right: 6px; 
+    top: 100px; 
+    pointer-events: all; 
+    cursor: help;
+} 
+
+
+/* ....................................................................... */
+/* On/off toggles for the help/info panels */
+
+div.panel_off {
+    visibility: hidden;
+    pointer-events: none;
+}
+
+div.panel_on {
+    visibility: visible;
+    pointer-events: all;
+}
+
+
+/* ....................................................................... */
+/* Help boxes */
+
+div#help {
+    margin: 6px;
+    padding: 4px;
+    background-color: #DEDFA3;
+    position: absolute;
+    width: 420px;
+    right: 0px;
+    z-index: 1001;
+    border: 1px solid #989970;
+
+    font-family: Georgia, Times New Roman, Times, serif;
+    font-size: 11pt;
+
+    -moz-transition: visibility 1.2s;
+    -o-transition: visibility 1.2s;
+    -webkit-transition: visibility 1.2s;
+    transition: visibility 1.2s;
+
+    -webkit-border-radius: 10px;
+    -moz-border-radius: 10px;
+    border-radius: 10px;
+
+    -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
+    -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
+    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
+}
+
+div#help ul {
+    margin: 0.5em 0em 0.5em 0em;
+    padding-left: 1.5em;
+    
+}
+
+div#help li {
+    margin: 0em;
+    padding: 0px;
+}
+
+div#faq {
+    position: absolute;
+    top: 6px;
+    left: 6px;
+    padding: 4px;
+    width: 860px;
+    height: 600px;
+    overflow-y: auto;
+    z-index: 1002;
+    background: #E5E4D6;
+
+    font-size: 11pt;
+
+    border: solid 1px #aaa;
+    border-radius: 8px;    
+    -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
+    -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
+    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
+}
+
+div#faq dt {
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 13pt;    
+    color: #5D1D4D;
+    font-weight: bold;
+    margin-top: .4em;
+}
+
+div#faq dd {
+    font-family: Georgia, Times New Roman, Times, serif;
+    padding-left: 0px;
+    margin-left: 0.7em;
+}
+
+div#close_faq {
+    position: fixed; 
+    margin-left: 820px; 
+    margin-top: 0px;
+    padding: 0px;
+}
+
+
+/* ....................................................................... */
+
+div#nocontent {
+    visibility: hidden;
+    pointer-events: none;
+    position: absolute;
+    width: 600px;
+    height: 200px;
+    top: 200px;
+    left: 200px;
+    background: #C3B091;
+    border: solid 2px #a00;
+    border-radius: 8px;    
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 20px;    
+    text-align: center;
+    vertical-align: center;
+    padding: 12px;
+}
+
+div#nocontent h1 {
+    margin: 1em;
+    color: red;
+    font-size: 24px;
+    font-weight: bold;
+}
+
+/* ....................................................................... */
+/* Node details panel */
+
+div#nodeInfo {
+    position: relative;
+    right: 4px;
+    cursor: text;
+    width: 300px;
+    z-index: 1000;
+    background: #E5E4D6;
+    border: solid 1px #aaa;
+    border-radius: 8px;    
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 10px;    
+    padding: 4px;
+    text-align: right;
+    color:black;
+}
+
+div#nodeInfo div#cover {
+    text-align: left; 
+    height: 300px;
+}
+
+div#nodeInfo div.t {
+    font-size: 14px;
+    font-weight: bold;
+}
+
+div#nodeInfo img.cover {
+    margin-bottom: 6px;
+    position: absolute;
+    right: 3px;
+}
+
+div#nodeInfo img.action {
+    cursor: pointer;
+    position: absolute;
+}
+
+div#nodeInfo div.f {
+    border-top: 1px dotted #8E5981;
+    margin-bottom: 3px;
+    margin-top: 3px;
+}
+
+div#nodeInfo span.d {
+    font-weight: bold;
+}
+
+div#nodeInfo span.c {
+    font-style: italic;
+}
+
+div#nodeInfo span.l {
+    font-size: 11px;
+    color: #24553E;
+    font-variant: small-caps;
+}
+
+/* ....................................................................... */
+/* SVG elements */
+
+div#netcanvas svg {
+    background-color: white;
+    cursor: move;
+}
+
+line.link {
+    stroke: #B2D9D8;
+}
+
+circle {
+    cursor: crosshair;
+    fill: #EBC763;
+}
+
+circle.level1 {
+    stroke: #f00;
+}
+
+circle.level2 {
+    fill-opacity: 0.8;
+    stroke-opacity: 0.8;
+    stroke: #777;
+}
+
+circle.level3 {
+    fill-opacity: 0.5;
+    stroke-opacity: 0.5;
+}
+
+circle.sibling {
+    /*fill: blue;*/
+    fill: #455EE8;
+}
+
+circle.main {
+    /*fill: red;*/
+    fill: #732A9A;
+    fill-opacity: 1.0;
+}
+
+/* ....................................................................... */
+/* Graph labels */
+
+g.gLabel {
+    font: 10px sans-serif;
+    font-weight: normal;
+    visibility: hidden;
+}
+
+g.on {
+    visibility: visible;    
+}
+
+g.zoomed {
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+    text-align: center;
+    color: #000;
+    border: none;
+    z-index: 0;
+}
+
+text {
+    font: 10px sans-serif;
+    font-weight: normal;
+    stroke-opacity: 1.0;
+}
+
+text.nlabel {
+    /*stroke: #000000;*/
+}
+
+text.nshadow {
+    stroke: #fff;
+    stroke-width: 3px;
+    /*stroke-opacity: 0.5;*/
+    /*visibility: hidden;*/
+}
+
+text.main {
+    font: 12px sans-serif;
+    font-weight: bold;
+}
+
+
+/* ....................................................................... */
+
+/* no longer used */
+
+.nlabel_on {
+    visibility: visible;
+    font-size: 12px;
+    opacity: 1.0;
+    fill: #101000;
+    stroke: #ffffff;
+    font-weight: bold;
+}
+
+.tooltip{
+    position: absolute;
+    width: 200px;
+    height: 50px;
+    padding: 8px;
+    font: 15px Helvetica Neue;
+    background: #FFF;
+    border: solid 1px #aaa;
+    border-radius: 8px;
+    pointer-events: none;
+    z-index:1000;
+    text-align:center;
+    background: rgba(222,223,163,0.8);
+}
+
+
diff --git a/portal/static/unbound_reservation_static/css/rmenu_styles.css b/portal/static/unbound_reservation_static/css/rmenu_styles.css
new file mode 100644 (file)
index 0000000..120239b
--- /dev/null
@@ -0,0 +1,272 @@
+@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,300);
+#cssmenu {
+  
+  display: none;
+  padding: 0;
+  margin: 0;
+  border: 0;
+  position: relative;
+  width: 150px;
+}
+#cssmenu ul,
+#cssmenu li {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+}
+#cssmenu ul ,
+#cssmenu ul li {
+  float: left;
+  min-height: 1px;
+  line-height: 1.5em;
+  vertical-align: middle;
+}
+#cssmenu ul li.hover,
+#cssmenu ul li:hover {
+  position: relative;
+  z-index: 599;
+  cursor: default;
+}
+#cssmenu ul ul {
+  visibility: hidden;
+  position: absolute;
+  top: 100%;
+  left: 0;
+  z-index: 598;
+  width: 100%;
+}
+#cssmenu ul ul li {
+  float: none;
+}
+#cssmenu ul ul,
+#cssmenu ul ul ul {
+  top: -1px;
+  left: 99%;
+}
+#cssmenu ul li:hover > ul {
+  visibility: visible;
+}
+#cssmenu ul li {
+  float: none;
+}
+#cssmenu a {
+  display: block;
+}
+/* Custom CSS Styles */
+#cssmenu {
+  font-family: "Segoe UI", Arial, sans-serif;
+  font-size: 11px;
+}
+#cssmenu:after,
+#cssmenu ul:after {
+  content: '';
+  display: block;
+  clear: both;
+}
+#cssmenu ul {
+  background: #F0EFEA;
+  border: 1px solid #aaaaaa;
+  padding: 4px;
+  width: 200px;
+}
+#cssmenu ul li {
+  color: #000000;
+  position: relative;
+}
+#cssmenu ul li.hover,
+#cssmenu ul li:hover {
+  background: #61b72d;
+  background: -moz-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #61b72d), color-stop(100%, #4b8e23));
+  background: -webkit-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: linear-gradient(#61b72d 0%, #4b8e23 100%);
+  color: #FFF;
+}
+#cssmenu ul li.hover > a,
+#cssmenu ul li:hover > a {
+  color: #FFF;
+  border: 1px solid #4b8e23;
+}
+#cssmenu ul ul {
+  width: 150px;
+}
+#cssmenu a {
+  border: 1px solid transparent;
+  padding: 3px 10px;
+}
+#cssmenu a:link,
+#cssmenu a:visited {
+  color: #000000;
+  text-decoration: none;
+}
+#cssmenu a:hover {
+  background: #61b72d;
+  background: -moz-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #61b72d), color-stop(100%, #4b8e23));
+  background: -webkit-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: linear-gradient(#61b72d 0%, #4b8e23 100%);
+  color: #FFF;
+}
+#cssmenu a:active {
+  color: #ffa500;
+}
+#cssmenu > ul > li.active > a {
+  background: #be3710;
+  }
+  #cssmenu .selector > a {
+  background: #be3710;
+  }
+#cssmenu .has-sub:hover > a:after,
+#cssmenu .has-sub.hover > a:after {
+  border-color: transparent transparent transparent #FFF;
+}
+#cssmenu .has-sub > a:after {
+  content: '';
+  width: 0px;
+  height: 0px;
+  border-style: solid;
+  border-width: 4px 0 4px 4px;
+  border-color: transparent transparent transparent #808080;
+  position: absolute;
+  top: 50%;
+  right: 5%;
+  margin-top: -4px;
+  -webkit-transform: rotate(360deg);
+}
+
+
+
+#cssmenu_ {
+  
+  display: none;
+  padding: 0;
+  margin: 0;
+  border: 0;
+  position: relative;
+  width: 150px;
+}
+#cssmenu_ ul,
+#cssmenu_ li {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+}
+#cssmenu_ ul ,
+#cssmenu_ ul li {
+  float: left;
+  min-height: 1px;
+  line-height: 1.5em;
+  vertical-align: middle;
+}
+#cssmenu_ ul li.hover,
+#cssmenu_ ul li:hover {
+  position: relative;
+  z-index: 599;
+  cursor: default;
+}
+#cssmenu_ ul ul {
+  visibility: hidden;
+  position: absolute;
+  top: 100%;
+  left: 0;
+  z-index: 598;
+  width: 100%;
+}
+#cssmenu_ ul ul li {
+  float: none;
+}
+#cssmenu_ ul ul,
+#cssmenu_ ul ul ul {
+  top: -1px;
+  left: 99%;
+}
+#cssmenu_ ul li:hover > ul {
+  visibility: visible;
+}
+#cssmenu_ ul li {
+  float: none;
+}
+#cssmenu_ a {
+  display: block;
+}
+/* Custom CSS Styles */
+#cssmenu_ {
+  font-family: "Segoe UI", Arial, sans-serif;
+  font-size: 11px;
+}
+#cssmenu_:after,
+#cssmenu_ ul:after {
+  content: '';
+  display: block;
+  clear: both;
+}
+#cssmenu_ ul {
+  background: #F0EFEA;
+  border: 1px solid #aaaaaa;
+  padding: 4px;
+  width: 200px;
+}
+#cssmenu_ ul li {
+  color: #000000;
+  position: relative;
+}
+#cssmenu_ ul li.hover,
+#cssmenu_ ul li:hover {
+  background: #61b72d;
+  background: -moz-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #61b72d), color-stop(100%, #4b8e23));
+  background: -webkit-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: linear-gradient(#61b72d 0%, #4b8e23 100%);
+  color: #FFF;
+}
+#cssmenu_ ul li.hover > a,
+#cssmenu_ ul li:hover > a {
+  color: #FFF;
+  border: 1px solid #4b8e23;
+}
+#cssmenu_ ul ul {
+  width: 150px;
+}
+#cssmenu_ a {
+  border: 1px solid transparent;
+  padding: 3px 10px;
+}
+#cssmenu_ a:link,
+#cssmenu_ a:visited {
+  color: #000000;
+  text-decoration: none;
+}
+#cssmenu_ a:hover {
+  background: #61b72d;
+  background: -moz-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #61b72d), color-stop(100%, #4b8e23));
+  background: -webkit-linear-gradient(#61b72d 0%, #4b8e23 100%);
+  background: linear-gradient(#61b72d 0%, #4b8e23 100%);
+  color: #FFF;
+}
+#cssmenu_ a:active {
+  color: #ffa500;
+}
+#cssmenu_ > ul > li.active > a {
+  background: #be3710;
+  }
+  #cssmenu_ .selector > a {
+  background: #be3710;
+  }
+#cssmenu_ .has-sub:hover > a:after,
+#cssmenu_ .has-sub.hover > a:after {
+  border-color: transparent transparent transparent #FFF;
+}
+#cssmenu_ .has-sub > a:after {
+  content: '';
+  width: 0px;
+  height: 0px;
+  border-style: solid;
+  border-width: 4px 0 4px 4px;
+  border-color: transparent transparent transparent #808080;
+  position: absolute;
+  top: 50%;
+  right: 5%;
+  margin-top: -4px;
+  -webkit-transform: rotate(360deg);
+}
diff --git a/portal/static/unbound_reservation_static/css/slider.css b/portal/static/unbound_reservation_static/css/slider.css
new file mode 100644 (file)
index 0000000..b527aa8
--- /dev/null
@@ -0,0 +1,138 @@
+/*!
+ * Slider for Bootstrap
+ *
+ * Copyright 2012 Stefan Petre
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+.slider {
+  display: inline-block;
+  vertical-align: middle;
+  position: relative;
+}
+.slider.slider-horizontal {
+  width: 210px;
+  height: 20px;
+}
+.slider.slider-horizontal .slider-track {
+  height: 10px;
+  width: 100%;
+  margin-top: -5px;
+  top: 50%;
+  left: 0;
+}
+.slider.slider-horizontal .slider-selection {
+  height: 100%;
+  top: 0;
+  bottom: 0;
+}
+.slider.slider-horizontal .slider-handle {
+  margin-left: -10px;
+  margin-top: -5px;
+}
+.slider.slider-horizontal .slider-handle.triangle {
+  border-width: 0 10px 10px 10px;
+  width: 0;
+  height: 0;
+  border-bottom-color: #0480be;
+  margin-top: 0;
+}
+.slider.slider-vertical {
+  height: 210px;
+  width: 20px;
+}
+.slider.slider-vertical .slider-track {
+  width: 10px;
+  height: 100%;
+  margin-left: -5px;
+  left: 50%;
+  top: 0;
+}
+.slider.slider-vertical .slider-selection {
+  width: 100%;
+  left: 0;
+  top: 0;
+  bottom: 0;
+}
+.slider.slider-vertical .slider-handle {
+  margin-left: -5px;
+  margin-top: -10px;
+}
+.slider.slider-vertical .slider-handle.triangle {
+  border-width: 10px 0 10px 10px;
+  width: 1px;
+  height: 1px;
+  border-left-color: #0480be;
+  margin-left: 0;
+}
+.slider input {
+  display: none;
+}
+.slider .tooltip-inner {
+  white-space: nowrap;
+}
+.slider-track {
+  position: absolute;
+  cursor: pointer;
+  background-color: #f7f7f7;
+  background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
+  background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
+  background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
+  background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
+  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+.slider-selection {
+  position: absolute;
+  background-color: #f7f7f7;
+  background-image: -moz-linear-gradient(top, #f9f9f9, #f5f5f5);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f9f9f9), to(#f5f5f5));
+  background-image: -webkit-linear-gradient(top, #f9f9f9, #f5f5f5);
+  background-image: -o-linear-gradient(top, #f9f9f9, #f5f5f5);
+  background-image: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
+  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+.slider-handle {
+  position: absolute;
+  width: 20px;
+  height: 20px;
+  background-color: #0e90d2;
+  background-image: -moz-linear-gradient(top, #149bdf, #0480be);
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
+  background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
+  background-image: -o-linear-gradient(top, #149bdf, #0480be);
+  background-image: linear-gradient(to bottom, #149bdf, #0480be);
+  background-repeat: repeat-x;
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);
+  -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
+  -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
+  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
+  opacity: 0.8;
+  border: 0px solid transparent;
+}
+.slider-handle.round {
+  -webkit-border-radius: 20px;
+  -moz-border-radius: 20px;
+  border-radius: 20px;
+}
+.slider-handle.triangle {
+  background: transparent none;
+}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/css/workflow.css b/portal/static/unbound_reservation_static/css/workflow.css
new file mode 100644 (file)
index 0000000..978327e
--- /dev/null
@@ -0,0 +1,151 @@
+li{ list-style: none !important; }
+ul{ margin-left: -30px; }
+
+.top-header{ margin-bottom: 5px; margin-top: 5px; }
+.border-editor{ border: 1px solid #CCC; overflow: hidden; background-color:rgb(255,165,0); }
+.heigh-editor{ height: 800px; }
+.content-editor{ margin-bottom: 50px; }
+.border-right-editor{ border-right: 1px solid #CCC; }
+.top-label{ margin-top: 20px; display: block; padding: 14px; font-weight: bold; background-color:#42403F; }
+.tool-panel{ margin-top: 20px; background-color:rgb(255,165,0); }
+
+.css-editor{ width: 100%; height: 92%; border: 1px dashed #D9534F; }
+#editor{ background: url('../img/workflow/bg-editor.jpg')}
+.ui-menu {
+    width: 100px;
+}
+
+.DCon {
+       background: url(../img/workflow/images.jpg);
+       background-size: 100% 100%;
+    cursor:pointer;
+       background-repeat: no-repeat;
+       height: 15px;
+       width: 15px;
+}
+.diagrama {
+       width: 150px;
+       height: 50px;   
+       padding:16px;
+       position:absolute;
+       border: 1px solid black;
+       z-index:4;
+       border-radius:1em;
+       border:1px solid #2e6f9a;
+       box-shadow: 2px 2px 19px #e0e0e0;
+       -o-box-shadow: 2px 2px 19px #e0e0e0;
+       -webkit-box-shadow: 2px 2px 19px #e0e0e0;
+       -moz-box-shadow: 2px 2px 19px #e0e0e0;
+       -moz-border-radius:8px;
+       border-radius:8px;
+       opacity:0.8;
+       filter:alpha(opacity=80);
+       cursor:move;
+       background-color:white;
+       font-size:11px;
+       -webkit-transition:background-color 0.25s ease-in;
+       -moz-transition:background-color 0.25s ease-in;
+       transition:background-color 0.25s ease-in;
+       text-align: center;
+       min-width: 150px;
+       min-height: 50px;       
+}
+
+.objeto:hover > .connect{
+       display: block;
+}
+
+
+.connect {
+    width: 10px;
+    height:0;
+    padding-bottom: 10px;
+    -moz-border-radius: 50%;
+    -webkit-border-radius: 50%;
+    border-radius: 50%;
+    background: #4679BD;
+    float: right;
+    position: relative;
+    right: -10px;
+    top: -0px;
+    display: none;
+}
+.msglabel {
+position: relative;
+width: 30px;
+height:10;
+right:-25px;
+top:-50px;
+font-size: 10px;
+color: #000000;
+}
+.actor{ 
+       background: url('../img/workflow/vm.png') no-repeat;
+       background-size: 64px 64px;
+       width: 64px;
+       height: 64px;
+}
+.actor span{ margin-top: 68px; display: block; }
+.actor:hover > .objeto{ background: none !important; }
+.actor:hover > .connect{
+       right: 5px;
+       top: -60px;
+}
+.actor:hover > .connect .msglabel{
+       right: 0px;
+       top: -50px;
+}
+.wireless{ 
+       background: url('../img/workflow/wireless.png') no-repeat;
+       background-size: 64px 64px;
+       width: 64px;
+       height: 64px;
+}
+.wireless span{ margin-top: 68px; display: block; }
+.wireless:hover > .objeto{ background: none !important; }
+.wireless:hover > .connect{
+       right: 5px;
+       top: -60px;
+}
+.wireless:hover > .msglabel{
+       right: 5px;
+       top: -60px;
+}
+.openflow{ 
+       background: url('../img/workflow/open_flow.png') no-repeat;
+       background-size: 64px 64px;
+       width: 64px;
+       height: 64px;
+}
+.openflow span{ margin-top: 68px; display: block; }
+.openflow:hover > .objeto{ background: none !important; }
+.openflow:hover > .connect{
+       right: 5px;
+       top: -60px;
+}
+.openflow:hover > .msglabel{
+       right: 5px;
+       top: -60px;
+}
+.custom-menu {
+    display: none;
+    z-index: 1000;
+    position: absolute;
+    overflow: hidden;
+    border: 1px solid #CCC;
+    white-space: nowrap;
+    font-family: sans-serif;
+    background: #FFF;
+    color: #333;
+    border-radius: 5px;
+}
+
+.custom-menu li {
+    padding: 8px 12px;
+    cursor: pointer;
+}
+
+.custom-menu li:hover {
+    background-color: #DEF;
+}
+.context-menu-list{ z-index: 9999 !important; }
diff --git a/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.eot b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.eot
new file mode 100644 (file)
index 0000000..423bd5d
Binary files /dev/null and b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.eot differ
diff --git a/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.svg b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.svg
new file mode 100644 (file)
index 0000000..4469488
--- /dev/null
@@ -0,0 +1,229 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="glyphicons_halflingsregular" horiz-adv-x="1200" >
+<font-face units-per-em="1200" ascent="960" descent="-240" />
+<missing-glyph horiz-adv-x="500" />
+<glyph />
+<glyph />
+<glyph unicode="&#xd;" />
+<glyph unicode=" " />
+<glyph unicode="*" d="M100 500v200h259l-183 183l141 141l183 -183v259h200v-259l183 183l141 -141l-183 -183h259v-200h-259l183 -183l-141 -141l-183 183v-259h-200v259l-183 -183l-141 141l183 183h-259z" />
+<glyph unicode="+" d="M0 400v300h400v400h300v-400h400v-300h-400v-400h-300v400h-400z" />
+<glyph unicode="&#xa0;" />
+<glyph unicode="&#x2000;" horiz-adv-x="652" />
+<glyph unicode="&#x2001;" horiz-adv-x="1304" />
+<glyph unicode="&#x2002;" horiz-adv-x="652" />
+<glyph unicode="&#x2003;" horiz-adv-x="1304" />
+<glyph unicode="&#x2004;" horiz-adv-x="434" />
+<glyph unicode="&#x2005;" horiz-adv-x="326" />
+<glyph unicode="&#x2006;" horiz-adv-x="217" />
+<glyph unicode="&#x2007;" horiz-adv-x="217" />
+<glyph unicode="&#x2008;" horiz-adv-x="163" />
+<glyph unicode="&#x2009;" horiz-adv-x="260" />
+<glyph unicode="&#x200a;" horiz-adv-x="72" />
+<glyph unicode="&#x202f;" horiz-adv-x="260" />
+<glyph unicode="&#x205f;" horiz-adv-x="326" />
+<glyph unicode="&#x20ac;" d="M100 500l100 100h113q0 47 5 100h-218l100 100h135q37 167 112 257q117 141 297 141q242 0 354 -189q60 -103 66 -209h-181q0 55 -25.5 99t-63.5 68t-75 36.5t-67 12.5q-24 0 -52.5 -10t-62.5 -32t-65.5 -67t-50.5 -107h379l-100 -100h-300q-6 -46 -6 -100h406l-100 -100 h-300q9 -74 33 -132t52.5 -91t62 -54.5t59 -29t46.5 -7.5q29 0 66 13t75 37t63.5 67.5t25.5 96.5h174q-31 -172 -128 -278q-107 -117 -274 -117q-205 0 -324 158q-36 46 -69 131.5t-45 205.5h-217z" />
+<glyph unicode="&#x2212;" d="M200 400h900v300h-900v-300z" />
+<glyph unicode="&#x2601;" d="M-14 494q0 -80 56.5 -137t135.5 -57h750q120 0 205 86t85 208q0 120 -85 206.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5z" />
+<glyph unicode="&#x2709;" d="M0 100l400 400l200 -200l200 200l400 -400h-1200zM0 300v600l300 -300zM0 1100l600 -603l600 603h-1200zM900 600l300 300v-600z" />
+<glyph unicode="&#x270f;" d="M-13 -13l333 112l-223 223zM187 403l214 -214l614 614l-214 214zM887 1103l214 -214l99 92q13 13 13 32.5t-13 33.5l-153 153q-15 13 -33 13t-33 -13z" />
+<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#xe001;" d="M0 1200h1200l-500 -550v-550h300v-100h-800v100h300v550z" />
+<glyph unicode="&#xe002;" d="M14 84q18 -55 86 -75.5t147 5.5q65 21 109 69t44 90v606l600 155v-521q-64 16 -138 -7q-79 -26 -122.5 -83t-25.5 -111q17 -55 85.5 -75.5t147.5 4.5q70 23 111.5 63.5t41.5 95.5v881q0 10 -7 15.5t-17 2.5l-752 -193q-10 -3 -17 -12.5t-7 -19.5v-689q-64 17 -138 -7 q-79 -25 -122.5 -82t-25.5 -112z" />
+<glyph unicode="&#xe003;" d="M23 693q0 200 142 342t342 142t342 -142t142 -342q0 -142 -78 -261l300 -300q7 -8 7 -18t-7 -18l-109 -109q-8 -7 -18 -7t-18 7l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 693q0 -136 97 -233t234 -97t233.5 96.5t96.5 233.5t-96.5 233.5t-233.5 96.5 t-234 -97t-97 -233z" />
+<glyph unicode="&#xe005;" d="M100 784q0 64 28 123t73 100.5t104.5 64t119 20.5t120 -38.5t104.5 -104.5q48 69 109.5 105t121.5 38t118.5 -20.5t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-149.5 152.5t-126.5 127.5 t-94 124.5t-33.5 117.5z" />
+<glyph unicode="&#xe006;" d="M-72 800h479l146 400h2l146 -400h472l-382 -278l145 -449l-384 275l-382 -275l146 447zM168 71l2 1z" />
+<glyph unicode="&#xe007;" d="M-72 800h479l146 400h2l146 -400h472l-382 -278l145 -449l-384 275l-382 -275l146 447zM168 71l2 1zM237 700l196 -142l-73 -226l192 140l195 -141l-74 229l193 140h-235l-77 211l-78 -211h-239z" />
+<glyph unicode="&#xe008;" d="M0 0v143l400 257v100q-37 0 -68.5 74.5t-31.5 125.5v200q0 124 88 212t212 88t212 -88t88 -212v-200q0 -51 -31.5 -125.5t-68.5 -74.5v-100l400 -257v-143h-1200z" />
+<glyph unicode="&#xe009;" d="M0 0v1100h1200v-1100h-1200zM100 100h100v100h-100v-100zM100 300h100v100h-100v-100zM100 500h100v100h-100v-100zM100 700h100v100h-100v-100zM100 900h100v100h-100v-100zM300 100h600v400h-600v-400zM300 600h600v400h-600v-400zM1000 100h100v100h-100v-100z M1000 300h100v100h-100v-100zM1000 500h100v100h-100v-100zM1000 700h100v100h-100v-100zM1000 900h100v100h-100v-100z" />
+<glyph unicode="&#xe010;" d="M0 50v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5zM0 650v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5zM600 50v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5zM600 650v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe011;" d="M0 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM0 450v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200 q-21 0 -35.5 14.5t-14.5 35.5zM0 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5 t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 450v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5 v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 450v200q0 21 14.5 35.5t35.5 14.5h200 q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe012;" d="M0 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM0 450q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v200q0 21 -14.5 35.5t-35.5 14.5h-200q-21 0 -35.5 -14.5 t-14.5 -35.5v-200zM0 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 50v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5 t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5zM400 450v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5zM400 850v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5 v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe013;" d="M29 454l419 -420l818 820l-212 212l-607 -607l-206 207z" />
+<glyph unicode="&#xe014;" d="M106 318l282 282l-282 282l212 212l282 -282l282 282l212 -212l-282 -282l282 -282l-212 -212l-282 282l-282 -282z" />
+<glyph unicode="&#xe015;" d="M23 693q0 200 142 342t342 142t342 -142t142 -342q0 -142 -78 -261l300 -300q7 -8 7 -18t-7 -18l-109 -109q-8 -7 -18 -7t-18 7l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 693q0 -136 97 -233t234 -97t233.5 96.5t96.5 233.5t-96.5 233.5t-233.5 96.5 t-234 -97t-97 -233zM300 600v200h100v100h200v-100h100v-200h-100v-100h-200v100h-100z" />
+<glyph unicode="&#xe016;" d="M23 694q0 200 142 342t342 142t342 -142t142 -342q0 -141 -78 -262l300 -299q7 -7 7 -18t-7 -18l-109 -109q-8 -8 -18 -8t-18 8l-300 299q-120 -77 -261 -77q-200 0 -342 142t-142 342zM176 694q0 -136 97 -233t234 -97t233.5 97t96.5 233t-96.5 233t-233.5 97t-234 -97 t-97 -233zM300 601h400v200h-400v-200z" />
+<glyph unicode="&#xe017;" d="M23 600q0 183 105 331t272 210v-166q-103 -55 -165 -155t-62 -220q0 -177 125 -302t302 -125t302 125t125 302q0 120 -62 220t-165 155v166q167 -62 272 -210t105 -331q0 -118 -45.5 -224.5t-123 -184t-184 -123t-224.5 -45.5t-224.5 45.5t-184 123t-123 184t-45.5 224.5 zM500 750q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v400q0 21 -14.5 35.5t-35.5 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-400z" />
+<glyph unicode="&#xe018;" d="M100 1h200v300h-200v-300zM400 1v500h200v-500h-200zM700 1v800h200v-800h-200zM1000 1v1200h200v-1200h-200z" />
+<glyph unicode="&#xe019;" d="M26 601q0 -33 6 -74l151 -38l2 -6q14 -49 38 -93l3 -5l-80 -134q45 -59 105 -105l133 81l5 -3q45 -26 94 -39l5 -2l38 -151q40 -5 74 -5q27 0 74 5l38 151l6 2q46 13 93 39l5 3l134 -81q56 44 104 105l-80 134l3 5q24 44 39 93l1 6l152 38q5 40 5 74q0 28 -5 73l-152 38 l-1 6q-16 51 -39 93l-3 5l80 134q-44 58 -104 105l-134 -81l-5 3q-45 25 -93 39l-6 1l-38 152q-40 5 -74 5q-27 0 -74 -5l-38 -152l-5 -1q-50 -14 -94 -39l-5 -3l-133 81q-59 -47 -105 -105l80 -134l-3 -5q-25 -47 -38 -93l-2 -6l-151 -38q-6 -48 -6 -73zM385 601 q0 88 63 151t152 63t152 -63t63 -151q0 -89 -63 -152t-152 -63t-152 63t-63 152z" />
+<glyph unicode="&#xe020;" d="M100 1025v50q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-50q0 -11 -7 -18t-18 -7h-1050q-11 0 -18 7t-7 18zM200 100v800h900v-800q0 -41 -29.5 -71t-70.5 -30h-700q-41 0 -70.5 30 t-29.5 71zM300 100h100v700h-100v-700zM500 100h100v700h-100v-700zM500 1100h300v100h-300v-100zM700 100h100v700h-100v-700zM900 100h100v700h-100v-700z" />
+<glyph unicode="&#xe021;" d="M1 601l656 644l644 -644h-200v-600h-300v400h-300v-400h-300v600h-200z" />
+<glyph unicode="&#xe022;" d="M100 25v1150q0 11 7 18t18 7h475v-500h400v-675q0 -11 -7 -18t-18 -7h-850q-11 0 -18 7t-7 18zM700 800v300l300 -300h-300z" />
+<glyph unicode="&#xe023;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM500 500v400h100 v-300h200v-100h-300z" />
+<glyph unicode="&#xe024;" d="M-100 0l431 1200h209l-21 -300h162l-20 300h208l431 -1200h-538l-41 400h-242l-40 -400h-539zM488 500h224l-27 300h-170z" />
+<glyph unicode="&#xe025;" d="M0 0v400h490l-290 300h200v500h300v-500h200l-290 -300h490v-400h-1100zM813 200h175v100h-175v-100z" />
+<glyph unicode="&#xe026;" d="M1 600q0 122 47.5 233t127.5 191t191 127.5t233 47.5t233 -47.5t191 -127.5t127.5 -191t47.5 -233t-47.5 -233t-127.5 -191t-191 -127.5t-233 -47.5t-233 47.5t-191 127.5t-127.5 191t-47.5 233zM188 600q0 -170 121 -291t291 -121t291 121t121 291t-121 291t-291 121 t-291 -121t-121 -291zM350 600h150v300h200v-300h150l-250 -300z" />
+<glyph unicode="&#xe027;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM350 600l250 300 l250 -300h-150v-300h-200v300h-150z" />
+<glyph unicode="&#xe028;" d="M0 25v475l200 700h800q199 -700 200 -700v-475q0 -11 -7 -18t-18 -7h-1150q-11 0 -18 7t-7 18zM200 500h200l50 -200h300l50 200h200l-97 500h-606z" />
+<glyph unicode="&#xe029;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -172 121.5 -293t292.5 -121t292.5 121t121.5 293q0 171 -121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM500 397v401 l297 -200z" />
+<glyph unicode="&#xe030;" d="M23 600q0 -118 45.5 -224.5t123 -184t184 -123t224.5 -45.5t224.5 45.5t184 123t123 184t45.5 224.5h-150q0 -177 -125 -302t-302 -125t-302 125t-125 302t125 302t302 125q136 0 246 -81l-146 -146h400v400l-145 -145q-157 122 -355 122q-118 0 -224.5 -45.5t-184 -123 t-123 -184t-45.5 -224.5z" />
+<glyph unicode="&#xe031;" d="M23 600q0 118 45.5 224.5t123 184t184 123t224.5 45.5q198 0 355 -122l145 145v-400h-400l147 147q-112 80 -247 80q-177 0 -302 -125t-125 -302h-150zM100 0v400h400l-147 -147q112 -80 247 -80q177 0 302 125t125 302h150q0 -118 -45.5 -224.5t-123 -184t-184 -123 t-224.5 -45.5q-198 0 -355 122z" />
+<glyph unicode="&#xe032;" d="M100 0h1100v1200h-1100v-1200zM200 100v900h900v-900h-900zM300 200v100h100v-100h-100zM300 400v100h100v-100h-100zM300 600v100h100v-100h-100zM300 800v100h100v-100h-100zM500 200h500v100h-500v-100zM500 400v100h500v-100h-500zM500 600v100h500v-100h-500z M500 800v100h500v-100h-500z" />
+<glyph unicode="&#xe033;" d="M0 100v600q0 41 29.5 70.5t70.5 29.5h100v200q0 82 59 141t141 59h300q82 0 141 -59t59 -141v-200h100q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-900q-41 0 -70.5 29.5t-29.5 70.5zM400 800h300v150q0 21 -14.5 35.5t-35.5 14.5h-200 q-21 0 -35.5 -14.5t-14.5 -35.5v-150z" />
+<glyph unicode="&#xe034;" d="M100 0v1100h100v-1100h-100zM300 400q60 60 127.5 84t127.5 17.5t122 -23t119 -30t110 -11t103 42t91 120.5v500q-40 -81 -101.5 -115.5t-127.5 -29.5t-138 25t-139.5 40t-125.5 25t-103 -29.5t-65 -115.5v-500z" />
+<glyph unicode="&#xe035;" d="M0 275q0 -11 7 -18t18 -7h50q11 0 18 7t7 18v300q0 127 70.5 231.5t184.5 161.5t245 57t245 -57t184.5 -161.5t70.5 -231.5v-300q0 -11 7 -18t18 -7h50q11 0 18 7t7 18v300q0 116 -49.5 227t-131 192.5t-192.5 131t-227 49.5t-227 -49.5t-192.5 -131t-131 -192.5 t-49.5 -227v-300zM200 20v460q0 8 6 14t14 6h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14zM800 20v460q0 8 6 14t14 6h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14z" />
+<glyph unicode="&#xe036;" d="M0 400h300l300 -200v800l-300 -200h-300v-400zM688 459l141 141l-141 141l71 71l141 -141l141 141l71 -71l-141 -141l141 -141l-71 -71l-141 141l-141 -141z" />
+<glyph unicode="&#xe037;" d="M0 400h300l300 -200v800l-300 -200h-300v-400zM700 857l69 53q111 -135 111 -310q0 -169 -106 -302l-67 54q86 110 86 248q0 146 -93 257z" />
+<glyph unicode="&#xe038;" d="M0 401v400h300l300 200v-800l-300 200h-300zM702 858l69 53q111 -135 111 -310q0 -170 -106 -303l-67 55q86 110 86 248q0 145 -93 257zM889 951l7 -8q123 -151 123 -344q0 -189 -119 -339l-7 -8l81 -66l6 8q142 178 142 405q0 230 -144 408l-6 8z" />
+<glyph unicode="&#xe039;" d="M0 0h500v500h-200v100h-100v-100h-200v-500zM0 600h100v100h400v100h100v100h-100v300h-500v-600zM100 100v300h300v-300h-300zM100 800v300h300v-300h-300zM200 200v100h100v-100h-100zM200 900h100v100h-100v-100zM500 500v100h300v-300h200v-100h-100v-100h-200v100 h-100v100h100v200h-200zM600 0v100h100v-100h-100zM600 1000h100v-300h200v-300h300v200h-200v100h200v500h-600v-200zM800 800v300h300v-300h-300zM900 0v100h300v-100h-300zM900 900v100h100v-100h-100zM1100 200v100h100v-100h-100z" />
+<glyph unicode="&#xe040;" d="M0 200h100v1000h-100v-1000zM100 0v100h300v-100h-300zM200 200v1000h100v-1000h-100zM500 0v91h100v-91h-100zM500 200v1000h200v-1000h-200zM700 0v91h100v-91h-100zM800 200v1000h100v-1000h-100zM900 0v91h200v-91h-200zM1000 200v1000h200v-1000h-200z" />
+<glyph unicode="&#xe041;" d="M1 700v475q0 10 7.5 17.5t17.5 7.5h474l700 -700l-500 -500zM148 953q0 -42 29 -71q30 -30 71.5 -30t71.5 30q29 29 29 71t-29 71q-30 30 -71.5 30t-71.5 -30q-29 -29 -29 -71z" />
+<glyph unicode="&#xe042;" d="M2 700v475q0 11 7 18t18 7h474l700 -700l-500 -500zM148 953q0 -42 30 -71q29 -30 71 -30t71 30q30 29 30 71t-30 71q-29 30 -71 30t-71 -30q-30 -29 -30 -71zM701 1200h100l700 -700l-500 -500l-50 50l450 450z" />
+<glyph unicode="&#xe043;" d="M100 0v1025l175 175h925v-1000l-100 -100v1000h-750l-100 -100h750v-1000h-900z" />
+<glyph unicode="&#xe044;" d="M200 0l450 444l450 -443v1150q0 20 -14.5 35t-35.5 15h-800q-21 0 -35.5 -15t-14.5 -35v-1151z" />
+<glyph unicode="&#xe045;" d="M0 100v700h200l100 -200h600l100 200h200v-700h-200v200h-800v-200h-200zM253 829l40 -124h592l62 124l-94 346q-2 11 -10 18t-18 7h-450q-10 0 -18 -7t-10 -18zM281 24l38 152q2 10 11.5 17t19.5 7h500q10 0 19.5 -7t11.5 -17l38 -152q2 -10 -3.5 -17t-15.5 -7h-600 q-10 0 -15.5 7t-3.5 17z" />
+<glyph unicode="&#xe046;" d="M0 200q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-150q-4 8 -11.5 21.5t-33 48t-53 61t-69 48t-83.5 21.5h-200q-41 0 -82 -20.5t-70 -50t-52 -59t-34 -50.5l-12 -20h-150q-41 0 -70.5 -29.5t-29.5 -70.5v-600z M356 500q0 100 72 172t172 72t172 -72t72 -172t-72 -172t-172 -72t-172 72t-72 172zM494 500q0 -44 31 -75t75 -31t75 31t31 75t-31 75t-75 31t-75 -31t-31 -75zM900 700v100h100v-100h-100z" />
+<glyph unicode="&#xe047;" d="M53 0h365v66q-41 0 -72 11t-49 38t1 71l92 234h391l82 -222q16 -45 -5.5 -88.5t-74.5 -43.5v-66h417v66q-34 1 -74 43q-18 19 -33 42t-21 37l-6 13l-385 998h-93l-399 -1006q-24 -48 -52 -75q-12 -12 -33 -25t-36 -20l-15 -7v-66zM416 521l178 457l46 -140l116 -317h-340 z" />
+<glyph unicode="&#xe048;" d="M100 0v89q41 7 70.5 32.5t29.5 65.5v827q0 28 -1 39.5t-5.5 26t-15.5 21t-29 14t-49 14.5v70h471q120 0 213 -88t93 -228q0 -55 -11.5 -101.5t-28 -74t-33.5 -47.5t-28 -28l-12 -7q8 -3 21.5 -9t48 -31.5t60.5 -58t47.5 -91.5t21.5 -129q0 -84 -59 -156.5t-142 -111 t-162 -38.5h-500zM400 200h161q89 0 153 48.5t64 132.5q0 90 -62.5 154.5t-156.5 64.5h-159v-400zM400 700h139q76 0 130 61.5t54 138.5q0 82 -84 130.5t-239 48.5v-379z" />
+<glyph unicode="&#xe049;" d="M200 0v57q77 7 134.5 40.5t65.5 80.5l173 849q10 56 -10 74t-91 37q-6 1 -10.5 2.5t-9.5 2.5v57h425l2 -57q-33 -8 -62 -25.5t-46 -37t-29.5 -38t-17.5 -30.5l-5 -12l-128 -825q-10 -52 14 -82t95 -36v-57h-500z" />
+<glyph unicode="&#xe050;" d="M-75 200h75v800h-75l125 167l125 -167h-75v-800h75l-125 -167zM300 900v300h150h700h150v-300h-50q0 29 -8 48.5t-18.5 30t-33.5 15t-39.5 5.5t-50.5 1h-200v-850l100 -50v-100h-400v100l100 50v850h-200q-34 0 -50.5 -1t-40 -5.5t-33.5 -15t-18.5 -30t-8.5 -48.5h-49z " />
+<glyph unicode="&#xe051;" d="M33 51l167 125v-75h800v75l167 -125l-167 -125v75h-800v-75zM100 901v300h150h700h150v-300h-50q0 29 -8 48.5t-18 30t-33.5 15t-40 5.5t-50.5 1h-200v-650l100 -50v-100h-400v100l100 50v650h-200q-34 0 -50.5 -1t-39.5 -5.5t-33.5 -15t-18.5 -30t-8 -48.5h-50z" />
+<glyph unicode="&#xe052;" d="M0 50q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 350q0 -20 14.5 -35t35.5 -15h800q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-800q-21 0 -35.5 -14.5t-14.5 -35.5 v-100zM0 650q0 -20 14.5 -35t35.5 -15h1000q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1000q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 950q0 -20 14.5 -35t35.5 -15h600q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-600q-21 0 -35.5 -14.5 t-14.5 -35.5v-100z" />
+<glyph unicode="&#xe053;" d="M0 50q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 650q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5 v-100zM200 350q0 -20 14.5 -35t35.5 -15h700q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-700q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM200 950q0 -20 14.5 -35t35.5 -15h700q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-700q-21 0 -35.5 -14.5 t-14.5 -35.5v-100z" />
+<glyph unicode="&#xe054;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM100 650v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1000q-21 0 -35.5 15 t-14.5 35zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM500 950v100q0 21 14.5 35.5t35.5 14.5h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-600 q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe055;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM0 350v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15 t-14.5 35zM0 650v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM0 950v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100 q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe056;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35zM0 350v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15 t-14.5 35zM0 650v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35zM0 950v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15 t-14.5 35zM300 50v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800 q-21 0 -35.5 15t-14.5 35zM300 650v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM300 950v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15 h-800q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe057;" d="M-101 500v100h201v75l166 -125l-166 -125v75h-201zM300 0h100v1100h-100v-1100zM500 50q0 -20 14.5 -35t35.5 -15h600q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-600q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 350q0 -20 14.5 -35t35.5 -15h300q20 0 35 15t15 35 v100q0 21 -15 35.5t-35 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 650q0 -20 14.5 -35t35.5 -15h500q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 950q0 -20 14.5 -35t35.5 -15h100q20 0 35 15t15 35v100 q0 21 -15 35.5t-35 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-100z" />
+<glyph unicode="&#xe058;" d="M1 50q0 -20 14.5 -35t35.5 -15h600q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-600q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 350q0 -20 14.5 -35t35.5 -15h300q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 650 q0 -20 14.5 -35t35.5 -15h500q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 950q0 -20 14.5 -35t35.5 -15h100q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM801 0v1100h100v-1100 h-100zM934 550l167 -125v75h200v100h-200v75z" />
+<glyph unicode="&#xe059;" d="M0 275v650q0 31 22 53t53 22h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53zM900 600l300 300v-600z" />
+<glyph unicode="&#xe060;" d="M0 44v1012q0 18 13 31t31 13h1112q19 0 31.5 -13t12.5 -31v-1012q0 -18 -12.5 -31t-31.5 -13h-1112q-18 0 -31 13t-13 31zM100 263l247 182l298 -131l-74 156l293 318l236 -288v500h-1000v-737zM208 750q0 56 39 95t95 39t95 -39t39 -95t-39 -95t-95 -39t-95 39t-39 95z " />
+<glyph unicode="&#xe062;" d="M148 745q0 124 60.5 231.5t165 172t226.5 64.5q123 0 227 -63t164.5 -169.5t60.5 -229.5t-73 -272q-73 -114 -166.5 -237t-150.5 -189l-57 -66q-10 9 -27 26t-66.5 70.5t-96 109t-104 135.5t-100.5 155q-63 139 -63 262zM342 772q0 -107 75.5 -182.5t181.5 -75.5 q107 0 182.5 75.5t75.5 182.5t-75.5 182t-182.5 75t-182 -75.5t-75 -181.5z" />
+<glyph unicode="&#xe063;" d="M1 600q0 122 47.5 233t127.5 191t191 127.5t233 47.5t233 -47.5t191 -127.5t127.5 -191t47.5 -233t-47.5 -233t-127.5 -191t-191 -127.5t-233 -47.5t-233 47.5t-191 127.5t-127.5 191t-47.5 233zM173 600q0 -177 125.5 -302t301.5 -125v854q-176 0 -301.5 -125 t-125.5 -302z" />
+<glyph unicode="&#xe064;" d="M117 406q0 94 34 186t88.5 172.5t112 159t115 177t87.5 194.5q21 -71 57.5 -142.5t76 -130.5t83 -118.5t82 -117t70 -116t50 -125.5t18.5 -136q0 -89 -39 -165.5t-102 -126.5t-140 -79.5t-156 -33.5q-114 6 -211.5 53t-161.5 138.5t-64 210.5zM243 414q14 -82 59.5 -136 t136.5 -80l16 98q-7 6 -18 17t-34 48t-33 77q-15 73 -14 143.5t10 122.5l9 51q-92 -110 -119.5 -185t-12.5 -156z" />
+<glyph unicode="&#xe065;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5q366 -6 397 -14l-186 -186h-311q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v125l200 200v-225q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5 t-117.5 282.5zM436 341l161 50l412 412l-114 113l-405 -405zM995 1015l113 -113l113 113l-21 85l-92 28z" />
+<glyph unicode="&#xe066;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h261l2 -80q-133 -32 -218 -120h-145q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5l200 153v-53q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5 zM423 524q30 38 81.5 64t103 35.5t99 14t77.5 3.5l29 -1v-209l360 324l-359 318v-216q-7 0 -19 -1t-48 -8t-69.5 -18.5t-76.5 -37t-76.5 -59t-62 -88t-39.5 -121.5z" />
+<glyph unicode="&#xe067;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q60 0 127 -23l-178 -177h-349q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v69l200 200v-169q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5 t-117.5 282.5zM342 632l283 -284l566 567l-136 137l-430 -431l-147 147z" />
+<glyph unicode="&#xe068;" d="M0 603l300 296v-198h200v200h-200l300 300l295 -300h-195v-200h200v198l300 -296l-300 -300v198h-200v-200h195l-295 -300l-300 300h200v200h-200v-198z" />
+<glyph unicode="&#xe069;" d="M200 50v1000q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-437l500 487v-1100l-500 488v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe070;" d="M0 50v1000q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-437l500 487v-487l500 487v-1100l-500 488v-488l-500 488v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe071;" d="M136 550l564 550v-487l500 487v-1100l-500 488v-488z" />
+<glyph unicode="&#xe072;" d="M200 0l900 550l-900 550v-1100z" />
+<glyph unicode="&#xe073;" d="M200 150q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v800q0 21 -14.5 35.5t-35.5 14.5h-200q-21 0 -35.5 -14.5t-14.5 -35.5v-800zM600 150q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v800q0 21 -14.5 35.5t-35.5 14.5h-200 q-21 0 -35.5 -14.5t-14.5 -35.5v-800z" />
+<glyph unicode="&#xe074;" d="M200 150q0 -20 14.5 -35t35.5 -15h800q21 0 35.5 15t14.5 35v800q0 21 -14.5 35.5t-35.5 14.5h-800q-21 0 -35.5 -14.5t-14.5 -35.5v-800z" />
+<glyph unicode="&#xe075;" d="M0 0v1100l500 -487v487l564 -550l-564 -550v488z" />
+<glyph unicode="&#xe076;" d="M0 0v1100l500 -487v487l500 -487v437q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438l-500 -488v488z" />
+<glyph unicode="&#xe077;" d="M300 0v1100l500 -487v437q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438z" />
+<glyph unicode="&#xe078;" d="M100 250v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5zM100 500h1100l-550 564z" />
+<glyph unicode="&#xe079;" d="M185 599l592 -592l240 240l-353 353l353 353l-240 240z" />
+<glyph unicode="&#xe080;" d="M272 194l353 353l-353 353l241 240l572 -571l21 -22l-1 -1v-1l-592 -591z" />
+<glyph unicode="&#xe081;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM300 500h200v-200h200v200h200v200h-200v200h-200v-200h-200v-200z" />
+<glyph unicode="&#xe082;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM300 500h600v200h-600v-200z" />
+<glyph unicode="&#xe083;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM246 459l213 -213l141 142l141 -142l213 213l-142 141l142 141l-213 212l-141 -141l-141 142l-212 -213l141 -141z" />
+<glyph unicode="&#xe084;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM270 551l276 -277l411 411l-175 174l-236 -236l-102 102z" />
+<glyph unicode="&#xe085;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM363 700h144q4 0 11.5 -1t11 -1t6.5 3t3 9t1 11t3.5 8.5t3.5 6t5.5 4t6.5 2.5t9 1.5t9 0.5h11.5h12.5q19 0 30 -10t11 -26 q0 -22 -4 -28t-27 -22q-5 -1 -12.5 -3t-27 -13.5t-34 -27t-26.5 -46t-11 -68.5h200q5 3 14 8t31.5 25.5t39.5 45.5t31 69t14 94q0 51 -17.5 89t-42 58t-58.5 32t-58.5 15t-51.5 3q-105 0 -172 -56t-67 -183zM500 300h200v100h-200v-100z" />
+<glyph unicode="&#xe086;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM400 300h400v100h-100v300h-300v-100h100v-200h-100v-100zM500 800h200v100h-200v-100z" />
+<glyph unicode="&#xe087;" d="M0 500v200h194q15 60 36 104.5t55.5 86t88 69t126.5 40.5v200h200v-200q54 -20 113 -60t112.5 -105.5t71.5 -134.5h203v-200h-203q-25 -102 -116.5 -186t-180.5 -117v-197h-200v197q-140 27 -208 102.5t-98 200.5h-194zM290 500q24 -73 79.5 -127.5t130.5 -78.5v206h200 v-206q149 48 201 206h-201v200h200q-25 74 -76 127.5t-124 76.5v-204h-200v203q-75 -24 -130 -77.5t-79 -125.5h209v-200h-210z" />
+<glyph unicode="&#xe088;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM356 465l135 135 l-135 135l109 109l135 -135l135 135l109 -109l-135 -135l135 -135l-109 -109l-135 135l-135 -135z" />
+<glyph unicode="&#xe089;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM322 537l141 141 l87 -87l204 205l142 -142l-346 -345z" />
+<glyph unicode="&#xe090;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -115 62 -215l568 567q-100 62 -216 62q-171 0 -292.5 -121.5t-121.5 -292.5zM391 245q97 -59 209 -59q171 0 292.5 121.5t121.5 292.5 q0 112 -59 209z" />
+<glyph unicode="&#xe091;" d="M0 547l600 453v-300h600v-300h-600v-301z" />
+<glyph unicode="&#xe092;" d="M0 400v300h600v300l600 -453l-600 -448v301h-600z" />
+<glyph unicode="&#xe093;" d="M204 600l450 600l444 -600h-298v-600h-300v600h-296z" />
+<glyph unicode="&#xe094;" d="M104 600h296v600h300v-600h298l-449 -600z" />
+<glyph unicode="&#xe095;" d="M0 200q6 132 41 238.5t103.5 193t184 138t271.5 59.5v271l600 -453l-600 -448v301q-95 -2 -183 -20t-170 -52t-147 -92.5t-100 -135.5z" />
+<glyph unicode="&#xe096;" d="M0 0v400l129 -129l294 294l142 -142l-294 -294l129 -129h-400zM635 777l142 -142l294 294l129 -129v400h-400l129 -129z" />
+<glyph unicode="&#xe097;" d="M34 176l295 295l-129 129h400v-400l-129 130l-295 -295zM600 600v400l129 -129l295 295l142 -141l-295 -295l129 -130h-400z" />
+<glyph unicode="&#xe101;" d="M23 600q0 118 45.5 224.5t123 184t184 123t224.5 45.5t224.5 -45.5t184 -123t123 -184t45.5 -224.5t-45.5 -224.5t-123 -184t-184 -123t-224.5 -45.5t-224.5 45.5t-184 123t-123 184t-45.5 224.5zM456 851l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5 t21.5 34.5l58 302q4 20 -8 34.5t-33 14.5h-207q-20 0 -32 -14.5t-8 -34.5zM500 300h200v100h-200v-100z" />
+<glyph unicode="&#xe102;" d="M0 800h100v-200h400v300h200v-300h400v200h100v100h-111v6t-1 15t-3 18l-34 172q-11 39 -41.5 63t-69.5 24q-32 0 -61 -17l-239 -144q-22 -13 -40 -35q-19 24 -40 36l-238 144q-33 18 -62 18q-39 0 -69.5 -23t-40.5 -61l-35 -177q-2 -8 -3 -18t-1 -15v-6h-111v-100z M100 0h400v400h-400v-400zM200 900q-3 0 14 48t35 96l18 47l214 -191h-281zM700 0v400h400v-400h-400zM731 900l202 197q5 -12 12 -32.5t23 -64t25 -72t7 -28.5h-269z" />
+<glyph unicode="&#xe103;" d="M0 -22v143l216 193q-9 53 -13 83t-5.5 94t9 113t38.5 114t74 124q47 60 99.5 102.5t103 68t127.5 48t145.5 37.5t184.5 43.5t220 58.5q0 -189 -22 -343t-59 -258t-89 -181.5t-108.5 -120t-122 -68t-125.5 -30t-121.5 -1.5t-107.5 12.5t-87.5 17t-56.5 7.5l-99 -55z M238.5 300.5q19.5 -6.5 86.5 76.5q55 66 367 234q70 38 118.5 69.5t102 79t99 111.5t86.5 148q22 50 24 60t-6 19q-7 5 -17 5t-26.5 -14.5t-33.5 -39.5q-35 -51 -113.5 -108.5t-139.5 -89.5l-61 -32q-369 -197 -458 -401q-48 -111 -28.5 -117.5z" />
+<glyph unicode="&#xe104;" d="M111 408q0 -33 5 -63q9 -56 44 -119.5t105 -108.5q31 -21 64 -16t62 23.5t57 49.5t48 61.5t35 60.5q32 66 39 184.5t-13 157.5q79 -80 122 -164t26 -184q-5 -33 -20.5 -69.5t-37.5 -80.5q-10 -19 -14.5 -29t-12 -26t-9 -23.5t-3 -19t2.5 -15.5t11 -9.5t19.5 -5t30.5 2.5 t42 8q57 20 91 34t87.5 44.5t87 64t65.5 88.5t47 122q38 172 -44.5 341.5t-246.5 278.5q22 -44 43 -129q39 -159 -32 -154q-15 2 -33 9q-79 33 -120.5 100t-44 175.5t48.5 257.5q-13 -8 -34 -23.5t-72.5 -66.5t-88.5 -105.5t-60 -138t-8 -166.5q2 -12 8 -41.5t8 -43t6 -39.5 t3.5 -39.5t-1 -33.5t-6 -31.5t-13.5 -24t-21 -20.5t-31 -12q-38 -10 -67 13t-40.5 61.5t-15 81.5t10.5 75q-52 -46 -83.5 -101t-39 -107t-7.5 -85z" />
+<glyph unicode="&#xe105;" d="M-61 600l26 40q6 10 20 30t49 63.5t74.5 85.5t97 90t116.5 83.5t132.5 59t145.5 23.5t145.5 -23.5t132.5 -59t116.5 -83.5t97 -90t74.5 -85.5t49 -63.5t20 -30l26 -40l-26 -40q-6 -10 -20 -30t-49 -63.5t-74.5 -85.5t-97 -90t-116.5 -83.5t-132.5 -59t-145.5 -23.5 t-145.5 23.5t-132.5 59t-116.5 83.5t-97 90t-74.5 85.5t-49 63.5t-20 30zM120 600q7 -10 40.5 -58t56 -78.5t68 -77.5t87.5 -75t103 -49.5t125 -21.5t123.5 20t100.5 45.5t85.5 71.5t66.5 75.5t58 81.5t47 66q-1 1 -28.5 37.5t-42 55t-43.5 53t-57.5 63.5t-58.5 54 q49 -74 49 -163q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 85 46 158q-102 -87 -226 -258zM377 656q49 -124 154 -191l105 105q-37 24 -75 72t-57 84l-20 36z" />
+<glyph unicode="&#xe106;" d="M-61 600l26 40q6 10 20 30t49 63.5t74.5 85.5t97 90t116.5 83.5t132.5 59t145.5 23.5q61 0 121 -17l37 142h148l-314 -1200h-148l37 143q-82 21 -165 71.5t-140 102t-109.5 112t-72 88.5t-29.5 43zM120 600q210 -282 393 -336l37 141q-107 18 -178.5 101.5t-71.5 193.5 q0 85 46 158q-102 -87 -226 -258zM377 656q49 -124 154 -191l47 47l23 87q-30 28 -59 69t-44 68l-14 26zM780 161l38 145q22 15 44.5 34t46 44t40.5 44t41 50.5t33.5 43.5t33 44t24.5 34q-97 127 -140 175l39 146q67 -54 131.5 -125.5t87.5 -103.5t36 -52l26 -40l-26 -40 q-7 -12 -25.5 -38t-63.5 -79.5t-95.5 -102.5t-124 -100t-146.5 -79z" />
+<glyph unicode="&#xe107;" d="M-97.5 34q13.5 -34 50.5 -34h1294q37 0 50.5 35.5t-7.5 67.5l-642 1056q-20 33 -48 36t-48 -29l-642 -1066q-21 -32 -7.5 -66zM155 200l445 723l445 -723h-345v100h-200v-100h-345zM500 600l100 -300l100 300v100h-200v-100z" />
+<glyph unicode="&#xe108;" d="M100 262v41q0 20 11 44.5t26 38.5l363 325v339q0 62 44 106t106 44t106 -44t44 -106v-339l363 -325q15 -14 26 -38.5t11 -44.5v-41q0 -20 -12 -26.5t-29 5.5l-359 249v-263q100 -91 100 -113v-64q0 -21 -13 -29t-32 1l-94 78h-222l-94 -78q-19 -9 -32 -1t-13 29v64 q0 22 100 113v263l-359 -249q-17 -12 -29 -5.5t-12 26.5z" />
+<glyph unicode="&#xe109;" d="M0 50q0 -20 14.5 -35t35.5 -15h1000q21 0 35.5 15t14.5 35v750h-1100v-750zM0 900h1100v150q0 21 -14.5 35.5t-35.5 14.5h-150v100h-100v-100h-500v100h-100v-100h-150q-21 0 -35.5 -14.5t-14.5 -35.5v-150zM100 100v100h100v-100h-100zM100 300v100h100v-100h-100z M100 500v100h100v-100h-100zM300 100v100h100v-100h-100zM300 300v100h100v-100h-100zM300 500v100h100v-100h-100zM500 100v100h100v-100h-100zM500 300v100h100v-100h-100zM500 500v100h100v-100h-100zM700 100v100h100v-100h-100zM700 300v100h100v-100h-100zM700 500 v100h100v-100h-100zM900 100v100h100v-100h-100zM900 300v100h100v-100h-100zM900 500v100h100v-100h-100z" />
+<glyph unicode="&#xe110;" d="M0 200v200h259l600 600h241v198l300 -295l-300 -300v197h-159l-600 -600h-341zM0 800h259l122 -122l141 142l-181 180h-341v-200zM678 381l141 142l122 -123h159v198l300 -295l-300 -300v197h-241z" />
+<glyph unicode="&#xe111;" d="M0 400v600q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-596l-304 -300v300h-100q-41 0 -70.5 29.5t-29.5 70.5z" />
+<glyph unicode="&#xe112;" d="M100 600v200h300v-250q0 -113 6 -145q17 -92 102 -117q39 -11 92 -11q37 0 66.5 5.5t50 15.5t36 24t24 31.5t14 37.5t7 42t2.5 45t0 47v25v250h300v-200q0 -42 -3 -83t-15 -104t-31.5 -116t-58 -109.5t-89 -96.5t-129 -65.5t-174.5 -25.5t-174.5 25.5t-129 65.5t-89 96.5 t-58 109.5t-31.5 116t-15 104t-3 83zM100 900v300h300v-300h-300zM800 900v300h300v-300h-300z" />
+<glyph unicode="&#xe113;" d="M-30 411l227 -227l352 353l353 -353l226 227l-578 579z" />
+<glyph unicode="&#xe114;" d="M70 797l580 -579l578 579l-226 227l-353 -353l-352 353z" />
+<glyph unicode="&#xe115;" d="M-198 700l299 283l300 -283h-203v-400h385l215 -200h-800v600h-196zM402 1000l215 -200h381v-400h-198l299 -283l299 283h-200v600h-796z" />
+<glyph unicode="&#xe116;" d="M18 939q-5 24 10 42q14 19 39 19h896l38 162q5 17 18.5 27.5t30.5 10.5h94q20 0 35 -14.5t15 -35.5t-15 -35.5t-35 -14.5h-54l-201 -961q-2 -4 -6 -10.5t-19 -17.5t-33 -11h-31v-50q0 -20 -14.5 -35t-35.5 -15t-35.5 15t-14.5 35v50h-300v-50q0 -20 -14.5 -35t-35.5 -15 t-35.5 15t-14.5 35v50h-50q-21 0 -35.5 15t-14.5 35q0 21 14.5 35.5t35.5 14.5h535l48 200h-633q-32 0 -54.5 21t-27.5 43z" />
+<glyph unicode="&#xe117;" d="M0 0v800h1200v-800h-1200zM0 900v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500v-100h-1200z" />
+<glyph unicode="&#xe118;" d="M1 0l300 700h1200l-300 -700h-1200zM1 400v600h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500v-200h-1000z" />
+<glyph unicode="&#xe119;" d="M302 300h198v600h-198l298 300l298 -300h-198v-600h198l-298 -300z" />
+<glyph unicode="&#xe120;" d="M0 600l300 298v-198h600v198l300 -298l-300 -297v197h-600v-197z" />
+<glyph unicode="&#xe121;" d="M0 100v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM31 400l172 739q5 22 23 41.5t38 19.5h672q19 0 37.5 -22.5t23.5 -45.5l172 -732h-1138zM800 100h100v100h-100v-100z M1000 100h100v100h-100v-100z" />
+<glyph unicode="&#xe122;" d="M-101 600v50q0 24 25 49t50 38l25 13v-250l-11 5.5t-24 14t-30 21.5t-24 27.5t-11 31.5zM99 500v250v5q0 13 0.5 18.5t2.5 13t8 10.5t15 3h200l675 250v-850l-675 200h-38l47 -276q2 -12 -3 -17.5t-11 -6t-21 -0.5h-8h-83q-20 0 -34.5 14t-18.5 35q-56 337 -56 351z M1100 200v850q0 21 14.5 35.5t35.5 14.5q20 0 35 -14.5t15 -35.5v-850q0 -20 -15 -35t-35 -15q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe123;" d="M74 350q0 21 13.5 35.5t33.5 14.5h17l118 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3 32t29 13h94q20 0 29 -10.5t3 -29.5l-18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q20 0 33.5 -14.5t13.5 -35.5q0 -20 -13 -40t-31 -27q-22 -9 -63 -23t-167.5 -37 t-251.5 -23t-245.5 20.5t-178.5 41.5l-58 20q-18 7 -31 27.5t-13 40.5zM497 110q12 -49 40 -79.5t63 -30.5t63 30.5t39 79.5q-48 -6 -102 -6t-103 6z" />
+<glyph unicode="&#xe124;" d="M21 445l233 -45l-78 -224l224 78l45 -233l155 179l155 -179l45 233l224 -78l-78 224l234 45l-180 155l180 156l-234 44l78 225l-224 -78l-45 233l-155 -180l-155 180l-45 -233l-224 78l78 -225l-233 -44l179 -156z" />
+<glyph unicode="&#xe125;" d="M0 200h200v600h-200v-600zM300 275q0 -75 100 -75h61q123 -100 139 -100h250q46 0 83 57l238 344q29 31 29 74v100q0 44 -30.5 84.5t-69.5 40.5h-328q28 118 28 125v150q0 44 -30.5 84.5t-69.5 40.5h-50q-27 0 -51 -20t-38 -48l-96 -198l-145 -196q-20 -26 -20 -63v-400z M400 300v375l150 212l100 213h50v-175l-50 -225h450v-125l-250 -375h-214l-136 100h-100z" />
+<glyph unicode="&#xe126;" d="M0 400v600h200v-600h-200zM300 525v400q0 75 100 75h61q123 100 139 100h250q46 0 83 -57l238 -344q29 -31 29 -74v-100q0 -44 -30.5 -84.5t-69.5 -40.5h-328q28 -118 28 -125v-150q0 -44 -30.5 -84.5t-69.5 -40.5h-50q-27 0 -51 20t-38 48l-96 198l-145 196 q-20 26 -20 63zM400 525l150 -212l100 -213h50v175l-50 225h450v125l-250 375h-214l-136 -100h-100v-375z" />
+<glyph unicode="&#xe127;" d="M8 200v600h200v-600h-200zM308 275v525q0 17 14 35.5t28 28.5l14 9l362 230q14 6 25 6q17 0 29 -12l109 -112q14 -14 14 -34q0 -18 -11 -32l-85 -121h302q85 0 138.5 -38t53.5 -110t-54.5 -111t-138.5 -39h-107l-130 -339q-7 -22 -20.5 -41.5t-28.5 -19.5h-341 q-7 0 -90 81t-83 94zM408 289l100 -89h293l131 339q6 21 19.5 41t28.5 20h203q16 0 25 15t9 36q0 20 -9 34.5t-25 14.5h-457h-6.5h-7.5t-6.5 0.5t-6 1t-5 1.5t-5.5 2.5t-4 4t-4 5.5q-5 12 -5 20q0 14 10 27l147 183l-86 83l-339 -236v-503z" />
+<glyph unicode="&#xe128;" d="M-101 651q0 72 54 110t139 37h302l-85 121q-11 16 -11 32q0 21 14 34l109 113q13 12 29 12q11 0 25 -6l365 -230q7 -4 16.5 -10.5t26 -26t16.5 -36.5v-526q0 -13 -85.5 -93.5t-93.5 -80.5h-342q-15 0 -28.5 20t-19.5 41l-131 339h-106q-84 0 -139 39t-55 111zM-1 601h222 q15 0 28.5 -20.5t19.5 -40.5l131 -339h293l106 89v502l-342 237l-87 -83l145 -184q10 -11 10 -26q0 -11 -5 -20q-1 -3 -3.5 -5.5l-4 -4t-5 -2.5t-5.5 -1.5t-6.5 -1t-6.5 -0.5h-7.5h-6.5h-476v-100zM999 201v600h200v-600h-200z" />
+<glyph unicode="&#xe129;" d="M97 719l230 -363q4 -6 10.5 -15.5t26 -25t36.5 -15.5h525q13 0 94 83t81 90v342q0 15 -20 28.5t-41 19.5l-339 131v106q0 84 -39 139t-111 55t-110 -53.5t-38 -138.5v-302l-121 84q-15 12 -33.5 11.5t-32.5 -13.5l-112 -110q-22 -22 -6 -53zM172 739l83 86l183 -146 q22 -18 47 -5q3 1 5.5 3.5l4 4t2.5 5t1.5 5.5t1 6.5t0.5 6v7.5v7v456q0 22 25 31t50 -0.5t25 -30.5v-202q0 -16 20 -29.5t41 -19.5l339 -130v-294l-89 -100h-503zM400 0v200h600v-200h-600z" />
+<glyph unicode="&#xe130;" d="M1 585q-15 -31 7 -53l112 -110q13 -13 32 -13.5t34 10.5l121 85l-1 -302q0 -84 38.5 -138t110.5 -54t111 55t39 139v106l339 131q20 6 40.5 19.5t20.5 28.5v342q0 7 -81 90t-94 83h-525q-17 0 -35.5 -14t-28.5 -28l-10 -15zM76 565l237 339h503l89 -100v-294l-340 -130 q-20 -6 -40 -20t-20 -29v-202q0 -22 -25 -31t-50 0t-25 31v456v14.5t-1.5 11.5t-5 12t-9.5 7q-24 13 -46 -5l-184 -146zM305 1104v200h600v-200h-600z" />
+<glyph unicode="&#xe131;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q162 0 299.5 -80t217.5 -218t80 -300t-80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 500h300l-2 -194l402 294l-402 298v-197h-298v-201z" />
+<glyph unicode="&#xe132;" d="M0 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t231.5 47.5q122 0 232.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-218 -217.5t-300 -80t-299.5 80t-217.5 217.5t-80 299.5zM200 600l400 -294v194h302v201h-300v197z" />
+<glyph unicode="&#xe133;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 600h200v-300h200v300h200l-300 400z" />
+<glyph unicode="&#xe134;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 600l300 -400l300 400h-200v300h-200v-300h-200z" />
+<glyph unicode="&#xe135;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM254 780q-8 -34 5.5 -93t7.5 -87q0 -9 17 -44t16 -60q12 0 23 -5.5 t23 -15t20 -13.5q20 -10 108 -42q22 -8 53 -31.5t59.5 -38.5t57.5 -11q8 -18 -15 -55.5t-20 -57.5q12 -21 22.5 -34.5t28 -27t36.5 -17.5q0 -6 -3 -15.5t-3.5 -14.5t4.5 -17q101 -2 221 111q31 30 47 48t34 49t21 62q-14 9 -37.5 9.5t-35.5 7.5q-14 7 -49 15t-52 19 q-9 0 -39.5 -0.5t-46.5 -1.5t-39 -6.5t-39 -16.5q-50 -35 -66 -12q-4 2 -3.5 25.5t0.5 25.5q-6 13 -26.5 17t-24.5 7q2 22 -2 41t-16.5 28t-38.5 -20q-23 -25 -42 4q-19 28 -8 58q8 16 22 22q6 -1 26 -1.5t33.5 -4.5t19.5 -13q12 -19 32 -37.5t34 -27.5l14 -8q0 3 9.5 39.5 t5.5 57.5q-4 23 14.5 44.5t22.5 31.5q5 14 10 35t8.5 31t15.5 22.5t34 21.5q-6 18 10 37q8 0 23.5 -1.5t24.5 -1.5t20.5 4.5t20.5 15.5q-10 23 -30.5 42.5t-38 30t-49 26.5t-43.5 23q11 41 1 44q31 -13 58.5 -14.5t39.5 3.5l11 4q6 36 -17 53.5t-64 28.5t-56 23 q-19 -3 -37 0q-15 -12 -36.5 -21t-34.5 -12t-44 -8t-39 -6q-15 -3 -46 0t-45 -3q-20 -6 -51.5 -25.5t-34.5 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -91t-29.5 -79zM518 915q3 12 16 30.5t16 25.5q10 -10 18.5 -10t14 6t14.5 14.5t16 12.5q0 -18 8 -42.5t16.5 -44 t9.5 -23.5q-6 1 -39 5t-53.5 10t-36.5 16z" />
+<glyph unicode="&#xe136;" d="M0 164.5q0 21.5 15 37.5l600 599q-33 101 6 201.5t135 154.5q164 92 306 -9l-259 -138l145 -232l251 126q13 -175 -151 -267q-123 -70 -253 -23l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5z" />
+<glyph unicode="&#xe137;" horiz-adv-x="1220" d="M0 196v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM0 596v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5zM0 996v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM600 596h500v100h-500v-100zM800 196h300v100h-300v-100zM900 996h200v100h-200v-100z" />
+<glyph unicode="&#xe138;" d="M100 1100v100h1000v-100h-1000zM150 1000h900l-350 -500v-300l-200 -200v500z" />
+<glyph unicode="&#xe139;" d="M0 200v200h1200v-200q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM0 500v400q0 41 29.5 70.5t70.5 29.5h300v100q0 41 29.5 70.5t70.5 29.5h200q41 0 70.5 -29.5t29.5 -70.5v-100h300q41 0 70.5 -29.5t29.5 -70.5v-400h-500v100h-200v-100h-500z M500 1000h200v100h-200v-100z" />
+<glyph unicode="&#xe140;" d="M0 0v400l129 -129l200 200l142 -142l-200 -200l129 -129h-400zM0 800l129 129l200 -200l142 142l-200 200l129 129h-400v-400zM729 329l142 142l200 -200l129 129v-400h-400l129 129zM729 871l200 200l-129 129h400v-400l-129 129l-200 -200z" />
+<glyph unicode="&#xe141;" d="M0 596q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM182 596q0 -172 121.5 -293t292.5 -121t292.5 121t121.5 293q0 171 -121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM291 655 q0 23 15.5 38.5t38.5 15.5t39 -16t16 -38q0 -23 -16 -39t-39 -16q-22 0 -38 16t-16 39zM400 850q0 22 16 38.5t39 16.5q22 0 38 -16t16 -39t-16 -39t-38 -16q-23 0 -39 16.5t-16 38.5zM513 609q0 32 21 56.5t52 29.5l122 126l1 1q-9 14 -9 28q0 22 16 38.5t39 16.5 q22 0 38 -16t16 -39t-16 -39t-38 -16q-16 0 -29 10l-55 -145q17 -22 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5q-37 0 -62.5 25.5t-25.5 61.5zM800 655q0 22 16 38t39 16t38.5 -15.5t15.5 -38.5t-16 -39t-38 -16q-23 0 -39 16t-16 39z" />
+<glyph unicode="&#xe142;" d="M-40 375q-13 -95 35 -173q35 -57 94 -89t129 -32q63 0 119 28q33 16 65 40.5t52.5 45.5t59.5 64q40 44 57 61l394 394q35 35 47 84t-3 96q-27 87 -117 104q-20 2 -29 2q-46 0 -79.5 -17t-67.5 -51l-388 -396l-7 -7l69 -67l377 373q20 22 39 38q23 23 50 23q38 0 53 -36 q16 -39 -20 -75l-547 -547q-52 -52 -125 -52q-55 0 -100 33t-54 96q-5 35 2.5 66t31.5 63t42 50t56 54q24 21 44 41l348 348q52 52 82.5 79.5t84 54t107.5 26.5q25 0 48 -4q95 -17 154 -94.5t51 -175.5q-7 -101 -98 -192l-252 -249l-253 -256l7 -7l69 -60l517 511 q67 67 95 157t11 183q-16 87 -67 154t-130 103q-69 33 -152 33q-107 0 -197 -55q-40 -24 -111 -95l-512 -512q-68 -68 -81 -163z" />
+<glyph unicode="&#xe143;" d="M79 784q0 131 99 229.5t230 98.5q144 0 242 -129q103 129 245 129q130 0 227 -98.5t97 -229.5q0 -46 -17.5 -91t-61 -99t-77 -89.5t-104.5 -105.5q-197 -191 -293 -322l-17 -23l-16 23q-43 58 -100 122.5t-92 99.5t-101 100l-84.5 84.5t-68 74t-60 78t-33.5 70.5t-15 78z M250 784q0 -27 30.5 -70t61.5 -75.5t95 -94.5l22 -22q93 -90 190 -201q82 92 195 203l12 12q64 62 97.5 97t64.5 79t31 72q0 71 -48 119.5t-106 48.5q-73 0 -131 -83l-118 -171l-114 174q-51 80 -124 80q-59 0 -108.5 -49.5t-49.5 -118.5z" />
+<glyph unicode="&#xe144;" d="M57 353q0 -94 66 -160l141 -141q66 -66 159 -66q95 0 159 66l283 283q66 66 66 159t-66 159l-141 141q-12 12 -19 17l-105 -105l212 -212l-389 -389l-247 248l95 95l-18 18q-46 45 -75 101l-55 -55q-66 -66 -66 -159zM269 706q0 -93 66 -159l141 -141l19 -17l105 105 l-212 212l389 389l247 -247l-95 -96l18 -18q46 -46 77 -99l29 29q35 35 62.5 88t27.5 96q0 93 -66 159l-141 141q-66 66 -159 66q-95 0 -159 -66l-283 -283q-66 -64 -66 -159z" />
+<glyph unicode="&#xe145;" d="M200 100v953q0 21 30 46t81 48t129 38t163 15t162 -15t127 -38t79 -48t29 -46v-953q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-41 0 -70.5 29.5t-29.5 70.5zM300 300h600v700h-600v-700zM496 150q0 -43 30.5 -73.5t73.5 -30.5t73.5 30.5t30.5 73.5t-30.5 73.5t-73.5 30.5 t-73.5 -30.5t-30.5 -73.5z" />
+<glyph unicode="&#xe146;" d="M0 0l303 380l207 208l-210 212h300l267 279l-35 36q-15 14 -15 35t15 35q14 15 35 15t35 -15l283 -282q15 -15 15 -36t-15 -35q-14 -15 -35 -15t-35 15l-36 35l-279 -267v-300l-212 210l-208 -207z" />
+<glyph unicode="&#xe148;" d="M295 433h139q5 -77 48.5 -126.5t117.5 -64.5v335l-27 7q-46 14 -79 26.5t-72 36t-62.5 52t-40 72.5t-16.5 99q0 92 44 159.5t109 101t144 40.5v78h100v-79q38 -4 72.5 -13.5t75.5 -31.5t71 -53.5t51.5 -84t24.5 -118.5h-159q-8 72 -35 109.5t-101 50.5v-307l64 -14 q34 -7 64 -16.5t70 -31.5t67.5 -52t47.5 -80.5t20 -112.5q0 -139 -89 -224t-244 -96v-77h-100v78q-152 17 -237 104q-40 40 -52.5 93.5t-15.5 139.5zM466 889q0 -29 8 -51t16.5 -34t29.5 -22.5t31 -13.5t38 -10q7 -2 11 -3v274q-61 -8 -97.5 -37.5t-36.5 -102.5zM700 237 q170 18 170 151q0 64 -44 99.5t-126 60.5v-311z" />
+<glyph unicode="&#xe149;" d="M100 600v100h166q-24 49 -44 104q-10 26 -14.5 55.5t-3 72.5t25 90t68.5 87q97 88 263 88q129 0 230 -89t101 -208h-153q0 52 -34 89.5t-74 51.5t-76 14q-37 0 -79 -14.5t-62 -35.5q-41 -44 -41 -101q0 -11 2.5 -24.5t5.5 -24t9.5 -26.5t10.5 -25t14 -27.5t14 -25.5 t15.5 -27t13.5 -24h242v-100h-197q8 -50 -2.5 -115t-31.5 -94q-41 -59 -99 -113q35 11 84 18t70 7q32 1 102 -16t104 -17q76 0 136 30l50 -147q-41 -25 -80.5 -36.5t-59 -13t-61.5 -1.5q-23 0 -128 33t-155 29q-39 -4 -82 -17t-66 -25l-24 -11l-55 145l16.5 11t15.5 10 t13.5 9.5t14.5 12t14.5 14t17.5 18.5q48 55 54 126.5t-30 142.5h-221z" />
+<glyph unicode="&#xe150;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM602 900l298 300l298 -300h-198v-900h-200v900h-198z" />
+<glyph unicode="&#xe151;" d="M2 300h198v900h200v-900h198l-298 -300zM700 0v200h100v-100h200v-100h-300zM700 400v100h300v-200h-99v-100h-100v100h99v100h-200zM700 700v500h300v-500h-100v100h-100v-100h-100zM801 900h100v200h-100v-200z" />
+<glyph unicode="&#xe152;" d="M2 300h198v900h200v-900h198l-298 -300zM700 0v500h300v-500h-100v100h-100v-100h-100zM700 700v200h100v-100h200v-100h-300zM700 1100v100h300v-200h-99v-100h-100v100h99v100h-200zM801 200h100v200h-100v-200z" />
+<glyph unicode="&#xe153;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM800 100v400h300v-500h-100v100h-200zM800 1100v100h200v-500h-100v400h-100zM901 200h100v200h-100v-200z" />
+<glyph unicode="&#xe154;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM800 400v100h200v-500h-100v400h-100zM800 800v400h300v-500h-100v100h-200zM901 900h100v200h-100v-200z" />
+<glyph unicode="&#xe155;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM700 100v200h500v-200h-500zM700 400v200h400v-200h-400zM700 700v200h300v-200h-300zM700 1000v200h200v-200h-200z" />
+<glyph unicode="&#xe156;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM700 100v200h200v-200h-200zM700 400v200h300v-200h-300zM700 700v200h400v-200h-400zM700 1000v200h500v-200h-500z" />
+<glyph unicode="&#xe157;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q162 0 281 -118.5t119 -281.5v-300q0 -165 -118.5 -282.5t-281.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500z" />
+<glyph unicode="&#xe158;" d="M0 400v300q0 163 119 281.5t281 118.5h300q165 0 282.5 -117.5t117.5 -282.5v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-163 0 -281.5 117.5t-118.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM400 300l333 250l-333 250v-500z" />
+<glyph unicode="&#xe159;" d="M0 400v300q0 163 117.5 281.5t282.5 118.5h300q163 0 281.5 -119t118.5 -281v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM300 700l250 -333l250 333h-500z" />
+<glyph unicode="&#xe160;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q165 0 282.5 -117.5t117.5 -282.5v-300q0 -162 -118.5 -281t-281.5 -119h-300q-165 0 -282.5 118.5t-117.5 281.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM300 400h500l-250 333z" />
+<glyph unicode="&#xe161;" d="M0 400v300h300v200l400 -350l-400 -350v200h-300zM500 0v200h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-500v200h400q165 0 282.5 -117.5t117.5 -282.5v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-400z" />
+<glyph unicode="&#xe162;" d="M216 519q10 -19 32 -19h302q-155 -438 -160 -458q-5 -21 4 -32l9 -8l9 -1q13 0 26 16l538 630q15 19 6 36q-8 18 -32 16h-300q1 4 78 219.5t79 227.5q2 17 -6 27l-8 8h-9q-16 0 -25 -15q-4 -5 -98.5 -111.5t-228 -257t-209.5 -238.5q-17 -19 -7 -40z" />
+<glyph unicode="&#xe163;" d="M0 400q0 -165 117.5 -282.5t282.5 -117.5h300q47 0 100 15v185h-500q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5h500v185q-14 4 -114 7.5t-193 5.5l-93 2q-165 0 -282.5 -117.5t-117.5 -282.5v-300zM600 400v300h300v200l400 -350l-400 -350v200h-300z " />
+<glyph unicode="&#xe164;" d="M0 400q0 -165 117.5 -282.5t282.5 -117.5h300q163 0 281.5 117.5t118.5 282.5v98l-78 73l-122 -123v-148q0 -41 -29.5 -70.5t-70.5 -29.5h-500q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5h156l118 122l-74 78h-100q-165 0 -282.5 -117.5t-117.5 -282.5 v-300zM496 709l353 342l-149 149h500v-500l-149 149l-342 -353z" />
+<glyph unicode="&#xe165;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM406 600 q0 80 57 137t137 57t137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137z" />
+<glyph unicode="&#xe166;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 800l445 -500l450 500h-295v400h-300v-400h-300zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe167;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 700h300v-300h300v300h295l-445 500zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe168;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 705l305 -305l596 596l-154 155l-442 -442l-150 151zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe169;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 988l97 -98l212 213l-97 97zM200 401h700v699l-250 -239l-149 149l-212 -212l149 -149zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe170;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM200 612l212 -212l98 97l-213 212zM300 1200l239 -250l-149 -149l212 -212l149 148l248 -237v700h-699zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe171;" d="M23 415l1177 784v-1079l-475 272l-310 -393v416h-392zM494 210l672 938l-672 -712v-226z" />
+<glyph unicode="&#xe172;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-850q0 -21 -15 -35.5t-35 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 1000h100v200h-100v-200z" />
+<glyph unicode="&#xe173;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-218l-276 -275l-120 120l-126 -127h-378v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM581 306l123 123l120 -120l353 352l123 -123l-475 -476zM600 1000h100v200h-100v-200z" />
+<glyph unicode="&#xe174;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-269l-103 -103l-170 170l-298 -298h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 1000h100v200h-100v-200zM700 133l170 170l-170 170l127 127l170 -170l170 170l127 -128l-170 -169l170 -170 l-127 -127l-170 170l-170 -170z" />
+<glyph unicode="&#xe175;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-300h-400v-200h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 300l300 -300l300 300h-200v300h-200v-300h-200zM600 1000v200h100v-200h-100z" />
+<glyph unicode="&#xe176;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-402l-200 200l-298 -298h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 300h200v-300h200v300h200l-300 300zM600 1000v200h100v-200h-100z" />
+<glyph unicode="&#xe177;" d="M0 250q0 -21 14.5 -35.5t35.5 -14.5h1100q21 0 35.5 14.5t14.5 35.5v550h-1200v-550zM0 900h1200v150q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-150zM100 300v200h400v-200h-400z" />
+<glyph unicode="&#xe178;" d="M0 400l300 298v-198h400v-200h-400v-198zM100 800v200h100v-200h-100zM300 800v200h100v-200h-100zM500 800v200h400v198l300 -298l-300 -298v198h-400zM800 300v200h100v-200h-100zM1000 300h100v200h-100v-200z" />
+<glyph unicode="&#xe179;" d="M100 700v400l50 100l50 -100v-300h100v300l50 100l50 -100v-300h100v300l50 100l50 -100v-400l-100 -203v-447q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v447zM800 597q0 -29 10.5 -55.5t25 -43t29 -28.5t25.5 -18l10 -5v-397q0 -21 14.5 -35.5 t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v1106q0 31 -18 40.5t-44 -7.5l-276 -117q-25 -16 -43.5 -50.5t-18.5 -65.5v-359z" />
+<glyph unicode="&#xe180;" d="M100 0h400v56q-75 0 -87.5 6t-12.5 44v394h500v-394q0 -38 -12.5 -44t-87.5 -6v-56h400v56q-4 0 -11 0.5t-24 3t-30 7t-24 15t-11 24.5v888q0 22 25 34.5t50 13.5l25 2v56h-400v-56q75 0 87.5 -6t12.5 -44v-394h-500v394q0 38 12.5 44t87.5 6v56h-400v-56q4 0 11 -0.5 t24 -3t30 -7t24 -15t11 -24.5v-888q0 -22 -25 -34.5t-50 -13.5l-25 -2v-56z" />
+<glyph unicode="&#xe181;" d="M0 300q0 -41 29.5 -70.5t70.5 -29.5h300q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-300q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM100 100h400l200 200h105l295 98v-298h-425l-100 -100h-375zM100 300v200h300v-200h-300zM100 600v200h300v-200h-300z M100 1000h400l200 -200v-98l295 98h105v200h-425l-100 100h-375zM700 402v163l400 133v-163z" />
+<glyph unicode="&#xe182;" d="M16.5 974.5q0.5 -21.5 16 -90t46.5 -140t104 -177.5t175 -208q103 -103 207.5 -176t180 -103.5t137 -47t92.5 -16.5l31 1l163 162q16 17 13 40.5t-22 37.5l-192 136q-19 14 -45 12t-42 -19l-119 -118q-143 103 -267 227q-126 126 -227 268l118 118q17 17 20 41.5 t-11 44.5l-139 194q-14 19 -36.5 22t-40.5 -14l-162 -162q-1 -11 -0.5 -32.5z" />
+<glyph unicode="&#xe183;" d="M0 50v212q0 20 10.5 45.5t24.5 39.5l365 303v50q0 4 1 10.5t12 22.5t30 28.5t60 23t97 10.5t97 -10t60 -23.5t30 -27.5t12 -24l1 -10v-50l365 -303q14 -14 24.5 -39.5t10.5 -45.5v-212q0 -21 -15 -35.5t-35 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5zM0 712 q0 -21 14.5 -33.5t34.5 -8.5l202 33q20 4 34.5 21t14.5 38v146q141 24 300 24t300 -24v-146q0 -21 14.5 -38t34.5 -21l202 -33q20 -4 34.5 8.5t14.5 33.5v200q-6 8 -19 20.5t-63 45t-112 57t-171 45t-235 20.5q-92 0 -175 -10.5t-141.5 -27t-108.5 -36.5t-81.5 -40 t-53.5 -36.5t-31 -27.5l-9 -10v-200z" />
+<glyph unicode="&#xe184;" d="M100 0v100h1100v-100h-1100zM175 200h950l-125 150v250l100 100v400h-100v-200h-100v200h-200v-200h-100v200h-200v-200h-100v200h-100v-400l100 -100v-250z" />
+<glyph unicode="&#xe185;" d="M100 0h300v400q0 41 -29.5 70.5t-70.5 29.5h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-400zM500 0v1000q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-1000h-300zM900 0v700q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-700h-300z" />
+<glyph unicode="&#xe186;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v300h-200v100h200v100h-300v-300h200v-100h-200v-100zM600 300h200v100h100v300h-100v100h-200v-500 zM700 400v300h100v-300h-100z" />
+<glyph unicode="&#xe187;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h100v200h100v-200h100v500h-100v-200h-100v200h-100v-500zM600 300h200v100h100v300h-100v100h-200v-500 zM700 400v300h100v-300h-100z" />
+<glyph unicode="&#xe188;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v100h-200v300h200v100h-300v-500zM600 300h300v100h-200v300h200v100h-300v-500z" />
+<glyph unicode="&#xe189;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 550l300 -150v300zM600 400l300 150l-300 150v-300z" />
+<glyph unicode="&#xe190;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300v500h700v-500h-700zM300 400h130q41 0 68 42t27 107t-28.5 108t-66.5 43h-130v-300zM575 549 q0 -65 27 -107t68 -42h130v300h-130q-38 0 -66.5 -43t-28.5 -108z" />
+<glyph unicode="&#xe191;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v300h-200v100h200v100h-300v-300h200v-100h-200v-100zM601 300h100v100h-100v-100zM700 700h100 v-400h100v500h-200v-100z" />
+<glyph unicode="&#xe192;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v400h-200v100h-100v-500zM301 400v200h100v-200h-100zM601 300h100v100h-100v-100zM700 700h100 v-400h100v500h-200v-100z" />
+<glyph unicode="&#xe193;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 700v100h300v-300h-99v-100h-100v100h99v200h-200zM201 300v100h100v-100h-100zM601 300v100h100v-100h-100z M700 700v100h200v-500h-100v400h-100z" />
+<glyph unicode="&#xe194;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM400 500v200 l100 100h300v-100h-300v-200h300v-100h-300z" />
+<glyph unicode="&#xe195;" d="M0 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM182 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM400 400v400h300 l100 -100v-100h-100v100h-200v-100h200v-100h-200v-100h-100zM700 400v100h100v-100h-100z" />
+<glyph unicode="&#xe197;" d="M-14 494q0 -80 56.5 -137t135.5 -57h222v300h400v-300h128q120 0 205 86t85 208q0 120 -85 206.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5zM300 200h200v300h200v-300 h200l-300 -300z" />
+<glyph unicode="&#xe198;" d="M-14 494q0 -80 56.5 -137t135.5 -57h8l414 414l403 -403q94 26 154.5 104t60.5 178q0 121 -85 207.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5zM300 200l300 300 l300 -300h-200v-300h-200v300h-200z" />
+<glyph unicode="&#xe199;" d="M100 200h400v-155l-75 -45h350l-75 45v155h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170z" />
+<glyph unicode="&#xe200;" d="M121 700q0 -53 28.5 -97t75.5 -65q-4 -16 -4 -38q0 -74 52.5 -126.5t126.5 -52.5q56 0 100 30v-306l-75 -45h350l-75 45v306q46 -30 100 -30q74 0 126.5 52.5t52.5 126.5q0 24 -9 55q50 32 79.5 83t29.5 112q0 90 -61.5 155.5t-150.5 71.5q-26 89 -99.5 145.5 t-167.5 56.5q-116 0 -197.5 -81.5t-81.5 -197.5q0 -4 1 -12t1 -11q-14 2 -23 2q-74 0 -126.5 -52.5t-52.5 -126.5z" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.ttf b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.ttf
new file mode 100644 (file)
index 0000000..a498ef4
Binary files /dev/null and b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.ttf differ
diff --git a/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.woff b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.woff
new file mode 100644 (file)
index 0000000..d83c539
Binary files /dev/null and b/portal/static/unbound_reservation_static/fonts/glyphicons-halflings-regular.woff differ
diff --git a/portal/static/unbound_reservation_static/img/any.jpg b/portal/static/unbound_reservation_static/img/any.jpg
new file mode 100644 (file)
index 0000000..ea4a86b
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/any.jpg differ
diff --git a/portal/static/unbound_reservation_static/img/close.png b/portal/static/unbound_reservation_static/img/close.png
new file mode 100644 (file)
index 0000000..7bdd304
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/close.png differ
diff --git a/portal/static/unbound_reservation_static/img/openflow.jpg b/portal/static/unbound_reservation_static/img/openflow.jpg
new file mode 100644 (file)
index 0000000..993a9d2
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/openflow.jpg differ
diff --git a/portal/static/unbound_reservation_static/img/target-32.png b/portal/static/unbound_reservation_static/img/target-32.png
new file mode 100644 (file)
index 0000000..6f98a5c
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/target-32.png differ
diff --git a/portal/static/unbound_reservation_static/img/vm.png b/portal/static/unbound_reservation_static/img/vm.png
new file mode 100644 (file)
index 0000000..75a6c38
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/vm.png differ
diff --git a/portal/static/unbound_reservation_static/img/wireless.gif b/portal/static/unbound_reservation_static/img/wireless.gif
new file mode 100644 (file)
index 0000000..bc84946
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/wireless.gif differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/actor.png b/portal/static/unbound_reservation_static/img/workflow/actor.png
new file mode 100644 (file)
index 0000000..988b337
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/actor.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/bg-editor.jpg b/portal/static/unbound_reservation_static/img/workflow/bg-editor.jpg
new file mode 100644 (file)
index 0000000..5d3b688
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/bg-editor.jpg differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/diagrama.png b/portal/static/unbound_reservation_static/img/workflow/diagrama.png
new file mode 100644 (file)
index 0000000..b8c87c4
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/diagrama.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/icons/calendar.gif b/portal/static/unbound_reservation_static/img/workflow/icons/calendar.gif
new file mode 100644 (file)
index 0000000..3296cbb
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/icons/calendar.gif differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/icons/flag_blue.png b/portal/static/unbound_reservation_static/img/workflow/icons/flag_blue.png
new file mode 100644 (file)
index 0000000..40394a6
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/icons/flag_blue.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/icons/flag_green.png b/portal/static/unbound_reservation_static/img/workflow/icons/flag_green.png
new file mode 100644 (file)
index 0000000..def17cc
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/icons/flag_green.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/icons/flag_magenta.png b/portal/static/unbound_reservation_static/img/workflow/icons/flag_magenta.png
new file mode 100644 (file)
index 0000000..bb91a7a
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/icons/flag_magenta.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/icons/flag_red.png b/portal/static/unbound_reservation_static/img/workflow/icons/flag_red.png
new file mode 100644 (file)
index 0000000..e99a587
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/icons/flag_red.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/images.jpg b/portal/static/unbound_reservation_static/img/workflow/images.jpg
new file mode 100644 (file)
index 0000000..79f5da8
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/images.jpg differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/open_flow.jpeg b/portal/static/unbound_reservation_static/img/workflow/open_flow.jpeg
new file mode 100644 (file)
index 0000000..c252d28
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/open_flow.jpeg differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/open_flow.png b/portal/static/unbound_reservation_static/img/workflow/open_flow.png
new file mode 100644 (file)
index 0000000..df682d1
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/open_flow.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/open_flow_icon.png b/portal/static/unbound_reservation_static/img/workflow/open_flow_icon.png
new file mode 100644 (file)
index 0000000..7d12298
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/open_flow_icon.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/persona.png b/portal/static/unbound_reservation_static/img/workflow/persona.png
new file mode 100644 (file)
index 0000000..28995f3
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/persona.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/vm.png b/portal/static/unbound_reservation_static/img/workflow/vm.png
new file mode 100644 (file)
index 0000000..954b4d4
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/vm.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/vm_icon.png b/portal/static/unbound_reservation_static/img/workflow/vm_icon.png
new file mode 100644 (file)
index 0000000..431c2a3
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/vm_icon.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/vm_icons.png b/portal/static/unbound_reservation_static/img/workflow/vm_icons.png
new file mode 100644 (file)
index 0000000..a291c4a
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/vm_icons.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/wireless.png b/portal/static/unbound_reservation_static/img/workflow/wireless.png
new file mode 100644 (file)
index 0000000..43e3173
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/wireless.png differ
diff --git a/portal/static/unbound_reservation_static/img/workflow/wireless_icon.png b/portal/static/unbound_reservation_static/img/workflow/wireless_icon.png
new file mode 100644 (file)
index 0000000..4298748
Binary files /dev/null and b/portal/static/unbound_reservation_static/img/workflow/wireless_icon.png differ
diff --git a/portal/static/unbound_reservation_static/js/bootstrap-slider.js b/portal/static/unbound_reservation_static/js/bootstrap-slider.js
new file mode 100644 (file)
index 0000000..fe752f5
--- /dev/null
@@ -0,0 +1,388 @@
+/* =========================================================\r
+ * bootstrap-slider.js v2.0.0\r
+ * http://www.eyecon.ro/bootstrap-slider\r
+ * =========================================================\r
+ * Copyright 2012 Stefan Petre\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ========================================================= */\r
\r
+!function( $ ) {\r
+\r
+       var Slider = function(element, options) {\r
+               this.element = $(element);\r
+               this.picker = $('<div class="slider">'+\r
+                                                       '<div class="slider-track">'+\r
+                                                               '<div class="slider-selection"></div>'+\r
+                                                               '<div class="slider-handle"></div>'+\r
+                                                               '<div class="slider-handle"></div>'+\r
+                                                       '</div>'+\r
+                                                       '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'+\r
+                                               '</div>')\r
+                                                       .insertBefore(this.element)\r
+                                                       .append(this.element);\r
+               this.id = this.element.data('slider-id')||options.id;\r
+               if (this.id) {\r
+                       this.picker[0].id = this.id;\r
+               }\r
+\r
+               if (typeof Modernizr !== 'undefined' && Modernizr.touch) {\r
+                       this.touchCapable = true;\r
+               }\r
+\r
+               var tooltip = this.element.data('slider-tooltip')||options.tooltip;\r
+\r
+               this.tooltip = this.picker.find('.tooltip');\r
+               this.tooltipInner = this.tooltip.find('div.tooltip-inner');\r
+\r
+               this.orientation = this.element.data('slider-orientation')||options.orientation;\r
+               switch(this.orientation) {\r
+                       case 'vertical':\r
+                               this.picker.addClass('slider-vertical');\r
+                               this.stylePos = 'top';\r
+                               this.mousePos = 'pageY';\r
+                               this.sizePos = 'offsetHeight';\r
+                               this.tooltip.addClass('right')[0].style.left = '100%';\r
+                               break;\r
+                       default:\r
+                               this.picker\r
+                                       .addClass('slider-horizontal')\r
+                                       .css('width', this.element.outerWidth());\r
+                               this.orientation = 'horizontal';\r
+                               this.stylePos = 'left';\r
+                               this.mousePos = 'pageX';\r
+                               this.sizePos = 'offsetWidth';\r
+                               this.tooltip.addClass('top')[0].style.top = -this.tooltip.outerHeight() - 14 + 'px';\r
+                               break;\r
+               }\r
+\r
+               this.min = this.element.data('slider-min')||options.min;\r
+               this.max = this.element.data('slider-max')||options.max;\r
+               this.step = this.element.data('slider-step')||options.step;\r
+               this.value = this.element.data('slider-value')||options.value;\r
+               if (this.value[1]) {\r
+                       this.range = true;\r
+               }\r
+\r
+               this.selection = this.element.data('slider-selection')||options.selection;\r
+               this.selectionEl = this.picker.find('.slider-selection');\r
+               if (this.selection === 'none') {\r
+                       this.selectionEl.addClass('hide');\r
+               }\r
+               this.selectionElStyle = this.selectionEl[0].style;\r
+\r
+\r
+               this.handle1 = this.picker.find('.slider-handle:first');\r
+               this.handle1Stype = this.handle1[0].style;\r
+               this.handle2 = this.picker.find('.slider-handle:last');\r
+               this.handle2Stype = this.handle2[0].style;\r
+\r
+               var handle = this.element.data('slider-handle')||options.handle;\r
+               switch(handle) {\r
+                       case 'round':\r
+                               this.handle1.addClass('round');\r
+                               this.handle2.addClass('round');\r
+                               break\r
+                       case 'triangle':\r
+                               this.handle1.addClass('triangle');\r
+                               this.handle2.addClass('triangle');\r
+                               break\r
+               }\r
+\r
+               if (this.range) {\r
+                       this.value[0] = Math.max(this.min, Math.min(this.max, this.value[0]));\r
+                       this.value[1] = Math.max(this.min, Math.min(this.max, this.value[1]));\r
+               } else {\r
+                       this.value = [ Math.max(this.min, Math.min(this.max, this.value))];\r
+                       this.handle2.addClass('hide');\r
+                       if (this.selection == 'after') {\r
+                               this.value[1] = this.max;\r
+                       } else {\r
+                               this.value[1] = this.min;\r
+                       }\r
+               }\r
+               this.diff = this.max - this.min;\r
+               this.percentage = [\r
+                       (this.value[0]-this.min)*100/this.diff,\r
+                       (this.value[1]-this.min)*100/this.diff,\r
+                       this.step*100/this.diff\r
+               ];\r
+\r
+               this.offset = this.picker.offset();\r
+               this.size = this.picker[0][this.sizePos];\r
+\r
+               this.formater = options.formater;\r
+\r
+               this.layout();\r
+\r
+               if (this.touchCapable) {\r
+                       // Touch: Bind touch events:\r
+                       this.picker.on({\r
+                               touchstart: $.proxy(this.mousedown, this)\r
+                       });\r
+               } else {\r
+                       this.picker.on({\r
+                               mousedown: $.proxy(this.mousedown, this)\r
+                       });\r
+               }\r
+\r
+               if (tooltip === 'show') {\r
+                       this.picker.on({\r
+                               mouseenter: $.proxy(this.showTooltip, this),\r
+                               mouseleave: $.proxy(this.hideTooltip, this)\r
+                       });\r
+               } else {\r
+                       this.tooltip.addClass('hide');\r
+               }\r
+       };\r
+\r
+       Slider.prototype = {\r
+               constructor: Slider,\r
+\r
+               over: false,\r
+               inDrag: false,\r
+               \r
+               showTooltip: function(){\r
+                       this.tooltip.addClass('in');\r
+                       //var left = Math.round(this.percent*this.width);\r
+                       //this.tooltip.css('left', left - this.tooltip.outerWidth()/2);\r
+                       this.over = true;\r
+               },\r
+               \r
+               hideTooltip: function(){\r
+                       if (this.inDrag === false) {\r
+                               this.tooltip.removeClass('in');\r
+                       }\r
+                       this.over = false;\r
+               },\r
+\r
+               layout: function(){\r
+                       this.handle1Stype[this.stylePos] = this.percentage[0]+'%';\r
+                       this.handle2Stype[this.stylePos] = this.percentage[1]+'%';\r
+                       if (this.orientation == 'vertical') {\r
+                               this.selectionElStyle.top = Math.min(this.percentage[0], this.percentage[1]) +'%';\r
+                               this.selectionElStyle.height = Math.abs(this.percentage[0] - this.percentage[1]) +'%';\r
+                       } else {\r
+                               this.selectionElStyle.left = Math.min(this.percentage[0], this.percentage[1]) +'%';\r
+                               this.selectionElStyle.width = Math.abs(this.percentage[0] - this.percentage[1]) +'%';\r
+                       }\r
+                       if (this.range) {\r
+                               this.tooltipInner.text(\r
+                                       this.formater(this.value[0]) + \r
+                                       ' : ' + \r
+                                       this.formater(this.value[1])\r
+                               );\r
+                               this.tooltip[0].style[this.stylePos] = this.size * (this.percentage[0] + (this.percentage[1] - this.percentage[0])/2)/100 - (this.orientation === 'vertical' ? this.tooltip.outerHeight()/2 : this.tooltip.outerWidth()/2) +'px';\r
+                       } else {\r
+                               this.tooltipInner.text(\r
+                                       this.formater(this.value[0])\r
+                               );\r
+                               this.tooltip[0].style[this.stylePos] = this.size * this.percentage[0]/100 - (this.orientation === 'vertical' ? this.tooltip.outerHeight()/2 : this.tooltip.outerWidth()/2) +'px';\r
+                       }\r
+               },\r
+\r
+               mousedown: function(ev) {\r
+\r
+                       // Touch: Get the original event:\r
+                       if (this.touchCapable && ev.type === 'touchstart') {\r
+                               ev = ev.originalEvent;\r
+                       }\r
+\r
+                       this.offset = this.picker.offset();\r
+                       this.size = this.picker[0][this.sizePos];\r
+\r
+                       var percentage = this.getPercentage(ev);\r
+\r
+                       if (this.range) {\r
+                               var diff1 = Math.abs(this.percentage[0] - percentage);\r
+                               var diff2 = Math.abs(this.percentage[1] - percentage);\r
+                               this.dragged = (diff1 < diff2) ? 0 : 1;\r
+                       } else {\r
+                               this.dragged = 0;\r
+                       }\r
+\r
+                       this.percentage[this.dragged] = percentage;\r
+                       this.layout();\r
+\r
+                       if (this.touchCapable) {\r
+                               // Touch: Bind touch events:\r
+                               $(document).on({\r
+                                       touchmove: $.proxy(this.mousemove, this),\r
+                                       touchend: $.proxy(this.mouseup, this)\r
+                               });\r
+                       } else {\r
+                               $(document).on({\r
+                                       mousemove: $.proxy(this.mousemove, this),\r
+                                       mouseup: $.proxy(this.mouseup, this)\r
+                               });\r
+                       }\r
+\r
+                       this.inDrag = true;\r
+                       var val = this.calculateValue();\r
+                       this.element.trigger({\r
+                                       type: 'slideStart',\r
+                                       value: val\r
+                               }).trigger({\r
+                                       type: 'slide',\r
+                                       value: val\r
+                               });\r
+                       return false;\r
+               },\r
+\r
+               mousemove: function(ev) {\r
+                       \r
+                       // Touch: Get the original event:\r
+                       if (this.touchCapable && ev.type === 'touchmove') {\r
+                               ev = ev.originalEvent;\r
+                       }\r
+\r
+                       var percentage = this.getPercentage(ev);\r
+                       if (this.range) {\r
+                               if (this.dragged === 0 && this.percentage[1] < percentage) {\r
+                                       this.percentage[0] = this.percentage[1];\r
+                                       this.dragged = 1;\r
+                               } else if (this.dragged === 1 && this.percentage[0] > percentage) {\r
+                                       this.percentage[1] = this.percentage[0];\r
+                                       this.dragged = 0;\r
+                               }\r
+                       }\r
+                       this.percentage[this.dragged] = percentage;\r
+                       this.layout();\r
+                       var val = this.calculateValue();\r
+                       this.element\r
+                               .trigger({\r
+                                       type: 'slide',\r
+                                       value: val\r
+                               })\r
+                               .data('value', val)\r
+                               .prop('value', val);\r
+                       return false;\r
+               },\r
+\r
+               mouseup: function(ev) {\r
+                       if (this.touchCapable) {\r
+                               // Touch: Bind touch events:\r
+                               $(document).off({\r
+                                       touchmove: this.mousemove,\r
+                                       touchend: this.mouseup\r
+                               });\r
+                       } else {\r
+                               $(document).off({\r
+                                       mousemove: this.mousemove,\r
+                                       mouseup: this.mouseup\r
+                               });\r
+                       }\r
+\r
+                       this.inDrag = false;\r
+                       if (this.over == false) {\r
+                               this.hideTooltip();\r
+                       }\r
+                       this.element;\r
+                       var val = this.calculateValue();\r
+                       this.element\r
+                               .trigger({\r
+                                       type: 'slideStop',\r
+                                       value: val\r
+                               })\r
+                               .data('value', val)\r
+                               .prop('value', val);\r
+                       return false;\r
+               },\r
+\r
+               calculateValue: function() {\r
+                       var val;\r
+                       if (this.range) {\r
+                               val = [\r
+                                       (this.min + Math.round((this.diff * this.percentage[0]/100)/this.step)*this.step),\r
+                                       (this.min + Math.round((this.diff * this.percentage[1]/100)/this.step)*this.step)\r
+                               ];\r
+                               this.value = val;\r
+                       } else {\r
+                               val = (this.min + Math.round((this.diff * this.percentage[0]/100)/this.step)*this.step);\r
+                               this.value = [val, this.value[1]];\r
+                       }\r
+                       return val;\r
+               },\r
+\r
+               getPercentage: function(ev) {\r
+                       if (this.touchCapable) {\r
+                               ev = ev.touches[0];\r
+                       }\r
+                       var percentage = (ev[this.mousePos] - this.offset[this.stylePos])*100/this.size;\r
+                       percentage = Math.round(percentage/this.percentage[2])*this.percentage[2];\r
+                       return Math.max(0, Math.min(100, percentage));\r
+               },\r
+\r
+               getValue: function() {\r
+                       if (this.range) {\r
+                               return this.value;\r
+                       }\r
+                       return this.value[0];\r
+               },\r
+\r
+               setValue: function(val) {\r
+                       this.value = val;\r
+\r
+                       if (this.range) {\r
+                               this.value[0] = Math.max(this.min, Math.min(this.max, this.value[0]));\r
+                               this.value[1] = Math.max(this.min, Math.min(this.max, this.value[1]));\r
+                       } else {\r
+                               this.value = [ Math.max(this.min, Math.min(this.max, this.value))];\r
+                               this.handle2.addClass('hide');\r
+                               if (this.selection == 'after') {\r
+                                       this.value[1] = this.max;\r
+                               } else {\r
+                                       this.value[1] = this.min;\r
+                               }\r
+                       }\r
+                       this.diff = this.max - this.min;\r
+                       this.percentage = [\r
+                               (this.value[0]-this.min)*100/this.diff,\r
+                               (this.value[1]-this.min)*100/this.diff,\r
+                               this.step*100/this.diff\r
+                       ];\r
+                       this.layout();\r
+               }\r
+       };\r
+\r
+       $.fn.slider = function ( option, val ) {\r
+               return this.each(function () {\r
+                       var $this = $(this),\r
+                               data = $this.data('slider'),\r
+                               options = typeof option === 'object' && option;\r
+                       if (!data)  {\r
+                               $this.data('slider', (data = new Slider(this, $.extend({}, $.fn.slider.defaults,options))));\r
+                       }\r
+                       if (typeof option == 'string') {\r
+                               data[option](val);\r
+                       }\r
+               })\r
+       };\r
+\r
+       $.fn.slider.defaults = {\r
+               min: 0,\r
+               max: 10,\r
+               step: 1,\r
+               orientation: 'horizontal',\r
+               value: 5,\r
+               selection: 'before',\r
+               tooltip: 'show',\r
+               handle: 'round',\r
+               formater: function(value) {\r
+                       return value;\r
+               }\r
+       };\r
+\r
+       $.fn.slider.Constructor = Slider;\r
+\r
+}( window.jQuery );
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/bootstrap-switch.js b/portal/static/unbound_reservation_static/js/bootstrap-switch.js
new file mode 100644 (file)
index 0000000..34fdd31
--- /dev/null
@@ -0,0 +1,532 @@
+/* ========================================================================
+ * bootstrap-switch - v3.0.1
+ * http://www.bootstrap-switch.org
+ * ========================================================================
+ * Copyright 2012-2013 Mattia Larentis
+ *
+ * ========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================================
+ */
+
+(function() {
+  var __slice = [].slice;
+
+  (function($, window) {
+    "use strict";
+    var BootstrapSwitch;
+    BootstrapSwitch = (function() {
+      function BootstrapSwitch(element, options) {
+        if (options == null) {
+          options = {};
+        }
+        this.$element = $(element);
+        this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, options, {
+          state: this.$element.is(":checked"),
+          size: this.$element.data("size"),
+          animate: this.$element.data("animate"),
+          disabled: this.$element.is(":disabled"),
+          readonly: this.$element.is("[readonly]"),
+          indeterminate: this.$element.data("indeterminate"),
+          onColor: this.$element.data("on-color"),
+          offColor: this.$element.data("off-color"),
+          onText: this.$element.data("on-text"),
+          offText: this.$element.data("off-text"),
+          labelText: this.$element.data("label-text"),
+          baseClass: this.$element.data("base-class"),
+          wrapperClass: this.$element.data("wrapper-class")
+        });
+        this.$wrapper = $("<div>", {
+          "class": (function(_this) {
+            return function() {
+              var classes;
+              classes = ["" + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass));
+              classes.push(_this.options.state ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
+              if (_this.options.size != null) {
+                classes.push("" + _this.options.baseClass + "-" + _this.options.size);
+              }
+              if (_this.options.animate) {
+                classes.push("" + _this.options.baseClass + "-animate");
+              }
+              if (_this.options.disabled) {
+                classes.push("" + _this.options.baseClass + "-disabled");
+              }
+              if (_this.options.readonly) {
+                classes.push("" + _this.options.baseClass + "-readonly");
+              }
+              if (_this.options.indeterminate) {
+                classes.push("" + _this.options.baseClass + "-indeterminate");
+              }
+              if (_this.$element.attr("id")) {
+                classes.push("" + _this.options.baseClass + "-id-" + (_this.$element.attr("id")));
+              }
+              return classes.join(" ");
+            };
+          })(this)()
+        });
+        this.$container = $("<div>", {
+          "class": "" + this.options.baseClass + "-container"
+        });
+        this.$on = $("<span>", {
+          html: this.options.onText,
+          "class": "" + this.options.baseClass + "-handle-on " + this.options.baseClass + "-" + this.options.onColor
+        });
+        this.$off = $("<span>", {
+          html: this.options.offText,
+          "class": "" + this.options.baseClass + "-handle-off " + this.options.baseClass + "-" + this.options.offColor
+        });
+        this.$label = $("<label>", {
+          "for": this.$element.attr("id"),
+          html: this.options.labelText,
+          "class": "" + this.options.baseClass + "-label"
+        });
+        if (this.options.indeterminate) {
+          this.$element.prop("indeterminate", true);
+        }
+        this.$element.on("init.bootstrapSwitch", (function(_this) {
+          return function() {
+            return _this.options.onInit.apply(element, arguments);
+          };
+        })(this));
+        this.$element.on("switchChange.bootstrapSwitch", (function(_this) {
+          return function() {
+            return _this.options.onSwitchChange.apply(element, arguments);
+          };
+        })(this));
+        this.$container = this.$element.wrap(this.$container).parent();
+        this.$wrapper = this.$container.wrap(this.$wrapper).parent();
+        this.$element.before(this.$on).before(this.$label).before(this.$off).trigger("init.bootstrapSwitch");
+        this._elementHandlers();
+        this._handleHandlers();
+        this._labelHandlers();
+        this._formHandler();
+      }
+
+      BootstrapSwitch.prototype._constructor = BootstrapSwitch;
+
+      BootstrapSwitch.prototype.state = function(value, skip) {
+        if (typeof value === "undefined") {
+          return this.options.state;
+        }
+        if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
+          return this.$element;
+        }
+        value = !!value;
+        this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.toggleState = function(skip) {
+        if (this.options.disabled || this.options.readonly || this.options.indeterminate) {
+          return this.$element;
+        }
+        return this.$element.prop("checked", !this.options.state).trigger("change.bootstrapSwitch", skip);
+      };
+
+      BootstrapSwitch.prototype.size = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.size;
+        }
+        if (this.options.size != null) {
+          this.$wrapper.removeClass("" + this.options.baseClass + "-" + this.options.size);
+        }
+        if (value) {
+          this.$wrapper.addClass("" + this.options.baseClass + "-" + value);
+        }
+        this.options.size = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.animate = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.animate;
+        }
+        value = !!value;
+        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-animate");
+        this.options.animate = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.disabled = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.disabled;
+        }
+        value = !!value;
+        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-disabled");
+        this.$element.prop("disabled", value);
+        this.options.disabled = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.toggleDisabled = function() {
+        this.$element.prop("disabled", !this.options.disabled);
+        this.$wrapper.toggleClass("" + this.options.baseClass + "-disabled");
+        this.options.disabled = !this.options.disabled;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.readonly = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.readonly;
+        }
+        value = !!value;
+        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-readonly");
+        this.$element.prop("readonly", value);
+        this.options.readonly = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.toggleReadonly = function() {
+        this.$element.prop("readonly", !this.options.readonly);
+        this.$wrapper.toggleClass("" + this.options.baseClass + "-readonly");
+        this.options.readonly = !this.options.readonly;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.indeterminate = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.indeterminate;
+        }
+        value = !!value;
+        this.$wrapper[value ? "addClass" : "removeClass"]("" + this.options.baseClass + "-indeterminate");
+        this.$element.prop("indeterminate", value);
+        this.options.indeterminate = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.toggleIndeterminate = function() {
+        this.$element.prop("indeterminate", !this.options.indeterminate);
+        this.$wrapper.toggleClass("" + this.options.baseClass + "-indeterminate");
+        this.options.indeterminate = !this.options.indeterminate;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.onColor = function(value) {
+        var color;
+        color = this.options.onColor;
+        if (typeof value === "undefined") {
+          return color;
+        }
+        if (color != null) {
+          this.$on.removeClass("" + this.options.baseClass + "-" + color);
+        }
+        this.$on.addClass("" + this.options.baseClass + "-" + value);
+        this.options.onColor = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.offColor = function(value) {
+        var color;
+        color = this.options.offColor;
+        if (typeof value === "undefined") {
+          return color;
+        }
+        if (color != null) {
+          this.$off.removeClass("" + this.options.baseClass + "-" + color);
+        }
+        this.$off.addClass("" + this.options.baseClass + "-" + value);
+        this.options.offColor = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.onText = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.onText;
+        }
+        this.$on.html(value);
+        this.options.onText = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.offText = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.offText;
+        }
+        this.$off.html(value);
+        this.options.offText = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.labelText = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.labelText;
+        }
+        this.$label.html(value);
+        this.options.labelText = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.baseClass = function(value) {
+        return this.options.baseClass;
+      };
+
+      BootstrapSwitch.prototype.wrapperClass = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.wrapperClass;
+        }
+        if (!value) {
+          value = $.fn.bootstrapSwitch.defaults.wrapperClass;
+        }
+        this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" "));
+        this.$wrapper.addClass(this._getClasses(value).join(" "));
+        this.options.wrapperClass = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.onInit = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.onInit;
+        }
+        if (!value) {
+          value = $.fn.bootstrapSwitch.defaults.onInit;
+        }
+        this.options.onInit = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.onSwitchChange = function(value) {
+        if (typeof value === "undefined") {
+          return this.options.onSwitchChange;
+        }
+        if (!value) {
+          value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
+        }
+        this.options.onSwitchChange = value;
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype.destroy = function() {
+        var $form;
+        $form = this.$element.closest("form");
+        if ($form.length) {
+          $form.off("reset.bootstrapSwitch").removeData("bootstrap-switch");
+        }
+        this.$container.children().not(this.$element).remove();
+        this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch");
+        return this.$element;
+      };
+
+      BootstrapSwitch.prototype._elementHandlers = function() {
+        return this.$element.on({
+          "change.bootstrapSwitch": (function(_this) {
+            return function(e, skip) {
+              var checked;
+              e.preventDefault();
+              e.stopPropagation();
+              e.stopImmediatePropagation();
+              checked = _this.$element.is(":checked");
+              if (checked === _this.options.state) {
+                return;
+              }
+              _this.options.state = checked;
+              _this.$wrapper.removeClass(checked ? "" + _this.options.baseClass + "-off" : "" + _this.options.baseClass + "-on").addClass(checked ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
+              if (!skip) {
+                if (_this.$element.is(":radio")) {
+                  $("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
+                }
+                return _this.$element.trigger("switchChange.bootstrapSwitch", [checked]);
+              }
+            };
+          })(this),
+          "focus.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              e.preventDefault();
+              e.stopPropagation();
+              e.stopImmediatePropagation();
+              return _this.$wrapper.addClass("" + _this.options.baseClass + "-focused");
+            };
+          })(this),
+          "blur.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              e.preventDefault();
+              e.stopPropagation();
+              e.stopImmediatePropagation();
+              return _this.$wrapper.removeClass("" + _this.options.baseClass + "-focused");
+            };
+          })(this),
+          "keydown.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              if (!e.which || _this.options.disabled || _this.options.readonly || _this.options.indeterminate) {
+                return;
+              }
+              switch (e.which) {
+                case 32:
+                  e.preventDefault();
+                  e.stopPropagation();
+                  e.stopImmediatePropagation();
+                  return _this.toggleState();
+                case 37:
+                  e.preventDefault();
+                  e.stopPropagation();
+                  e.stopImmediatePropagation();
+                  return _this.state(false);
+                case 39:
+                  e.preventDefault();
+                  e.stopPropagation();
+                  e.stopImmediatePropagation();
+                  return _this.state(true);
+              }
+            };
+          })(this)
+        });
+      };
+
+      BootstrapSwitch.prototype._handleHandlers = function() {
+        this.$on.on("click.bootstrapSwitch", (function(_this) {
+          return function(e) {
+            _this.state(false);
+            return _this.$element.trigger("focus.bootstrapSwitch");
+          };
+        })(this));
+        return this.$off.on("click.bootstrapSwitch", (function(_this) {
+          return function(e) {
+            _this.state(true);
+            return _this.$element.trigger("focus.bootstrapSwitch");
+          };
+        })(this));
+      };
+
+      BootstrapSwitch.prototype._labelHandlers = function() {
+        return this.$label.on({
+          "mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              var left, pageX, percent, right;
+              if (!_this.drag) {
+                return;
+              }
+              e.preventDefault();
+              pageX = e.pageX || e.originalEvent.touches[0].pageX;
+              percent = ((pageX - _this.$wrapper.offset().left) / _this.$wrapper.width()) * 100;
+              left = 25;
+              right = 75;
+              if (percent < left) {
+                percent = left;
+              } else if (percent > right) {
+                percent = right;
+              }
+              _this.$container.css("margin-left", "" + (percent - right) + "%");
+              return _this.$element.trigger("focus.bootstrapSwitch");
+            };
+          })(this),
+          "mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              if (_this.drag || _this.options.disabled || _this.options.readonly || _this.options.indeterminate) {
+                return;
+              }
+              e.preventDefault();
+              _this.drag = true;
+              if (_this.options.animate) {
+                _this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
+              }
+              return _this.$element.trigger("focus.bootstrapSwitch");
+            };
+          })(this),
+          "mouseup.bootstrapSwitch touchend.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              if (!_this.drag) {
+                return;
+              }
+              e.preventDefault();
+              _this.drag = false;
+              _this.$element.prop("checked", parseInt(_this.$container.css("margin-left"), 10) > -(_this.$container.width() / 6)).trigger("change.bootstrapSwitch");
+              _this.$container.css("margin-left", "");
+              if (_this.options.animate) {
+                return _this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
+              }
+            };
+          })(this),
+          "mouseleave.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              return _this.$label.trigger("mouseup.bootstrapSwitch");
+            };
+          })(this),
+          "click.bootstrapSwitch": (function(_this) {
+            return function(e) {
+              _this.toggleState();
+              return _this.$element.trigger("focus.bootstrapSwitch");
+            };
+          })(this)
+        });
+      };
+
+      BootstrapSwitch.prototype._formHandler = function() {
+        var $form;
+        $form = this.$element.closest("form");
+        if ($form.data("bootstrap-switch")) {
+          return;
+        }
+        return $form.on("reset.bootstrapSwitch", function() {
+          return window.setTimeout(function() {
+            return $form.find("input").filter(function() {
+              return $(this).data("bootstrap-switch");
+            }).each(function() {
+              return $(this).bootstrapSwitch("state", this.checked);
+            });
+          }, 1);
+        }).data("bootstrap-switch", true);
+      };
+
+      BootstrapSwitch.prototype._getClasses = function(classes) {
+        var c, cls, _i, _len;
+        if (!$.isArray(classes)) {
+          return ["" + this.options.baseClass + "-" + classes];
+        }
+        cls = [];
+        for (_i = 0, _len = classes.length; _i < _len; _i++) {
+          c = classes[_i];
+          cls.push("" + this.options.baseClass + "-" + c);
+        }
+        return cls;
+      };
+
+      return BootstrapSwitch;
+
+    })();
+    $.fn.bootstrapSwitch = function() {
+      var args, option, ret;
+      option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+      ret = this;
+      this.each(function() {
+        var $this, data;
+        $this = $(this);
+        data = $this.data("bootstrap-switch");
+        if (!data) {
+          $this.data("bootstrap-switch", data = new BootstrapSwitch(this, option));
+        }
+        if (typeof option === "string") {
+          return ret = data[option].apply(data, args);
+        }
+      });
+      return ret;
+    };
+    $.fn.bootstrapSwitch.Constructor = BootstrapSwitch;
+    return $.fn.bootstrapSwitch.defaults = {
+      state: true,
+      size: null,
+      animate: true,
+      disabled: false,
+      readonly: false,
+      indeterminate: false,
+      onColor: "primary",
+      offColor: "default",
+      onText: "ON",
+      offText: "OFF",
+      labelText: "&nbsp;",
+      baseClass: "bootstrap-switch",
+      wrapperClass: "wrapper",
+      onInit: function() {},
+      onSwitchChange: function() {}
+    };
+  })(window.jQuery, window);
+
+}).call(this);
diff --git a/portal/static/unbound_reservation_static/js/bootstrap-switch.min.js b/portal/static/unbound_reservation_static/js/bootstrap-switch.min.js
new file mode 100644 (file)
index 0000000..aaa07c4
--- /dev/null
@@ -0,0 +1,22 @@
+/* ========================================================================
+ * bootstrap-switch - v3.0.1
+ * http://www.bootstrap-switch.org
+ * ========================================================================
+ * Copyright 2012-2013 Mattia Larentis
+ *
+ * ========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================================
+ */
+
+(function(){var t=[].slice;!function(e,s){"use strict";var o;return o=function(){function t(t,s){null==s&&(s={}),this.$element=e(t),this.options=e.extend({},e.fn.bootstrapSwitch.defaults,s,{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class")}),this.$wrapper=e("<div>",{"class":function(t){return function(){var e;return e=[""+t.options.baseClass].concat(t._getClasses(t.options.wrapperClass)),e.push(t.options.state?""+t.options.baseClass+"-on":""+t.options.baseClass+"-off"),null!=t.options.size&&e.push(""+t.options.baseClass+"-"+t.options.size),t.options.animate&&e.push(""+t.options.baseClass+"-animate"),t.options.disabled&&e.push(""+t.options.baseClass+"-disabled"),t.options.readonly&&e.push(""+t.options.baseClass+"-readonly"),t.options.indeterminate&&e.push(""+t.options.baseClass+"-indeterminate"),t.$element.attr("id")&&e.push(""+t.options.baseClass+"-id-"+t.$element.attr("id")),e.join(" ")}}(this)()}),this.$container=e("<div>",{"class":""+this.options.baseClass+"-container"}),this.$on=e("<span>",{html:this.options.onText,"class":""+this.options.baseClass+"-handle-on "+this.options.baseClass+"-"+this.options.onColor}),this.$off=e("<span>",{html:this.options.offText,"class":""+this.options.baseClass+"-handle-off "+this.options.baseClass+"-"+this.options.offColor}),this.$label=e("<label>",{"for":this.$element.attr("id"),html:this.options.labelText,"class":""+this.options.baseClass+"-label"}),this.options.indeterminate&&this.$element.prop("indeterminate",!0),this.$element.on("init.bootstrapSwitch",function(e){return function(){return e.options.onInit.apply(t,arguments)}}(this)),this.$element.on("switchChange.bootstrapSwitch",function(e){return function(){return e.options.onSwitchChange.apply(t,arguments)}}(this)),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.$on).before(this.$label).before(this.$off).trigger("init.bootstrapSwitch"),this._elementHandlers(),this._handleHandlers(),this._labelHandlers(),this._formHandler()}return t.prototype._constructor=t,t.prototype.state=function(t,e){return"undefined"==typeof t?this.options.state:this.options.disabled||this.options.readonly||this.options.indeterminate?this.$element:(t=!!t,this.$element.prop("checked",t).trigger("change.bootstrapSwitch",e),this.$element)},t.prototype.toggleState=function(t){return this.options.disabled||this.options.readonly||this.options.indeterminate?this.$element:this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",t)},t.prototype.size=function(t){return"undefined"==typeof t?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(""+this.options.baseClass+"-"+this.options.size),t&&this.$wrapper.addClass(""+this.options.baseClass+"-"+t),this.options.size=t,this.$element)},t.prototype.animate=function(t){return"undefined"==typeof t?this.options.animate:(t=!!t,this.$wrapper[t?"addClass":"removeClass"](""+this.options.baseClass+"-animate"),this.options.animate=t,this.$element)},t.prototype.disabled=function(t){return"undefined"==typeof t?this.options.disabled:(t=!!t,this.$wrapper[t?"addClass":"removeClass"](""+this.options.baseClass+"-disabled"),this.$element.prop("disabled",t),this.options.disabled=t,this.$element)},t.prototype.toggleDisabled=function(){return this.$element.prop("disabled",!this.options.disabled),this.$wrapper.toggleClass(""+this.options.baseClass+"-disabled"),this.options.disabled=!this.options.disabled,this.$element},t.prototype.readonly=function(t){return"undefined"==typeof t?this.options.readonly:(t=!!t,this.$wrapper[t?"addClass":"removeClass"](""+this.options.baseClass+"-readonly"),this.$element.prop("readonly",t),this.options.readonly=t,this.$element)},t.prototype.toggleReadonly=function(){return this.$element.prop("readonly",!this.options.readonly),this.$wrapper.toggleClass(""+this.options.baseClass+"-readonly"),this.options.readonly=!this.options.readonly,this.$element},t.prototype.indeterminate=function(t){return"undefined"==typeof t?this.options.indeterminate:(t=!!t,this.$wrapper[t?"addClass":"removeClass"](""+this.options.baseClass+"-indeterminate"),this.$element.prop("indeterminate",t),this.options.indeterminate=t,this.$element)},t.prototype.toggleIndeterminate=function(){return this.$element.prop("indeterminate",!this.options.indeterminate),this.$wrapper.toggleClass(""+this.options.baseClass+"-indeterminate"),this.options.indeterminate=!this.options.indeterminate,this.$element},t.prototype.onColor=function(t){var e;return e=this.options.onColor,"undefined"==typeof t?e:(null!=e&&this.$on.removeClass(""+this.options.baseClass+"-"+e),this.$on.addClass(""+this.options.baseClass+"-"+t),this.options.onColor=t,this.$element)},t.prototype.offColor=function(t){var e;return e=this.options.offColor,"undefined"==typeof t?e:(null!=e&&this.$off.removeClass(""+this.options.baseClass+"-"+e),this.$off.addClass(""+this.options.baseClass+"-"+t),this.options.offColor=t,this.$element)},t.prototype.onText=function(t){return"undefined"==typeof t?this.options.onText:(this.$on.html(t),this.options.onText=t,this.$element)},t.prototype.offText=function(t){return"undefined"==typeof t?this.options.offText:(this.$off.html(t),this.options.offText=t,this.$element)},t.prototype.labelText=function(t){return"undefined"==typeof t?this.options.labelText:(this.$label.html(t),this.options.labelText=t,this.$element)},t.prototype.baseClass=function(){return this.options.baseClass},t.prototype.wrapperClass=function(t){return"undefined"==typeof t?this.options.wrapperClass:(t||(t=e.fn.bootstrapSwitch.defaults.wrapperClass),this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" ")),this.$wrapper.addClass(this._getClasses(t).join(" ")),this.options.wrapperClass=t,this.$element)},t.prototype.onInit=function(t){return"undefined"==typeof t?this.options.onInit:(t||(t=e.fn.bootstrapSwitch.defaults.onInit),this.options.onInit=t,this.$element)},t.prototype.onSwitchChange=function(t){return"undefined"==typeof t?this.options.onSwitchChange:(t||(t=e.fn.bootstrapSwitch.defaults.onSwitchChange),this.options.onSwitchChange=t,this.$element)},t.prototype.destroy=function(){var t;return t=this.$element.closest("form"),t.length&&t.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element},t.prototype._elementHandlers=function(){return this.$element.on({"change.bootstrapSwitch":function(t){return function(s,o){var n;return s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),n=t.$element.is(":checked"),n!==t.options.state?(t.options.state=n,t.$wrapper.removeClass(n?""+t.options.baseClass+"-off":""+t.options.baseClass+"-on").addClass(n?""+t.options.baseClass+"-on":""+t.options.baseClass+"-off"),o?void 0:(t.$element.is(":radio")&&e("[name='"+t.$element.attr("name")+"']").not(t.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),t.$element.trigger("switchChange.bootstrapSwitch",[n]))):void 0}}(this),"focus.bootstrapSwitch":function(t){return function(e){return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.$wrapper.addClass(""+t.options.baseClass+"-focused")}}(this),"blur.bootstrapSwitch":function(t){return function(e){return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.$wrapper.removeClass(""+t.options.baseClass+"-focused")}}(this),"keydown.bootstrapSwitch":function(t){return function(e){if(e.which&&!t.options.disabled&&!t.options.readonly&&!t.options.indeterminate)switch(e.which){case 32:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.toggleState();case 37:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.state(!1);case 39:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.state(!0)}}}(this)})},t.prototype._handleHandlers=function(){return this.$on.on("click.bootstrapSwitch",function(t){return function(){return t.state(!1),t.$element.trigger("focus.bootstrapSwitch")}}(this)),this.$off.on("click.bootstrapSwitch",function(t){return function(){return t.state(!0),t.$element.trigger("focus.bootstrapSwitch")}}(this))},t.prototype._labelHandlers=function(){return this.$label.on({"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function(t){return function(e){var s,o,n,i;if(t.drag)return e.preventDefault(),o=e.pageX||e.originalEvent.touches[0].pageX,n=(o-t.$wrapper.offset().left)/t.$wrapper.width()*100,s=25,i=75,s>n?n=s:n>i&&(n=i),t.$container.css("margin-left",""+(n-i)+"%"),t.$element.trigger("focus.bootstrapSwitch")}}(this),"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function(t){return function(e){return t.drag||t.options.disabled||t.options.readonly||t.options.indeterminate?void 0:(e.preventDefault(),t.drag=!0,t.options.animate&&t.$wrapper.removeClass(""+t.options.baseClass+"-animate"),t.$element.trigger("focus.bootstrapSwitch"))}}(this),"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function(t){return function(e){return t.drag?(e.preventDefault(),t.drag=!1,t.$element.prop("checked",parseInt(t.$container.css("margin-left"),10)>-(t.$container.width()/6)).trigger("change.bootstrapSwitch"),t.$container.css("margin-left",""),t.options.animate?t.$wrapper.addClass(""+t.options.baseClass+"-animate"):void 0):void 0}}(this),"mouseleave.bootstrapSwitch":function(t){return function(){return t.$label.trigger("mouseup.bootstrapSwitch")}}(this),"click.bootstrapSwitch":function(t){return function(){return t.toggleState(),t.$element.trigger("focus.bootstrapSwitch")}}(this)})},t.prototype._formHandler=function(){var t;return t=this.$element.closest("form"),t.data("bootstrap-switch")?void 0:t.on("reset.bootstrapSwitch",function(){return s.setTimeout(function(){return t.find("input").filter(function(){return e(this).data("bootstrap-switch")}).each(function(){return e(this).bootstrapSwitch("state",this.checked)})},1)}).data("bootstrap-switch",!0)},t.prototype._getClasses=function(t){var s,o,n,i;if(!e.isArray(t))return[""+this.options.baseClass+"-"+t];for(o=[],n=0,i=t.length;i>n;n++)s=t[n],o.push(""+this.options.baseClass+"-"+s);return o},t}(),e.fn.bootstrapSwitch=function(){var s,n,i;return n=arguments[0],s=2<=arguments.length?t.call(arguments,1):[],i=this,this.each(function(){var t,a;return t=e(this),a=t.data("bootstrap-switch"),a||t.data("bootstrap-switch",a=new o(this,n)),"string"==typeof n?i=a[n].apply(a,s):void 0}),i},e.fn.bootstrapSwitch.Constructor=o,e.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:"&nbsp;",baseClass:"bootstrap-switch",wrapperClass:"wrapper",onInit:function(){},onSwitchChange:function(){}}}(window.jQuery,window)}).call(this);
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/bootstrap.min.js b/portal/static/unbound_reservation_static/js/bootstrap.min.js
new file mode 100644 (file)
index 0000000..b04a0e8
--- /dev/null
@@ -0,0 +1,6 @@
+/*!
+ * Bootstrap v3.1.1 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown",h),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=" li:not(.divider):visible a",i=f.find("[role=menu]"+h+", [role=listbox]"+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu], [role=listbox]",f.prototype.keydown)}(jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());c.is("a")&&b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this,d=this.tip();this.setContent(),this.options.animation&&d.addClass("fade");var e="function"==typeof this.options.placement?this.options.placement.call(this,d[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,g=f.test(e);g&&(e=e.replace(f,"")||"top"),d.detach().css({top:0,left:0,display:"block"}).addClass(e),this.options.container?d.appendTo(this.options.container):d.insertAfter(this.$element);var h=this.getPosition(),i=d[0].offsetWidth,j=d[0].offsetHeight;if(g){var k=this.$element.parent(),l=e,m=document.documentElement.scrollTop||document.body.scrollTop,n="body"==this.options.container?window.innerWidth:k.outerWidth(),o="body"==this.options.container?window.innerHeight:k.outerHeight(),p="body"==this.options.container?0:k.offset().left;e="bottom"==e&&h.top+h.height+j-m>o?"top":"top"==e&&h.top-m-j<0?"bottom":"right"==e&&h.right+i>n?"left":"left"==e&&h.left-i<p?"right":e,d.removeClass(l).addClass(e)}var q=this.getCalculatedOffset(e,h,i,j);this.applyPlacement(q,e),this.hoverState=null;var r=function(){c.$element.trigger("shown.bs."+c.type)};a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,r).emulateTransitionEnd(150):r()}},b.prototype.applyPlacement=function(b,c){var d,e=this.tip(),f=e[0].offsetWidth,g=e[0].offsetHeight,h=parseInt(e.css("margin-top"),10),i=parseInt(e.css("margin-left"),10);isNaN(h)&&(h=0),isNaN(i)&&(i=0),b.top=b.top+h,b.left=b.left+i,a.offset.setOffset(e[0],a.extend({using:function(a){e.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),e.addClass("in");var j=e[0].offsetWidth,k=e[0].offsetHeight;if("top"==c&&k!=g&&(d=!0,b.top=b.top+g-k),/bottom|top/.test(c)){var l=0;b.left<0&&(l=-2*b.left,b.left=0,e.offset(b),j=e[0].offsetWidth,k=e[0].offsetHeight),this.replaceArrow(l-f+j,j,"left")}else this.replaceArrow(k-g,k,"top");d&&e.offset(b)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery);
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/contextmenu/bower.json b/portal/static/unbound_reservation_static/js/contextmenu/bower.json
new file mode 100644 (file)
index 0000000..3ca53d0
--- /dev/null
@@ -0,0 +1,48 @@
+{
+    "name": "contextMenu",
+    "description": "contextMenu.js is a plugin to create windows like context menu with keyboard interaction, different type of inputs ,trigger events and much more.",
+    "main": "contextMenu.js",
+    "author": {
+        "name": "Sudhanshu Yadav",
+        "email": "sudhanshuyadav2@gmail.com"
+    },
+    "version": "1.3.0",
+    "repository": {
+        "type": "git",
+        "url": "https://github.com/s-yadav/contextMenu.js"
+    },
+    "ignore": [
+        "contextMenu.js.jquery.json"
+    ],
+    "licenses": [
+        {
+            "type": "MIT",
+            "url": "https://github.com/s-yadav/contextMenu.js/blob/master/MIT-LICENSE.txt"
+        },
+        {
+            "type": "GPLv2 or Later",
+            "url": "http://opensource.org/licenses/GPL-2.0"
+        }
+    ],
+    "bugs": {
+        "url": "https://github.com/s-yadav/contextMenu.js/issues"
+    },
+    "dependencies": {
+        "jquery": ">=1.6"
+    },
+    "keywords": [
+        "context-menu",
+        "contextmenu",
+        "right-click-menu",
+        "context",
+        "submenu",
+        "jquery",
+        "popup",
+        "menu",
+        "tooltip"
+    ],
+    "readmeFilename": "README.md",
+    "homepage": "http://ignitersworld.com/lab/contextMenu.html",
+    "demo": "http://ignitersworld.com/lab/contextMenu.html#demo",
+    "docs": "http://ignitersworld.com/lab/contextMenu.html#documentation"
+}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.css b/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.css
new file mode 100644 (file)
index 0000000..e15c50a
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *contextMenu.js v 1.1.2
+ *Author: Sudhanshu Yadav
+ *s-yadav.github.com
+ *Copyright (c) 2013 Sudhanshu Yadav.
+ *Dual licensed under the MIT and GPL licenses
+ */
+/*Context menu css */
+.iw-contextMenu {
+       -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
+       -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
+       box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
+       border:1px solid #E6E6E6;
+       display:none;
+       z-index:1000;
+       overflow:auto;
+}
+.iw-cm-menu{
+       background:#F4F4F4;
+       color:#333;
+       margin:0px;
+       padding:0px;
+       }
+
+.iw-cm-menu li {
+       list-style:none;
+       padding:3px;
+       padding-left:30px;
+       padding-right:20px;
+       border-bottom:1px solid #CCC;
+       cursor:pointer;
+       position:relative;
+}
+.iw-mOverlay{
+       position:absolute; width:100%; height:100%; top:0px; left:0px;
+       background:#FFF;
+       opacity:.5;
+       }
+.iw-contextMenu li.iw-mDisable {
+       opacity:.3;
+}
+.iw-mSelected {
+       background-color:rgb(0,51,102);
+       color:#F2F2F2;
+}
+.iw-cm-arrow-right {
+       width: 0; 
+       height: 0; 
+       border-top: 5px solid transparent;
+       border-bottom: 5px solid transparent; 
+       border-left:5px solid #333333; 
+       position:absolute;
+       right:3px;
+       top:50%;
+       margin-top:-3px;
+}
+
+.iw-mIcon{
+       width:20px;
+       height:20px;
+       left:0px;
+       top:3px;
+       position:absolute;
+       }
+/*context menu css end */
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.js b/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.js
new file mode 100644 (file)
index 0000000..0ccb3c1
--- /dev/null
@@ -0,0 +1,762 @@
+/*
+ *contextMenu.js v 1.3.0
+ *Author: Sudhanshu Yadav
+ *s-yadav.github.com
+ *Copyright (c) 2013 Sudhanshu Yadav.
+ *Dual licensed under the MIT and GPL licenses
+ */
+;(function ($, window, document, undefined) {
+    "use strict";
+
+    $.fn.contextMenu = function (method, selector, option) {
+
+        //parameter fix
+        if (!methods[method]) {
+            option = selector;
+            selector = method;
+            method = 'popup';
+        }
+
+
+        //need to check for array object
+        else if (selector) {
+            if (!((selector instanceof Array) || (typeof selector === 'string') || (selector.nodeType) || (selector.jquery))) {
+                option = selector;
+                selector = null;
+            }
+        }
+
+        if ((selector instanceof Array) && (method != 'update')) {
+            method = 'menu';
+        }
+
+        var myoptions = option;
+        if (method != 'update') {
+            option = iMethods.optionOtimizer(method, option);
+            myoptions = $.extend({}, $.fn.contextMenu.defaults, option);
+            if (!myoptions.baseTrigger) {
+                myoptions.baseTrigger = this;
+            }
+        }
+        methods[method].call(this, selector, myoptions);
+        return this;
+    };
+    $.fn.contextMenu.defaults = {
+        triggerOn: 'click', //avaliable options are all event related mouse plus enter option
+        displayAround: 'cursor', // cursor or trigger
+        mouseClick: 'left',
+        verAdjust: 0,
+        horAdjust: 0,
+        top: 'auto',
+        left: 'auto',
+        closeOther: true, //to close other already opened context menu
+        containment: window,
+        winEventClose: true,
+        sizeStyle: 'auto', //allowed values are auto and content (popup size will be according content size)
+        position: 'auto', //allowed values are top, left, bottom and right
+        closeOnClick: true, //close context menu on click/ trigger of any item in menu
+
+        //callback
+        onOpen: function (data, event) {},
+        afterOpen: function (data, event) {},
+        onClose: function (data, event) {}
+    };
+
+    var methods = {
+        menu: function (selector, option) {
+            var trigger = $(this);
+            selector = iMethods.createMenuList(trigger, selector, option);
+            iMethods.contextMenuBind.call(this, selector, option, 'menu');
+        },
+        popup: function (selector, option) {
+            $(selector).addClass('iw-contextMenu');
+            iMethods.contextMenuBind.call(this, selector, option, 'popup');
+        },
+        update: function (selector, option) {
+            var self = this;
+            this.each(function () {
+                var trgr = $(this),
+                    menuData = trgr.data('iw-menuData');
+                //refresh if any new element is added
+                if (!menuData) {
+                    self.contextMenu('refresh');
+                    menuData = trgr.data('iw-menuData');
+                }
+
+                var menu = menuData.menu;
+                if (typeof selector === 'object') {
+
+                    for (var i = 0; i < selector.length; i++) {
+                        var name = selector[i].name,
+                            disable = selector[i].disable,
+                            fun = selector[i].fun,
+                            img = selector[i].img,
+                            title = selector[i].title,
+                            className = selector[i].className,
+                            elm = menu.children('li').filter(function () {
+                                return $(this).contents().filter(function () {
+                                    return this.nodeType == 3;
+                                }).text() == name;
+                            }),
+                            subMenu = selector[i].subMenu;
+
+                        //toggle disable if provided on update method
+                        disable != undefined && (disable ? elm.addClass('iw-mDisable') : elm.removeClass('iw-mDisable'));
+                        
+                        //bind new function if provided
+                        fun && elm.unbind('click.contextMenu').bind('click.contextMenu',fun);
+                        
+                        //update title
+                        title != undefined && elm.attr('title',title);
+                        
+                        //update class name
+                        className!= undefined && elm.attr('class',className);
+                        
+                        //update image
+                        if(img){
+                            var imgIcon = elm.find('.iw-mIcon');
+                            if(imgIcon.length){
+                                imgIcon[0].src = img;
+                            }
+                            else{
+                                elm.prepend('<img src="' + img + '" align="absmiddle" class="iw-mIcon" />');
+                            }
+                        }
+                        
+                        //to change submenus
+                        if (subMenu) {
+                            elm.contextMenu('update', subMenu);
+                        }
+                    }
+
+                }
+
+                iMethods.onOff(menu);
+                menuData.option = $.extend({}, menuData.option, option);
+                trgr.data('iw-menuData', menuData);
+
+                //bind event again if trigger option has changed.
+                var eventType = menuData.option.triggerOn;
+                if (option) {
+                    if (eventType != option.triggerOn) {
+                        trgr.unbind('.contextMenu');
+                        //to bind event
+                        trgr.bind(eventType + '.contextMenu', iMethods.eventHandler);
+                    }
+                }
+            });
+        },
+        refresh: function () {
+            var menuData = this.filter(function () {
+                    return !!$(this).data('iw-menuData');
+                }).data('iw-menuData'),
+                newElm = this.filter(function () {
+                    return !$(this).data('iw-menuData');
+                });
+            //to change basetrigger on refresh  
+            menuData.option.baseTrigger = this;
+            iMethods.contextMenuBind.call(newElm, menuData.menuSelector, menuData.option);
+        },
+        open: function(sel,data){
+               data = data || {};
+               var e = data.event || new Event('click');
+               if(data.top) e.clientY = data.top;
+               if(data.left) e.clientX = data.left;
+            this.each(function(){
+                iMethods.eventHandler.call(this,e);
+            });
+        },
+        //to force context menu to close
+        close: function () {
+            var menuData = this.data('iw-menuData');
+            if (menuData) {
+                iMethods.closeContextMenu(menuData.option, this, menuData.menu, null);
+            }
+        },
+        //to get value of a key
+        value: function (key) {
+            var menuData = this.data('iw-menuData');
+            if (menuData[key]) {
+                return menuData[key];
+            } else if (menuData.option) {
+                return menuData.option[key];
+            }
+            return null;
+        },
+        destroy: function () {
+            this.each(function () {
+                var trgr = $(this),
+                    menuId = trgr.data('iw-menuData').menuId,
+                    menu = $('.iw-contextMenu[menuId=' + menuId + ']'),
+                    menuData = menu.data('iw-menuData');
+
+                //Handle the situation of dynamically added element.
+                if (!menuData) return;
+
+
+                if (menuData.noTrigger == 1) {
+                    if (menu.hasClass('iw-created')) {
+                        menu.remove();
+                    } else {
+                        menu.removeClass('iw-contextMenu ' + menuId)
+                            .removeAttr('menuId').removeData('iw-menuData');
+                        //to destroy submenus
+                        menu.find('li.iw-mTrigger').contextMenu('destroy');
+                    }
+                } else {
+                    menuData.noTrigger--;
+                    menu.data('iw-menuData', menuData);
+                }
+                trgr.unbind('.contextMenu').removeClass('iw-mTrigger').removeData('iw-menuData');
+            });
+        }
+    };
+    var iMethods = {
+        contextMenuBind: function (selector, option, method) {
+            var trigger = this,
+                menu = $(selector),
+                menuData = menu.data('iw-menuData');
+
+            //fallback
+            if (menu.length == 0) {
+                menu = trigger.find(selector);
+                if (menu.length == 0) {
+                    return;
+                }
+            }
+
+            if (method == 'menu') {
+                iMethods.menuHover(menu);
+            }
+            //get base trigger
+            var baseTrigger = option.baseTrigger;
+
+
+            if (!menuData) {
+                var menuId;
+                if (!baseTrigger.data('iw-menuData')) {
+                    menuId = Math.ceil(Math.random() * 100000);
+                    baseTrigger.data('iw-menuData', {
+                        'menuId': menuId
+                    });
+                } else {
+                    menuId = baseTrigger.data('iw-menuData').menuId;
+                }
+                //create clone menu to calculate exact height and width.
+                var cloneMenu = menu.clone();
+                cloneMenu.appendTo('body');
+
+                menuData = {
+                    'menuId': menuId,
+                    'menuWidth': cloneMenu.outerWidth(true),
+                    'menuHeight': cloneMenu.outerHeight(true),
+                    'noTrigger': 1,
+                    'trigger': trigger
+                };
+
+
+                //to set data on selector
+                menu.data('iw-menuData', menuData).attr('menuId', menuId);
+                //remove clone menu
+                cloneMenu.remove();
+            } else {
+                menuData.noTrigger++;
+                menu.data('iw-menuData', menuData);
+            }
+
+            //to set data on trigger
+            trigger.addClass('iw-mTrigger').data('iw-menuData', {
+                'menuId': menuData.menuId,
+                'option': option,
+                'menu': menu,
+                'menuSelector': selector,
+                'method': method
+            });
+
+            //hover fix
+            var eventType;
+            if (option.triggerOn == 'hover') {
+                eventType = 'mouseenter';
+                //hover out if display is of context menu is on hover
+                if (baseTrigger.index(trigger) != -1) {
+                    baseTrigger.add(menu).bind('mouseleave.contextMenu', function (e) {
+                        if ($(e.relatedTarget).closest('.iw-contextMenu').length == 0) {
+                            $('.iw-contextMenu[menuId="' + menuData.menuId + '"]').hide(100);
+                        }
+                    });
+                }
+
+            } else {
+                eventType = option.triggerOn;
+            }
+
+           trigger.delegate('input,a,.needs-click','click',function(e){ e.stopImmediatePropagation()});
+
+            //to bind event
+            trigger.bind(eventType + '.contextMenu', iMethods.eventHandler);
+
+            //to stop bubbling in menu
+            menu.bind('click mouseenter', function (e) {
+                e.stopPropagation();
+            });
+
+            menu.delegate('li', 'click', function (e) {
+                if (option.closeOnClick) iMethods.closeContextMenu(option, trigger, menu, e);
+            });
+        },
+        eventHandler: function (e) {
+            e.preventDefault();
+            var trigger = $(this),
+                trgrData = trigger.data('iw-menuData'),
+                menu = trgrData.menu,
+                menuData = menu.data('iw-menuData'),
+                option = trgrData.option,
+                cntnmnt = option.containment,
+                clbckData = {
+                    trigger: trigger,
+                    menu: menu
+                },
+                //check conditions
+                cntWin = cntnmnt == window,
+                btChck = option.baseTrigger.index(trigger) == -1;
+
+            //to close previous open menu.
+            if (!btChck && option.closeOther) {
+                $('.iw-contextMenu').css('display', 'none');
+            }
+
+            //to reset already selected menu item
+            menu.find('.iw-mSelected').removeClass('iw-mSelected');
+
+            //call open callback
+            option.onOpen.call(this, clbckData, e);
+
+
+            var cObj = $(cntnmnt),
+                cHeight = cObj.innerHeight(),
+                cWidth = cObj.innerWidth(),
+                cTop = 0,
+                cLeft = 0,
+                menuHeight = menuData.menuHeight,
+                menuWidth = menuData.menuWidth,
+                va, ha,
+                left = 0,
+                top = 0,
+                bottomMenu,
+                rightMenu,
+                verAdjust = va = parseInt(option.verAdjust),
+                horAdjust = ha = parseInt(option.horAdjust);
+
+            if (!cntWin) {
+                cTop = cObj.offset().top;
+                cLeft = cObj.offset().left;
+
+                //to add relative position if no position is defined on containment
+                if (cObj.css('position') == 'static') {
+                    cObj.css('position', 'relative');
+                }
+
+            }
+
+            if (option.sizeStyle == 'auto') {
+                menuHeight = Math.min(menuHeight, cHeight);
+                menuWidth = Math.min(menuWidth, cWidth);
+                menuWidth = menuWidth + 20;
+            }
+
+            if (option.displayAround == 'cursor') {
+                left = cntWin ? e.clientX : e.clientX + $(window).scrollLeft() - cLeft;
+                top = cntWin ? e.clientY : e.clientY + $(window).scrollTop() - cTop;
+                bottomMenu = top + menuHeight;
+                rightMenu = left + menuWidth;
+                //max height and width of context menu
+                if (bottomMenu > cHeight) {
+                    if ((top - menuHeight) < 0) {
+                        if ((bottomMenu - cHeight) < (menuHeight - top)) {
+                            top = cHeight - menuHeight;
+                            va = -1 * va;
+                        } else {
+                            top = 0;
+                            va = 0;
+                        }
+                    } else {
+                        top = top - menuHeight;
+                        va = -1 * va;
+                    }
+                }
+                if (rightMenu > cWidth) {
+                    if ((left - menuWidth) < 0) {
+                        if ((rightMenu - cWidth) < (menuWidth - left)) {
+                            left = cWidth - menuWidth;
+                            ha = -1 * ha;
+                        } else {
+                            left = 0;
+                            ha = 0;
+                        }
+                    } else {
+                        left = left - menuWidth;
+                        ha = -1 * ha;
+                    }
+                }
+            } else if (option.displayAround == 'trigger') {
+                var triggerHeight = trigger.outerHeight(true),
+                    triggerWidth = trigger.outerWidth(true),
+                    triggerLeft = cntWin ? trigger.offset().left - cObj.scrollLeft() : trigger.offset().left - cLeft,
+                    triggerTop = cntWin ? trigger.offset().top - cObj.scrollTop() : trigger.offset().top - cTop,
+                    leftShift = triggerWidth;
+
+                left = triggerLeft + triggerWidth;
+                top = triggerTop;
+
+
+                bottomMenu = top + menuHeight;
+                rightMenu = left + menuWidth;
+                //max height and width of context menu
+                if (bottomMenu > cHeight) {
+                    if ((top - menuHeight) < 0) {
+                        if ((bottomMenu - cHeight) < (menuHeight - top)) {
+                            top = cHeight - menuHeight;
+                            va = -1 * va;
+                        } else {
+                            top = 0;
+                            va = 0;
+                        }
+                    } else {
+                        top = top - menuHeight + triggerHeight;
+                        va = -1 * va;
+                    }
+                }
+                if (rightMenu > cWidth) {
+                    if ((left - menuWidth) < 0) {
+                        if ((rightMenu - cWidth) < (menuWidth - left)) {
+                            left = cWidth - menuWidth;
+                            ha = -1 * ha;
+                            leftShift = -triggerWidth;
+                        } else {
+                            left = 0;
+                            ha = 0;
+                            leftShift = 0;
+                        }
+                    } else {
+                        left = left - menuWidth - triggerWidth;
+                        ha = -1 * ha;
+                        leftShift = -triggerWidth;
+                    }
+                }
+                //test end
+                if (option.position == 'top') {
+                    menuHeight = Math.min(menuData.menuHeight, triggerTop);
+                    top = triggerTop - menuHeight;
+                    va = verAdjust;
+                    left = left - leftShift;
+                } else if (option.position == 'left') {
+                    menuWidth = Math.min(menuData.menuWidth, triggerLeft);
+                    left = triggerLeft - menuWidth;
+                    ha = horAdjust;
+                } else if (option.position == 'bottom') {
+                    menuHeight = Math.min(menuData.menuHeight, (cHeight - triggerTop - triggerHeight));
+                    top = triggerTop + triggerHeight;
+                    va = verAdjust;
+                    left = left - leftShift;
+                } else if (option.position == 'right') {
+                    menuWidth = Math.min(menuData.menuWidth, (cWidth - triggerLeft - triggerWidth));
+                    left = triggerLeft + triggerWidth;
+                    ha = horAdjust;
+                }
+            }
+            //to draw contextMenu
+            var outerLeftRight = menu.outerWidth(true) - menu.width(),
+                outerTopBottom = menu.outerHeight(true) - menu.height();
+
+
+            //applying css property
+            var cssObj = {
+                'position': (cntWin || btChck) ? 'fixed' : 'absolute',
+                'display': 'inline-block',
+                'height': '',
+                'width': '',
+                'overflow-y': menuHeight != menuData.menuHeight ? 'auto' : 'hidden',
+                'overflow-x': menuWidth != menuData.menuWidth ? 'auto' : 'hidden'
+            };
+
+            if (option.sizeStyle == 'auto') {
+                cssObj.height = menuHeight - outerTopBottom + 'px';
+                cssObj.width = menuWidth - outerLeftRight + 'px';
+            }
+
+            //to get position from offset parent
+            if (option.left != 'auto') {
+                left = iMethods.getPxSize(option.left, cWidth);
+            }
+            if (option.top != 'auto') {
+                top = iMethods.getPxSize(option.top, cHeight);
+            }
+            if (!cntWin) {
+                var oParPos = trigger.offsetParent().offset();
+                if (btChck) {
+                    left = left + cLeft - $(window).scrollLeft();
+                    top = top + cTop - $(window).scrollTop();
+                } else {
+                    left = left - (cLeft - oParPos.left);
+                    top = top - (cTop - oParPos.top);
+                }
+            }
+            cssObj.left = left + ha + 'px';
+            cssObj.top = top + va + 'px';
+
+            menu.css(cssObj);
+
+            //to call after open call back
+            option.afterOpen.call(this, clbckData, e);
+
+
+            //to add current menu class
+            if (trigger.closest('.iw-contextMenu').length == 0) {
+                $('.iw-curMenu').removeClass('iw-curMenu');
+                menu.addClass('iw-curMenu');
+            }
+
+
+            var dataParm = {
+                trigger: trigger,
+                menu: menu,
+                option: option,
+                method: trgrData.method
+            };
+            $('html').unbind('click', iMethods.clickEvent).click(dataParm, iMethods.clickEvent);
+            $(document).unbind('keydown', iMethods.keyEvent).keydown(dataParm, iMethods.keyEvent);
+            if (option.winEventClose) {
+                $(window).bind('scroll resize', dataParm, iMethods.scrollEvent);
+            }
+        },
+
+        scrollEvent: function (e) {
+            iMethods.closeContextMenu(e.data.option, e.data.trigger, e.data.menu, e);
+        },
+
+        clickEvent: function (e) {
+            var button = e.data.trigger.get(0);
+
+            if ((button !== e.target) && ($(e.target).closest('.iw-contextMenu').length == 0)) {
+                iMethods.closeContextMenu(e.data.option, e.data.trigger, e.data.menu, e);
+            }
+        },
+        keyEvent: function (e) {
+            e.preventDefault();
+            var menu = e.data.menu,
+                option = e.data.option,
+                keyCode = e.keyCode;
+            // handle cursor keys
+            if (keyCode == 27) {
+                iMethods.closeContextMenu(option, e.data.trigger, menu, e);
+            }
+            if (e.data.method == 'menu') {
+                var curMenu = $('.iw-curMenu'),
+                    optList = curMenu.children('li:not(.iw-mDisable)'),
+                    selected = optList.filter('.iw-mSelected'),
+                    index = optList.index(selected),
+                    focusOn = function (elm) {
+                        selected.removeClass('iw-mSelected');
+                        elm.addClass('iw-mSelected');
+                    },
+                    first = function () {
+                        focusOn(optList.filter(':first'));
+                    },
+                    last = function () {
+                        focusOn(optList.filter(':last'));
+                    },
+                    next = function () {
+                        focusOn(optList.filter(':eq(' + (index + 1) + ')'));
+                    },
+                    prev = function () {
+                        focusOn(optList.filter(':eq(' + (index - 1) + ')'));
+                    },
+                    subMenu = function () {
+                        var menuData = selected.data('iw-menuData');
+                        if (menuData) {
+                            selected.triggerHandler('mouseenter.contextMenu');
+                            var selector = menuData.menu;
+                            selector.addClass('iw-curMenu');
+                            curMenu.removeClass('iw-curMenu');
+                            curMenu = selector;
+                            optList = curMenu.children('li:not(.iw-mDisable)');
+                            selected = optList.filter('.iw-mSelected');
+                            first();
+                        }
+                    },
+                    parMenu = function () {
+                        var selector = curMenu.data('iw-menuData').trigger;
+                        var parMenu = selector.closest('.iw-contextMenu');
+                        if (parMenu.length != 0) {
+                            curMenu.removeClass('iw-curMenu').css('display', 'none');
+                            parMenu.addClass('iw-curMenu');
+                        }
+                    };
+                switch (keyCode) {
+                case 13:
+                    selected.click();
+                    break;
+                case 40:
+                    (index == optList.length - 1 || selected.length == 0) ? first(): next();
+                    break;
+                case 38:
+                    (index == 0 || selected.length == 0) ? last(): prev();
+                    break;
+                case 33:
+                    first();
+                    break;
+                case 34:
+                    last();
+                    break;
+                case 37:
+                    parMenu();
+                    break;
+                case 39:
+                    subMenu();
+                    break;
+                }
+            }
+        },
+        closeContextMenu: function (option, trigger, menu, e) {
+
+            //unbind all events from top DOM
+            $(document).unbind('keydown', iMethods.keyEvent);
+            $('html').unbind('click', iMethods.clickEvent);
+            $(window).unbind('scroll resize', iMethods.scrollEvent);
+            $('.iw-contextMenu').hide();
+            $(document).focus();
+
+            //call close function
+            option.onClose.call(this, {
+                trigger: trigger,
+                menu: menu
+            }, e);
+        },
+        getPxSize: function (size, of) {
+            if (!isNaN(size)) {
+                return size;
+            }
+            if (size.indexOf('%') != -1) {
+                return parseInt(size) * of / 100;
+            } else {
+                return parseInt(size);
+            }
+        },
+        menuHover: function (menu) {
+            menu.children('li').bind('mouseenter', function (e) {
+                //to make curmenu
+                $('.iw-curMenu').removeClass('iw-curMenu');
+                menu.addClass('iw-curMenu');
+                //to select the list
+                var selected = menu.find('li.iw-mSelected'),
+                    submenu = selected.find('.iw-contextMenu');
+                if ((submenu.length != 0) && (selected[0] != this)) {
+                    submenu.hide(100);
+                }
+                selected.removeClass('iw-mSelected');
+                $(this).addClass('iw-mSelected');
+            });
+        },
+        createMenuList: function (trgr, selector, option) {
+            var baseTrigger = option.baseTrigger,
+                randomNum = Math.floor(Math.random() * 10000);
+            if ((typeof selector == 'object') && (!selector.nodeType) && (!selector.jquery)) {
+                var menuList = $('<ul class="iw-contextMenu iw-created iw-cm-menu" id="iw-contextMenu' + randomNum + '"></ul>');
+                for (var i = 0; i < selector.length; i++) {
+                    var selObj = selector[i],
+                        name = selObj.name,
+                        fun = selObj.fun,
+                        subMenu = selObj.subMenu,
+                        img = selObj.img || '',
+                        title = selObj.title || "",
+                        className = selObj.className || "",
+                        disable = selObj.disable,
+                        list = $('<li title="' + title + '" class="' + className + '">' + name + '</li>');
+                    if (img) {
+                        list.prepend('<img src="' + img + '" align="absmiddle" class="iw-mIcon" />');
+                    }
+
+                    //to add disable
+                    if (disable) {
+                        list.addClass('iw-mDisable');
+                    }
+
+                    list.bind('click.contextMenu', fun);
+
+                    //to create sub menu
+                    menuList.append(list);
+                    if (subMenu) {
+                        list.append('<div class="iw-cm-arrow-right" />');
+                        iMethods.subMenu(list, subMenu, baseTrigger, option);
+                    }
+                }
+                if (baseTrigger.index(trgr[0]) == -1) {
+                    trgr.append(menuList);
+                } else {
+                    var par = option.containment == window ? 'body' : option.containment;
+                    $(par).append(menuList);
+                }
+
+                iMethods.onOff($('#iw-contextMenu' + randomNum));
+                return '#iw-contextMenu' + randomNum;
+            } else if ($(selector).length != 0) {
+                var element = $(selector);
+                element.removeClass('iw-contextMenuCurrent')
+                    .addClass('iw-contextMenu iw-cm-menu iw-contextMenu' + randomNum)
+                    .attr('menuId', 'iw-contextMenu' + randomNum)
+                    .css('display', 'none');
+
+                //to create subMenu
+                element.find('ul').each(function (index, element) {
+                    var subMenu = $(this),
+                        parent = subMenu.parent('li');
+                    parent.append('<div class="iw-cm-arrow-right" />');
+                    subMenu.addClass('iw-contextMenuCurrent');
+                    iMethods.subMenu(parent, '.iw-contextMenuCurrent', baseTrigger, option);
+                });
+                iMethods.onOff($('.iw-contextMenu' + randomNum));
+                return '.iw-contextMenu' + randomNum;
+            }
+        },
+        subMenu: function (trigger, selector, baseTrigger, option) {
+            trigger.contextMenu('menu', selector, {
+                triggerOn: 'hover',
+                displayAround: 'trigger',
+                position: 'auto',
+                baseTrigger: baseTrigger,
+                containment: option.containment
+            });
+        },
+        onOff: function (menu) {
+
+            menu.find('.iw-mOverlay').remove();
+            menu.find('.iw-mDisable').each(function () {
+                var list = $(this);
+                list.append('<div class="iw-mOverlay"/>');
+                list.find('.iw-mOverlay').bind('click mouseenter', function (event) {
+                    event.stopPropagation();
+                });
+
+            });
+
+        },
+        optionOtimizer: function (method, option) {
+            if (!option) {
+                return;
+            }
+            if (method == 'menu') {
+                if (!option.mouseClick) {
+                    option.mouseClick = 'right';
+                }
+            }
+            if ((option.mouseClick == 'right') && (option.triggerOn == 'click')) {
+                option.triggerOn = 'contextmenu';
+            }
+
+            if ($.inArray(option.triggerOn, ['hover', 'mouseenter', 'mouseover', 'mouseleave', 'mouseout', 'focusin', 'focusout']) != -1) {
+                option.displayAround = 'trigger';
+            }
+            return option;
+        }
+    };
+})(jQuery, window, document);
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.js.jquery.json b/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.js.jquery.json
new file mode 100644 (file)
index 0000000..7dd52de
--- /dev/null
@@ -0,0 +1,28 @@
+{
+    "name": "contextMenu.js",
+    "version": "1.3.0",
+    "title": "A light weight multi functional context menu plugin",
+    "author": {
+        "name": "Sudhanshu Yadav",
+        "url": "https://ignitersworld.com"
+    },
+    "licenses": [
+        {
+            "type": "MIT",
+            "url": "https://github.com/s-yadav/contextMenu.js/blob/master/MIT-LICENSE.txt"
+        },
+        {
+            "type": "GPLv2 or Later",
+            "url": "http://opensource.org/licenses/GPL-2.0"
+        }
+    ],
+    "dependencies": {
+        "jquery": ">=1.6"
+    },
+       "keywords":["context-menu","contextmenu","right-click-menu","context","submenu","jquery","popup","menu","tooltip"],
+    "demo": "http://ignitersworld.com/lab/contextMenu.html#demo",
+    "docs": "http://ignitersworld.com/lab/contextMenu.html#documentation",
+    "homepage": "http://ignitersworld.com/lab/contextMenu.html",
+    "download": "https://github.com/s-yadav/contextMenu.js",
+    "description": "contextMenu.js is a multi functional context menu plugin. It supports different type of input, keyboard interaction, trigger events, submenus and lot more."
+}
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.min.js b/portal/static/unbound_reservation_static/js/contextmenu/contextMenu.min.js
new file mode 100644 (file)
index 0000000..c101135
--- /dev/null
@@ -0,0 +1,8 @@
+/*
+ *contextMenu.js v 1.3.0
+ *Author: Sudhanshu Yadav
+ *s-yadav.github.com
+ *Copyright (c) 2013 Sudhanshu Yadav.
+ *Dual licensed under the MIT and GPL licenses
+ */
+;!function(e,t,n,i){"use strict";e.fn.contextMenu=function(t,n,i){a[t]?n&&(n instanceof Array||"string"==typeof n||n.nodeType||n.jquery||(i=n,n=null)):(i=n,n=t,t="popup"),n instanceof Array&&"update"!=t&&(t="menu");var r=i;return"update"!=t&&(i=o.optionOtimizer(t,i),r=e.extend({},e.fn.contextMenu.defaults,i),r.baseTrigger||(r.baseTrigger=this)),a[t].call(this,n,r),this},e.fn.contextMenu.defaults={triggerOn:"click",displayAround:"cursor",mouseClick:"left",verAdjust:0,horAdjust:0,top:"auto",left:"auto",closeOther:!0,containment:t,winEventClose:!0,sizeStyle:"auto",position:"auto",closeOnClick:!0,onOpen:function(){},afterOpen:function(){},onClose:function(){}};var a={menu:function(t,n){var i=e(this);t=o.createMenuList(i,t,n),o.contextMenuBind.call(this,t,n,"menu")},popup:function(t,n){e(t).addClass("iw-contextMenu"),o.contextMenuBind.call(this,t,n,"popup")},update:function(t,n){var a=this;this.each(function(){var r=e(this),u=r.data("iw-menuData");u||(a.contextMenu("refresh"),u=r.data("iw-menuData"));var c=u.menu;if("object"==typeof t)for(var s=0;s<t.length;s++){var l=t[s].name,d=t[s].disable,m=t[s].fun,f=t[s].img,g=t[s].title,h=t[s].className,p=c.children("li").filter(function(){return e(this).contents().filter(function(){return 3==this.nodeType}).text()==l}),w=t[s].subMenu;if(d!=i&&(d?p.addClass("iw-mDisable"):p.removeClass("iw-mDisable")),m&&p.unbind("click.contextMenu").bind("click.contextMenu",m),g!=i&&p.attr("title",g),h!=i&&p.attr("class",h),f){var v=p.find(".iw-mIcon");v.length?v[0].src=f:p.prepend('<img src="'+f+'" align="absmiddle" class="iw-mIcon" />')}w&&p.contextMenu("update",w)}o.onOff(c),u.option=e.extend({},u.option,n),r.data("iw-menuData",u);var M=u.option.triggerOn;n&&M!=n.triggerOn&&(r.unbind(".contextMenu"),r.bind(M+".contextMenu",o.eventHandler))})},refresh:function(){var t=this.filter(function(){return!!e(this).data("iw-menuData")}).data("iw-menuData"),n=this.filter(function(){return!e(this).data("iw-menuData")});t.option.baseTrigger=this,o.contextMenuBind.call(n,t.menuSelector,t.option)},open:function(e,t){t=t||{};var n=t.event||new Event("click");t.top&&(n.clientY=t.top),t.left&&(n.clientX=t.left),this.each(function(){o.eventHandler.call(this,n)})},close:function(){var e=this.data("iw-menuData");e&&o.closeContextMenu(e.option,this,e.menu,null)},value:function(e){var t=this.data("iw-menuData");return t[e]?t[e]:t.option?t.option[e]:null},destroy:function(){this.each(function(){var t=e(this),n=t.data("iw-menuData").menuId,i=e(".iw-contextMenu[menuId="+n+"]"),a=i.data("iw-menuData");a&&(1==a.noTrigger?i.hasClass("iw-created")?i.remove():(i.removeClass("iw-contextMenu "+n).removeAttr("menuId").removeData("iw-menuData"),i.find("li.iw-mTrigger").contextMenu("destroy")):(a.noTrigger--,i.data("iw-menuData",a)),t.unbind(".contextMenu").removeClass("iw-mTrigger").removeData("iw-menuData"))})}},o={contextMenuBind:function(t,n,i){var a=this,r=e(t),u=r.data("iw-menuData");if(0!=r.length||(r=a.find(t),0!=r.length)){"menu"==i&&o.menuHover(r);var c=n.baseTrigger;if(u)u.noTrigger++,r.data("iw-menuData",u);else{var s;c.data("iw-menuData")?s=c.data("iw-menuData").menuId:(s=Math.ceil(1e5*Math.random()),c.data("iw-menuData",{menuId:s}));var l=r.clone();l.appendTo("body"),u={menuId:s,menuWidth:l.outerWidth(!0),menuHeight:l.outerHeight(!0),noTrigger:1,trigger:a},r.data("iw-menuData",u).attr("menuId",s),l.remove()}a.addClass("iw-mTrigger").data("iw-menuData",{menuId:u.menuId,option:n,menu:r,menuSelector:t,method:i});var d;"hover"==n.triggerOn?(d="mouseenter",-1!=c.index(a)&&c.add(r).bind("mouseleave.contextMenu",function(t){0==e(t.relatedTarget).closest(".iw-contextMenu").length&&e('.iw-contextMenu[menuId="'+u.menuId+'"]').hide(100)})):d=n.triggerOn,a.delegate("input,a,.needs-click","click",function(e){e.stopImmediatePropagation()}),a.bind(d+".contextMenu",o.eventHandler),r.bind("click mouseenter",function(e){e.stopPropagation()}),r.delegate("li","click",function(e){n.closeOnClick&&o.closeContextMenu(n,a,r,e)})}},eventHandler:function(i){i.preventDefault();var a=e(this),r=a.data("iw-menuData"),u=r.menu,c=u.data("iw-menuData"),s=r.option,l=s.containment,d={trigger:a,menu:u},m=l==t,f=-1==s.baseTrigger.index(a);!f&&s.closeOther&&e(".iw-contextMenu").css("display","none"),u.find(".iw-mSelected").removeClass("iw-mSelected"),s.onOpen.call(this,d,i);var g,h,p,w,v=e(l),M=v.innerHeight(),x=v.innerWidth(),b=0,C=0,k=c.menuHeight,y=c.menuWidth,D=0,O=0,T=g=parseInt(s.verAdjust),I=h=parseInt(s.horAdjust);if(m||(b=v.offset().top,C=v.offset().left,"static"==v.css("position")&&v.css("position","relative")),"auto"==s.sizeStyle&&(k=Math.min(k,M),y=Math.min(y,x),y+=20),"cursor"==s.displayAround)D=m?i.clientX:i.clientX+e(t).scrollLeft()-C,O=m?i.clientY:i.clientY+e(t).scrollTop()-b,p=O+k,w=D+y,p>M&&(0>O-k?k-O>p-M?(O=M-k,g=-1*g):(O=0,g=0):(O-=k,g=-1*g)),w>x&&(0>D-y?y-D>w-x?(D=x-y,h=-1*h):(D=0,h=0):(D-=y,h=-1*h));else if("trigger"==s.displayAround){var S=a.outerHeight(!0),H=a.outerWidth(!0),E=m?a.offset().left-v.scrollLeft():a.offset().left-C,A=m?a.offset().top-v.scrollTop():a.offset().top-b,z=H;D=E+H,O=A,p=O+k,w=D+y,p>M&&(0>O-k?k-O>p-M?(O=M-k,g=-1*g):(O=0,g=0):(O=O-k+S,g=-1*g)),w>x&&(0>D-y?y-D>w-x?(D=x-y,h=-1*h,z=-H):(D=0,h=0,z=0):(D=D-y-H,h=-1*h,z=-H)),"top"==s.position?(k=Math.min(c.menuHeight,A),O=A-k,g=T,D-=z):"left"==s.position?(y=Math.min(c.menuWidth,E),D=E-y,h=I):"bottom"==s.position?(k=Math.min(c.menuHeight,M-A-S),O=A+S,g=T,D-=z):"right"==s.position&&(y=Math.min(c.menuWidth,x-E-H),D=E+H,h=I)}var j=u.outerWidth(!0)-u.width(),W=u.outerHeight(!0)-u.height(),P={position:m||f?"fixed":"absolute",display:"inline-block",height:"",width:"","overflow-y":k!=c.menuHeight?"auto":"hidden","overflow-x":y!=c.menuWidth?"auto":"hidden"};if("auto"==s.sizeStyle&&(P.height=k-W+"px",P.width=y-j+"px"),"auto"!=s.left&&(D=o.getPxSize(s.left,x)),"auto"!=s.top&&(O=o.getPxSize(s.top,M)),!m){var L=a.offsetParent().offset();f?(D=D+C-e(t).scrollLeft(),O=O+b-e(t).scrollTop()):(D-=C-L.left,O-=b-L.top)}P.left=D+h+"px",P.top=O+g+"px",u.css(P),s.afterOpen.call(this,d,i),0==a.closest(".iw-contextMenu").length&&(e(".iw-curMenu").removeClass("iw-curMenu"),u.addClass("iw-curMenu"));var q={trigger:a,menu:u,option:s,method:r.method};e("html").unbind("click",o.clickEvent).click(q,o.clickEvent),e(n).unbind("keydown",o.keyEvent).keydown(q,o.keyEvent),s.winEventClose&&e(t).bind("scroll resize",q,o.scrollEvent)},scrollEvent:function(e){o.closeContextMenu(e.data.option,e.data.trigger,e.data.menu,e)},clickEvent:function(t){var n=t.data.trigger.get(0);n!==t.target&&0==e(t.target).closest(".iw-contextMenu").length&&o.closeContextMenu(t.data.option,t.data.trigger,t.data.menu,t)},keyEvent:function(t){t.preventDefault();var n=t.data.menu,i=t.data.option,a=t.keyCode;if(27==a&&o.closeContextMenu(i,t.data.trigger,n,t),"menu"==t.data.method){var r=e(".iw-curMenu"),u=r.children("li:not(.iw-mDisable)"),c=u.filter(".iw-mSelected"),s=u.index(c),l=function(e){c.removeClass("iw-mSelected"),e.addClass("iw-mSelected")},d=function(){l(u.filter(":first"))},m=function(){l(u.filter(":last"))},f=function(){l(u.filter(":eq("+(s+1)+")"))},g=function(){l(u.filter(":eq("+(s-1)+")"))},h=function(){var e=c.data("iw-menuData");if(e){c.triggerHandler("mouseenter.contextMenu");var t=e.menu;t.addClass("iw-curMenu"),r.removeClass("iw-curMenu"),r=t,u=r.children("li:not(.iw-mDisable)"),c=u.filter(".iw-mSelected"),d()}},p=function(){var e=r.data("iw-menuData").trigger,t=e.closest(".iw-contextMenu");0!=t.length&&(r.removeClass("iw-curMenu").css("display","none"),t.addClass("iw-curMenu"))};switch(a){case 13:c.click();break;case 40:s==u.length-1||0==c.length?d():f();break;case 38:0==s||0==c.length?m():g();break;case 33:d();break;case 34:m();break;case 37:p();break;case 39:h()}}},closeContextMenu:function(i,a,r,u){e(n).unbind("keydown",o.keyEvent),e("html").unbind("click",o.clickEvent),e(t).unbind("scroll resize",o.scrollEvent),e(".iw-contextMenu").hide(),e(n).focus(),i.onClose.call(this,{trigger:a,menu:r},u)},getPxSize:function(e,t){return isNaN(e)?-1!=e.indexOf("%")?parseInt(e)*t/100:parseInt(e):e},menuHover:function(t){t.children("li").bind("mouseenter",function(){e(".iw-curMenu").removeClass("iw-curMenu"),t.addClass("iw-curMenu");var n=t.find("li.iw-mSelected"),i=n.find(".iw-contextMenu");0!=i.length&&n[0]!=this&&i.hide(100),n.removeClass("iw-mSelected"),e(this).addClass("iw-mSelected")})},createMenuList:function(n,i,a){var r=a.baseTrigger,u=Math.floor(1e4*Math.random());if("object"==typeof i&&!i.nodeType&&!i.jquery){for(var c=e('<ul class="iw-contextMenu iw-created iw-cm-menu" id="iw-contextMenu'+u+'"></ul>'),s=0;s<i.length;s++){var l=i[s],d=l.name,m=l.fun,f=l.subMenu,g=l.img||"",h=l.title||"",p=l.className||"",w=l.disable,v=e('<li title="'+h+'" class="'+p+'">'+d+"</li>");g&&v.prepend('<img src="'+g+'" align="absmiddle" class="iw-mIcon" />'),w&&v.addClass("iw-mDisable"),v.bind("click.contextMenu",m),c.append(v),f&&(v.append('<div class="iw-cm-arrow-right" />'),o.subMenu(v,f,r,a))}if(-1==r.index(n[0]))n.append(c);else{var M=a.containment==t?"body":a.containment;e(M).append(c)}return o.onOff(e("#iw-contextMenu"+u)),"#iw-contextMenu"+u}if(0!=e(i).length){var x=e(i);return x.removeClass("iw-contextMenuCurrent").addClass("iw-contextMenu iw-cm-menu iw-contextMenu"+u).attr("menuId","iw-contextMenu"+u).css("display","none"),x.find("ul").each(function(){var t=e(this),n=t.parent("li");n.append('<div class="iw-cm-arrow-right" />'),t.addClass("iw-contextMenuCurrent"),o.subMenu(n,".iw-contextMenuCurrent",r,a)}),o.onOff(e(".iw-contextMenu"+u)),".iw-contextMenu"+u}},subMenu:function(e,t,n,i){e.contextMenu("menu",t,{triggerOn:"hover",displayAround:"trigger",position:"auto",baseTrigger:n,containment:i.containment})},onOff:function(t){t.find(".iw-mOverlay").remove(),t.find(".iw-mDisable").each(function(){var t=e(this);t.append('<div class="iw-mOverlay"/>'),t.find(".iw-mOverlay").bind("click mouseenter",function(e){e.stopPropagation()})})},optionOtimizer:function(t,n){return n?("menu"==t&&(n.mouseClick||(n.mouseClick="right")),"right"==n.mouseClick&&"click"==n.triggerOn&&(n.triggerOn="contextmenu"),-1!=e.inArray(n.triggerOn,["hover","mouseenter","mouseover","mouseleave","mouseout","focusin","focusout"])&&(n.displayAround="trigger"),n):void 0}}}(jQuery,window,document);
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/createpost.js b/portal/static/unbound_reservation_static/js/createpost.js
new file mode 100644 (file)
index 0000000..fbf5479
--- /dev/null
@@ -0,0 +1,130 @@
+$(function() {
+
+
+    // Submit post on submit
+   // $('#b1').bind('click', function(event){
+    //    event.preventDefault();
+   //     console.log("form submitted!")  // sanity check
+   //     create_post();
+  //  });
+$('#b1').bind('click', function(event){
+        event.preventDefault();
+        console.log("form submitted!")  // sanity check
+               jsondata=document.getElementById("jsondata").value;
+               user_data=document.getElementById("user_slices").value;
+        create_post(jsondata, user_data,1);
+    });
+       $('#b2').bind('click', function(event){
+        event.preventDefault();
+        console.log("form submitted!")  // sanity check
+               //jsondata=document.getElementById("jsondata").value;
+               //user_data=document.getElementById("user_slices").value;
+        create_post(jsondata, user_data,2);
+    });
+    // AJAX for posting
+    function create_post(jsondata, user_data,b) {
+       
+       $("button").hide(300);
+         $("#but").show(6000);
+       $('#but').html('<img src="http://preloaders.net/preloaders/287/Filling%20broken%20ring.gif"> loading...');
+        console.log("create post is working!")
+console.log(JSON.stringify(jsondata)); 
+var obj = jQuery.parseJSON(jsondata);
+console.log(JSON.stringify(obj));
+       // sanity check
+               var myEvent = {"resources":[{"type": "Node"},{"type": "Node"}]};
+               console.log(JSON.stringify(myEvent));
+               //jsondata=JSON.parse(JSON.parse(json).jsondata);
+               jsondata=jsondata.replace("\\", "");
+               console.log(obj);
+        $.ajax({
+            url : "create_post/", // the endpoint
+            type : "POST", // http method
+            data : {"name" : user_data, "mitsos" : JSON.stringify(obj), "b": b}, // data sent with the post request
+            // handle a successful response
+                       complete:function(){
+                       //alert("Request completed");
+            $("#but").hide();
+                       $("button").show();
+                       $("#b2").show();
+        },
+            success : function(data,status) {
+                
+                console.log(data,status); // log the returned json to the console
+               
+                          var obj = JSON.parse(data);
+                         // alert(data);
+                       for (var i = 0; i < obj.resource_response.resources.length; i++) {
+                       var k=i+1;
+                       var m='#'+k;
+                          input_2 = "<span> Node-"+k+"</span>"+
+                                       //"<div class='msglabel'>"<div class='msglabel'>+obj.resource_response.resources[0].domain+"<br>"+obj.resource_response.resources[0].name+"</div>"+
+                                       "<div class='connect'><div class='msglabel'>domain:"+obj.resource_response.resources[i].domain+"<br>name:"+obj.resource_response.resources[i].name+"<br>"+obj.resource_response.resources[i].urn+"</div></div>";
+                          $(m).html(input_2);
+                          }
+                          
+                console.log("success"); // another sanity check
+            },
+            // handle a non-successful response
+            error : function(xhr,errmsg,err) {
+                $('#results').html("<div class='alert-box alert radius' data-alert>Oops! We have encountered an error: "+errmsg+
+                    " <a href='#' class='close'>&times;</a></div>"); // add the error to the dom
+                console.log("papapa" + xhr.status + ": " + xhr.responseText); // provide a bit more info about the error to the console
+            }
+        });
+    };
+
+
+    // This function gets cookie with a given name
+    function getCookie(name) {
+        var cookieValue = null;
+        if (document.cookie && document.cookie != '') {
+            var cookies = document.cookie.split(';');
+            for (var i = 0; i < cookies.length; i++) {
+                var cookie = jQuery.trim(cookies[i]);
+                // Does this cookie string begin with the name we want?
+                if (cookie.substring(0, name.length + 1) == (name + '=')) {
+                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+                    break;
+                }
+            }
+        }
+        return cookieValue;
+    }
+    var csrftoken = getCookie('csrftoken');
+
+    /*
+    The functions below will create a header with csrftoken
+    */
+
+    function csrfSafeMethod(method) {
+        // these HTTP methods do not require CSRF protection
+        return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
+    }
+    function sameOrigin(url) {
+        // test that a given url is a same-origin URL
+        // url could be relative or scheme relative or absolute
+        var host = document.location.host; // host + port
+        var protocol = document.location.protocol;
+        var sr_origin = '//' + host;
+        var origin = protocol + sr_origin;
+        // Allow absolute or scheme relative URLs to same origin
+        return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
+            (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
+            // or any other URL that isn't scheme relative or absolute i.e relative.
+            !(/^(\/\/|http:|https:).*/.test(url));
+    }
+
+    $.ajaxSetup({
+        beforeSend: function(xhr, settings) {
+            if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
+                // Send the token to same-origin, relative URLs only.
+                // Send the token only if the method warrants CSRF protection
+                // Using the CSRFToken value acquired earlier
+                xhr.setRequestHeader("X-CSRFToken", csrftoken);
+            }
+        }
+    });
+
+});
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/createpost_.js b/portal/static/unbound_reservation_static/js/createpost_.js
new file mode 100644 (file)
index 0000000..b19b5cd
--- /dev/null
@@ -0,0 +1,120 @@
+$(function() {
+
+
+    // Submit post on submit
+   // $('#b1').bind('click', function(event){
+    //    event.preventDefault();
+   //     console.log("form submitted!")  // sanity check
+   //     create_post();
+  //  });
+$('#b1').bind('click', function(event){
+        event.preventDefault();
+        console.log("form submitted!")  // sanity check
+               jsondata=document.getElementById("jsondata").value;
+        create_post(jsondata);
+    });
+    // AJAX for posting
+    function create_post(jsondata) {
+       $("button").hide(300);
+         $("#but").show(6000);
+       $('#but').html('<img src="http://preloaders.net/preloaders/287/Filling%20broken%20ring.gif"> loading...');
+        console.log("create post is working!")
+console.log(JSON.stringify(jsondata)); 
+var obj = jQuery.parseJSON(jsondata);
+console.log(JSON.stringify(obj));
+       // sanity check
+               var myEvent = {"resources":[{"type": "Node"},{"type": "Node"}]};
+               console.log(JSON.stringify(myEvent));
+               //jsondata=JSON.parse(JSON.parse(json).jsondata);
+               jsondata=jsondata.replace("\\", "");
+               console.log(jsondata);
+        $.ajax({
+            url : "create_post/", // the endpoint
+            type : "POST", // http method
+            data : JSON.stringify(obj), // data sent with the post request
+            // handle a successful response
+                       complete:function(){
+                       //alert("Request completed");
+            $("#but").hide();
+                       $("button").show();
+        },
+            success : function(data,status) {
+                
+                console.log(data,status); // log the returned json to the console
+               
+                          var obj = JSON.parse(data);
+                         // alert(data);
+                       for (var i = 0; i < obj.resource_response.resources.length; i++) {
+                       var k=i+1;
+                       var m='#'+k;
+                          input_2 = "<span> Node-"+k+"</span>"+
+                                       //"<div class='msglabel'>"<div class='msglabel'>+obj.resource_response.resources[0].domain+"<br>"+obj.resource_response.resources[0].name+"</div>"+
+                                       "<div class='connect'><div class='msglabel'>domain:"+obj.resource_response.resources[i].domain+"<br>name:"+obj.resource_response.resources[i].name+"<br>"+obj.resource_response.resources[i].urn+"</div></div>";
+                          $(m).html(input_2);
+                          }
+                          
+                console.log("success"); // another sanity check
+            },
+            // handle a non-successful response
+            error : function(xhr,errmsg,err) {
+                $('#results').html("<div class='alert-box alert radius' data-alert>Oops! We have encountered an error: "+errmsg+
+                    " <a href='#' class='close'>&times;</a></div>"); // add the error to the dom
+                console.log("papapa" + xhr.status + ": " + xhr.responseText); // provide a bit more info about the error to the console
+            }
+        });
+    };
+
+
+    // This function gets cookie with a given name
+    function getCookie(name) {
+        var cookieValue = null;
+        if (document.cookie && document.cookie != '') {
+            var cookies = document.cookie.split(';');
+            for (var i = 0; i < cookies.length; i++) {
+                var cookie = jQuery.trim(cookies[i]);
+                // Does this cookie string begin with the name we want?
+                if (cookie.substring(0, name.length + 1) == (name + '=')) {
+                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+                    break;
+                }
+            }
+        }
+        return cookieValue;
+    }
+    var csrftoken = getCookie('csrftoken');
+
+    /*
+    The functions below will create a header with csrftoken
+    */
+
+    function csrfSafeMethod(method) {
+        // these HTTP methods do not require CSRF protection
+        return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
+    }
+    function sameOrigin(url) {
+        // test that a given url is a same-origin URL
+        // url could be relative or scheme relative or absolute
+        var host = document.location.host; // host + port
+        var protocol = document.location.protocol;
+        var sr_origin = '//' + host;
+        var origin = protocol + sr_origin;
+        // Allow absolute or scheme relative URLs to same origin
+        return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
+            (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
+            // or any other URL that isn't scheme relative or absolute i.e relative.
+            !(/^(\/\/|http:|https:).*/.test(url));
+    }
+
+    $.ajaxSetup({
+        beforeSend: function(xhr, settings) {
+            if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
+                // Send the token to same-origin, relative URLs only.
+                // Send the token only if the method warrants CSRF protection
+                // Using the CSRFToken value acquired earlier
+                xhr.setRequestHeader("X-CSRFToken", csrftoken);
+            }
+        }
+    });
+
+});
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/createpost__.js b/portal/static/unbound_reservation_static/js/createpost__.js
new file mode 100644 (file)
index 0000000..fa2748b
--- /dev/null
@@ -0,0 +1,121 @@
+$(function() {
+
+
+    // Submit post on submit
+   // $('#b1').bind('click', function(event){
+    //    event.preventDefault();
+   //     console.log("form submitted!")  // sanity check
+   //     create_post();
+  //  });
+$('#b1').bind('click', function(event){
+        event.preventDefault();
+        console.log("form submitted!")  // sanity check
+               jsondata=document.getElementById("jsondata").value;
+               user_data=document.getElementById("user_slices").value;
+        create_post(jsondata, user_data);
+    });
+    // AJAX for posting
+    function create_post(jsondata, user_data) {
+       $("button").hide(300);
+         $("#but").show(6000);
+       $('#but').html('<img src="http://preloaders.net/preloaders/287/Filling%20broken%20ring.gif"> loading...');
+        console.log("create post is working!")
+console.log(JSON.stringify(jsondata)); 
+var obj = jQuery.parseJSON(jsondata);
+console.log(JSON.stringify(obj));
+       // sanity check
+               var myEvent = {"resources":[{"type": "Node"},{"type": "Node"}]};
+               console.log(JSON.stringify(myEvent));
+               //jsondata=JSON.parse(JSON.parse(json).jsondata);
+               jsondata=jsondata.replace("\\", "");
+               console.log(jsondata);
+        $.ajax({
+            url : "create_post/", // the endpoint
+            type : "POST", // http method
+            data : {"name" : user_data, "body" : JSON.stringify(obj)}, // data sent with the post request
+            // handle a successful response
+                       complete:function(){
+                       //alert("Request completed");
+            $("#but").hide();
+                       $("button").show();
+        },
+            success : function(data,status) {
+                
+                console.log(data,status); // log the returned json to the console
+               
+                          var obj = JSON.parse(data);
+                         // alert(data);
+                       for (var i = 0; i < obj.resource_response.resources.length; i++) {
+                       var k=i+1;
+                       var m='#'+k;
+                          input_2 = "<span> Node-"+k+"</span>"+
+                                       //"<div class='msglabel'>"<div class='msglabel'>+obj.resource_response.resources[0].domain+"<br>"+obj.resource_response.resources[0].name+"</div>"+
+                                       "<div class='connect'><div class='msglabel'>domain:"+obj.resource_response.resources[i].domain+"<br>name:"+obj.resource_response.resources[i].name+"<br>"+obj.resource_response.resources[i].urn+"</div></div>";
+                          $(m).html(input_2);
+                          }
+                          
+                console.log("success"); // another sanity check
+            },
+            // handle a non-successful response
+            error : function(xhr,errmsg,err) {
+                $('#results').html("<div class='alert-box alert radius' data-alert>Oops! We have encountered an error: "+errmsg+
+                    " <a href='#' class='close'>&times;</a></div>"); // add the error to the dom
+                console.log("papapa" + xhr.status + ": " + xhr.responseText); // provide a bit more info about the error to the console
+            }
+        });
+    };
+
+
+    // This function gets cookie with a given name
+    function getCookie(name) {
+        var cookieValue = null;
+        if (document.cookie && document.cookie != '') {
+            var cookies = document.cookie.split(';');
+            for (var i = 0; i < cookies.length; i++) {
+                var cookie = jQuery.trim(cookies[i]);
+                // Does this cookie string begin with the name we want?
+                if (cookie.substring(0, name.length + 1) == (name + '=')) {
+                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+                    break;
+                }
+            }
+        }
+        return cookieValue;
+    }
+    var csrftoken = getCookie('csrftoken');
+
+    /*
+    The functions below will create a header with csrftoken
+    */
+
+    function csrfSafeMethod(method) {
+        // these HTTP methods do not require CSRF protection
+        return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
+    }
+    function sameOrigin(url) {
+        // test that a given url is a same-origin URL
+        // url could be relative or scheme relative or absolute
+        var host = document.location.host; // host + port
+        var protocol = document.location.protocol;
+        var sr_origin = '//' + host;
+        var origin = protocol + sr_origin;
+        // Allow absolute or scheme relative URLs to same origin
+        return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
+            (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
+            // or any other URL that isn't scheme relative or absolute i.e relative.
+            !(/^(\/\/|http:|https:).*/.test(url));
+    }
+
+    $.ajaxSetup({
+        beforeSend: function(xhr, settings) {
+            if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
+                // Send the token to same-origin, relative URLs only.
+                // Send the token only if the method warrants CSRF protection
+                // Using the CSRFToken value acquired earlier
+                xhr.setRequestHeader("X-CSRFToken", csrftoken);
+            }
+        }
+    });
+
+});
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/dhtmlx.js b/portal/static/unbound_reservation_static/js/dhtmlx.js
new file mode 100644 (file)
index 0000000..4a2cef1
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Product Name: dhtmlxSuite 
+Version: 4.2 
+Edition: Standard 
+License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
+Copyright UAB Dinamenta http://www.dhtmlx.com
+*/
+
+if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.2",skin:null,skinDetect:function(a){return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[this.readFromCss(a+"_skin_detect")]||null},readFromCss:function(g,j){var c=document.createElement("DIV");c.className=g;if(document.body.firstChild!=null){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c[j||"offsetWidth"];c.parentNode.removeChild(c);c=null;return a},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var g=this.first();for(var c in this.data){g=Math.max(g,this.data[c])}return g},reserve:function(a){this.data[a]=this.last()+this.step;return this.data[a]},clear:function(a){if(this.data[a]!=null){this.data[a]=null;delete this.data[a]}}},s2b:function(a){if(typeof(a)=="string"){a=a.toLowerCase()}return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},s2j:function(s){var obj=null;dhx4.temp=null;try{eval("dhx4.temp="+s)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null;return obj},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).top},_aOfs:function(a){var g=0,c=0;while(a){g=g+parseInt(a.offsetTop);c=c+parseInt(a.offsetLeft);a=a.offsetParent}return{top:g,left:c}},_aOfsRect:function(j){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{top:Math.round(r),left:Math.round(g)}},getOffset:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfs(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(j){if(this._isObj(j)){var g={};for(var c in j){if(typeof(j[c])=="object"&&j[c]!=null){g[c]=this._copyObj(j[c])}else{g[c]=j[c]}}}else{var g=[];for(var c=0;c<j.length;c++){if(typeof(j[c])=="object"&&j[c]!=null){g[c]=this._copyObj(j[c])}else{g[c]=j[c]}}}return g},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=0);var c={};c.left=document.body.scrollLeft;c.right=c.left+(window.innerWidth||document.body.clientWidth);c.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);c.bottom=c.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return c},selectTextRange:function(j,m,c){j=(typeof(j)=="string"?document.getElementById(j):j);var a=j.value.length;m=Math.max(Math.min(m,a),0);c=Math.min(c,a);if(j.setSelectionRange){try{j.setSelectionRange(m,c)}catch(l){}}else{if(j.createTextRange){var g=j.createTextRange();g.moveStart("character",m);g.moveEnd("character",c-a);try{g.select()}catch(l){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var g={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var c in g){if(this.transData.transProp==false&&document.documentElement.style[c]!=null){this.transData.transProp=c;this.transData.transEv=g[c]}}g=null}return this.transData},_xmlNodeValue:function(a){var g="";for(var c=0;c<a.childNodes.length;c++){g+=(a.childNodes[c].nodeValue!=null?a.childNodes[c].nodeValue.toString().replace(/^[\n\r\s]{0,}/,"").replace(/[\n\r\s]{0,}$/,""):"")}return g}};window.dhx4.isIE=(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE6=(window.XMLHttpRequest==null&&navigator.userAgent.indexOf("MSIE")>=0);window.dhx4.isIE7=(navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0);window.dhx4.isIE8=(navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}if(typeof(window.dhx4.template)=="undefined"){window.dhx4.trim=function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")};window.dhx4.template=function(c,g,a){return c.replace(/#([a-z0-9_-]{1,})(\|([^#]*))?#/gi,function(){var n=arguments[1];var m=window.dhx4.trim(arguments[3]);var o=null;var l=[g[n]];if(m.length>0){m=m.split(":");var j=[];for(var r=0;r<m.length;r++){if(r>0&&j[j.length-1].match(/\\$/)!=null){j[j.length-1]=j[j.length-1].replace(/\\$/,"")+":"+m[r]}else{j.push(m[r])}}o=j[0];for(var r=1;r<j.length;r++){l.push(j[r])}}if(typeof(o)=="string"&&typeof(window.dhx4.template[o])=="function"){return window.dhx4.template[o].apply(window.dhx4.template,l)}if(n.length>0&&typeof(g[n])!="undefined"){if(a==true){return window.dhx4.trim(g[n])}return String(g[n])}return""})};window.dhx4.template.date=function(a,c){if(a!=null){if(a instanceof Date){return window.dhx4.date2str(a,c)}else{a=a.toString();if(a.match(/^\d*$/)!=null){return window.dhx4.date2str(new Date(parseInt(a)),c)}return a}}return""};window.dhx4.template.maxlength=function(c,a){return String(c).substr(0,a)};window.dhx4.template.number_format=function(j,l,g,a){var c=window.dhx4.template._parseFmt(l,g,a);if(c==false){return j}return window.dhx4.template._getFmtValue(j,c)};window.dhx4.template.lowercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toLowerCase()};window.dhx4.template.uppercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toUpperCase()};window.dhx4.template._parseFmt=function(n,g,a){var j=n.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(j==null||j.length!=4){return false}var c={i_len:false,i_sep:(typeof(g)=="string"?g:","),d_len:false,d_sep:(typeof(a)=="string"?a:"."),s_bef:(typeof(j[1])=="string"?j[1]:""),s_aft:(typeof(j[3])=="string"?j[3]:"")};var m=j[2].split(".");if(m[1]!=null){c.d_len=m[1].length}var l=m[0].split(",");if(l.length>1){c.i_len=l[l.length-1].length}return c};window.dhx4.template._getFmtValue=function(value,fmt){var r=String(value).match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(r!=null&&r.length==5){var v0="";if(r[1]!=null){v0+=r[1]}v0+=fmt.s_bef;if(fmt.i_len!==false){var i=0;var v1="";for(var q=r[2].length-1;q>=0;q--){v1=""+r[2].charAt(q)+v1;if(++i==fmt.i_len&&q>0){v1=fmt.i_sep+v1;i=0}}v0+=v1}else{v0+=r[2]}if(fmt.d_len!==false){if(r[4]==null){r[4]=""}while(r[4].length<fmt.d_len){r[4]+="0"}eval("dhx4.temp = new RegExp(/\\d{"+fmt.d_len+"}/);");var t1=(r[4]).match(dhx4.temp);if(t1!=null){v0+=fmt.d_sep+t1}dhx4.temp=t1=null}v0+=fmt.s_aft;return v0}return value}}if(typeof(window.dhx4.dateLang)=="undefined"){window.dhx4.dateLang="en";window.dhx4.dateStrings={en:{monthFullName:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShortName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayFullName:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShortName:["Su","Mo","Tu","We","Th","Fr","Sa"]}};window.dhx4.dateFormat={en:"%Y-%m-%d"};window.dhx4.date2str=function(m,j,a){if(j==null||typeof(j)=="undefnied"){j=window.dhx4.dateFormat[window.dhx4.dateLang]}if(a==null||typeof(a)=="undefnied"){a=window.dhx4.dateStrings[window.dhx4.dateLang]}if(m instanceof Date){var l=function(n){return(String(n).length==1?"0"+String(n):n)};var c=function(o){switch(o){case"%d":return l(m.getDate());case"%j":return m.getDate();case"%D":return a.dayShortName[m.getDay()];case"%l":return a.dayFullName[m.getDay()];case"%m":return l(m.getMonth()+1);case"%n":return m.getMonth()+1;case"%M":return a.monthShortName[m.getMonth()];case"%F":return a.monthFullName[m.getMonth()];case"%y":return l(m.getYear()%100);case"%Y":return m.getFullYear();case"%g":return(m.getHours()+11)%12+1;case"%h":return l((m.getHours()+11)%12+1);case"%G":return m.getHours();case"%H":return l(m.getHours());case"%i":return l(m.getMinutes());case"%s":return l(m.getSeconds());case"%a":return(m.getHours()>11?"pm":"am");case"%A":return(m.getHours()>11?"PM":"AM");case"%%":return"%";case"%u":return m.getMilliseconds();case"%P":if(window.dhx4.temp_calendar!=null&&window.dhx4.temp_calendar.tz!=null){return window.dhx4.temp_calendar.tz}var r=m.getTimezoneOffset();var q=Math.abs(Math.floor(r/60));var n=Math.abs(r)-q*60;return(r>0?"-":"+")+l(q)+":"+l(n);default:return o}};var g=String(j||window.dhx4.dateFormat).replace(/%[a-zA-Z]/g,c)}return(g||String(m))};window.dhx4.str2date=function(l,A,E){if(A==null||typeof(A)=="undefnied"){A=window.dhx4.dateFormat[window.dhx4.dateLang]}if(E==null||typeof(E)=="undefnied"){E=window.dhx4.dateStrings[window.dhx4.dateLang]}A=A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var D=[];var o=[];A=A.replace(/%[a-z]/gi,function(q){switch(q){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":o.push(q);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":o.push(q);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":o.push(q);return"(\\d{1,2})";case"%Y":o.push(q);return"(\\d{4})";case"%a":o.push(q);return"([am|pm])";case"%A":o.push(q);return"([AM|PM])";case"%u":o.push(q);return"(\\d{1,6})";case"%P":o.push(q);return"([+-]\\d{1,2}:\\d{1,2})"}return q});var F=new RegExp(A,"i");var s=l.match(F);if(s==null||s.length-1!=o.length){return"Invalid Date"}for(var c=1;c<s.length;c++){D.push(s[c])}var g={"%y":1,"%Y":1,"%n":2,"%m":2,"%M":2,"%F":2,"%d":3,"%j":3,"%a":4,"%A":4,"%H":5,"%G":5,"%h":5,"%g":5,"%i":6,"%s":7,"%u":7,"%P":7};var u={};var n={};for(var c=0;c<o.length;c++){if(typeof(g[o[c]])!="undefined"){var j=g[o[c]];if(!u[j]){u[j]=[];n[j]=[]}u[j].push(D[c]);n[j].push(o[c])}}D=[];o=[];for(var c=1;c<=7;c++){if(u[c]!=null){for(var y=0;y<u[c].length;y++){D.push(u[c][y]);o.push(n[c][y])}}}var a=new Date();a.setDate(1);a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);var x=function(w,r){for(var v=0;v<r.length;v++){if(r[v].toLowerCase()==w){return v}}return -1};for(var c=0;c<D.length;c++){switch(o[c]){case"%d":case"%j":case"%n":case"%m":case"%Y":case"%H":case"%G":case"%i":case"%s":case"%u":if(!isNaN(D[c])){a[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds","%u":"setMilliseconds"}[o[c]]](Number(D[c])+(o[c]=="%m"||o[c]=="%n"?-1:0))}break;case"%M":case"%F":var m=x(D[c].toLowerCase(),E[{"%M":"monthShortName","%F":"monthFullName"}[o[c]]]);if(m>=0){a.setMonth(m)}break;case"%y":if(!isNaN(D[c])){var C=Number(D[c]);a.setFullYear(C+(C>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(D[c])){var C=Number(D[c]);if(C<=12&&C>=0){a.setHours(C+(x("pm",D)>=0?(C==12?0:12):(C==12?-12:0)))}}break;case"%P":if(window.dhx4.temp_calendar!=null){window.dhx4.temp_calendar.tz=D[c]}break}}return a}}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"get",parse:function(a){if(typeof a!=="string"){return a}a=a.replace(/^[\s]+/,"");if(window.DOMParser&&!dhx4.isIE){var c=(new window.DOMParser()).parseFromString(a,"text/xml")}else{if(window.ActiveXObject!==window.undefined){var c=new window.ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(a)}}return c},xmltop:function(a,j,g){if(typeof j.status=="undefined"||j.status<400){xml=(!j.responseXML)?dhx4.ajax.parse(j.responseText||j):(j.responseXML||j);if(xml&&xml.documentElement!==null){try{if(!xml.getElementsByTagName("parsererror").length){return xml.getElementsByTagName(a)[0]}}catch(c){}}}if(g!==-1){dhx4.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],g])}return document.createElement("DIV")},xpath:function(g,a){if(!a.nodeName){a=a.responseXML||a}if(dhx4.isIE){try{return a.selectNodes(g)||[]}catch(l){return[]}}else{var j=[];var m;var c=(a.ownerDocument||a).evaluate(g,a,null,XPathResult.ANY_TYPE,null);while(m=c.iterateNext()){j.push(m)}return j}},query:function(a){dhx4.ajax._call((a.method||"GET"),a.url,a.data||"",(a.async||true),a.callback,null,a.headers)},get:function(a,c){return this._call("GET",a,null,true,c)},getSync:function(a){return this._call("GET",a,null,false)},put:function(c,a,g){return this._call("PUT",c,a,true,g)},del:function(c,a,g){return this._call("DELETE",c,a,true,g)},post:function(c,a,g){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){g=a;a=""}else{a=String(a)}}return this._call("POST",c,a,true,g)},postSync:function(c,a){a=(a==null?"":String(a));return this._call("POST",c,a,false)},getLong:function(a,c){this._call("GET",a,null,true,c,{url:a})},postLong:function(c,a,g){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){g=a;a=""}this._call("POST",c,a,true,g,{url:c,postData:a})},_call:function(a,c,g,l,n,r,j){var q=(window.XMLHttpRequest&&!dhx4.isIE?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var m=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(l==true){q.onreadystatechange=function(){if((q.readyState==4)||(m==true&&q.readyState==3)){if(q.status!=200||q.responseText==""){if(!dhx4.callEvent("onAjaxError",[q])){return}}window.setTimeout(function(){if(typeof(n)=="function"){n.apply(window,[{xmlDoc:q,filePath:c,async:l}])}if(r!=null){if(typeof(r.postData)!="undefined"){dhx4.ajax.postLong(r.url,r.postData,n)}else{dhx4.ajax.getLong(r.url,n)}}n=null;q=null},1)}}}if(a=="GET"&&this.cache!=true){c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"}q.open(a,c,l);if(j!=null){for(var o in j){q.setRequestHeader(o,j[o])}}else{if(a=="POST"||a=="PUT"||a=="DELETE"){q.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(a=="GET"){g=null}}}q.setRequestHeader("X-Requested-With","XMLHttpRequest");q.send(g);return{xmlDoc:q,filePath:c,async:l}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(n,g,m,l,o){if(o=="clear"){for(var c in n._dhxdataload){n._dhxdataload[c]=null;delete n._dhxdataload[c]}n._loadData=null;n._dhxdataload=null;n.load=null;n.loadStruct=null;n=null;return}n._dhxdataload={initObj:g,xmlToJson:m,xmlRootTag:l,onBeforeXLS:null};n._loadData=function(v,w,x){if(arguments.length==2){x=w;w=null}var u=null;if(arguments.length==3){x=arguments[2]}if(typeof(v)=="string"){var s=v.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var C=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(C.test(s.replace(/^<\?xml[^\?]*\?>\s*/,""))){u=dhx4.ajax.parse(v);if(u!=null){u=this[this._dhxdataload.xmlToJson].apply(this,[u])}}if(u==null&&(s.match(/^\{.*\}$/)!=null||s.match(/^\[.*\]$/)!=null)){u=dhx4.s2j(s)}if(u==null){this.callEvent("onXLS",[]);var r=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var s=this._dhxdataload.onBeforeXLS.apply(this,[v]);if(s!=null&&typeof(s)=="object"){if(s.url!=null){v=s.url}if(s.params!=null){for(var y in s.params){r.push(y+"="+encodeURIComponent(s.params[y]))}}}}var A=this;var q=function(a){var D=null;if((a.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(a.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){D=A[A._dhxdataload.xmlToJson].apply(A,[a.xmlDoc.responseXML])}else{D=dhx4.s2j(a.xmlDoc.responseText)}if(D!=null){A[A._dhxdataload.initObj].apply(A,[D,v])}A.callEvent("onXLE",[]);if(x!=null){if(typeof(x)=="function"){x.apply(A,[])}else{if(typeof(window[x])=="function"){window[x].apply(A,[])}}}q=x=null;D=a=A=null};r=r.join("&")+(typeof(w)=="string"?"&"+w:"");if(dhx4.ajax.method=="post"){dhx4.ajax.post(v,r,q)}else{if(dhx4.ajax.method=="get"){dhx4.ajax.get(v+(r.length>0?(v.indexOf("?")>0?"&":"?")+r:""),q)}}return}}else{if(typeof(v.documentElement)=="object"||(typeof(v.tagName)!="undefined"&&typeof(v.getElementsByTagName)!="undefined"&&v.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){u=this[this._dhxdataload.xmlToJson].apply(this,[v])}else{u=window.dhx4._copyObj(v)}}if(u!=null){this[this._dhxdataload.initObj].apply(this,[u])}if(x!=null){if(typeof(x)=="function"){x.apply(this,[])}else{if(typeof(window[x])=="function"){window[x].apply(this,[])}}x=null}};if(o!=null){var j={struct:"loadStruct",data:"load"};for(var c in o){if(o[c]==true){n[j[c]]=function(){return this._loadData.apply(this,arguments)}}}}n=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,c){if(c=="clear"){a.detachAllEvents();a.dhxevs=null;a.attachEvent=null;a.detachEvent=null;a.checkEvent=null;a.callEvent=null;a.detachAllEvents=null;a=null;return}a.dhxevs={data:{}};a.attachEvent=function(g,l){g=String(g).toLowerCase();if(!this.dhxevs.data[g]){this.dhxevs.data[g]={}}var j=window.dhx4.newId();this.dhxevs.data[g][j]=l;return j};a.detachEvent=function(m){for(var j in this.dhxevs.data){var l=0;for(var g in this.dhxevs.data[j]){if(g==m){this.dhxevs.data[j][g]=null;delete this.dhxevs.data[j][g]}else{l++}}if(l==0){this.dhxevs.data[j]=null;delete this.dhxevs.data[j]}}};a.checkEvent=function(g){g=String(g).toLowerCase();return(this.dhxevs.data[g]!=null)};a.callEvent=function(j,m){j=String(j).toLowerCase();if(this.dhxevs.data[j]==null){return true}var l=true;for(var g in this.dhxevs.data[j]){l=this.dhxevs.data[j][g].apply(this,m)&&l}return l};a.detachAllEvents=function(){for(var j in this.dhxevs.data){for(var g in this.dhxevs.data[j]){this.dhxevs.data[j][g]=null;delete this.dhxevs.data[j][g]}this.dhxevs.data[j]=null;delete this.dhxevs.data[j]}};a=null};dhx4._eventable(dhx4)}if(!window.dhtmlxValidation){dhtmlxValidation=function(){};dhtmlxValidation.prototype={isEmpty:function(a){return a==""},isNotEmpty:function(a){return(a instanceof Array?a.length>0:!a=="")},isValidBoolean:function(a){return !!a.toString().match(/^(0|1|true|false)$/)},isValidEmail:function(a){return !!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,4})$)/i)},isValidInteger:function(a){return !!a.toString().match(/(^-?\d+$)/)},isValidNumeric:function(a){return !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},isValidAplhaNumeric:function(a){return !!a.toString().match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(c){var a=c.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return a&&!!(a[1]<=9999&&a[2]<=12&&a[3]<=31&&a[4]<=59&&a[5]<=59&&a[6]<=59)||false},isValidDate:function(a){var c=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return c&&!!(c[1]<=9999&&c[2]<=12&&c[3]<=31)||false},isValidTime:function(c){var a=c.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return a&&!!(a[1]<=24&&a[2]<=59&&a[3]<=59)||false},isValidIPv4:function(a){var c=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return c&&!!(c[1]<=255&&c[2]<=255&&c[3]<=255&&c[4]<=255)||false},isValidCurrency:function(a){return a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/)&&true||false},isValidSSN:function(a){return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&true||false},isValidSIN:function(a){return a.toString().match(/^\d{9}$/)&&true||false}};dhtmlxValidation=new dhtmlxValidation()}if(typeof(window.dhtmlx)=="undefined"){window.dhtmlx={extend:function(g,c){for(var j in c){if(!g[j]){g[j]=c[j]}}return g},extend_api:function(a,j,g){var c=window[a];if(!c){return}window[a]=function(n){if(n&&typeof n=="object"&&!n.tagName){var m=c.apply(this,(j._init?j._init(n):arguments));for(var l in dhtmlx){if(j[l]){this[j[l]](dhtmlx[l])}}for(var l in n){if(j[l]){this[j[l]](n[l])}else{if(l.indexOf("on")===0){this.attachEvent(l,n[l])}}}}else{var m=c.apply(this,arguments)}if(j._patch){j._patch(this)}return m||this};window[a].prototype=c.prototype;if(g){dhtmlx.extend(window[a].prototype,g)}},url:function(a){if(a.indexOf("?")!=-1){return"&"}else{return"?"}}}}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop){return window.dhtmlDragAndDrop}this.lastLanding=0;this.dragNode=0;this.dragStartNode=0;this.dragStartObject=0;this.tempDOMU=null;this.tempDOMM=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,c){a.onmousedown=this.preCreateDragCopy;a.dragStarter=c;this.addDragLanding(a,c)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,c){a.dragLanding=c};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if((a||window.event)&&(a||event).button==2){return}if(window.dhtmlDragAndDrop.waitDrag){window.dhtmlDragAndDrop.waitDrag=0;document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;return false}if(window.dhtmlDragAndDrop.dragNode){window.dhtmlDragAndDrop.stopDrag(a)}window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=new Date().valueOf();if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlDragAndDropObject.prototype.callDrag=function(g){if(!g){g=window.event}dragger=window.dhtmlDragAndDrop;if((new Date()).valueOf()-dragger.downtime<100){return}if(!dragger.dragNode){if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,g);if(!dragger.dragNode){return dragger.stopDrag()}dragger.dragNode.onselectstart=function(){return false};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else{return dragger.stopDrag(g,true)}}if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var a=dragger.gldragNode;if(dragger.gldragNode.old){a=dragger.gldragNode.old}a.parentNode.removeChild(a);var c=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var l=document.createElement("Div");l.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=l.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=g.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=g.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!g.srcElement){var j=g.target}else{j=g.srcElement}dragger.checkLanding(j,g)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(l){if(window.name){var g=parent.frames[window.name].frameElement.offsetParent;var j=0;var c=0;while(g){j+=g.offsetLeft;c+=g.offsetTop;g=g.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);j+=a.split("_")[0]*1;c+=a.split("_")[1]*1}if(l){return j+"_"+c}else{this.fx=j}this.fy=c}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(c,a){if((c)&&(c.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=c;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,a.clientX,a.clientY,a);this.lastLanding_scr=(_isIE?a.srcElement:a.target)}else{if((c)&&(c.tagName!="BODY")){this.checkLanding(c.parentNode,a)}else{if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding,a.clientX,a.clientY,a)}this.lastLanding=0;if(this._onNotFound){this._onNotFound()}}}};dhtmlDragAndDropObject.prototype.stopDrag=function(c,g){dragger=window.dhtmlDragAndDrop;if(!g){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:c.target))}}dragger.lastLanding=null;if((dragger.dragNode)&&(dragger.dragNode.parentNode==document.body)){dragger.dragNode.parentNode.removeChild(dragger.dragNode)}dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(g){if(g){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=g)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window)}}catch(c){}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=g)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}}catch(c){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(g,j){if(g){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=g.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=g.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=g.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=g.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(j))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=g)){parent.dhtmlDragAndDrop.initFrameRoute(window)}}catch(c){}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=g)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.initFrameRoute(window,((!g||j)?1:0))}}catch(c){}}};_isFF=false;_isIE=false;_isOpera=false;_isKHTML=false;_isMacOS=false;_isChrome=false;_FFrv=false;_KHTMLrv=false;_OperaRv=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){_isChrome=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;_FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if((navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat"){_isIE=8}}else{if(navigator.appName=="Netscape"&&navigator.userAgent.indexOf("Trident")!=-1){_isIE=8}else{_isFF=true;_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}}if(typeof(window.dhtmlxEvent)=="undefined"){function dhtmlxEvent(c,g,a){if(c.addEventListener){c.addEventListener(g,a,false)}else{if(c.attachEvent){c.attachEvent("on"+g,a)}}}}if(dhtmlxEvent.touchDelay==null){dhtmlxEvent.touchDelay=2000}if(typeof(dhtmlxEvent.initTouch)=="undefined"){dhtmlxEvent.initTouch=function(){var j;var l;var c,a;dhtmlxEvent(document.body,"touchstart",function(m){l=m.touches[0].target;c=m.touches[0].clientX;a=m.touches[0].clientY;j=window.setTimeout(g,dhtmlxEvent.touchDelay)});function g(){if(l){var m=document.createEvent("HTMLEvents");m.initEvent("dblclick",true,true);l.dispatchEvent(m);j=l=null}}dhtmlxEvent(document.body,"touchmove",function(m){if(j){if(Math.abs(m.touches[0].clientX-c)>50||Math.abs(m.touches[0].clientY-a)>50){window.clearTimeout(j);j=l=false}}});dhtmlxEvent(document.body,"touchend",function(m){if(j){window.clearTimeout(j);j=l=false}});dhtmlxEvent.initTouch=function(){}}}if(!window.dhtmlx){dhtmlx={}}dhtmlx.assert=function(c,a){if(!c){dhtmlx.error(a)}};dhtmlx.assert_enabled=function(){return false};dhtmlx.assert_event=function(m,g){if(!m._event_check){m._event_check={};m._event_check_size={}}for(var c in g){m._event_check[c.toLowerCase()]=g[c];var l=-1;for(var j in g[c]){l++}m._event_check_size[c.toLowerCase()]=l}};dhtmlx.assert_method_info=function(l,c,j,m){var a=[];for(var g=0;g<m.length;g++){a.push(m[g][0]+" : "+m[g][1]+"\n   "+m[g][2].describe()+(m[g][3]?"; optional":""))}return l.name+"."+c+"\n"+j+"\n Arguments:\n - "+a.join("\n - ")};dhtmlx.assert_method=function(g,a){for(var c in a){dhtmlx.assert_method_process(g,c,a[c].descr,a[c].args,(a[c].min||99),a[c].skip)}};dhtmlx.assert_method_process=function(m,c,l,n,g,j){var a=m[c];if(!j){m[c]=function(){if(arguments.length!=n.length&&arguments.length<g){dhtmlx.log("warn","Incorrect count of parameters\n"+m[c].describe()+"\n\nExpecting "+n.length+" but have only "+arguments.length)}else{for(var o=0;o<n.length;o++){if(!n[o][3]&&!n[o][2](arguments[o])){dhtmlx.log("warn","Incorrect method call\n"+m[c].describe()+"\n\nActual value of "+(o+1)+" parameter: {"+(typeof arguments[o])+"} "+arguments[o])}}}return a.apply(this,arguments)}}m[c].describe=function(){return dhtmlx.assert_method_info(m,c,l,n)}};dhtmlx.assert_event_call=function(g,c,a){if(g._event_check){if(!g._event_check[c]){dhtmlx.log("warn","Not expected event call :"+c)}else{if(dhtmlx.isNotDefined(a)){dhtmlx.log("warn","Event without parameters :"+c)}else{if(g._event_check_size[c]!=a.length){dhtmlx.log("warn","Incorrect event call, expected "+g._event_check_size[c]+" parameter(s), but have "+a.length+" parameter(s), for "+c+" event")}}}}};dhtmlx.assert_event_attach=function(c,a){if(c._event_check&&!c._event_check[a]){dhtmlx.log("warn","Unknown event name: "+a)}};dhtmlx.assert_property=function(c,a){if(!c._settings_check){c._settings_check={}}dhtmlx.extend(c._settings_check,a)};dhtmlx.assert_check=function(g,c){if(typeof g=="object"){for(var a in g){dhtmlx.assert_settings(a,g[a],c)}}};dhtmlx.assert_settings=function(o,l,j){j=j||this._settings_check;if(j){if(!j[o]){return dhtmlx.log("warn","Unknown propery: "+o)}var n="";var c="";var a=false;for(var g=0;g<j[o].length;g++){var m=j[o][g];if(typeof m=="string"){continue}if(typeof m=="function"){a=a||m(l)}else{if(typeof m=="object"&&typeof m[1]=="function"){a=a||m[1](l);if(a&&m[2]){dhtmlx.assert_check(l,m[2])}}}if(a){break}}if(!a){dhtmlx.log("warn","Invalid configuration\n"+dhtmlx.assert_info(o,j)+"\nActual value: {"+(typeof l)+"} "+l)}}};dhtmlx.assert_info=function(c,m){var a=m[c];var l="";var j=[];for(var g=0;g<a.length;g++){if(typeof rule=="string"){l=a[g]}else{if(a[g].describe){j.push(a[g].describe())}else{if(a[g][1]&&a[g][1].describe){j.push(a[g][1].describe())}}}}return"Property: "+c+", "+l+" \nExpected value: \n - "+j.join("\n - ")};if(dhtmlx.assert_enabled()){dhtmlx.assert_rule_color=function(a){if(typeof a!="string"){return false}if(a.indexOf("#")!==0){return false}if(a.substr(1).replace(/[0-9A-F]/gi,"")!==""){return false}return true};dhtmlx.assert_rule_color.describe=function(){return"{String} Value must start from # and contain hexadecimal code of color"};dhtmlx.assert_rule_template=function(a){if(typeof a=="function"){return true}if(typeof a=="string"){return true}return false};dhtmlx.assert_rule_template.describe=function(){return"{Function},{String} Value must be a function which accepts data object and return text string, or a sting with optional template markers"};dhtmlx.assert_rule_boolean=function(a){if(typeof a=="boolean"){return true}return false};dhtmlx.assert_rule_boolean.describe=function(){return"{Boolean} true or false"};dhtmlx.assert_rule_object=function(a,c){if(typeof a=="object"){return true}return false};dhtmlx.assert_rule_object.describe=function(){return"{Object} Configuration object"};dhtmlx.assert_rule_string=function(a){if(typeof a=="string"){return true}return false};dhtmlx.assert_rule_string.describe=function(){return"{String} Plain string"};dhtmlx.assert_rule_htmlpt=function(a){return !!dhtmlx.toNode(a)};dhtmlx.assert_rule_htmlpt.describe=function(){return"{Object},{String} HTML node or ID of HTML Node"};dhtmlx.assert_rule_notdocumented=function(a){return false};dhtmlx.assert_rule_notdocumented.describe=function(){return"This options wasn't documented"};dhtmlx.assert_rule_key=function(c){var a=function(g){return c[g]};a.describe=function(){var j=[];for(var g in c){j.push(g)}return"{String} can take one of next values: "+j.join(", ")};return a};dhtmlx.assert_rule_dimension=function(a){if(a*1==a&&!isNaN(a)&&a>=0){return true}return false};dhtmlx.assert_rule_dimension.describe=function(){return"{Integer} value must be a positive number"};dhtmlx.assert_rule_number=function(a){if(typeof a=="number"){return true}return false};dhtmlx.assert_rule_number.describe=function(){return"{Integer} value must be a number"};dhtmlx.assert_rule_function=function(a){if(typeof a=="function"){return true}return false};dhtmlx.assert_rule_function.describe=function(){return"{Function} value must be a custom function"};dhtmlx.assert_rule_any=function(a){return true};dhtmlx.assert_rule_any.describe=function(){return"Any value"};dhtmlx.assert_rule_mix=function(g,c){var j=function(a){if(g(a)||c(a)){return true}return false};j.describe=function(){return g.describe()};return j}}dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.copy=function(c){var a=dhtmlx.copy._function;a.prototype=c;return new a()};dhtmlx.copy._function=function(){};dhtmlx.extend=function(c,a){for(var g in a){c[g]=a[g]}if(dhtmlx.assert_enabled()&&a._assert){c._assert();c._assert=null}dhtmlx.assert(c,"Invalid nesting target");dhtmlx.assert(a,"Invalid nesting source");if(a._init){c._init()}return c};dhtmlx.proto_extend=function(){var m=arguments;var g=m[0];var c=[];for(var l=m.length-1;l>0;l--){if(typeof m[l]=="function"){m[l]=m[l].prototype}for(var j in m[l]){if(j=="_init"){c.push(m[l][j])}else{if(!g[j]){g[j]=m[l][j]}}}}if(m[0]._init){c.push(m[0]._init)}g._init=function(){for(var n=0;n<c.length;n++){c[n].apply(this,arguments)}};g.base=m[1];var a=function(n){this._init(n);if(this._parseSettings){this._parseSettings(n,this.defaults)}};a.prototype=g;g=m=null;return a};dhtmlx.bind=function(c,a){return function(){return c.apply(a,arguments)}};dhtmlx.require=function(a){if(!dhtmlx._modules[a]){dhtmlx.assert(dhtmlx.ajax,"load module is required");dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx._modules[a]=true}};dhtmlx._modules={};dhtmlx.exec=function(code){if(window.execScript){window.execScript(code)}else{window.eval(code)}};dhtmlx.methodPush=function(a,g,c){return function(){var j=false;j=a[g].apply(a,arguments);return j}};dhtmlx.isNotDefined=function(c){return typeof c=="undefined"};dhtmlx.delay=function(j,c,g,a){setTimeout(function(){var l=j.apply(c,g);j=c=g=null;return l},a||1)};dhtmlx.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}this._seed++;return this._seed};dhtmlx.toNode=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};dhtmlx.toArray=function(a){return dhtmlx.extend((a||[]),dhtmlx.PowerArray)};dhtmlx.toFunctor=function(str){return(typeof(str)=="string")?eval(str):str};dhtmlx._events={};dhtmlx.event=function(j,g,a,c){j=dhtmlx.toNode(j);var l=dhtmlx.uid();dhtmlx._events[l]=[j,g,a];if(c){a=dhtmlx.bind(a,c)}if(j.addEventListener){j.addEventListener(g,a,false)}else{if(j.attachEvent){j.attachEvent("on"+g,a)}}return l};dhtmlx.eventRemove=function(c){if(!c){return}dhtmlx.assert(this._events[c],"Removing non-existing event");var a=dhtmlx._events[c];if(a[0].removeEventListener){a[0].removeEventListener(a[1],a[2],false)}else{if(a[0].detachEvent){a[0].detachEvent("on"+a[1],a[2])}}delete this._events[c]};dhtmlx.log=function(c,g,a){if(window.console&&console.log){c=c.toLowerCase();if(window.console[c]){window.console[c](g||"unknown error")}else{window.console.log(c+": "+g)}if(a){window.console.log(a)}}};dhtmlx.log_full_time=function(a){dhtmlx._start_time_log=new Date();dhtmlx.log("Info","Timing start ["+a+"]");window.setTimeout(function(){var c=new Date();dhtmlx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhtmlx._start_time_log.valueOf())/1000+"s")},1)};dhtmlx.log_time=function(a){var g="_start_time_log"+a;if(!dhtmlx[g]){dhtmlx[g]=new Date();dhtmlx.log("Info","Timing start ["+a+"]")}else{var c=new Date();dhtmlx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhtmlx[g].valueOf())/1000+"s");dhtmlx[g]=null}};dhtmlx.error=function(c,a){dhtmlx.log("error",c,a)};dhtmlx.EventSystem={_init:function(){this._events={};this._handlers={};this._map={}},block:function(){this._events._block=true},unblock:function(){this._events._block=false},mapEvent:function(a){dhtmlx.extend(this._map,a)},callEvent:function(g,l){if(this._events._block){return true}g=g.toLowerCase();dhtmlx.assert_event_call(this,g,l);var j=this._events[g.toLowerCase()];var a=true;if(dhtmlx.debug){dhtmlx.log("info","["+this.name+"] event:"+g,l)}if(j){for(var c=0;c<j.length;c++){if(j[c].apply(this,(l||[]))===false){a=false}}}if(this._map[g]&&!this._map[g].callEvent(g,l)){a=false}return a},attachEvent:function(c,a,j){c=c.toLowerCase();dhtmlx.assert_event_attach(this,c);j=j||dhtmlx.uid();a=dhtmlx.toFunctor(a);var g=this._events[c]||dhtmlx.toArray();g.push(a);this._events[c]=g;this._handlers[j]={f:a,t:c};return j},detachEvent:function(j){if(this._handlers[j]){var c=this._handlers[j].t;var a=this._handlers[j].f;var g=this._events[c];g.remove(a);delete this._handlers[j]}}};dhtmlx.PowerArray={removeAt:function(c,a){if(c>=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,g){if(!g&&g!==0){this.push(c)}else{var a=this.splice(g,(this.length-g));this[g]=c;this.push.apply(this,a)}},find:function(a){for(i=0;i<this.length;i++){if(a==this[i]){return i}}return -1},each:function(a,g){for(var c=0;c<this.length;c++){a.call((g||this),this[c])}},map:function(a,g){for(var c=0;c<this.length;c++){this[c]=a.call((g||this),this[c])}return this}};dhtmlx.env={};if(navigator.userAgent.indexOf("Opera")!=-1){dhtmlx._isOpera=true}else{dhtmlx._isIE=!!document.all;dhtmlx._isFF=!document.all;dhtmlx._isWebKit=(navigator.userAgent.indexOf("KHTML")!=-1);if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"){dhtmlx._isIE=8}if(navigator.appVersion.indexOf("MSIE 9.0")!=-1&&document.compatMode!="BackCompat"){dhtmlx._isIE=9}}dhtmlx.env={};(function(){dhtmlx.env.transform=false;dhtmlx.env.transition=false;var a={};a.names=["transform","transition"];a.transform=["transform","WebkitTransform","MozTransform","oTransform","msTransform"];a.transition=["transition","WebkitTransition","MozTransition","oTransition"];var j=document.createElement("DIV");var g;for(var c=0;c<a.names.length;c++){while(p=a[a.names[c]].pop()){if(typeof j.style[p]!="undefined"){dhtmlx.env[a.names[c]]=true}}}})();dhtmlx.env.transform_prefix=(function(){var a;if(dhtmlx._isOpera){a="-o-"}else{a="";if(dhtmlx._isFF){a="-moz-"}if(dhtmlx._isWebKit){a="-webkit-"}}return a})();dhtmlx.env.svg=(function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")})();dhtmlx.zIndex={drag:10000};dhtmlx.html={create:function(c,a,g){a=a||{};var j=document.createElement(c);for(var l in a){j.setAttribute(l,a[l])}if(a.style){j.style.cssText=a.style}if(a["class"]){j.className=a["class"]}if(g){j.innerHTML=g}return j},getValue:function(a){a=dhtmlx.toNode(a);if(!a){return""}return dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(c){if(c instanceof Array){for(var a=0;a<c.length;a++){this.remove(c[a])}}else{if(c&&c.parentNode){c.parentNode.removeChild(c)}}},insertBefore:function(c,g,a){if(!c){return}if(g){g.parentNode.insertBefore(c,g)}else{a.appendChild(c)}},locate:function(c,j){c=c||event;var a=c.target||c.srcElement;while(a){if(a.getAttribute){var g=a.getAttribute(j);if(g){return g}}a=a.parentNode}return null},offset:function(j){if(j.getBoundingClientRect){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{y:Math.round(r),x:Math.round(g)}}else{var r=0,g=0;while(j){r=r+parseInt(j.offsetTop,10);g=g+parseInt(j.offsetLeft,10);j=j.offsetParent}return{y:r,x:g}}},pos:function(a){a=a||event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}var c=((dhtmlx._isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:a.clientX+c.scrollLeft-c.clientLeft,y:a.clientY+c.scrollTop-c.clientTop}},preventEvent:function(a){if(a&&a.preventDefault){a.preventDefault()}dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=true;return false},addCss:function(c,a){c.className+=" "+a},removeCss:function(c,a){c.className=c.className.replace(RegExp(a,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");dhtmlx.assert(a.length,"Can't locate codebase");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"}})();if(!dhtmlx.ui){dhtmlx.ui={}}dhtmlx.Destruction={_init:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this._htmlmap=null;this._htmlrows=null;if(this._html){document.body.appendChild(this._html)}this._html=null;if(this._obj){this._obj.innerHTML="";this._obj._htmlmap=null}this._obj=this._dataobj=null;this.data=null;this._events=this._handlers={};if(this.render){this.render=function(){}}}};dhtmlx.destructors=[];dhtmlx.event(window,"unload",function(){if(dhtmlx.destructors){for(var g=0;g<dhtmlx.destructors.length;g++){dhtmlx.destructors[g].destructor()}dhtmlx.destructors=[]}for(var c in dhtmlx._events){var j=dhtmlx._events[c];if(j[0].removeEventListener){j[0].removeEventListener(j[1],j[2],false)}else{if(j[0].detachEvent){j[0].detachEvent("on"+j[1],j[2])}}delete dhtmlx._events[c]}});dhtmlx.ajax=function(a,c,g){if(arguments.length!==0){var j=new dhtmlx.ajax();if(g){j.master=g}j.get(a,null,c)}if(!this.getXHR){return new dhtmlx.ajax()}return this};dhtmlx.ajax.prototype={getXHR:function(){if(dhtmlx._isIE){return new ActiveXObject("Microsoft.xmlHTTP")}else{return new XMLHttpRequest()}},send:function(l,q,n){var c=this.getXHR();if(typeof n=="function"){n=[n]}if(typeof q=="object"){var m=[];for(var g in q){var o=q[g];if(o===null||o===dhtmlx.undefined){o=""}m.push(g+"="+encodeURIComponent(o))}q=m.join("&")}if(q&&!this.post){l=l+(l.indexOf("?")!=-1?"&":"?")+q;q=null}c.open(this.post?"POST":"GET",l,!this._sync);if(this.post){c.setRequestHeader("Content-type","application/x-www-form-urlencoded")}var j=this;c.onreadystatechange=function(){if(!c.readyState||c.readyState==4){if(n&&j){for(var a=0;a<n.length;a++){if(n[a]){n[a].call((j.master||j),c.responseText,c.responseXML,c)}}}j.master=null;n=j=null}};c.send(q||null);return c},get:function(a,g,c){this.post=false;return this.send(a,g,c)},post:function(a,g,c){this.post=true;return this.send(a,g,c)},sync:function(){this._sync=true;return this}};dhtmlx.AtomDataLoader={_init:function(a){this.data={};if(a){this._settings.datatype=a.datatype||"json";this._after_init.push(this._load_when_ready)}},_load_when_ready:function(){this._ready_for_data=true;if(this._settings.url){this.url_setter(this._settings.url)}if(this._settings.data){this.data_setter(this._settings.data)}},url_setter:function(a){if(!this._ready_for_data){return a}this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data){return a}this.parse(a,this._settings.datatype);return true},load:function(a,c){this.callEvent("onXLS",[]);if(typeof c=="string"){this.data.driver=dhtmlx.DataDriver[c];c=arguments[2]}else{this.data.driver=dhtmlx.DataDriver.xml}dhtmlx.ajax(a,[this._onLoad,c],this)},parse:function(c,a){this.callEvent("onXLS",[]);this.data.driver=dhtmlx.DataDriver[a||"xml"];this._onLoad(c,null)},_onLoad:function(l,c,a){var g=this.data.driver;var j=g.getRecords(g.toObject(l,c))[0];this.data=(g?g.getDetails(j):l);this.callEvent("onXLE",[])},_check_data_feed:function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.callEvent("onXLS",[]);dhtmlx.ajax(a,function(j,g){this._ignore_feed=true;this.setValues(dhtmlx.DataDriver.json.toObject(j)[0]);this._ignore_feed=false;this.callEvent("onXLE",[])},this);return false}};dhtmlx.DataDriver={};dhtmlx.DataDriver.json={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){eval("dhtmlx.temp="+data);return dhtmlx.temp}return data},getRecords:function(a){if(a&&!(a instanceof Array)){return[a]}return a},getDetails:function(a){return a},getInfo:function(a){return{_size:(a.total_count||0),_from:(a.pos||0),_key:(a.dhx_security)}}};dhtmlx.DataDriver.json_ext={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){var temp;eval("temp="+data);dhtmlx.temp=[];var header=temp.header;for(var i=0;i<temp.data.length;i++){var item={};for(var j=0;j<header.length;j++){if(typeof(temp.data[i][j])!="undefined"){item[header[j]]=temp.data[i][j]}}dhtmlx.temp.push(item)}return dhtmlx.temp}return data},getRecords:function(a){if(a&&!(a instanceof Array)){return[a]}return a},getDetails:function(a){return a},getInfo:function(a){return{_size:(a.total_count||0),_from:(a.pos||0)}}};dhtmlx.DataDriver.html={toObject:function(c){if(typeof c=="string"){var a=null;if(c.indexOf("<")==-1){a=dhtmlx.toNode(c)}if(!a){a=document.createElement("DIV");a.innerHTML=c}return a.getElementsByTagName(this.tag)}return c},getRecords:function(a){if(a.tagName){return a.childNodes}return a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(a){return{_size:0,_from:0}},tag:"LI"};dhtmlx.DataDriver.jsarray={toObject:function(data){if(typeof data=="string"){eval("dhtmlx.temp="+data);return dhtmlx.temp}return data},getRecords:function(a){return a},getDetails:function(g){var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}}};dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(g){g=this.stringToArray(g);var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}},stringToArray:function(c){c=c.split(this.cell);for(var a=0;a<c.length;a++){c[a]=c[a].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"")}return c},row:"\n",cell:","};dhtmlx.DataDriver.xml={toObject:function(c,a){if(a&&(a=this.checkResponse(c,a))){return a}if(typeof c=="string"){return this.fromString(c)}return c},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){return{_size:(a.documentElement.getAttribute("total_count")||0),_from:(a.documentElement.getAttribute("pos")||0),_key:(a.documentElement.getAttribute("dhx_security"))}},xpath:function(j,q){if(window.XPathResult){var g=j;if(j.nodeName.indexOf("document")==-1){j=j.ownerDocument}var n=[];var c=j.evaluate(q,g,null,XPathResult.ANY_TYPE,null);var o=c.iterateNext();while(o){n.push(o);o=c.iterateNext()}return n}else{var m=true;try{if(typeof(j.selectNodes)=="undefined"){m=false}}catch(l){}if(m){return j.selectNodes(q)}else{var a=q.split("/").pop();return j.getElementsByTagName(a)}}},tagToObject:function(g,q){q=q||{};var l=false;var j=g.attributes;if(j&&j.length){for(var n=0;n<j.length;n++){q[j[n].name]=j[n].value}l=true}var c=g.childNodes;var o={};for(var n=0;n<c.length;n++){if(c[n].nodeType==1){var m=c[n].tagName;if(typeof q[m]!="undefined"){if(!(q[m] instanceof Array)){q[m]=[q[m]]}q[m].push(this.tagToObject(c[n],{}))}else{q[c[n].tagName]=this.tagToObject(c[n],{})}l=true}}if(!l){return this.nodeValue(g)}q.value=this.nodeValue(g);return q},nodeValue:function(a){if(a.firstChild){return a.firstChild.wholeText||a.firstChild.data}return""},fromString:function(c){if(window.DOMParser&&!dhtmlx._isIE){return(new DOMParser()).parseFromString(c,"text/xml")}if(window.ActiveXObject){var a=new ActiveXObject("Microsoft.xmlDOM");a.loadXML(c);return a}dhtmlx.error("Load from xml string is not supported")},checkResponse:function(j,g){if(g&&(g.firstChild&&g.firstChild.tagName!="parsererror")){return g}var c=this.fromString(j.replace(/^[\s]+/,""));if(c){return c}dhtmlx.error("xml can't be parsed",j)}};dhtmlx.DataLoader={_init:function(a){a=a||"";this.name="DataStore";this.data=(a.datastore)||(new dhtmlx.DataStore());this._readyHandler=this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._call_onready,this))},load:function(a,c){dhtmlx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed){this.data.feed=function(j,g){if(this._load_count){return this._load_count=[j,g]}else{this._load_count=true}this.load(a+((a.indexOf("?")==-1)?"?":"&")+"posStart="+j+"&count="+g,function(){var l=this._load_count;this._load_count=false;if(typeof l=="object"){this.data.feed.apply(this,l)}})}}},_onLoad:function(g,c,a){this.data._parse(this.data.driver.toObject(g,c));this.callEvent("onXLE",[]);if(this._readyHandler){this.data.detachEvent(this._readyHandler);this._readyHandler=null}},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhtmlx.bind(function(n,m){if(this._settings.dataFeed){var l={};if(!n&&!l){return}if(typeof n=="function"){if(!m){return}n(m,l)}else{l={text:m}}this.clearAll();var c=this._settings.dataFeed;if(typeof c=="function"){return c.call(this,m,l)}var j=[];for(var g in l){j.push("dhx_filter["+g+"]="+encodeURIComponent(l[g]))}this.load(c+(c.indexOf("?")<0?"?":"&")+j.join("&"),this._settings.datatype);return false}},this));return a},_call_onready:function(){if(this._settings.ready){var a=dhtmlx.toFunctor(this._settings.ready);if(a&&a.call){a.apply(this,arguments)}}}};dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};dhtmlx.DataStore.prototype={setDriver:function(a){dhtmlx.assert(dhtmlx.DataDriver[a],"incorrect DataDriver");this.driver=dhtmlx.DataDriver[a]},_parse:function(m){this.callEvent("onParse",[this.driver,m]);if(this._filter_order){this.filter()}var n=this.driver.getInfo(m);if(n._key){dhtmlx.security_key=n._key}var l=this.driver.getRecords(m);var q=(n._from||0)*1;if(q===0&&this.order[0]){q=this.order.length}var c=0;for(var g=0;g<l.length;g++){var a=this.driver.getDetails(l[g]);var o=this.id(a);if(!this.pull[o]){this.order[c+q]=o;c++}this.pull[o]=a;if(this.extraParser){this.extraParser(a)}if(this._scheme){if(this._scheme.$init){this._scheme.$update(a)}else{if(this._scheme.$update){this._scheme.$update(a)}}}}for(var g=0;g<n._size;g++){if(!this.order[g]){var o=dhtmlx.uid();var a={id:o,$template:"loading"};this.pull[o]=a;this.order[g]=o}}this.callEvent("onStoreLoad",[this.driver,m]);this.refresh()},id:function(a){return a.id||(a.id=dhtmlx.uid())},changeId:function(c,a){dhtmlx.assert(this.pull[c],"Can't change id, for non existing item: "+c);this.pull[a]=this.pull[c];this.pull[a].id=a;this.order[this.order.find(c)]=a;if(this._filter_order){this._filter_order[this._filter_order.find(c)]=a}this.callEvent("onIdChange",[c,a]);if(this._render_change_id){this._render_change_id(c,a)}},get:function(a){return this.item(a)},set:function(c,a){return this.update(c,a)},item:function(a){return this.pull[a]},update:function(c,a){if(this._scheme&&this._scheme.$update){this._scheme.$update(a)}if(this.callEvent("onBeforeUpdate",[c,a])===false){return false}this.pull[c]=a;this.refresh(c)},refresh:function(a){if(this._skip_refresh){return}if(a){this.callEvent("onStoreUpdated",[a,this.pull[a],"update"])}else{this.callEvent("onStoreUpdated",[null,null,null])}},silent:function(a){this._skip_refresh=true;a.call(this);this._skip_refresh=false},getRange:function(j,g){if(j){j=this.indexById(j)}else{j=this.startOffset||0}if(g){g=this.indexById(g)}else{g=Math.min((this.endOffset||Infinity),(this.dataCount()-1));if(g<0){g=0}}if(j>g){var c=g;g=j;j=c}return this.getIndexRange(j,g)},getIndexRange:function(j,g){g=Math.min((g||Infinity),this.dataCount()-1);var a=dhtmlx.toArray();for(var c=(j||0);c<=g;c++){a.push(this.item(this.order[c]))}return a},dataCount:function(){return this.order.length},exists:function(a){return !!(this.pull[a])},move:function(a,j){if(a<0||j<0){dhtmlx.error("DataStore::move","Incorrect indexes");return}var g=this.idByIndex(a);var c=this.item(g);this.order.removeAt(a);this.order.insertAt(g,Math.min(this.order.length,j));this.callEvent("onStoreUpdated",[g,c,"move"])},scheme:function(a){this._scheme=a},sync:function(l,j,a){if(typeof j!="function"){a=j;j=null}if(dhtmlx.debug_bind){this.debug_sync_master=l;dhtmlx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}var g=l;if(l.name!="DataStore"){l=l.data}var c=dhtmlx.bind(function(o,m,n){if(n!="update"||j){o=null}if(!o){this.order=dhtmlx.toArray([].concat(l.order));this._filter_order=null;this.pull=l.pull;if(j){this.silent(j)}if(this._on_sync){this._on_sync()}}if(dhtmlx.debug_bind){dhtmlx.log("[sync:request] "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id+" <= "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id)}if(!a){this.refresh(o)}else{a=false}},this);l.attachEvent("onStoreUpdated",c);this.feed=function(n,m){g.loadNext(m,n)};c()},add:function(l,a){if(this._scheme){l=l||{};for(var c in this._scheme){l[c]=l[c]||this._scheme[c]}if(this._scheme){if(this._scheme.$init){this._scheme.$update(l)}else{if(this._scheme.$update){this._scheme.$update(l)}}}}var m=this.id(l);var j=this.dataCount();if(dhtmlx.isNotDefined(a)||a<0){a=j}if(a>j){dhtmlx.log("Warning","DataStore:add","Index of out of bounds");a=Math.min(this.order.length,a)}if(this.callEvent("onBeforeAdd",[m,l,a])===false){return false}if(this.exists(m)){return dhtmlx.error("Not unique ID")}this.pull[m]=l;this.order.insertAt(m,a);if(this._filter_order){var g=this._filter_order.length;if(!a&&this.order.length){g=0}this._filter_order.insertAt(m,g)}this.callEvent("onafterAdd",[m,a]);this.callEvent("onStoreUpdated",[m,l,"add"]);return m},remove:function(g){if(g instanceof Array){for(var a=0;a<g.length;a++){this.remove(g[a])}return}if(this.callEvent("onBeforeDelete",[g])===false){return false}if(!this.exists(g)){return dhtmlx.error("Not existing ID",g)}var c=this.item(g);this.order.remove(g);if(this._filter_order){this._filter_order.remove(g)}delete this.pull[g];this.callEvent("onafterdelete",[g]);this.callEvent("onStoreUpdated",[g,c,"delete"])},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this.feed=null;this._filter_order=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){if(a>=this.order.length||a<0){dhtmlx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);return a},next:function(c,a){return this.order[this.indexById(c)+(a||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(c,a){return this.order[this.indexById(c)-(a||1)]},sort:function(m,c,a){var g=m;if(typeof m=="function"){g={as:m,dir:c}}else{if(typeof m=="string"){g={by:m,dir:c,as:a}}}var l=[g.by,g.dir,g.as];if(!this.callEvent("onbeforesort",l)){return}if(this.order.length){var n=dhtmlx.sort.create(g);var j=this.getRange(this.first(),this.last());j.sort(n);this.order=j.map(function(o){return this.id(o)},this)}this.refresh();this.callEvent("onaftersort",l)},filter:function(l,j){if(!this.callEvent("onBeforeFilter",[l,j])){return}if(this._filter_order){this.order=this._filter_order;delete this._filter_order}if(!this.order.length){return}if(l){var c=l;j=j||"";if(typeof l=="string"){l=dhtmlx.Template.fromHTML(l);j=j.toString().toLowerCase();c=function(o,n){return l(o).toLowerCase().indexOf(n)!=-1}}var g=dhtmlx.toArray();for(var a=0;a<this.order.length;a++){var m=this.order[a];if(c(this.item(m),j)){g.push(m)}}this._filter_order=this.order;this.order=g}this.refresh();this.callEvent("onAfterFilter",[])},each:function(g,c){for(var a=0;a<this.order.length;a++){g.call((c||this),this.item(this.order[a]))}},provideApi:function(j,c){this.debug_bind_master=j;if(c){this.mapEvent({onbeforesort:j,onaftersort:j,onbeforeadd:j,onafteradd:j,onbeforedelete:j,onafterdelete:j,onbeforeupdate:j})}var g=["get","set","sort","add","remove","exists","idByIndex","indexById","item","update","refresh","dataCount","filter","next","previous","clearAll","first","last","serialize"];for(var a=0;a<g.length;a++){j[g[a]]=dhtmlx.methodPush(this,g[a])}if(dhtmlx.assert_enabled()){this.assert_event(j)}},serialize:function(){var g=this.order;var a=[];for(var c=0;c<g.length;c++){a.push(this.pull[g[c]])}return a}};dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(g,c){g=g*1;c=c*1;return g>c?1:(g<c?-1:0)},string_strict:function(g,c){g=g.toString();c=c.toString();return g>c?1:(g<c?-1:0)},string:function(g,c){g=g.toString().toLowerCase();c=c.toString().toLowerCase();return g>c?1:(g<c?-1:0)}},by:function(c,a){if(!c){return a}if(typeof a!="function"){a=dhtmlx.sort.as[a||"string"]}c=dhtmlx.Template.fromHTML(c);return function(j,g){return a(c(j),c(g))}},dir:function(c,a){if(c=="asc"){return a}return function(j,g){return a(j,g)*-1}}};dhtmlx.KeyEvents={_init:function(){dhtmlx.event(this._obj,"keypress",this._onKeyPress,this)},_onKeyPress:function(c){c=c||event;var a=c.which||c.keyCode;this.callEvent((this._edit_id?"onEditKeyPress":"onKeyPress"),[a,c.ctrlKey,c.shiftKey,c])}};dhtmlx.MouseEvents={_init:function(){if(this.on_click){dhtmlx.event(this._obj,"click",this._onClick,this);dhtmlx.event(this._obj,"contextmenu",this._onContext,this)}if(this.on_dblclick){dhtmlx.event(this._obj,"dblclick",this._onDblClick,this)}if(this.on_mouse_move){dhtmlx.event(this._obj,"mousemove",this._onMouse,this);dhtmlx.event(this._obj,(dhtmlx._isIE?"mouseleave":"mouseout"),this._onMouse,this)}},_onClick:function(a){return this._mouseEvent(a,this.on_click,"ItemClick")},_onDblClick:function(a){return this._mouseEvent(a,this.on_dblclick,"ItemDblClick")},_onContext:function(a){var c=dhtmlx.html.locate(a,this._id);if(c&&!this.callEvent("onBeforeContextMenu",[c,a])){return dhtmlx.html.preventEvent(a)}},_onMouse:function(a){if(dhtmlx._isIE){a=document.createEventObject(event)}if(this._mouse_move_timer){window.clearTimeout(this._mouse_move_timer)}this.callEvent("onMouseMoving",[a]);this._mouse_move_timer=window.setTimeout(dhtmlx.bind(function(){if(a.type=="mousemove"){this._onMouseMove(a)}else{this._onMouseOut(a)}},this),500)},_onMouseMove:function(a){if(!this._mouseEvent(a,this.on_mouse_move,"MouseMove")){this.callEvent("onMouseOut",[a||event])}},_onMouseOut:function(a){this.callEvent("onMouseOut",[a||event])},_mouseEvent:function(m,l,c){m=m||event;var a=m.target||m.srcElement;var g="";var n=null;var j=false;while(a&&a.parentNode){if(!j&&a.getAttribute){n=a.getAttribute(this._id);if(n){if(a.getAttribute("userdata")){this.callEvent("onLocateData",[n,a])}if(!this.callEvent("on"+c,[n,m,a])){return}j=true}}g=a.className;if(g){g=g.split(" ");g=g[0]||g[1];if(l[g]){return l[g].call(this,m,n||dhtmlx.html.locate(m,this._id),a)}}a=a.parentNode}return j}};dhtmlx.Settings={_init:function(){this._settings=this.config={}},define:function(c,a){if(typeof c=="object"){return this._parseSeetingColl(c)}return this._define(c,a)},_define:function(c,a){dhtmlx.assert_settings.call(this,c,a);var g=this[c+"_setter"];return this._settings[c]=g?g.call(this,a):a},_parseSeetingColl:function(g){if(g){for(var c in g){this._define(c,g[c])}}},_parseSettings:function(g,a){var c=dhtmlx.extend({},a);if(typeof g=="object"&&!g.tagName){dhtmlx.extend(c,g)}this._parseSeetingColl(c)},_mergeSettings:function(a,g){for(var c in g){switch(typeof a[c]){case"object":a[c]=this._mergeSettings((a[c]||{}),g[c]);break;case"undefined":a[c]=g[c];break;default:break}}return a},_parseContainer:function(c,a,g){if(typeof c=="object"&&!c.tagName){c=c.container}this._obj=this.$view=dhtmlx.toNode(c);if(!this._obj&&g){this._obj=g(c)}dhtmlx.assert(this._obj,"Incorrect html container");this._obj.className+=" "+a;this._obj.onselectstart=function(){return false};this._dataobj=this._obj},_set_type:function(a){if(typeof a=="object"){return this.type_setter(a)}dhtmlx.assert(this.types,"RenderStack :: Types are not defined");dhtmlx.assert(this.types[a],"RenderStack :: Inccorect type name",a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){if(a){dhtmlx.extend(this.type,a)}this.type._item_start=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type._item_end=this.template_item_end(this.type);this.render()},type_setter:function(a){this._set_type(typeof a=="object"?dhtmlx.Type.add(this,a):a);return a},template_setter:function(a){return this.type_setter({template:a})},css_setter:function(a){this._obj.className+=" "+a;return a}};dhtmlx.Template={_cache:{},empty:function(){return""},setter:function(a){return dhtmlx.Template.fromHTML(a)},obj_setter:function(c){var a=dhtmlx.Template.setter(c);var g=this;return function(){return a.apply(g,arguments)}},fromHTML:function(a){if(typeof a=="function"){return a}if(this._cache[a]){return this._cache[a]}a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this._cache[a]=Function("obj","common",a)}};dhtmlx.Type={add:function(g,c){if(!g.types&&g.prototype.types){g=g.prototype}if(dhtmlx.assert_enabled()){this.assert_event(c)}var a=c.name||"default";this._template(c);this._template(c,"edit");this._template(c,"loading");g.types[a]=dhtmlx.extend(dhtmlx.extend({},(g.types[a]||this._default)),c);return a},_default:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},_template:function(g,a){a="template"+(a?("_"+a):"");var c=g[a];if(c&&(typeof c=="string")){if(c.indexOf("->")!=-1){c=c.split("->");switch(c[0]){case"html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case"http":c=new dhtmlx.ajax().sync().get(c[1],{uid:(new Date()).valueOf()}).responseText;break;default:break}}g[a]=dhtmlx.Template.fromHTML(c)}}};dhtmlx.SingleRender={_init:function(){},_toHTML:function(a){return this.type._item_start(a,this.type)+this.type.template(a,this.type)+this.type._item_end},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data){this._dataobj.innerHTML=this._toHTML(this.data)}if(this.callEvent){this.callEvent("onAfterRender",[])}}}};dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}if(typeof a=="string"){a={template:a}}dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this._parseSettings(a,{type:"default",dy:0,dx:20});this._dataobj=this._obj=document.createElement("DIV");this._obj.className="dhx_tooltip";dhtmlx.html.insertBefore(this._obj,document.body.firstChild)};dhtmlx.ui.Tooltip.prototype={show:function(a,c){if(this._disabled){return}if(this.data!=a){this.data=a;this.render(a)}this._obj.style.top=c.y+this._settings.dy+"px";this._obj.style.left=c.x+this._settings.dx+"px";this._obj.style.display="block"},hide:function(){this.data=null;this._obj.style.display="none"},disable:function(){this._disabled=true},enable:function(){this._disabled=false},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};dhtmlx.AutoTooltip={tooltip_setter:function(c){var a=new dhtmlx.ui.Tooltip(c);this.attachEvent("onMouseMove",function(j,g){a.show(this.get(j),dhtmlx.html.pos(g))});this.attachEvent("onMouseOut",function(j,g){a.hide()});this.attachEvent("onMouseMoving",function(j,g){a.hide()});return a}};dhtmlx.compat=function(a,c){if(dhtmlx.compat[a]){dhtmlx.compat[a](c)}};if(!dhtmlx.attaches){dhtmlx.attaches={}}dhtmlx.attaches.attachAbstract=function(c,a){var l=document.createElement("DIV");l.id="CustomObject_"+dhtmlx.uid();l.style.width="100%";l.style.height="100%";l.cmp="grid";document.body.appendChild(l);this.attachObject(l.id);a.container=l.id;var j=this.vs[this.av];j.grid=new window[c](a);j.gridId=l.id;j.gridObj=l;j.grid.setSizes=function(){if(this.resize){this.resize()}else{this.render()}};var g="_viewRestore";return this.vs[this[g]()].grid};dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};function dhtmlXCellObject(g,a){this.cell=document.createElement("DIV");this.cell.className="dhx_cell"+(a||"");this._idd=g;this._isCell=true;this.conf={borders:true,idx:{},css:a||"",idx_data:{cont:"dhx_cell_cont",pr1:"dhx_cell_progress_bar",pr2:"dhx_cell_progress_img",menu:"dhx_cell_menu",toolbar:"dhx_cell_toolbar",ribbon:"dhx_cell_ribbon",sb:"dhx_cell_statusbar",cover:"dhx_cell_cover"},ofs_nodes:{t:{},b:{}}};this.dataNodes={};this.views={};var c=document.createElement("DIV");c.className="dhx_cell_cont"+this.conf.css;this.cell.appendChild(c);c=null;this._updateIdx=function(){for(var j in this.conf.idx){this.conf.idx[j]=null;delete this.conf.idx[j]}for(var n=0;n<this.cell.childNodes.length;n++){var l=this.cell.childNodes[n].className;for(var j in this.conf.idx_data){var m=new RegExp(this.conf.idx_data[j]);if(l.match(m)!=null){this.conf.idx[j]=n}}}this.callEvent("_onIdxUpdated",[])};this._adjustAttached=function(){for(var j in this.dataNodes){if(this.dataNodes[j]!=null&&typeof(this.dataNodes[j].setSizes)=="function"){this.dataNodes[j].setSizes()}}if(this.dataObj!=null&&typeof(this.dataObj.setSizes)=="function"){if(this.dataType=="layout"&&typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof window.dhtmlXLayoutCell&&this.dataObj._getMainInst()!=this.layout._getMainInst()){this.dataObj.setSizes();return}this.dataObj.setSizes.apply(this.dataObj,arguments)}};this._setSize=function(u,r,v,n,o,q,l,m){if(this.conf.size==null){this.conf.size={}}if(m==null){m={}}var A={left:"x",top:"y",width:"w",height:"h"};this.conf.size.x=u;this.conf.size.y=r;this.conf.size.w=Math.max(v,0);this.conf.size.h=Math.max(n,0);for(var s in A){var j=(m[s]||s);this.cell.style[j]=this.conf.size[A[s]]+"px"}this.callEvent("_onSetSize",[]);if(q!==true){this._adjustCont(o,l)}else{this._adjustAttached(o)}this._adjustProgress()};this._adjustCont=function(q,n){var o=this.cell.childNodes[this.conf.idx.cont];var m=0;for(var j in this.conf.ofs_nodes.t){var l=this.conf.ofs_nodes.t[j];m+=(l=="func"?this[j]():(l==true?this.cell.childNodes[this.conf.idx[j]].offsetHeight:0))}var r=0;for(var j in this.conf.ofs_nodes.b){var l=this.conf.ofs_nodes.b[j];r+=(l=="func"?this[j]():(l==true?this.cell.childNodes[this.conf.idx[j]].offsetHeight:0))}o.style.left="0px";o.style.top=m+"px";if(!this.conf.cells_cont){this.conf.cells_cont={};o.style.width=this.cell.offsetWidth+"px";o.style.height=Math.max(this.cell.offsetHeight-m-r,0)+"px";this.conf.cells_cont.w=parseInt(o.style.width)-o.offsetWidth;this.conf.cells_cont.h=parseInt(o.style.height)-o.offsetHeight}o.style.left="0px";o.style.top=m+"px";o.style.width=Math.max(this.cell.offsetWidth+this.conf.cells_cont.w,0)+"px";o.style.height=Math.max(this.conf.size.h-m-r+this.conf.cells_cont.h,0)+"px";o=null;this._adjustAttached(q);if(n=="expand"&&this.dataType=="editor"&&this.dataObj!=null){this.dataObj._prepareContent(true)}};this._mtbUpdBorder=function(){var l=["menu","toolbar","ribbon"];for(var n=0;n<l.length;n++){if(this.conf.idx[l[n]]!=null){var o=this.cell.childNodes[this.conf.idx[l[n]]];var m="dhx_cell_"+l[n]+"_no_borders";var j="dhx_cell_"+l[n]+"_def";o.className=o.className.replace(new RegExp(this.conf.borders?m:j),this.conf.borders?j:m);o=null}}};this._resetSizeState=function(){this.conf.cells_cont=null};this.conf.view="def";this.conf.views_loaded={};this.conf.views_loaded[this.conf.view]=true;this._viewSave=function(m){this.views[m]={borders:this.conf.borders,ofs_nodes:{t:{},b:{}},url_data:this.conf.url_data,dataType:this.dataType,dataObj:this.dataObj,cellCont:[],dataNodes:{},dataNodesCont:{}};var n=this.cell.childNodes[this.conf.idx.cont];while(n.childNodes.length>0){this.views[m].cellCont.push(n.firstChild);n.removeChild(n.firstChild)}n=null;this.dataType=null;this.dataObj=null;this.conf.url_data=null;for(var l in this.dataNodes){for(var j in this.conf.ofs_nodes){if(typeof(this.conf.ofs_nodes[j][l])!="undefined"){this.views[m].ofs_nodes[j][l]=this.conf.ofs_nodes[j][l];this.conf.ofs_nodes[j][l]=null;delete this.conf.ofs_nodes[j][l]}}this.views[m].dataNodesCont[l]=this.cell.childNodes[this.conf.idx[l]];this.cell.removeChild(this.cell.childNodes[this.conf.idx[l]]);this.views[m].dataNodes[l]=this.dataNodes[l];this.dataNodes[l]=null;delete this.dataNodes[l];this._updateIdx()}this.callEvent("_onViewSave",[m])};this._viewRestore=function(m){if(this.views[m]==null){return}this.dataObj=this.views[m].dataObj;this.dataType=this.views[m].dataType;this.conf.url_data=this.views[m].url_data;for(var n=0;n<this.views[m].cellCont.length;n++){this.cell.childNodes[this.conf.idx.cont].appendChild(this.views[m].cellCont[n])}for(var l in this.views[m].dataNodes){this.dataNodes[l]=this.views[m].dataNodes[l];if(l=="menu"){this.cell.insertBefore(this.views[m].dataNodesCont[l],this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont])}if(l=="toolbar"){this.cell.insertBefore(this.views[m].dataNodesCont[l],this.cell.childNodes[this.conf.idx.cont])}if(l=="sb"){this.cell.appendChild(this.views[m].dataNodesCont[l])}this._updateIdx()}for(var l in this.views[m].ofs_nodes){for(var j in this.views[m].ofs_nodes[l]){this.conf.ofs_nodes[l][j]=this.views[m].ofs_nodes[l][j]}}if(this.conf.borders!=this.views[m].borders){this[this.views[m].borders?"_showBorders":"_hideBorders"](true)}if(this.dataType=="url"&&this.conf.url_data!=null&&this.conf.url_data.ajax==false&&this.conf.url_data.post_data!=null){this.reloadURL()}this.callEvent("_onViewRestore",[m]);this._viewDelete(m)};this._viewDelete=function(m){if(this.views[m]==null){return}this.views[m].borders=null;for(var l in this.views[m].ofs_nodes){for(var j in this.views[m].ofs_nodes[l]){this.views[m].ofs_nodes[l][j]=null}this.views[m].ofs_nodes[l]=null}this.views[m].dataType=null;this.views[m].dataObj=null;this.views[m].url_data=null;for(var n=0;n<this.views[m].cellCont.length;n++){this.views[m].cellCont[n]=null}this.views[m].cellCont=null;for(var l in this.views[m].dataNodes){this.views[m].dataNodes[l]=null;this.views[m].dataNodesCont[l]=null}this.views[m].dataNodes=this.views[m].dataNodesCont=null;this.views[m]=null;delete this.views[m]};window.dhx4._eventable(this);this._updateIdx();return this}dhtmlXCellObject.prototype.showView=function(a){if(this.conf.view==a){return false}this._viewSave(this.conf.view);this._viewRestore(a);this._updateIdx();this._adjustCont();this.conf.view=a;var c=(typeof(this.conf.views_loaded[this.conf.view])=="undefined");this.conf.views_loaded[this.conf.view]=true;return c};dhtmlXCellObject.prototype.getViewName=function(){return this.conf.view};dhtmlXCellObject.prototype.unloadView=function(j){if(j==this.conf.view){var l=this.conf.unloading;this.conf.unloading=true;if(typeof(this.detachMenu)=="function"){this.detachMenu()}if(typeof(this.detachToolbar)=="function"){this.detachToolbar()}if(typeof(this.detachRibbon)=="function"){this.detachRibbon()}this.detachStatusBar();this._detachObject(null,true);this.conf.unloading=l;if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(this.views[j]==null){return}var g=this.views[j];for(var c in g.dataNodes){if(typeof(g.dataNodes[c].unload)=="function"){g.dataNodes[c].unload()}g.dataNodes[c]=null;g.dataNodesCont[c]=null}if(g.dataType=="url"){if(g.cellCont!=null&&g.cellCont[0]!="null"){this._detachURLEvents(g.cellCont[0])}}else{if(g.dataObj!=null){if(typeof(g.dataObj.unload)=="function"){g.dataObj.unload()}else{if(typeof(g.dataObj.destructor)=="function"){g.dataObj.destructor()}}g.dataObj=null}}g=null;this._viewDelete(j);if(typeof(this.conf.views_loaded[j])!="undefined"){delete this.conf.views_loaded[j]}};dhtmlXCellObject.prototype.getId=function(){return this._idd};dhtmlXCellObject.prototype.progressOn=function(){if(this.conf.progress==true){return}this.conf.progress=true;var c=document.createElement("DIV");c.className=this.conf.idx_data.pr1;var a=document.createElement("DIV");a.className=this.conf.idx_data.pr2;if(this.conf.idx.cover!=null){this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cover])}else{this.cell.appendChild(a)}this.cell.insertBefore(c,a);c=a=null;this._updateIdx();this._adjustProgress()};dhtmlXCellObject.prototype.progressOff=function(){if(this.conf.progress!=true){return}this.cell.childNodes[this.conf.idx.pr2].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr2]);this.cell.childNodes[this.conf.idx.pr1].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr1]);this.conf.progress=false;this._updateIdx()};dhtmlXCellObject.prototype._adjustProgress=function(){if(this.conf.idx.pr1==null){return}if(!this.conf.pr){this.conf.pr={}}var c=this.cell.childNodes[this.conf.idx.pr1];var a=this.cell.childNodes[this.conf.idx.pr2];if(!this.conf.pr.ofs){a.style.width=c.offsetWidth+"px";a.style.height=c.offsetHeight+"px";this.conf.pr.ofs={w:a.offsetWidth-a.clientWidth,h:a.offsetHeight-a.clientHeight}}a.style.width=c.offsetWidth-this.conf.pr.ofs.w+"px";a.style.height=c.offsetHeight-this.conf.pr.ofs.h+"px";c=a=null};dhtmlXCellObject.prototype._showCellCover=function(){if(this.conf.cover==true){return}this.conf.cover=true;var a=document.createElement("DIV");a.className=this.conf.idx_data.cover;this.cell.appendChild(a);a=null;this._updateIdx()};dhtmlXCellObject.prototype._hideCellCover=function(){if(this.conf.cover!=true){return}this.cell.removeChild(this.cell.childNodes[this.conf.idx.cover]);this._updateIdx();this.conf.cover=false};dhtmlXCellObject.prototype._showBorders=function(a){if(this.conf.borders){return}this.conf.borders=true;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css;this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[true]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._hideBorders=function(a){if(!this.conf.borders){return}this.conf.borders=false;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css+" dhx_cell_cont_no_borders";this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[false]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._getWidth=function(){return this.cell.offsetWidth};dhtmlXCellObject.prototype._getHeight=function(){return this.cell.offsetHeight};dhtmlXCellObject.prototype.showInnerScroll=function(){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto"};dhtmlXCellObject.prototype._unload=function(){this.conf.unloading=true;this.callEvent("_onCellUnload",[]);this.progressOff();this.unloadView(this.conf.view);this.dataNodes=null;this.cell.parentNode.removeChild(this.cell);this.cell=null;window.dhx4._eventable(this,"clear");for(var c in this.views){this.unloadView(c)}this.conf=null;for(var c in this){this[c]=null}};dhtmlXCellObject.prototype.attachObject=function(j,g){if(window.dhx4.s2b(g)&&!(typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof window.dhtmlXWindowsCell))){g=false}if(typeof(j)=="string"){j=document.getElementById(j)}if(j.parentNode==this.cell.childNodes[this.conf.idx.cont]){j=null;return}if(g){j.style.display="";var a=j.offsetWidth;var c=j.offsetHeight}this._attachObject(j);this.dataType="obj";j.style.display="";j=null;if(g){this._adjustByCont(a,c)}};dhtmlXCellObject.prototype.appendObject=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(a.parentNode==this.cell.childNodes[this.conf.idx.cont]){a=null;return}if(!this.conf.append_mode){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto";this.conf.append_mode=true}this._attachObject(a,null,null,true);this.dataType="obj";a.style.display="";a=null};dhtmlXCellObject.prototype.detachObject=function(c,a){this._detachObject(null,c,a)};dhtmlXCellObject.prototype.getAttachedStatusBar=function(){return this.dataNodes.sb};dhtmlXCellObject.prototype.getAttachedObject=function(){return this.dataObj};dhtmlXCellObject.prototype.attachURL=function(c,r,g){if(g==true){g={}}var j=(typeof(g)!="undefined"&&g!=false&&g!=null);if(!this.conf.url_data){this.conf.url_data={}}this.conf.url_data.url=c;this.conf.url_data.ajax=(r==true);this.conf.url_data.post_data=(g==true?{}:(g||null));if(r==true){var q=this;if(j){var l="";for(var o in g){l+="&"+encodeURIComponent(o)+"="+encodeURIComponent(g[o])}dhx4.ajax.post(c,l,function(a){q.attachHTMLString("<div style='position:relative;width:100%;height:100%;overflow:auto;'>"+a.xmlDoc.responseText+"</div>");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}else{dhx4.ajax.get(c,function(a){q.attachHTMLString("<div style='position:relative;width:100%;height:100%;overflow:auto;'>"+a.xmlDoc.responseText+"</div>");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}}else{if(this.dataType=="url"){var m=this.getFrame()}else{var m=document.createElement("IFRAME");m.frameBorder=0;m.border=0;m.style.width="100%";m.style.height="100%";m.style.position="relative";this._attachObject(m);this.dataType="url";this._attachURLEvents()}if(j){var n=(typeof(this.conf.url_data.post_ifr)=="undefined");this.conf.url_data.post_ifr=true;if(n){this._attachURLEvents()}m.src="about:blank"}else{m.src=c+(window.dhx4.ajax.cache!=true?(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime():"")}m=null}m=null};dhtmlXCellObject.prototype.reloadURL=function(){if(!(this.dataType=="url"||this.dataType=="url-ajax")){return}if(this.conf.url_data==null){return}this.attachURL(this.conf.url_data.url,this.conf.url_data.ajax,this.conf.url_data.post_data)};dhtmlXCellObject.prototype.attachHTMLString=function(str){this._attachObject(null,null,str);var z=str.match(/<script[^>]*>[^\f]*?<\/script>/g)||[];for(var i=0;i<z.length;i++){var s=z[i].replace(/<([\/]{0,1})script[^>]*>/gi,"");if(s){if(window.execScript){window.execScript(s)}else{window.eval(s)}}}};dhtmlXCellObject.prototype.attachScheduler=function(a,n,c,j){j=j||window.scheduler;var l=false;if(c){var m=document.getElementById(c);if(m){l=true}}if(!l){var g=c||'<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>';var m=document.createElement("DIV");m.id="dhxSchedObj_"+new Date().getTime();m.style.width="100%";m.style.height="100%";m.style.position="relative";m.style.overflow="hidden";m.className="dhx_cal_container";m.innerHTML='<div class="dhx_cal_navline"><div class="dhx_cal_prev_button">&nbsp;</div><div class="dhx_cal_next_button">&nbsp;</div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div>'+g+'</div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>'}this._attachObject(m);this.dataType="scheduler";this.dataObj=j;this.dataObj.setSizes=function(){this.update_view()};j.init(m.id,a,n);m=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachMap=function(a){var c=document.createElement("DIV");c.id="GMapsObj_"+this._genStr(12);c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(!a){a={center:new google.maps.LatLng(40.719837,-73.992348),zoom:11,mapTypeId:google.maps.MapTypeId.ROADMAP}}this.dataType="maps";this.dataObj=new google.maps.Map(c,a);this.dataObj.setSizes=function(){google.maps.event.trigger(this,"resize")};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype._createNode_sb=function(n,j,m,a,l){if(typeof(l)!="undefined"){n=l}else{var c=j||{};var o=(typeof(c.text)=="string"&&c.text.length>0?c.text:"&nbsp;");var g=(typeof(c.height)=="number"?c.height:false);var n=document.createElement("DIV");n.className="dhx_cell_statusbar_def";n.innerHTML="<div class='"+(c.paging==true?"dhx_cell_statusbar_paging":"dhx_cell_statusbar_text")+"'>"+o+"</div>";if(g!=false){n.firstChild.style.height=n.firstChild.style.lineHeight=g+"px"}}if(this.conf.idx.pr1!=null){this.cell.insertBefore(n,this.cell.childNodes[this.conf.idx.pr1])}else{this.cell.appendChild(n)}this.conf.ofs_nodes.b.sb=true;this._updateIdx();this._adjustCont(this._idd);return n};dhtmlXCellObject.prototype.attachStatusBar=function(a){if(this.dataNodes.sb){return}if(a!=null&&window.dhx4.s2b(a.paging)==true){a.height=null}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){this.cell.childNodes[this.conf.idx.cont].className+=" dhx_cell_statusbar_attached"}this.dataNodes.sb=this._attachObject("sb",a);this.dataNodes.sb.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sb.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sb.onselectstart=function(c){return false};return this.dataNodes.sb};dhtmlXCellObject.prototype.detachStatusBar=function(){if(!this.dataNodes.sb){return}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){this.cell.childNodes[this.conf.idx.cont].className=this.cell.childNodes[this.conf.idx.cont].className.replace(/\s{0,}dhx_cell_statusbar_attached/,"")}this.dataNodes.sb.setText=this.dataNodes.sb.getText=this.dataNodes.sb.onselectstart=null;this.dataNodes.sb=null;delete this.dataNodes.sb;this._detachObject("sb")};dhtmlXCellObject.prototype.showStatusBar=function(){this._mtbShowHide("sb","")};dhtmlXCellObject.prototype.hideStatusBar=function(){this._mtbShowHide("sb","none")};dhtmlXCellObject.prototype._mtbShowHide=function(c,a){if(!this.dataNodes[c]){return}this.cell.childNodes[this.conf.idx[c]].style.display=a;this._adjustCont()};dhtmlXCellObject.prototype.getFrame=dhtmlXCellObject.prototype._getFrame=function(){if(this.dataType!="url"){return null}return this.cell.childNodes[this.conf.idx.cont].firstChild};dhtmlXCellObject.prototype._genStr=function(){if(!this._genStrId){this._genStrId=new Date().getTime()}return this._genStrId++};dhtmlXCellObject.prototype._attachURLEvents=function(){if(this.dataType!="url"){return}var g=this;var c=this._idd;var a=this.cell.childNodes[this.conf.idx.cont].firstChild;if(typeof(this._doOnFrameMouseDown)!="function"){this._doOnFrameMouseDown=function(j){g.callEvent("_onContentMouseDown",[c,j||event])}}if(typeof(window.addEventListener)=="function"){a.onload=function(){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.addEventListener("mousedown",g._doOnFrameMouseDown,false)}}catch(j){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(j){}}}else{a.onreadystatechange=function(j){if(this.readyState=="complete"){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.attachEvent("onmousedown",g._doOnFrameMouseDown)}}catch(l){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(l){}}}}};dhtmlXCellObject.prototype._doOnFrameContentLoaded=function(){if(this.conf.url_data.post_ifr==true){var m=this.getFrame().contentWindow.document;var l=m.createElement("FORM");l.method="POST";l.action=this.conf.url_data.url;m.body.appendChild(l);var g={};if(window.dhx4.ajax.cache!=true){g["dhxr"+new Date().getTime()]="1"}for(var c in this.conf.url_data.post_data){g[c]=this.conf.url_data.post_data[c]}for(var c in g){var j=m.createElement("INPUT");j.type="hidden";j.name=c;j.value=g[c];l.appendChild(j);j=null}this.conf.url_data.post_ifr=false;l.submit()}else{this.callEvent("_onContentLoaded",[this._idd])}};dhtmlXCellObject.prototype._detachURLEvents=function(a){if(a==null){if(this.dataType!="url"){return}a=this.cell.childNodes[this.conf.idx.cont].firstChild}if(typeof(window.addEventListener)=="function"){a.onload=null;try{a.contentWindow.document.body.removeEventListener("mousedown",this._doOnFrameMouseDown,false)}catch(c){}}else{a.onreadystatechange=null;try{a.contentWindow.document.body.detachEvent("onmousedown",this._doOnFrameMouseDown)}catch(c){}}a=null};dhtmlXCellObject.prototype._attachObject=function(l,c,j,a,g){if(typeof(l)=="string"&&{menu:1,toolbar:1,ribbon:1,sb:1}[l]==1){return this["_createNode_"+l].apply(this,arguments)}if(a!=true){this._detachObject(null,true,null)}if(typeof(j)=="string"){this.cell.childNodes[this.conf.idx.cont].innerHTML=j}else{this.cell.childNodes[this.conf.idx.cont].appendChild(l)}l=null};dhtmlXCellObject.prototype._detachObject=function(l,c,a){this.callEvent("_onBeforeContentDetach",[]);if(l=="menu"||l=="toolbar"||l=="ribbon"||l=="sb"){var j=this.cell.childNodes[this.conf.idx[l]];j.parentNode.removeChild(j);j=null;this.conf.ofs_nodes[l=="sb"?"b":"t"][l]=false;this._updateIdx();if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(c==true){a=false}else{if(typeof(a)=="undefined"){a=document.body}else{if(typeof(a)=="string"){a=document.getElementById(a)}}}if(a===false){if(this.dataType=="url"){this._detachURLEvents()}else{if(this.dataObj!=null){if(typeof(this.dataObj.unload)=="function"){this.dataObj.unload()}else{if(typeof(this.dataObj.destructor)=="function"){this.dataObj.destructor()}}}}}var j=this.cell.childNodes[this.conf.idx.cont];while(j.childNodes.length>0){if(a===false){j.removeChild(j.lastChild)}else{j.firstChild.style.display="none";a.appendChild(j.firstChild)}}if(this.conf.append_mode){j.style.overflow="";this.conf.append_mode=false}var g=(this.dataType=="tabbar");this.dataObj=null;this.dataType=null;a=j=null;if(this.conf.unloading!=true&&g){this.showHeader(true);this._showBorders()}};dhtmlXCellObject.prototype._attachFromCell=function(c){this.detachObject(true);var j="layout";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){j="window"}if(typeof(window.dhtmlXWindowsCell)!="undefined"&&c instanceof window.dhtmlXWindowsCell&&c.wins.w[c._idd].conf.parked){c.wins._winCellSetOpacity(c._idd,"open",false)}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&c instanceof window.dhtmlXAccordionCell&&c.conf.opened==false){c._cellSetOpacity("open",false)}for(var g in c.dataNodes){this._attachObject(g,null,null,null,c.cell.childNodes[c.conf.idx[g]]);this.dataNodes[g]=c.dataNodes[g];c.dataNodes[g]=null;c.conf.ofs_nodes[g=="sb"?"b":"t"][g]=false;c._updateIdx()}this._mtbUpdBorder();if(c.dataType!=null&&c.dataObj!=null){this.dataType=c.dataType;this.dataObj=c.dataObj;while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}c.dataType=null;c.dataObj=null;if(this.dataType=="grid"){if(j=="window"&&this.conf.skin=="dhx_skyblue"){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}}}else{while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}}this.conf.view=c.conf.view;c.conf.view="def";for(var g in c.views){this.views[g]=c.views[g];c.views[g]=null;delete c.views[g]}c._updateIdx();c._adjustCont();this._updateIdx();this._adjustCont();if(c.conf.progress==true){c.progressOff();this.progressOn()}else{this.progressOff()}if(j=="window"&&this.wins.w[this._idd].conf.parked){this.wins._winCellSetOpacity(this._idd,"close",false)}};function dhtmlXCellTop(j,c){if(arguments.length==0||typeof(j)=="undefined"){return}var a=this;this.dataNodes={};this.conf.ofs={t:0,b:0,l:0,r:0};this.conf.ofs_nodes={t:{},b:{}};this.conf.progress=false;this.conf.fs_mode=false;this.conf.fs_tm=null;this.conf.fs_resize=false;if(j==document.body){this.conf.fs_mode=true;this.base=j;if(this.base==document.body){var g={dhx_skyblue:{t:2,b:2,l:2,r:2},dhx_web:{t:8,b:8,l:8,r:8},dhx_terrace:{t:9,b:9,l:8,r:8}};this.conf.ofs=(g[this.conf.skin]!=null?g[this.conf.skin]:g.dhx_skyblue)}}else{this.base=(typeof(j)=="string"?document.getElementById(j):j)}this.base.className+=" "+this.conf.css+"_base_"+this.conf.skin;this.cont=document.createElement("DIV");this.cont.className=this.conf.css+"_cont";this.base.appendChild(this.cont);if(c!=null){this.setOffsets(c,false)}else{if(this.base._ofs!=null){this.setOffsets(this.base._ofs,false);this.base._ofs=null;try{delete this.base._ofs}catch(l){}}}this._adjustCont=function(){var o=this.conf.ofs.t;for(var n in this.conf.ofs_nodes.t){o+=(this.conf.ofs_nodes.t[n]==true?this.dataNodes[n].offsetHeight:0)}var m=this.conf.ofs.b;for(var n in this.conf.ofs_nodes.b){m+=(this.conf.ofs_nodes.b[n]==true?this.dataNodes[n].offsetHeight:0)}this.cont.style.left=this.conf.ofs.l+"px";this.cont.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.cont.style.top=o+"px";this.cont.style.height=this.base.offsetHeight-o-m+"px"};this._setBaseSkin=function(m){this.base.className=this.base.className.replace(new RegExp(this.conf.css+"_base_"+this.conf.skin,"gi"),this.conf.css+"_base_"+m)};this._initFSResize=function(){if(this.conf.fs_resize==true){return}this._doOnResizeStart=function(){window.clearTimeout(a.conf.fs_tm);a.conf.fs_tm=window.setTimeout(a._doOnResizeEnd,200)};this._doOnResizeEnd=function(){a.setSizes()};if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResizeStart,false)}else{window.attachEvent("onresize",this._doOnResizeStart)}this.conf.fs_resize=true};if(this.conf.fs_mode==true){this._initFSResize()}this._unloadTop=function(){this._mtbUnload();this.detachHeader();this.detachFooter();if(this.conf.fs_mode==true){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResizeStart,false)}else{window.detachEvent("onresize",this._doOnResizeStart)}}this.base.removeChild(this.cont);var m=new RegExp("s{0,}"+this.conf.css+"_base_"+this.conf.skin,"gi");this.base.className=this.base.className.replace(m,"");this.cont=this.base=null;a=null};j=null}dhtmlXCellTop.prototype.setOffsets=function(m,l){var j=false;for(var c in m){var g=c.charAt(0);if(typeof(this.conf.ofs[g])!="undefined"&&!isNaN(m[c])){this.conf.ofs[g]=parseInt(m[c]);j=true}}if(l!==false&&typeof(this.setSizes)=="function"&&j==true){this.setSizes()}};dhtmlXCellTop.prototype.attachMenu=function(a){if(this.dataNodes.menu!=null){return}this.dataNodes.menuObj=document.createElement("DIV");this.dataNodes.menuObj.className="dhxcelltop_menu";this.base.insertBefore(this.dataNodes.menuObj,this.dataNodes.toolbarObj||this.dataNodes.ribbonObj||this.cont);if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.menuObj;this.dataNodes.menu=new dhtmlXMenuObject(a);this.dataNodes.menuEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.menuObj.style.display=="none"){return}this.dataNodes.menuObj.style.left=this.conf.ofs.l+"px";this.dataNodes.menuObj.style.marginTop=(this.dataNodes.haObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.menuObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.t.menuObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.menu};dhtmlXCellTop.prototype.detachMenu=function(){if(this.dataNodes.menu==null){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;this.dataNodes.menuObj.parentNode.removeChild(this.dataNodes.menuObj);this.dataNodes.menuObj=null;this.detachEvent(this.dataNodes.menuEv);this.dataNodes.menuEv=null;delete this.dataNodes.menu;delete this.dataNodes.menuObj;delete this.dataNodes.menuEv;this.conf.ofs_nodes.t.menuObj=false;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.toolbarObj=document.createElement("DIV");this.dataNodes.toolbarObj.className="dhxcelltop_toolbar";this.base.insertBefore(this.dataNodes.toolbarObj,this.cont);this.dataNodes.toolbarObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.toolbarObj.firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this.dataNodes.toolbarEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.toolbarObj.style.display=="none"){return}this.dataNodes.toolbarObj.style.left=this.conf.ofs.l+"px";this.dataNodes.toolbarObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.toolbarObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell.setSizes()});this.conf.ofs_nodes.t.toolbarObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.toolbar};dhtmlXCellTop.prototype.detachToolbar=function(){if(this.dataNodes.toolbar==null){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;this.dataNodes.toolbarObj.parentNode.removeChild(this.dataNodes.toolbarObj);this.dataNodes.toolbarObj=null;this.detachEvent(this.dataNodes.toolbarEv);this.dataNodes.toolbarEv=null;this.conf.ofs_nodes.t.toolbarObj=false;delete this.dataNodes.toolbar;delete this.dataNodes.toolbarObj;delete this.dataNodes.toolbarEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.ribbonObj=document.createElement("DIV");this.dataNodes.ribbonObj.className="dhxcelltop_ribbon";this.base.insertBefore(this.dataNodes.ribbonObj,this.cont);this.dataNodes.ribbonObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.ribbonObj.firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);this.dataNodes.ribbonEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.ribbonObj.style.display=="none"){return}this.dataNodes.ribbonObj.style.left=this.conf.ofs.l+"px";this.dataNodes.ribbonObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.ribbonObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.dataNodes.ribbon.setSizes()});this.conf.ofs_nodes.t.ribbonObj=true;var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c.setSizes()});this.setSizes();a.parnt=null;a=null;return this.dataNodes.ribbon};dhtmlXCellTop.prototype.detachRibbon=function(){if(this.dataNodes.ribbon==null){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;this.dataNodes.ribbonObj.parentNode.removeChild(this.dataNodes.ribbonObj);this.dataNodes.ribbonObj=null;this.detachEvent(this.dataNodes.ribbonEv);this.dataNodes.ribbonEv=null;this.conf.ofs_nodes.t.ribbonObj=false;delete this.dataNodes.ribbon;delete this.dataNodes.ribbonObj;delete this.dataNodes.ribbonEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachStatusBar=function(a){if(this.dataNodes.sbObj){return}if(typeof(a)=="undefined"){a={}}this.dataNodes.sbObj=document.createElement("DIV");this.dataNodes.sbObj.className="dhxcelltop_statusbar";if(this.cont.nextSibling!=null){this.base.insertBefore(this.dataNodes.sbObj,this.cont.nextSibling)}else{this.base.appendChild(this.dataNodes.sbObj)}this.dataNodes.sbObj.innerHTML="<div class='dhxcont_statusbar'>"+(typeof(a.text)=="string"&&a.text.length>0?a.text:"&nbsp;")+"</div>";if(typeof(a.height)=="number"){this.dataNodes.sbObj.firstChild.style.height=this.dataNodes.sbObj.firstChild.style.lineHeight=a.height+"px"}this.dataNodes.sbObj.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sbObj.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sbObj.onselectstart=function(c){return false};this.dataNodes.sbEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.sbObj.style.display=="none"){return}this.dataNodes.sbObj.style.left=this.conf.ofs.l+"px";this.dataNodes.sbObj.style.bottom=(this.dataNodes.faObj!=null?this.dataNodes.faObj.offsetHeight:0)+this.conf.ofs.t+"px";this.dataNodes.sbObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.b.sbObj=true;this.setSizes();return this.dataNodes.sbObj};dhtmlXCellTop.prototype.detachStatusBar=function(){if(!this.dataNodes.sbObj){return}this.dataNodes.sbObj.setText=this.dataNodes.sbObj.getText=this.dataNodes.sbObj.onselectstart=null;this.dataNodes.sbObj.parentNode.removeChild(this.dataNodes.sbObj);this.dataNodes.sbObj=null;this.detachEvent(this.dataNodes.sbEv);this.dataNodes.sbEv=null;this.conf.ofs_nodes.b.sbObj=false;delete this.dataNodes.sb;delete this.dataNodes.sbObj;delete this.dataNodes.sbEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.showMenu=function(){this._mtbShowHide("menuObj","")};dhtmlXCellTop.prototype.hideMenu=function(){this._mtbShowHide("menuObj","none")};dhtmlXCellTop.prototype.showToolbar=function(){this._mtbShowHide("toolbarObj","")};dhtmlXCellTop.prototype.hideToolbar=function(){this._mtbShowHide("toolbarObj","none")};dhtmlXCellTop.prototype.showRibbon=function(){this._mtbShowHide("ribbonObj","")};dhtmlXCellTop.prototype.hideRibbon=function(){this._mtbShowHide("ribbonObj","none")};dhtmlXCellTop.prototype.showStatusBar=function(){this._mtbShowHide("sbObj","")};dhtmlXCellTop.prototype.hideStatusBar=function(){this._mtbShowHide("sbObj","none")};dhtmlXCellTop.prototype._mtbShowHide=function(c,a){if(this.dataNodes[c]==null){return}this.dataNodes[c].style.display=a;this.setSizes()};dhtmlXCellTop.prototype._mtbUnload=function(c,a){this.detachMenu();this.detachToolbar();this.detachStatusBar();this.detachRibbon()};dhtmlXCellTop.prototype.getAttachedMenu=function(){return this.dataNodes.menu};dhtmlXCellTop.prototype.getAttachedToolbar=function(){return this.dataNodes.toolbar};dhtmlXCellTop.prototype.getAttachedRibbon=function(){return this.dataNodes.ribbon};dhtmlXCellTop.prototype.getAttachedStatusBar=function(){return this.dataNodes.sbObj};dhtmlXCellTop.prototype.progressOn=function(){if(this.conf.progress){return}this.conf.progress=true;var c=document.createElement("DIV");c.className="dhxcelltop_progress";this.base.appendChild(c);var a=document.createElement("DIV");a.className="dhxcelltop_progress_img";this.base.appendChild(a);c=a=null};dhtmlXCellTop.prototype.progressOff=function(){if(!this.conf.progress){return}var j={dhxcelltop_progress:true,dhxcelltop_progress_img:true};for(var g=0;g<this.base.childNodes.length;g++){if(typeof(this.base.childNodes[g].className)!="undefined"&&j[this.base.childNodes[g].className]==true){j[this.base.childNodes[g].className]=this.base.childNodes[g]}}for(var c in j){if(j[c]!=true){this.base.removeChild(j[c])}j[c]=null}this.conf.progress=false;j=null};dhtmlXCellTop.prototype.attachHeader=function(c,a){if(this.dataNodes.haObj!=null){return}if(typeof(c)!="object"){c=document.getElementById(c)}this.dataNodes.haObj=document.createElement("DIV");this.dataNodes.haObj.className="dhxcelltop_hdr";this.dataNodes.haObj.style.height=(a||c.offsetHeight)+"px";this.base.insertBefore(this.dataNodes.haObj,this.dataNodes.menuObj||this.dataNodes.toolbarObj||this.cont);this.dataNodes.haObj.appendChild(c);c.style.visibility="visible";c=null;this.dataNodes.haEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.haObj.style.left=this.conf.ofs.l+"px";this.dataNodes.haObj.style.marginTop=this.conf.ofs.t+"px";this.dataNodes.haObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.t.haObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachHeader=function(){if(!this.dataNodes.haObj){return}while(this.dataNodes.haObj.childNodes.length>0){this.dataNodes.haObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.haObj.lastChild)}this.dataNodes.haObj.parentNode.removeChild(this.dataNodes.haObj);this.dataNodes.haObj=null;this.detachEvent(this.dataNodes.haEv);this.dataNodes.haEv=null;this.conf.ofs_nodes.t.haObj=false;delete this.dataNodes.haEv;delete this.dataNodes.haObj;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachFooter=function(g,a){if(this.dataNodes.faObj!=null){return}if(typeof(g)!="object"){g=document.getElementById(g)}this.dataNodes.faObj=document.createElement("DIV");this.dataNodes.faObj.className="dhxcelltop_ftr";this.dataNodes.faObj.style.height=(a||g.offsetHeight)+"px";var c=(this.dataNodes.sbObj||this.cont);if(this.base.lastChild==c){this.base.appendChild(this.dataNodes.faObj)}else{this.base.insertBefore(this.dataNodes.faObj,c.nextSibling)}this.dataNodes.faEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.faObj.style.left=this.conf.ofs.l+"px";this.dataNodes.faObj.style.bottom=this.conf.ofs.b+"px";this.dataNodes.faObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.faObj.appendChild(g);g.style.visibility="visible";c=g=null;this.conf.ofs_nodes.b.faObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachFooter=function(){if(!this.dataNodes.faObj){return}while(this.dataNodes.faObj.childNodes.length>0){this.dataNodes.faObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.faObj.lastChild)}this.dataNodes.faObj.parentNode.removeChild(this.dataNodes.faObj);this.dataNodes.faObj=null;this.detachEvent(this.dataNodes.faEv);this.dataNodes.faEv=null;this.conf.ofs_nodes.b.faObj=false;delete this.dataNodes.faEv;delete this.dataNodes.faObj;if(!this.conf.unloading){this.setSizes()}};function dhtmlXCalendarObject(m,u){this.i={};var g=null;if(typeof(m)=="string"){var j=document.getElementById(m)}else{var j=m}if(j&&typeof(j)=="object"&&j.tagName&&String(j.tagName).toLowerCase()!="input"){g=j}j=null;if(typeof(m)!="object"||!m.length){m=[m]}for(var c=0;c<m.length;c++){if(typeof(m[c])=="string"){m[c]=(document.getElementById(m[c])||null)}if(m[c]!=null&&m[c].tagName&&String(m[c].tagName).toLowerCase()=="input"){this.i[window.dhx4.newId()]={input:m[c]}}else{if(!(m[c] instanceof Array)&&m[c] instanceof Object&&(m[c].input!=null||m[c].button!=null)){if(m[c].input!=null&&typeof(m[c].input)=="string"){m[c].input=document.getElementById(m[c].input)}if(m[c].button!=null&&typeof(m[c].button)=="string"){m[c].button=document.getElementById(m[c].button)}this.i[window.dhx4.newId()]=m[c]}}m[c]=null}this.conf={skin:(u||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhtmlxcalendar")||"dhx_skyblue"),zi:window.dhx4.newId(),touch:!window.dhx4.isIE,ws_first:true};this.setSkin=function(q,a){if(this.conf.skin==q&&!a){return}this.conf.skin=q;this.base.className="dhtmlxcalendar_"+this.conf.skin;this._ifrSize()};this.base=document.createElement("DIV");this.base.style.display="none";this.base.appendChild(document.createElement("DIV"));if(g!=null){this._hasParent=true;g.appendChild(this.base);g=null}else{document.body.appendChild(this.base)}this.setParent=function(a){if(this._hasParent){if(typeof(a)=="object"){a.appendChild(this.base)}else{if(typeof(a)=="string"){document.getElementById(a).appendChild(this.base)}}}};this.setSkin(this.conf.skin,true);this.base.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}a.cancelBubble=true};this.base.onmousedown=function(){return false};if(this.conf.touch){this.base.ontouchstart=this.base.onclick}this.loadUserLanguage=function(y){if(!this.langData[y]){return}this.lang=y;this.setWeekStartDay(this.langData[this.lang].weekstart);this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");if(this.msCont){var x=0;for(var v=0;v<this.msCont.childNodes.length;v++){for(var a=0;a<this.msCont.childNodes[v].childNodes.length;a++){this.msCont.childNodes[v].childNodes[a].innerHTML=this.langData[this.lang].monthesSNames[x++]}}}};this.contMonth=document.createElement("DIV");this.contMonth.className="dhtmlxcalendar_month_cont";this.contMonth.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.firstChild.appendChild(this.contMonth);var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contMonth.appendChild(n);var s=document.createElement("LI");s.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";s.innerHTML="<div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left\";'></div><span></span><div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right\";'></div>";n.appendChild(s);var l=this;s.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}var q=(w.target||w.srcElement);if(q.className&&q.className.indexOf("dhtmlxcalendar_month_arrow")===0){l._hideSelector();var v=(q.parentNode.firstChild==q?-1:1);var a=new Date(l._activeMonth);l._drawMonth(new Date(l._activeMonth.getFullYear(),l._activeMonth.getMonth()+v,1,0,0,0,0));l._evOnArrowClick([a,new Date(l._activeMonth)]);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_month"){w.cancelBubble=true;l._showSelector("month",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_month",true);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_year"){w.cancelBubble=true;l._showSelector("year",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_year",true);return}l._hideSelector()};if(this.conf.touch==true){s.ontouchstart=s.onclick}this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.firstChild.appendChild(this.contDays);this.setWeekStartDay=function(a){if(a==0){a=7}this._wStart=Math.min(Math.max((isNaN(a)?1:a),1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var y=document.createElement("UL");y.className="dhtmlxcalendar_line";this.contDays.appendChild(y)}else{var y=this.contDays.firstChild}var v=this._wStart;var x=this.langData[this.lang].daysSNames;x.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var A=0;A<8;A++){if(y.childNodes[A]==null){var a=document.createElement("LI");y.appendChild(a)}else{var a=y.childNodes[A]}if(A==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="<div class='dhtmlxcalendar_label'>"+(this.langData[this.lang].weekname||"w")+"</div>"}else{a.className="dhtmlxcalendar_cell"+(v>=6?" dhtmlxcalendar_day_weekday_cell":"")+(A==1?"_first":"");a.innerHTML=x[v];if(++v>7){v=1}}}if(this._activeMonth!=null){this._drawMonth(this._activeMonth)}};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.firstChild.appendChild(this.contDates);this.contDates.onclick=function(y){y=y||event;if(y.type=="touchstart"&&y.preventDefault!=null){y.preventDefault()}var q=(y.target||y.srcElement);if(q.parentNode!=null&&q.parentNode._date!=null){q=q.parentNode}if(q._date!=null&&!q._css_dis){var w=l._activeDate.getHours();var v=l._activeDate.getMinutes();var x=q._date;if(l.checkEvent("onBeforeChange")){if(!l.callEvent("onBeforeChange",[new Date(q._date.getFullYear(),q._date.getMonth(),q._date.getDate(),w,v)])){return}}if(l._activeDateCell!=null){l._activeDateCell._css_date=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w)}var a=(l._activeDate.getFullYear()+"_"+l._activeDate.getMonth()!=x.getFullYear()+"_"+x.getMonth());l._nullDate=false;l._activeDate=new Date(x.getFullYear(),x.getMonth(),x.getDate(),w,v);l._activeDateCell=q;l._activeDateCell._css_date=true;l._activeDateCell._css_hover=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w);if(a){l._drawMonth(l._activeDate)}if(l._activeInp&&l.i[l._activeInp]&&l.i[l._activeInp].input!=null){l.i[l._activeInp].input.value=l._dateToStr(new Date(l._activeDate.getTime()))}if(!l._hasParent){if(y.type=="touchstart"){window.setTimeout(function(){l._hide()},400)}else{l._hide()}}l._evOnClick([new Date(l._activeDate.getTime())])}};if(this.conf.touch==true){this.contDates.ontouchstart=this.contDates.onclick}this.contDates.onmouseover=function(q){q=q||event;var a=(q.target||q.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(l._lastHover==a||a._css_hover){return}a._css_hover=true;l._updateCellStyle(a._q,a._w);l._lastHover=a;l._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),q]);a=null}};this.contDates.onmouseout=function(a){l._clearDayHover(a||event)};this._lastHover=null;this._clearDayHover=function(a){if(!this._lastHover){return}this._lastHover._css_hover=false;this._updateCellStyle(this._lastHover._q,this._lastHover._w);l._evOnMouseOut([new Date(this._lastHover._date.getFullYear(),this._lastHover._date.getMonth(),this._lastHover._date.getDate(),0,0,0,0),a]);this._lastHover=null};for(var c=0;c<6;c++){var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contDates.appendChild(n);for(var r=0;r<=7;r++){var s=document.createElement("LI");if(r==0){s.className="dhtmlxcalendar_cell_wn"}else{s.className="dhtmlxcalendar_cell"}n.appendChild(s)}}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.base.firstChild.appendChild(this.contTime);this.showTime=function(){this.contTime.style.display="";this._ifrSize()};this.hideTime=function(){this.contTime.style.display="none";this._ifrSize()};var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contTime.appendChild(n);var s=document.createElement("LI");s.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";s.innerHTML="<div class='dhtmlxcalendar_time_img'></div><span class='dhtmlxcalendar_label_hours'></span><span class='dhtmlxcalendar_label_colon'> : </span><span class='dhtmlxcalendar_label_minutes'></span>";n.appendChild(s);s.onclick=function(v){v=v||event;if(v.type=="touchstart"&&v.preventDefault!=null){v.preventDefault()}var a=(v.target||v.srcElement);if(a.tagName!=null&&a.tagName.toLowerCase()=="span"&&a._par==true&&a.parentNode!=null){a=a.parentNode}if(a.className&&a.className=="dhtmlxcalendar_label_hours"){v.cancelBubble=true;var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){v.cancelBubble=true;if(l._minutesInterval==1){var w=l.getFormatedDate("%i");a.innerHTML="<span class='dhtmlxcalendar_selected_date'>"+w.charAt(0)+"</span>"+w.charAt(1);a.firstChild._par=true;l._selectorMode=1}var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_minutes",true);return}l._hideSelector()};if(this.conf.touch==true){s.ontouchstart=s.onclick}this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(q){window.dhx4.temp_calendar={tz:null};this._nullDate=(typeof(q)=="undefined"||q===""||!q);if(!(q instanceof Date)){q=this._strToDate(String(q||""));if(q=="Invalid Date"){q=new Date()}else{this.conf.tz=window.dhx4.temp_calendar.tz}window.dhx4.temp_calendar=null}if(this.conf.tz==null){this.conf.tz=window.dhx4.date2str(q,"%P")}var a=q.getTime();if(this._isOutOfRange(a)){return}this._activeDate=new Date(a);this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleHours();this._updateVisibleMinutes()};this.getDate=function(v){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(v){window.dhx4.temp_calendar={tz:this.conf.tz};var q=this._dateToStr(a);window.dhx4.temp_calendar=null;return q}return a};this._drawMonth=function(H){if(!(H instanceof Date)){return}if(isNaN(H.getFullYear())){H=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(H.getFullYear(),H.getMonth(),1,0,0,0,0);this._activeDateCell=null;var E=new Date(this._activeMonth.getTime());var x=E.getDay();var K=x-this._wStart;if(K<0){K=K+7}E.setDate(E.getDate()-K);var N=H.getMonth();var O=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var C=0;for(var v=0;v<6;v++){var F=this._wStart;for(var M=0;M<=7;M++){if(M==0){var L=this.getWeekNumber(new Date(E.getFullYear(),E.getMonth(),E.getDate()+C,0,0,0,0));if(L>=52&&this.conf.ws_first==true&&this._activeMonth.getMonth()==0){var A=this.getWeekNumber(new Date(E.getFullYear(),E.getMonth(),E.getDate()+C+7,0,0,0,0));if(A<L&&A>1){L=1}}this.contDates.childNodes[v].childNodes[M].innerHTML="<div class='dhtmlxcalendar_label'>"+L+"</div>"}else{var a=new Date(E.getFullYear(),E.getMonth(),E.getDate()+C,0,0,0,0);if(a.getHours()!=0){var D=(a.getHours()>12?24-a.getHours():a.getHours());a.setTime(a.getTime()+60*60*1000*D)}var J=a.getDay();var y=a.getTime();var I="dhtmlxcalendar_label";if(this._tipData[y]!=null){if(this._tipData[y].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[v].childNodes[M].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[v].childNodes[M].setAttribute("title",this._tipData[y].text)}if(this._tipData[y].showIcon){I+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[v].childNodes[M].removeAttribute("title")}this.contDates.childNodes[v].childNodes[M].innerHTML="<div class='"+I+"'>"+a.getDate()+"</div>";this.contDates.childNodes[v].childNodes[M]._date=new Date(y);this.contDates.childNodes[v].childNodes[M]._q=v;this.contDates.childNodes[v].childNodes[M]._w=M;this.contDates.childNodes[v].childNodes[M]._css_month=(a.getMonth()==N);this.contDates.childNodes[v].childNodes[M]._css_date=(!this._nullDate&&y==O);this.contDates.childNodes[v].childNodes[M]._css_weekend=(F>=6);this.contDates.childNodes[v].childNodes[M]._css_dis=this._isOutOfRange(y);this.contDates.childNodes[v].childNodes[M]._css_holiday=(this._holidays[y]==true);this._updateCellStyle(v,M);if(y==O){this._activeDateCell=this.contDates.childNodes[v].childNodes[M]}if(++F>7){F=1}C++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(H)};this._updateCellStyle=function(y,a){var x=this.contDates.childNodes[y].childNodes[a];var v="dhtmlxcalendar_cell dhtmlxcalendar_cell";v+=(x._css_month?"_month":"");v+=(x._css_date?"_date":"");v+=(x._css_weekend?"_weekend":"");v+=(x._css_holiday?"_holiday":"");v+=(x._css_dis?"_dis":"");v+=(x._css_hover&&!x._css_dis?"_hover":"");x.className=v;x=null};this._minutesInterval=5;this._initSelector=function(E,y){if(!this._selCover){this._selCover=document.createElement("DIV");this._selCover.className="dhtmlxcalendar_selector_cover";this.base.firstChild.appendChild(this._selCover)}if(!this._sel){this._sel=document.createElement("DIV");this._sel.className="dhtmlxcalendar_selector_obj";this.base.firstChild.appendChild(this._sel);this._sel.appendChild(document.createElement("TABLE"));this._sel.firstChild.className="dhtmlxcalendar_selector_table";this._sel.firstChild.cellSpacing=0;this._sel.firstChild.cellPadding=0;this._sel.firstChild.border=0;this._sel.firstChild.appendChild(document.createElement("TBODY"));this._sel.firstChild.firstChild.appendChild(document.createElement("TR"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.childNodes[0].className="dhtmlxcalendar_selector_cell_left";this._sel.firstChild.firstChild.firstChild.childNodes[1].className="dhtmlxcalendar_selector_cell_middle";this._sel.firstChild.firstChild.firstChild.childNodes[2].className="dhtmlxcalendar_selector_cell_right";this._sel.firstChild.firstChild.firstChild.childNodes[0].innerHTML="&nbsp;";this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML="&nbsp;";this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_left"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"};this._sel.onmouseover=function(w){w=w||event;var q=(w.target||w.srcElement);if(q._cell===true){if(l._selHover!=q){l._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";l._selHover=q}}};this._sel.onmouseout=function(){l._clearSelHover()};this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;l._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;l._scrollYears(1)};if(this.conf.touch==true){this._sel.firstChild.firstChild.firstChild.childNodes[0].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick;this._sel.firstChild.firstChild.firstChild.childNodes[2].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick}this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[E]==true){return}if(E=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.innerHTML=this.langData[this.lang].monthesSNames[v];H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._month=v;H._cell=true;this._msCells[v++]=H}}this.msCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){l._hideSelector();l._updateActiveMonth();l._drawMonth(new Date(l._activeMonth.getFullYear(),q._month,1,0,0,0,0));l._doOnSelectorChange()}};if(this.conf.touch==true){this.msCont.ontouchstart=this.msCont.onclick}}if(E=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.className="dhtmlxcalendar_selector_cell";H._cell=true;D.appendChild(H)}}this.ysCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){l._hideSelector();l._drawMonth(new Date(q._year,l._activeMonth.getMonth(),1,0,0,0,0));l._doOnSelectorChange()}};if(this.conf.touch==true){this.ysCont.ontouchstart=this.ysCont.onclick}}if(E=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(D);for(var F=0;F<6;F++){var H=document.createElement("LI");H.innerHTML=this._fixLength(v,2);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._hours=v;H._cell=true;this._hsCells[v++]=H}}this.hsCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){l._hideSelector();l._activeDate.setHours(q._hours);l._updateActiveHours();l._updateVisibleHours();l._doOnSelectorChange();l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())])}};if(this.conf.touch==true){this.hsCont.ontouchstart=this.hsCont.onclick}}if(E=="minutes"){var C=4;var x=3;var A=2;if(this._minutesInterval==1){if(this._selectorMode==1){C=2;x=3;A=1}else{C=2;x=5;A=1;y+="5"}}if(this._minutesInterval==10){C=2}if(this._minutesInterval==15){C=1;x=4;y+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var v=0;for(var a=0;a<C;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(D);for(var F=0;F<x;F++){var H=document.createElement("LI");H.innerHTML=(A>1?this._fixLength(v,A):v);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._minutes=v;H._cell=true;this._rsCells[v]=H;v+=this._minutesInterval}}this.rsCont.onclick=function(I){I=I||event;if(I.type=="touchstart"&&I.preventDefault!=null){I.preventDefault()}I.cancelBubble=true;var w=(I.target||I.srcElement);if(w._minutes!=null){if(l._minutesInterval==1){var q=l.getFormatedDate("%i");if(l._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}l._activeDate.setMinutes(Number(q));l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())]);l._hideSelector();if(l._selectorMode==1){l._updateVisibleMinutes(true);l._selectorMode=2;l._showSelector("minutes",l._sel._x,l._sel._y,"selector_minutes",true);l._updateActiveMinutes();return}else{l._selectorMode=1}}else{l._hideSelector();l._activeDate.setMinutes(w._minutes);l._updateActiveMinutes();l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())])}l._updateVisibleMinutes();l._doOnSelectorChange()}};if(this.conf.touch==true){this.rsCont.ontouchstart=this.rsCont.onclick}}this._sel._ta[E]=true};this._showSelector=function(A,q,C,w,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&A==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){q+=12}if(!this._sel||!this._sel._ta[A]){this._initSelector(A,w)}if(A!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=q;this._sel._y=C;this._sel.style.visibility="hidden";this._sel.style.display="";this._selCover.style.width=this.base.offsetWidth-2+"px";this._selCover.style.top=this.contMonth.offsetHeight+"px";this._selCover.style.height=this.contDates.offsetHeight+this.contDays.offsetHeight-1+"px";this._selCover.style.display="";this._sel._t=A;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+w;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(A=="year"?"":"none");var v=Math.max(0,q-Math.round(this._sel.offsetWidth/2));if(v+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){v=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=v+"px";if(A=="hours"||A=="minutes"){this._sel.style.top=C-this._sel.offsetHeight+"px"}else{this._sel.style.top=C+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(A)};this._doOnSelectorShow=function(a){if(a=="month"){this._updateActiveMonth()}if(a=="year"){this._updateYearsList(this._activeMonth)}if(a=="hours"){this._updateActiveHours()}if(a=="minutes"){this._updateActiveMinutes()}};this._hideSelector=function(a){if(!this._sel){return}this._sel.style.display="none";this._sel.style.visible="hidden";this._selCover.style.display="none";if(this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i");this._unloadSelector("minutes")}};this._isSelectorVisible=function(){if(!this._sel){return false}return(this._sel.style.display!="none")};this._doOnSelectorChange=function(a){this.callEvent("onChange",[new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),this._activeDate.getMinutes(),this._activeDate.getSeconds()),a===true])};this._clearSelHover=function(){if(!this._selHover){return}this._selHover.className=String(this._selHover.className.replace(/dhtmlxcalendar_selector_cell_hover/gi,""));this._selHover=null};this._unloadSelector=function(v){if(!this._sel){return}if(!this._sel._ta[v]){return}if(v=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var q in this._msCells){this._msCells[q]._cell=null;this._msCells[q]._month=null;this._msCells[q].parentNode.removeChild(this._msCells[q]);this._msCells[q]=null}this._msCells=null;while(this.msCont.childNodes.length>0){this.msCont.removeChild(this.msCont.lastChild)}this.msCont.parentNode.removeChild(this.msCont);this.msCont=null}if(v=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var q in this._ysCells){this._ysCells[q]._cell=null;this._ysCells[q]._year=null;this._ysCells[q].parentNode.removeChild(this._ysCells[q]);this._ysCells[q]=null}this._ysCells=null;while(this.ysCont.childNodes.length>0){this.ysCont.removeChild(this.ysCont.lastChild)}this.ysCont.parentNode.removeChild(this.ysCont);this.ysCont=null}if(v=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var q in this._hsCells){this._hsCells[q]._cell=null;this._hsCells[q]._hours=null;this._hsCells[q].parentNode.removeChild(this._hsCells[q]);this._hsCells[q]=null}this._hsCells=null;while(this.hsCont.childNodes.length>0){this.hsCont.removeChild(this.hsCont.lastChild)}this.hsCont.parentNode.removeChild(this.hsCont);this.hsCont=null}if(v=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var q in this._rsCells){this._rsCells[q]._cell=null;this._rsCells[q]._minutes=null;this._rsCells[q].parentNode.removeChild(this._rsCells[q]);this._rsCells[q]=null}this._rsCells=null;while(this.rsCont.childNodes.length>0){this.rsCont.removeChild(this.rsCont.lastChild)}this.rsCont.parentNode.removeChild(this.rsCont);this.rsCont=null}this._sel._ta[v]=null};this.setMinutesInterval=function(a){if(!(a==1||a==5||a==10||a==15)){return}this._minutesInterval=a;this._unloadSelector("minutes")};this._updateActiveMonth=function(){if(typeof(this._msActive)!="undefined"&&typeof(this._msCells[this._msActive])!="undefined"){this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell"}this._msActive=this._activeMonth.getMonth();this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateActiveYear=function(){var a=this._activeMonth.getFullYear();if(this._ysCells[a]){this._ysCells[a].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateYearsList=function(C){for(var x in this._ysCells){this._ysCells[x]=null;delete this._ysCells[x]}var y=12*Math.floor(C.getFullYear()/12);for(var A=0;A<4;A++){for(var v=0;v<3;v++){this.ysCont.childNodes[A].childNodes[v].innerHTML=y;this.ysCont.childNodes[A].childNodes[v]._year=y;this.ysCont.childNodes[A].childNodes[v].className="dhtmlxcalendar_selector_cell";this._ysCells[y++]=this.ysCont.childNodes[A].childNodes[v]}}this._updateActiveYear()};this._scrollYears=function(a){var v=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var q=new Date(v,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(q)};this._updateActiveHours=function(){if(typeof(this._hsActive)!="undefined"&&typeof(this._hsCells[this._hsActive])!="undefined"){this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell"}this._hsActive=this._activeDate.getHours();this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleHours=function(){this.contTime.firstChild.firstChild.childNodes[1].innerHTML=this._fixLength(this._activeDate.getHours(),2)};this._updateActiveMinutes=function(){if(this._rsActive!=null&&typeof(this._rsActive)!="undefined"&&typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell"}if(this._minutesInterval==1){this._rsActive=(this.getFormatedDate("%i").toString()).charAt(this._selectorMode==1?0:1)}else{this._rsActive=this._activeDate.getMinutes()}if(typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateVisibleMinutes=function(q){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(q==true){a=a.charAt(0)+"<span class='dhtmlxcalendar_selected_date'>"+a.charAt(1)+"</span>"}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(q==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,q){while(String(a).length<q){a="0"+String(a)}return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(x){var w={};if(this._strToDate!=null){for(var q in this.i){if(this.i[q].input!=null&&this.i[q].input.value.length>0){var y=this._strToDate(this.i[q].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(y instanceof Date){w[q]=y}}}}this._dateFormat=x;var v=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var A=a.replace(/%/,"");switch(A){case"n":case"h":case"j":case"g":case"G":return"\\d{1,2}";case"m":case"d":case"H":case"i":case"s":case"y":return"\\d{2}";case"Y":return"\\d{4}";case"M":return"("+l.langData[l.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+l.langData[l.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM";case"u":return"\\d{1,6}";case"P":return"[\\+\\-]\\d{1,2}\\:\\d{1,2}"}return a});this._dateFormatRE=new RegExp(v,"i");for(var q in w){this.i[q].input.value=this._dateToStr(w[q])}w=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._updateDateStr=function(q){if(!this._dateFormatRE||!q.match(this._dateFormatRE)){return}if(q==this.getFormatedDate()){return}var a=this._strToDate(q);if(!(a instanceof Date)){return}if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this._nullDate=false;this._activeDate=a;this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleMinutes();this._updateVisibleHours();if(this._sel&&this._isSelectorVisible()){this._doOnSelectorShow(this._sel._t)}this._doOnSelectorChange(true)};this.showMonth=function(a){if(typeof(a)=="string"){a=this._strToDate(a)}if(!(a instanceof Date)){return}this._drawMonth(a)};this.setFormatedDate=function(x,y,q,w){var v=this._strToDate(y,x);if(w){return v}this.setDate(v)};this.getFormatedDate=function(q,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,q)};this.getWeekNumber=function(y){if(typeof(y)=="string"){y=this._strToDate(y)}if(!(y instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var H=this._wStart;var x=H+7;var F=4;var v=new Date(y.getFullYear(),0,1,0,0,0,0);var w=v.getDay();if(w==0){w=7}if(F<H){F+=7;w+=7}var D=0;if(w>=H&&w<=F){}else{D=1}var C=w-H;var E=new Date(y.getFullYear(),0,1-C+D*7,0,0,0,0);var J=604800000;var q=new Date(y.getFullYear(),y.getMonth(),y.getDate()+1,0,0,0,0);var I=Math.ceil((q.getTime()-E.getTime())/J);if(I==0){var A=new Date(y.getFullYear(),y.getMonth(),y.getDate(),0,0,0,0);var a=A.getDay()-this._wStart;if(a<0){a=a+7}A.setDate(A.getDate()-a);I=this.getWeekNumber(A)}return I};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(v){if(!v&&this._hasParent){this._show();return}if(typeof(v)=="object"&&typeof(v._dhtmlxcalendar_uid)!="undefined"&&this.i[v._dhtmlxcalendar_uid]==v){this._show(v._dhtmlxcalendar_uid);return}if(typeof(v)=="undefined"){for(var q in this.i){if(!v){v=q}}}if(!v){return}this._show(v)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,q){this._px=null;this._py=null;if(a=="right"||a=="bottom"){this.pos=a}else{this.pos="int";if(typeof(a)!="undefined"&&!isNaN(a)){this.base.style.left=a+"px";this._px=a}if(typeof(q)!="undefined"&&!isNaN(q)){this.base.style.top=q+"px";this._py=q}this._ifrSize()}};this._show=function(A,a){if(a===true&&this._activeInp==A&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!A){if(this._px&&this._py){this.base.style.left=this._px+"px";this.base.style.top=this._py+"px"}else{this.base.style.left="0px";this.base.style.top="0px"}}else{if(this.base.className.indexOf("dhtmlxcalendar_in_input")==-1){this.base.className+=" dhtmlxcalendar_in_input"}var w=(this.i[A].input||this.i[A].button);var q=(navigator.appVersion.indexOf("MSIE")!=-1);var x=Math.max((q?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var v=x+(q?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);if(this.pos=="right"){this.base.style.left=this._getLeft(w)+w.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(w),v-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var y=this._getTop(w)+w.offsetHeight+1;if(y+this.base.offsetHeight>v){y=this._getTop(w)-this.base.offsetHeight}this.base.style.left=this._getLeft(w)+"px";this.base.style.top=y+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=A;w=null}this._hideSelector();this.base.style.visibility="visible";this.base.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this._ifrSize();if(this._ifr){this._ifr.style.display=""}this.callEvent("onShow",[])};this._hide=function(){this._hideSelector();this.base.style.display="none";window.dhx4.zim.clear(this.conf.zi);if(this.base.className.indexOf("dhtmlxcalendar_in_input")>=0){this.base.className=this.base.className.replace(/\s{0,}dhtmlxcalendar_in_input/gi,"")}this._activeInp=null;if(this._ifr){this._ifr.style.display="none"}this.callEvent("onHide",[])};this._isVisible=function(){return(this.base.style.display!="none")};this._getLeft=function(a){return this._posGetOffset(a).left};this._getTop=function(a){return this._posGetOffset(a).top};this._posGetOffsetSum=function(a){var v=0,q=0;while(a){v=v+parseInt(a.offsetTop);q=q+parseInt(a.offsetLeft);a=a.offsetParent}return{top:v,left:q}};this._posGetOffsetRect=function(w){var A=w.getBoundingClientRect();var C=document.body;var q=document.documentElement;var a=window.pageYOffset||q.scrollTop||C.scrollTop;var x=window.pageXOffset||q.scrollLeft||C.scrollLeft;var y=q.clientTop||C.clientTop||0;var D=q.clientLeft||C.clientLeft||0;var E=A.top+a-y;var v=A.left+x-D;return{top:Math.round(E),left:Math.round(v)}};this._posGetOffset=function(a){return this[a.getBoundingClientRect?"_posGetOffsetRect":"_posGetOffsetSum"](a)};this._rangeActive=false;this._rangeFrom=null;this._rangeTo=null;this._rangeSet={};this.setInsensitiveDays=function(w){var a=this._extractDates(w);for(var v=0;v<a.length;v++){this._rangeSet[new Date(a[v].getFullYear(),a[v].getMonth(),a[v].getDate(),0,0,0,0).getTime()]=true}this._drawMonth(this._activeMonth)};this.clearInsensitiveDays=function(){this._clearRangeSet();this._drawMonth(this._activeMonth)};this._holidays={};this.setHolidays=function(v){if(v==null){this._clearHolidays()}else{if(v!=null){var a=this._extractDates(v);for(var w=0;w<a.length;w++){this._holidays[new Date(a[w].getFullYear(),a[w].getMonth(),a[w].getDate(),0,0,0,0).getTime()]=true}}}this._drawMonth(this._activeMonth)};this._extractDates=function(x){if(typeof(x)=="string"||x instanceof Date){x=[x]}var v=[];for(var y=0;y<x.length;y++){if(typeof(x[y])=="string"){var A=x[y].split(",");for(var a=0;a<A.length;a++){v.push(this._strToDate(A[a]))}}else{if(x[y] instanceof Date){v.push(x[y])}}}return v};this._clearRange=function(){this._rangeActive=false;this._rangeType=null;this._rangeFrom=null;this._rangeTo=null};this._clearRangeSet=function(){for(var q in this._rangeSet){this._rangeSet[q]=null;delete this._rangeSet[q]}};this._clearHolidays=function(){for(var q in this._holidays){this._holidays[q]=null;delete this._holidays[q]}};this._isOutOfRange=function(q){if(this._rangeSet[q]==true){return true}if(this._rangeActive){if(this._rangeType=="in"&&(q<this._rangeFrom||q>this._rangeTo)){return true}if(this._rangeType=="out"&&(q>=this._rangeFrom&&q<=this._rangeTo)){return true}if(this._rangeType=="from"&&q<this._rangeFrom){return true}if(this._rangeType=="to"&&q>this._rangeTo){return true}}var a=new Date(q);if(this._rangeWeek){if(this._rangeWeekData[a.getDay()]===true){return true}}if(this._rangeMonth){if(this._rangeMonthData[a.getDate()]===true){return true}}if(this._rangeYear){if(this._rangeYearData[a.getMonth()+"_"+a.getDate()]===true){return true}}return false};this.clearSensitiveRange=function(){this._clearRange();this._drawMonth(this._activeMonth)};this.setSensitiveRange=function(w,v,a){var q=false;if(w!=null&&v!=null){if(!(w instanceof Date)){w=this._strToDate(w)}if(!(v instanceof Date)){v=this._strToDate(v)}if(w.getTime()>v.getTime()){return}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";q=true}if(!q&&w!=null&&v==null){if(!(w instanceof Date)){w=this._strToDate(w)}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";q=true}if(!q&&w==null&&v!=null){if(!(v instanceof Date)){v=this._strToDate(v)}this._rangeFrom=null;this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";q=true}if(q){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(q,a){if(q!=null&&a!=null){if(!(q instanceof Date)){q=this._strToDate(q)}if(!(a instanceof Date)){a=this._strToDate(a)}if(q.getTime()>a.getTime()){return}this._rangeFrom=new Date(q.getFullYear(),q.getMonth(),q.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="out";this._drawMonth(this._activeMonth);return}if(q!=null&&a==null){this.setSensitiveRange(null,q,true);return}if(q==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(A,y){if(A=="week"){if(typeof(y)!="object"&&typeof(y.length)=="undefined"){y=[y]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var v in this._rangeWeekData){this._rangeWeekData[v]=false;delete this._rangeWeekData[v]}for(var x=0;x<y.length;x++){this._rangeWeekData[y[x]]=true;if(y[x]==7){this._rangeWeekData[0]=true}}this._rangeWeek=true}if(A=="month"){if(typeof(y)!="object"&&typeof(y.length)=="undefined"){y=[y]}if(!this._rangeMonthData){this._rangeMonthData={}}for(var v in this._rangeMonthData){this._rangeMonthData[v]=false;delete this._rangeMonthData[v]}for(var x=0;x<y.length;x++){this._rangeMonthData[y[x]]=true}this._rangeMonth=true}if(A=="year"){var w=this._extractDates(y);if(!this._rangeYearData){this._rangeYearData={}}for(var v in this._rangeYearData){this._rangeYearData[v]=false;delete this._rangeYearData[v]}for(var x=0;x<w.length;x++){this._rangeYearData[w[x].getMonth()+"_"+w[x].getDate()]=true}this._rangeYear=true}this._drawMonth(this._activeMonth)};this.enableDays=function(a){if(a=="week"){this._rangeWeek=false}if(a=="month"){this._rangeMonth=false}if(a=="year"){this._rangeYear=false}this._drawMonth(this._activeMonth)};this._tipData={};this._tipTM=null;this._tipTMTime=400;this._tipEvs=false;this._tipPopup=null;this._tipCellDate=null;this._tipCellDim=null;this.setTooltip=function(w,A,C,a){var x=this._extractDates(w);for(var y=0;y<x.length;y++){var v=new Date(x[y].getFullYear(),x[y].getMonth(),x[y].getDate(),0,0,0,0).getTime();this._tipData[v]={text:A,showIcon:C,usePopup:a}}this._drawMonth(this._activeMonth)};this.clearTooltip=function(v){var w=this._extractDates(v);for(var x=0;x<w.length;x++){var a=new Date(w[x].getFullYear(),w[x].getMonth(),w[x].getDate(),0,0,0,0).getTime();this._tipData[a]=null;delete this._tipData[a]}this._drawMonth(this._activeMonth)};this._initTooltipPopup=function(){if(this._tipEvs){return}this.attachEvent("onMouseOver",function(q){var a=new Date(q.getFullYear(),q.getMonth(),q.getDate(),0,0,0,0).getTime();if(this._tipData[a]!=null){if(this._tipTM){window.clearTimeout(this._tipTM)}this._tipCellDate=q;this._tipCellDim=this.getCellDimension(q);this._tipText=this._tipData[a].text;this._tipTM=window.setTimeout(this._showTooltipPopup,this._tipTMTime)}});this.attachEvent("onMouseOut",this._hideTooltipPopup);this._tipEvs=true};this._showTooltipPopup=function(A,a,C,q,v){if(!l._tipPopup){l._tipPopup=new dhtmlXPopup({mode:"top"})}l._tipPopup.attachHTML(l._tipText);l._tipPopup.show(l._tipCellDim.x,l._tipCellDim.y,l._tipCellDim.w,l._tipCellDim.h);l.callEvent("onPopupShow",[l._tipCellDate])};this._hideTooltipPopup=function(){if(this._tipTM){window.clearTimeout(this._tipTM)}if(this._tipPopup!=null&&this._tipPopup.isVisible()){this._tipPopup.hide();this.callEvent("onPopupHide",[this._tipCellDate])}};this.getPopup=function(){return this._tipPopup};this.getCellDimension=function(x){if(typeof(x)=="string"){x=this._strToDate(x)}if(!(x instanceof Date)){return null}var y=new Date(x.getFullYear(),x.getMonth(),x.getDate(),0,0,0,0).getTime();var v=null;for(var A=0;A<this.contDates.childNodes.length;A++){for(var a=0;a<this.contDates.childNodes[A].childNodes.length;a++){var C=this.contDates.childNodes[A].childNodes[a];if(C._date!=null&&C._date.getTime()==y){v={x:this._getLeft(C),y:this._getTop(C),w:C.offsetWidth,h:C.offsetHeight}}C=null}}return v};this._updateFromInput=function(a){if(this._nullInInput&&((a.value).replace(/\s/g,"")).length==0){if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[null])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this.setDate(null)}else{this._updateDateStr(a.value)}a=null};this._doOnClick=function(q){q=q||event;var a=(q.target||q.srcElement);if(a._dhtmlxcalendar_uid&&a._dhtmlxcalendar_uid!=l._activeInp&&l._isVisible()&&l._activeInp){l._hide();return}if(!a._dhtmlxcalendar_uid||!l.i[a._dhtmlxcalendar_uid]){if(l._isSelectorVisible()){l._hideSelector()}else{if(!l._hasParent&&l._isVisible()){l._hide()}}}};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13){if(l._isSelectorVisible()){l._hideSelector()}else{if(l._isVisible()&&!l._hasParent){l._hide()}}}};this._doOnInpClick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}var a=(q.target||q.srcElement);if(!a._dhtmlxcalendar_uid){return}if(!l._listenerEnabled){l._updateFromInput(a)}l._show(a._dhtmlxcalendar_uid,true)};this._doOnInpKeyUp=function(q){q=q||event;var a=(q.target||q.srcElement);if(q.keyCode==13||!a._dhtmlxcalendar_uid){return}if(!l._listenerEnabled){l._updateFromInput(a)}};this._doOnBtnClick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}var a=(q.target||q.srcElement);if(!a._dhtmlxcalendar_uid){return}if(l.i[a._dhtmlxcalendar_uid].input!=null){l._updateFromInput(l.i[a._dhtmlxcalendar_uid].input)}l._show(a._dhtmlxcalendar_uid,true)};this._doOnUnload=function(){if(l&&l.unload){l.unload()}};if(typeof(window.addEventListener)=="function"){document.body.addEventListener("click",l._doOnClick,false);window.addEventListener("keydown",l._doOnKeyDown,false);window.addEventListener("unload",l._doOnUnload,false);if(this.conf.touch==true){document.body.addEventListener("touchstart",l._doOnClick,false)}}else{document.body.attachEvent("onclick",l._doOnClick);document.body.attachEvent("onkeydown",l._doOnKeyDown);window.attachEvent("onunload",l._doOnUnload)}this.attachObj=function(v){var q=window.dhx4.newId();if(typeof(v)=="string"){this.i[q]={input:document.getElementById(v)}}else{if(typeof(v.tagName)!="undefined"){this.i[q]={input:v}}else{if(typeof(v)=="object"&&(v.input!=null||v.button!=null)){this.i[q]={};if(v.input!=null){this.i[q].input=(typeof(v.input)=="string"?document.getElementById(v.input):v.input)}if(v.button!=null){this.i[q].button=(typeof(v.button)=="string"?document.getElementById(v.button):v.button)}}}}this._attachEventsToObject(q);return q};this.detachObj=function(w){var v=null;if(this.i[w]!=null){v=w}else{if(typeof(w)=="string"){w=document.getElementById(w);v=w._dhtmlxcalendar_uid}else{if(typeof(w.tagName)!="undefined"){v=w._dhtmlxcalendar_uid}else{if(typeof(w)=="object"&&(w.input!=null||w.button!=null)){if(v==null&&w.input!=null){v=(typeof(w.input)=="string"?document.getElementById(w.input):w.input)._dhtmlxcalendar_uid}if(v==null&&w.button!=null){v=(typeof(w.button)=="string"?document.getElementById(w.button):w.button)._dhtmlxcalendar_uid}}}}}if(v!=null&&this.i[v]!=null){this._detachEventsFromObject(v);for(var q in this.i[q]){this.i[v][q]._dhtmlxcalendar_uid=null;this.i[v][q]=null;delete this.i[v][q]}this.i[v]=null;delete this.i[v];return true}return false};this._attachEventsToObject=function(q){if(this.i[q].button!=null){this.i[q].button._dhtmlxcalendar_uid=q;if(typeof(window.addEventListener)=="function"){this.i[q].button.addEventListener("click",l._doOnBtnClick,false);if(this.conf.touch==true){this.i[q].button.addEventListener("touchstart",l._doOnBtnClick,false)}}else{this.i[q].button.attachEvent("onclick",l._doOnBtnClick)}}else{if(this.i[q].input!=null){this.i[q].input._dhtmlxcalendar_uid=q;if(typeof(window.addEventListener)=="function"){this.i[q].input.addEventListener("click",l._doOnInpClick,false);this.i[q].input.addEventListener("keyup",l._doOnInpKeyUp,false);if(this.conf.touch==true){this.i[q].input.addEventListener("touchstart",l._doOnInpClick,false)}}else{this.i[q].input.attachEvent("onclick",l._doOnInpClick);this.i[q].input.attachEvent("onkeyup",l._doOnInpKeyUp)}}}};this._detachEventsFromObject=function(q){if(this.i[q].button!=null){if(typeof(window.addEventListener)=="function"){this.i[q].button.removeEventListener("click",l._doOnBtnClick,false);if(this.conf.touch==true){this.i[q].button.removeEventListener("touchstart",l._doOnBtnClick,false)}}else{this.i[q].button.detachEvent("onclick",l._doOnBtnClick)}}else{if(this.i[q].input!=null){if(typeof(window.addEventListener)=="function"){this.i[q].input.removeEventListener("click",l._doOnInpClick,false);this.i[q].input.removeEventListener("keyup",l._doOnInpKeyUp,false);if(this.conf.touch==true){this.i[q].input.removeEventListener("touchstart",l._doOnInpClick,false)}}else{this.i[q].input.detachEvent("onclick",l._doOnInpClick);this.i[q].input.detachEvent("onkeyup",l._doOnInpKeyUp)}}}};this.enableListener=function(a){if(!a){return}if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",l._listenerEvFocus,false);a.addEventListener("blur",l._listenerEvBlur,false)}else{a.attachEvent("onfocus",l._listenerEvFocus);a.attachEvent("onblur",l._listenerEvBlur)}a=null};this.disableListener=function(a){if(!a){return}a._f0=false;if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",l._listenerEvFocus,false);a.removeEventListener("blur",l._listenerEvBlur,false)}else{a.detachEvent("onfocus",l._listenerEvFocus);a.detachEvent("onblur",l._listenerEvBlur)}a=null};this._startListener=function(a){if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(a._v1)=="undefined"){a._v1=a.value}if(a._v1!=a.value){this._updateFromInput(a);a._v1=a.value}if(a._f0){this._tmListener=window.setTimeout(function(){l._startListener(a)},100)}};this._listenerEvFocus=function(q){q=q||event;var a=q.target||q.srcElement;a._f0=true;l._startListener(a);a=null};this._listenerEvBlur=function(q){q=q||event;var a=q.target||q.srcElement;a._f0=false;a=null};for(var o in this.i){this._attachEventsToObject(o)}window.dhx4._eventable(this);this._evOnArrowClick=function(a){return this.callEvent("onArrowClick",a)};this._evOnClick=function(a){return this.callEvent("onClick",a)};this._evOnMouseOut=function(a){return this.callEvent("onMouseOut",a)};this._evOnMouseOver=function(a){return this.callEvent("onMouseOver",a)};this.unload=function(){this._activeDate=null;this._activeDateCell=null;this._activeInp=null;this._activeMonth=null;this._dateFormat=null;this._dateFormatRE=null;this._lastHover=null;if(this._tmListener){window.clearTimeout(this._tmListener)}this._tmListener=null;if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("click",l._doOnClick,false);window.removeEventListener("keydown",l._doOnKeyDown,false);window.removeEventListener("unload",l._doOnUnload,false);if(this.conf.touch==true){document.body.removeEventListener("touchstart",l._doOnClick,false)}}else{document.body.detachEvent("onclick",l._doOnClick);document.body.detachEvent("onkeydown",l._doOnKeyDown);window.detachEvent("onunload",l._doOnKeyDown)}this._doOnClick=null;this._doOnKeyDown=null;this._doOnUnload=null;for(var q in this.i){this.i[q]._dhtmlxcalendar_uid=null;this._detachEventsFromObject(q);this.disableListener(this.i[q].input);this.i[q]=null;delete this.i[q]}this.i=null;this._doOnInpClick=null;this._doOnInpKeyUp=null;window.dhx4._eventable(this,"clear");this.contMonth.onselectstart=null;this.contMonth.firstChild.firstChild.onclick=null;this.contMonth.firstChild.firstChild.ontouchstart=null;this.contMonth.firstChild.firstChild.firstChild.onmouseover=null;this.contMonth.firstChild.firstChild.firstChild.onmouseout=null;this.contMonth.firstChild.firstChild.lastChild.onmouseover=null;this.contMonth.firstChild.firstChild.lastChild.onmouseout=null;while(this.contMonth.firstChild.firstChild.childNodes.length>0){this.contMonth.firstChild.firstChild.removeChild(this.contMonth.firstChild.firstChild.lastChild)}this.contMonth.firstChild.removeChild(this.contMonth.firstChild.firstChild);this.contMonth.removeChild(this.contMonth.firstChild);this.contMonth.parentNode.removeChild(this.contMonth);this.contMonth=null;while(this.contDays.firstChild.childNodes.length>0){this.contDays.firstChild.removeChild(this.contDays.firstChild.lastChild)}this.contDays.removeChild(this.contDays.firstChild);this.contDays.parentNode.removeChild(this.contDays);this.contDays=null;this.contDates.onclick=null;this.contDates.ontouchstart=null;this.contDates.onmouseover=null;this.contDates.onmouseout=null;while(this.contDates.childNodes.length>0){while(this.contDates.lastChild.childNodes.length>0){this.contDates.lastChild.lastChild._css_date=null;this.contDates.lastChild.lastChild._css_month=null;this.contDates.lastChild.lastChild._css_weekend=null;this.contDates.lastChild.lastChild._css_hover=null;this.contDates.lastChild.lastChild._date=null;this.contDates.lastChild.lastChild._q=null;this.contDates.lastChild.lastChild._w=null;this.contDates.lastChild.removeChild(this.contDates.lastChild.lastChild)}this.contDates.removeChild(this.contDates.lastChild)}this.contDates.parentNode.removeChild(this.contDates);this.contDates=null;this.contTime.firstChild.firstChild.onclick=null;this.contTime.firstChild.firstChild.ontouchstart=null;while(this.contTime.firstChild.firstChild.childNodes.length>0){this.contTime.firstChild.firstChild.removeChild(this.contTime.firstChild.firstChild.lastChild)}this.contTime.firstChild.removeChild(this.contTime.firstChild.firstChild);this.contTime.removeChild(this.contTime.firstChild);this.contTime.parentNode.removeChild(this.contTime);this.contTime=null;this._lastHover=null;this._unloadSelector("month");this._unloadSelector("year");this._unloadSelector("hours");this._unloadSelector("minutes");if(this._selCover){this._selCover.parentNode.removeChild(this._selCover);this._selCover=null}if(this._sel){for(var q in this._sel._ta){this._sel._ta[q]=null}this._sel._ta=null;this._sel._t=null;this._sel.onmouseover=null;this._sel.onmouseout=null;while(this._sel.firstChild.firstChild.firstChild.childNodes.length>0){this._sel.firstChild.firstChild.firstChild.lastChild.onclick=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseover=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseout=null;this._sel.firstChild.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild.lastChild)}this._sel.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild);this._sel.firstChild.removeChild(this._sel.firstChild.firstChild);while(this._sel.childNodes.length>0){this._sel.removeChild(this._sel.lastChild)}this._sel.parentNode.removeChild(this._sel);this._sel=null}this.base.onclick=null;this.base.onmousedown=null;this.base.ontouchstart=null;this.base.onmouseout=null;this.base.parentNode.removeChild(this.base);this.base=null;this._clearDayHover=null;this._clearSelHover=null;this._doOnSelectorChange=null;this._doOnSelectorShow=null;this._drawMonth=null;this._fixLength=null;this._getLeft=null;this._getTop=null;this._ifrSize=null;this._hide=null;this._hideSelector=null;this._initSelector=null;this._isSelectorVisible=null;this._isVisible=null;this._posGetOffset=null;this._posGetOffsetRect=null;this._posGetOffsetSum=null;this._scrollYears=null;this._show=null;this._showSelector=null;this._strToDate=null;this._updateActiveHours=null;this._updateActiveMinutes=null;this._updateActiveMonth=null;this._updateActiveYear=null;this._updateCellStyle=null;this._updateDateStr=null;this._updateVisibleHours=null;this._updateVisibleMinutes=null;this._updateYearsList=null;this.enableIframe=null;this.hide=null;this.hideTime=null;this.setDate=null;this.setDateFormat=null;this.setYearsRange=null;this.show=null;this.showTime=null;this.unload=null;if(this._tipPopup!=null){this._tipPopup.unload();this._tipPopup=null}for(var q in this){delete this[q]}q=l=null};this.setDate(this._activeDate);return this}dhtmlXCalendarObject.prototype.lang="en";dhtmlXCalendarObject.prototype.langData={en:{dateformat:"%Y-%m-%d",hdrformat:"%F %Y",monthesFNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthesSNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysFNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysSNames:["Su","Mo","Tu","We","Th","Fr","Sa"],weekstart:1,weekname:"w"}};dhtmlXCalendarObject.prototype._buildMonthHdr=function(l){var c=this;var j=function(m){return(String(m).length==1?"0"+String(m):m)};var a=function(m,n){return"<span class='dhtmlxcalendar_month_label_"+m+"'>"+n+"</span>"};var g=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(m){switch(m){case"%m":return a("month",j(l.getMonth()+1));case"%n":return a("month",l.getMonth()+1);case"%M":return a("month",c.langData[c.lang].monthesSNames[l.getMonth()]);case"%F":return a("month",c.langData[c.lang].monthesFNames[l.getMonth()]);case"%y":return a("year",j(l.getYear()%100));case"%Y":return a("year",l.getFullYear());case"%%":return"%";default:return m}});c=j=a=null;return g};dhtmlXCalendarObject.prototype.enableIframe=function(a){if(a==true){if(!this._ifr){this._ifr=document.createElement("IFRAME");this._ifr.frameBorder=0;this._ifr.border=0;this._ifr.setAttribute("src","javascript:false;");this._ifr.className="dhtmlxcalendar_ifr";this._ifr.onload=function(){this.onload=null;this.contentWindow.document.open("text/html","replace");this.contentWindow.document.write("<html><head><style>html,body{width:100%;height:100%;overflow:hidden;margin:0px;}</style></head><body</body></html>")};this.base.parentNode.insertBefore(this._ifr,this.base);this._ifrSize()}}else{if(this._ifr){this._ifr.parentNode.removeChild(this._ifr);this._ifr=null}}};dhtmlXCalendarObject.prototype._ifrSize=function(){if(this._ifr){this._ifr.style.left=this.base.style.left;this._ifr.style.top=this.base.style.top;this._ifr.style.width=this.base.offsetWidth+"px";this._ifr.style.height=this.base.offsetHeight+"px"}};dhtmlxCalendarObject=dhtmlXCalendarObject;dhtmlXCalendarObject.prototype._dateStrings=function(){var a=this.langData[this.lang];return{monthFullName:a.monthesFNames,monthShortName:a.monthesSNames,dayFullName:a.daysFNames,dayShortName:a.daysSNames}};dhtmlXCalendarObject.prototype._strToDate=function(c,a){return window.dhx4.str2date(c,a||this._dateFormat,this._dateStrings())};dhtmlXCalendarObject.prototype._dateToStr=function(c,a){return window.dhx4.date2str(c,a||this._dateFormat,this._dateStrings())};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(c){var a=this;this.leftCalendar=new dhtmlXCalendarObject(c);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(c);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(g){a._updateRange("rightCalendar",g,null);a._evOnClick(["left",g])});this.rightCalendar.attachEvent("onClick",function(g){a._updateRange("leftCalendar",null,g);a._evOnClick(["right",g])});this.leftCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["left",g])});this.rightCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["right",g])});this.show=function(){this.leftCalendar.show();this.rightCalendar.base.style.marginLeft=this.leftCalendar.base.offsetWidth-1+"px";this.rightCalendar.show()};this.hide=function(){this.leftCalendar.hide();this.rightCalendar.hide()};this.setDateFormat=function(g){this.leftCalendar.setDateFormat(g);this.rightCalendar.setDateFormat(g)};this.setDates=function(j,g){if(j!=null){this.leftCalendar.setDate(j)}if(g!=null){this.rightCalendar.setDate(g)}this._updateRange()};this._updateRange=function(g,l,j){if(arguments.length==3){(g=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(l,j)}else{this.leftCalendar.setSensitiveRange(null,this.rightCalendar.getDate());this.rightCalendar.setSensitiveRange(this.leftCalendar.getDate(),null)}};this.getFormatedDate=function(){return this.leftCalendar.getFormatedDate.apply(this.leftCalendar,arguments)};this.unload=function(){window.dhx4._eventable(this,"clear");this.leftCalendar.unload();this.rightCalendar.unload();this.leftCalendar=this.rightCalendar=null;this._updateRange=null;this._evOnClick=null;this._evOnBeforeChange=null;this.show=null;this.hide=null;this.setDateFormat=null;this.setDates=null;this.getFormatedDate=null;this.unload=null;a=null};this._evOnClick=function(g){return this.callEvent("onClick",g)};this._evOnBeforeChange=function(g){return this.callEvent("onBeforeChange",g)};window.dhx4._eventable(this);return this};function dhtmlXCombo(m,s,g,o,l){var n=this;var j=null;var u=null;if(typeof(m)=="object"&&!m.tagName){j=m;m=j.parent;g=j.width;s=j.name;o=j.mode;u=j.skin}this.cont=(typeof(m)=="string"?document.getElementById(m):m);this.conf={skin:null,form_name:s||"dhxcombo",combo_width:(parseInt(g)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(o)=="string"&&typeof(this.modes[o])!="undefined"?o:"option"),opts_count:8,opts_count_min:3,opts_width:null,item_h:null,list_zi_id:window.dhx4.newId(),allow_free_text:true,allow_empty_value:true,enabled:true,img_path:"",img_def:"",img_def_dis:true,template:{input:"#text#",option:"#text#"},f_func:null,f_mode:false,f_url:false,f_cache:false,f_cache_data:{},f_dyn:false,f_dyn_end:false,f_mask:"",f_ac:true,f_ac_text:"",f_server_tm:null,f_server_last:"",f_loading:false,s_tm:null,s_time:200,s_mode:"select",last_hover:null,last_selected:null,last_match:null,last_text:"",last_value:"",tm_hover:null,tm_confirm_blur:null,clear_click:false,clear_blur:false,clear_bsp:false,clear_key:false,sp:{dhx_skyblue:{list_ofs:1,hdr_ofs:1,scr_ofs:1},dhx_web:{list_ofs:0,hdr_ofs:1,scr_ofs:0},dhx_terrace:{list_ofs:1,hdr_ofs:1,scr_ofs:1}},col_w:null};this.conf.combo_image=(this.modes[this.conf.opts_type].image==true);this.t={};this.base=document.createElement("DIV");this.base.style.width=this.conf.combo_width+"px";this.base.innerHTML="<input type='text' class='dhxcombo_input' style='width:"+(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px;"+(this.conf.combo_image?"margin-left:23px;":"")+"' autocomplete='off'><input type='hidden' value=''><input type='hidden' value='false'><div class='dhxcombo_select_button'><div class='dhxcombo_select_img'></div></div>"+(this.conf.combo_image?"<div class='dhxcombo_top_image'>"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"</div>":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list._listId=window.dhx4.newId();this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this._doOnListScroll=function(){if(n.conf.s_tm!=null){window.clearTimeout(n.conf.s_tm)}n.conf.s_tm=window.setTimeout(n._doOnListScrollAction,n.conf.s_time)};this._doOnListScrollAction=function(){n.conf.s_tm=null;if(n.conf.s_mode=="scroll"&&n.list.scrollHeight-n.list.scrollTop-10<n.list.clientHeight){n._subloadRequest()}};if(typeof(window.addEventListener)=="function"){this.list.addEventListener("scroll",this._doOnListScroll,false)}else{this.list.attachEvent("onscroll",this._doOnListScroll)}this.setSkin(u||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcombo")||"dhx_skyblue");this._updateTopImage=function(a){if(!this.conf.combo_image){return}if(a!=null){this.base.lastChild.innerHTML=this.t[a].obj.getTopImage(this.t[a].item,this.conf.enabled)}else{this.base.lastChild.innerHTML=this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)}};this._filterOpts=function(C){if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}var x=String(this.base.firstChild.value).replace(new RegExp(this.conf.f_ac_text+"$","i"),"");if(this.conf.f_server_last==x.toLowerCase()){this._checkForMatch();return}if(this.conf.f_url!=null&&this.checkEvent("onDynXLS")){this.conf.f_server_last=x.toLowerCase();this.callEvent("onDynXLS",[x]);return}if(this.conf.f_url!=null){if(x.length==0){this.conf.f_server_last=x.toLowerCase();this.clearAll();return}if(this.conf.f_cache==true&&this.conf.f_cache_data[x]!=null){this.clearAll();this.conf.f_server_last=x.toLowerCase();for(var w=0;w<this.conf.f_cache_data[x].data.length;w++){this.load(this.conf.f_cache_data[x].data[w])}if(this.conf.f_dyn){this.conf.f_dyn_end=this.conf.f_cache_data[x].dyn_end;this.conf.f_mask=this.conf.f_cache_data[x].mask}if(C!==true){this._showList(true);this._checkForMatch()}}else{this.conf.f_server_tm=window.setTimeout(function(){n.conf.f_server_last=x.toLowerCase();n.conf.f_mask=x;var q="mask="+encodeURIComponent(x);if(n.conf.f_dyn){q+="&pos=0";n.conf.f_dyn_end=false}var a=function(J){if(n.conf.f_cache){if(!n.conf.f_cache_data[x]){n.conf.f_cache_data[x]={data:[],dyn_end:false,mask:x}}n.conf.f_cache_data[x].data.push(J.xmlDoc.responseXML)}n.clearAll();n.load(J.xmlDoc.responseXML);var I=(n.base.offsetWidth>0&&n.base.offsetHeight>0);if(I==true&&n.conf.enabled==true&&n.conf.combo_focus==true&&C!==true){if(n.conf.f_ac&&n.conf.f_mode=="start"&&n.conf.clear_bsp==false&&n.list.firstChild!=null){var H=n.list.firstChild._optId;var K=String(n.t[H].obj.getText(n.list.firstChild,true));if(String(K).toLowerCase().indexOf(String(x).toLowerCase())===0){n.base.firstChild.value=K;n._selectRange(x.length,K.length)}}n._showList(true);n._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(n.conf.f_url,q,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(n.conf.f_url+(String(n.conf.f_url).indexOf("?")>=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=x.toLowerCase();var v=(x.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+String(x).replace(/[\\\^\$\*\+\?\.\(\)\|\{\}\[\]]/gi,"\\$&"),"i"));var y=null;for(var D in this.t){var F=false;if(v!==true){if(this.conf.f_func!=null){var A=this._getOption(this.t[D].item._optId,w);F=(this.conf.f_func.apply(window,[x,A])==true)}else{var E=this.t[D].obj.getText(this.t[D].item,true);F=(v.test(E)==true)}}if(v===true||F==true){this.t[D].item.style.display="";if(y==null&&x.length>0){y=String(this.t[D].obj.getText(this.t[D].item,true))}}else{this.t[D].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&y!=null){this.conf.f_ac_text=y.replace(new RegExp("^"+x,"i"),"");this.base.firstChild.value=y;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}if(this.conf.f_mode=="between"&&this.conf.clear_bsp==true){this._checkForMatch(true)}if(C!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}if(a.add!=true&&this.conf.f_loading!=true){this.clearAll(false)}this.addOption(a.options)};this._xmlToObj=function(Q,y,x){var D={add:false,options:[]};var K=(y==true?Q:Q.getElementsByTagName("complete"));if(K.length>0){if(window.dhx4.s2b(K[0].getAttribute("add"))==true){D.add=true}var J=K[0].childNodes;for(var H=0;H<J.length;H++){if(typeof(J[H].tagName)!="undefined"){if(String(J[H].tagName).toLowerCase()=="template"){var P={};for(var C=0;C<J[H].childNodes.length;C++){var I=J[H].childNodes[C];if(I.tagName!=null){var L=I.tagName;if(typeof(this.conf.template[L])!="undefined"){P[L]=window.dhx4._xmlNodeValue(I)}if(L=="columns"){for(var N=0;N<I.childNodes.length;N++){var A=I.childNodes[N];if(A.tagName!=null&&A.tagName=="column"){var F={};for(var O in {width:1,css:1,header:1,option:1}){if(A.getAttribute(O)!=null){F[O]=A.getAttribute(O)}}for(var O in {header:1,option:1}){var M=A.getElementsByTagName(O);if(M[0]!=null&&M[0].firstChild!=null){F[O]=window.dhx4._xmlNodeValue(M[0])}}if(P.columns==null){P.columns=[]}P.columns.push(F)}A=null}}}I=null}this.setTemplate(P)}if(String(J[H].tagName).toLowerCase()=="option"){var E=false;if(y==true){E=(D.options.length==x)}else{E=window.dhx4.s2b(J[H].getAttribute("selected"))}var v={value:J[H].getAttribute("value"),text:window.dhx4._xmlNodeValue(J[H]),selected:E,checked:window.dhx4.s2b(J[H].getAttribute("checked"))};for(var O in {img:1,img_dis:1,img_src:1,img_src_dis:1,css:1}){if(J[H].getAttribute(O)!=null){v[O]=J[H].getAttribute(O)}}for(var C=0;C<J[H].childNodes.length;C++){if(J[H].childNodes[C].tagName!=null&&String(J[H].childNodes[C].tagName).toLowerCase()=="text"){v.text={};var I=J[H].childNodes[C];for(var N=0;N<I.childNodes.length;N++){if(I.childNodes[N].tagName!=null){v.text[I.childNodes[N].tagName]=window.dhx4._xmlNodeValue(I.childNodes[N])}}}}D.options.push(v)}}}K=J=null}return D};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","complete",{data:true});window.dhx4._eventable(this);this._getNearItem=function(v,q){var a=null;while(v!=null){v=v[q<0?"previousSibling":"nextSibling"];if(a==null&&v!=null&&v.style.display==""&&v._optId!=null){a=v;v=null}}return a};this.setName(this.conf.form_name);this._doOnListMouseMove=function(q){q=q||event;var a=q.target||q.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){if(n.conf.tm_hover){window.clearTimeout(n.conf.tm_hover)}n._setSelected(a._optId)}a=a.parentNode}a=null};this._doOnListMouseDown=function(a){a=a||event;a.cancelBubble=true;n.conf.clear_click=true;window.setTimeout(function(){n.base.firstChild.focus()},1)};this._doOnListMouseUp=function(v){v=v||event;var a=v.target||v.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){var q=true;if(typeof(n.t[a._optId].obj.optionClick)=="function"&&n.t[a._optId].obj.optionClick(a,v,n)!==true){q=false}if(q){n._setSelected(a._optId,null,true);n._confirmSelect("click")}}a=a.parentNode}a=null};this._doOnListMouseOut=function(a){if(n.conf.tm_hover){window.clearTimeout(n.conf.tm_hover)}n.conf.tm_hover=window.setTimeout(function(){var q=n.conf.last_match||n.conf.last_selected;if(n.conf.last_match==null&&n.t[q]!=null){if(n.base.firstChild.value!=n.t[q].obj.getText(n.t[q].item,true)){q=null}}n._setSelected(q,null,true)},1)};this._doOnBaseMouseDown=function(x){if(!n.conf.enabled){return}n.conf.clear_click=true;x=x||event;var q=x.target||x.srcElement;if(q!=this.firstChild){window.setTimeout(function(){n.base.firstChild.focus()},1);var w=q;while(w!=this&&w!=null){if(w==this.lastChild){if(typeof(n.modes[n.conf.opts_type].topImageClick)=="function"){var v=(n.conf.last_hover||n.conf.last_selected);var a=(v!=null?n.t[v].item:null);if(n.modes[n.conf.opts_type].topImageClick(a,n)!==true){v=a=null;return}}w=null}else{w=w.parentNode}}}if(n._isListVisible()){n._hideList()}else{if(q!=this.firstChild){n.conf.clear_blur=true}n._showList();n._setSelected(n.conf.last_selected,true,true)}q=null};this._doOnBodyMouseDown=function(){if(n.conf.clear_click){n.conf.clear_click=false;return}n._confirmSelect("blur")};this._doOnInputFocus=function(){n.conf.clear_blur=false;if(n.conf.tm_confirm_blur){window.clearTimeout(n.conf.tm_confirm_blur)}if(n.conf.combo_focus==false){n.conf.combo_focus=true;n.callEvent("onFocus",[])}};this._doOnInputBlur=function(){if(n.conf.clear_blur==true){n.conf.clear_blur=false;return}if(n.conf.tm_confirm_blur){window.clearTimeout(n.conf.tm_confirm_blur)}n.conf.tm_confirm_blur=window.setTimeout(function(){if(n.conf.clear_click==false){n._confirmSelect("blur");n.conf.combo_focus=false;n.callEvent("onBlur",[])}},20)};this._doOnInputKeyUp=function(a){a=a||event;if(n.conf.f_mode!=false){n.conf.clear_bsp=(a.keyCode==8||a.keyCode==46);n._filterOpts();return}else{n._checkForMatch()}};this._doOnInputKeyDown=function(a){a=a||event;if((a.keyCode==38||a.keyCode==40)&&!a.ctrlKey&&!a.shiftKey&&!a.altKey){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;n._keyOnUpDown(a.keyCode==38?-1:1)}if(a.keyCode==113){if(!n._isListVisible()){n._showList();if(n.base.firstChild.value==n.conf.last_text){n._setSelected(n.conf.last_selected,true,true);n.base.firstChild.value=n.conf.last_text;n.conf.f_server_last=n.base.firstChild.value.toLowerCase()}else{n.conf.f_server_last=n.base.firstChild.value.toLowerCase();if(n.conf.f_mode==false){n._checkForMatch()}}}else{}}if(a.keyCode==27){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;n._cancelSelect()}if(a.keyCode==13){if(a.preventDefault){a.preventDefault()}n._confirmSelect("kbd")}n.conf.clear_key=true;n.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(n.conf.clear_key){n.conf.clear_key=false;return}a=a||event;n.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var q=null;if(this.conf.last_hover){q=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){q=this.t[this.conf.last_selected].item}}if(!q&&this._getListVisibleCount()==0){return}if(q!=null&&q.style.display!=""){q=null}this._showList();if(q!=null){if(this.t[q._optId].obj.isSelected(q)){q=this._getNearItem(q,a)}}else{q=this.list.firstChild;if(q.style.display!=""){q=this._getNearItem(q,1)}}if(q==null){return}this._setSelected(q._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[q._optId].obj.getText(q,true)}else{var v=String(this.t[q._optId].obj.getText(q,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(v.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=v.substring(this.conf.f_server_last.length,v.length);this.base.firstChild.value=v;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=v;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=v;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}q=null};this.conf.evs_nodes=[{node:document.body,evs:{mousedown:"_doOnBodyMouseDown"}},{node:this.base,evs:{mousedown:"_doOnBaseMouseDown"}},{node:this.base.firstChild,evs:{keyup:"_doOnInputKeyUp",keydown:"_doOnInputKeyDown",keypress:"_doOnInputKeyPress",focus:"_doOnInputFocus",blur:"_doOnInputBlur"}},{node:this.list,evs:{mousemove:"_doOnListMouseMove",mousedown:"_doOnListMouseDown",mouseup:"_doOnListMouseUp",mouseout:"_doOnListMouseOut"}}];for(var c=0;c<this.conf.evs_nodes.length;c++){for(var r in this.conf.evs_nodes[c].evs){if(typeof(window.addEventListener)=="function"){this.conf.evs_nodes[c].node.addEventListener(r,this[this.conf.evs_nodes[c].evs[r]],false)}else{this.conf.evs_nodes[c].node.attachEvent("on"+r,this[this.conf.evs_nodes[c].evs[r]])}}}this.unload=function(){this.clearAll();this.t=null;for(var w=0;w<this.conf.evs_nodes.length;w++){for(var v in this.conf.evs_nodes[w].evs){if(typeof(window.addEventListener)=="function"){this.conf.evs_nodes[w].node.removeEventListener(v,this[this.conf.evs_nodes[w].evs[v]],false)}else{this.conf.evs_nodes[w].node.detachEvent("on"+v,this[this.conf.evs_nodes[w].evs[v]])}this.conf.evs_nodes[w].evs[v]=null;delete this.conf.evs_nodes[w].evs[v]}this.conf.evs_nodes[w].node=null;this.conf.evs_nodes[w].evs=null;delete this.conf.evs_nodes[w].node;delete this.conf.evs_nodes[w].evs;this.conf.evs_nodes[w]=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");this._mcDetachHeader();this.DOMelem_input=this.DOMelem_button=this.DOMlist=this.DOMelem=this.DOMParent=null;for(var v in this.conf){this.conf[v]=null;delete this.conf[v]}this.conf=null;if(typeof(window.addEventListener)=="function"){this.list.removeEventListener("scroll",this._doOnListScroll,false)}else{this.list.detachEvent("onscroll",this._doOnListScroll)}this.base.parentNode.removeChild(this.base);this.list.parentNode.removeChild(this.list);this.base=this.list=this.cont=null;this.modes=null;for(var v in this){if(typeof(this[v])=="function"){this[v]=null}}n=null};this.DOMelem_input=this.base.firstChild;this.DOMelem_button=this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)];this.DOMlist=this.list;this.DOMelem=this.base;this.DOMParent=m;m=null;if(j!=null){if(j.filter!=null){if(typeof(j.filter)=="string"){this.enableFilteringMode(true,j.filter,window.dhx4.s2b(j.filter_cache),window.dhx4.s2b(j.filter_sub_load))}else{this.enableFilteringMode(true)}}if(j.image_path!=null){this.setImagePath(j.image_path)}if(j.default_image!=null||j.default_image_dis!=null){this.setDefaultImage(j.default_image,j.default_image_dis)}if(j.items||j.options){this.addOption(j.items||j.options)}if(j.xml||j.json){this.load(j.xml||j.json)}if(typeof(j.readonly)!="undefined"){this.readonly(j.readonly)}j=null}return this}function dhtmlXComboFromSelect(g){if(typeof(g)=="string"){g=document.getElementById(g)}var c=g.offsetWidth;var r=g.getAttribute("name")||null;var j=document.createElement("SPAN");g.parentNode.insertBefore(j,g);var m=g.getAttribute("mode")||g.getAttribute("opt_type")||"option";var l=new dhtmlXCombo(j,r,c,m);j=null;var o=g.getAttribute("imagePath");if(o){l.setImagePath(o)}var q=g.getAttribute("defaultImage");var n=g.getAttribute("defaultImageDis");if(window.dhx4.s2b(n)==true){n=true}if(q!=null||n!=null){l.setDefaultImage(q,n)}var a=l._xmlToObj([g],true,g.selectedIndex);if(a.options.length>0){l.addOption(a.options)}a=null;g.parentNode.removeChild(g);g=null;return l}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a.replace(/(\[.*)?$/,"_new_value$1")};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true")}else{this.base.firstChild.removeAttribute("readOnly")}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(g){for(var c in g){if(typeof(this.conf.template[c])!="undefined"){this.conf.template[c]=String(g[c])}}if(g.columns!=null){this._mcMakeTemplate(g.columns)}else{this._mcDetachHeader()}for(var c in this.t){this.t[c].obj.setText(this.t[c].item,this.t[c].item._conf.text)}this._confirmSelect()};dhtmlXCombo.prototype.setSkin=function(a){if(a==this.conf.skin){return}this.conf.skin=a;this.base.className="dhxcombo_"+this.conf.skin+(this.conf.enabled?"":" dhxcombo_disabled");this.list.className="dhxcombolist_"+this.conf.skin+(this.hdr!=null?" dhxcombolist_multicolumn":"");if(this.hdr!=null){this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr"}};dhtmlXCombo.prototype.getInput=function(){return this.base.firstChild};dhtmlXCombo.prototype.getButton=function(){return this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)]};dhtmlXCombo.prototype.getList=function(){return this.list};dhtmlXCombo.prototype.getBase=function(){return this.base};dhtmlXCombo.prototype.getParent=function(){return this.DOMParent};dhtmlXCombo.prototype.forEachOption=function(a){for(var c=0;c<this.list.childNodes.length;c++){a.apply(window,[this._getOption(this.list.childNodes[c]._optId,c)])}};dhtmlXCombo.prototype.setFocus=function(){if(this.conf.enabled){this.base.firstChild.focus()}};dhtmlXCombo.prototype.setFontSize=function(a,c){if(a!=null){this.base.firstChild.style.fontSize=a}if(c!=null){this.list.style.fontSize=c}};dhtmlXCombo.prototype.getOption=function(l){var m=null;var g=null;for(var j=0;j<this.list.childNodes.length;j++){if(m==null){var c=this.list.childNodes[j]._optId;if(this.t[c].obj.getValue(this.t[c].item)==l){m=c;g=j}}}return(m==null?null:this._getOption(m,g))};dhtmlXCombo.prototype.getOptionByIndex=function(a){if(a<0){return null}if(this.list.childNodes[a]==null){return null}return this._getOption(this.list.childNodes[a]._optId,a)};dhtmlXCombo.prototype.getOptionByLabel=function(l){var m=null;var g=null;for(var j=0;j<this.list.childNodes.length;j++){if(m==null){var c=this.list.childNodes[j]._optId;if(this.t[c].obj.getText(this.t[c].item,true)==l){m=c;g=j}}}return(m==null?null:this._getOption(m,g))};dhtmlXCombo.prototype.getSelectedIndex=function(){return this._getOptionProp(this.conf.last_selected,"index",-1)};dhtmlXCombo.prototype.getSelectedText=function(){return this._getOptionProp(this.conf.last_selected,"text","")};dhtmlXCombo.prototype.getSelectedValue=function(){return this._getOptionProp(this.conf.last_selected,"value",null)};dhtmlXCombo.prototype.getActualValue=function(){return this.base.childNodes[1].value};dhtmlXCombo.prototype.getComboText=function(){return this.base.childNodes[0].value};dhtmlXCombo.prototype.getIndexByValue=function(c){var a=this.getOption(c);return(a!=null?a.index:-1)};dhtmlXCombo.prototype.setComboText=function(a){if(this.conf.allow_free_text!=true){return}this.unSelectOption();this.conf.last_text=this.base.firstChild.value=a;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()};dhtmlXCombo.prototype.setComboValue=function(c){var a=this.getOption(c);if(a!=null){this.selectOption(a.index)}else{this.conf.last_value=c;this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="true"}};dhtmlXCombo.prototype.selectOption=function(c,g,a){if(c<0||c>=this.list.childNodes.length){return}var j=this.list.childNodes[c]._optId;this._setSelected(j,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null}this.base.firstChild.value="";if(this.conf.f_mode!=false){this._filterOpts(true)}this._hideList();this._updateTopImage(null);this._confirmSelect("script")};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelect("script")};dhtmlXCombo.prototype.enable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));if(this.conf.enabled==a){return}this.conf.enabled=a;if(a){this.base.className="dhxcombo_"+this.conf.skin;this.base.firstChild.removeAttribute("disabled")}else{this._hideList();this.base.className="dhxcombo_"+this.conf.skin+" dhxcombo_disabled";this.base.firstChild.setAttribute("disabled","true")}this._updateTopImage(this.conf.last_selected)};dhtmlXCombo.prototype.disable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));this.enable(!a)};dhtmlXCombo.prototype.isEnabled=function(){return(this.conf.enabled==true)};dhtmlXCombo.prototype.show=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.base.style.display=(a==true?"":"none")};dhtmlXCombo.prototype.hide=function(a){if(typeof(a)=="undefined"){a=true}this.show(!a)};dhtmlXCombo.prototype.isVisible=function(){return(this.base.style.display=="")};dhtmlXCombo.prototype.setFilterHandler=function(a){if(typeof(a)=="function"){this.conf.f_func=a;this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{if(typeof(a)=="string"&&typeof(window[a])=="function"){this.conf.f_func=window[a];this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{this.conf.f_func=null}}};dhtmlXCombo.prototype.enableFilteringMode=function(j,c,a,g){if(j==true||j=="between"){this.conf.f_mode=(j==true?"start":"between");if(c!=null){this.conf.f_url=c;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(g)}else{this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}}else{this.conf.f_mode=false;this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}};dhtmlXCombo.prototype.filter=function(g,a){for(var j=0;j<this.list.childNodes.length;j++){var c=g.apply(window,[this._getOption(this.list.childNodes[j]._optId,j)]);this.list.childNodes[j].style.display=(c===true?"":"none")}if(typeof(a)=="undefined"||a==true){this._showList(true)}};dhtmlXCombo.prototype.sort=function(g){var a=[];for(var c=0;c<this.list.childNodes.length;c++){var j=this.list.childNodes[c]._optId;a.push([j,this._getOption(j,c)])}if(g=="asc"||g=="desc"){k=true;a.sort(function(m,l){m=m[1].text_option.toLowerCase();l=l[1].text_option.toLowerCase();var n=(g=="asc"?1:-1);return(m>l?n:-1*n)})}else{if(typeof(g)=="function"||typeof(window[g])=="function"){if(typeof(window[g])=="function"){g=window[g]}a.sort(function(m,l){return g.apply(window,[m[1],l[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var c=0;c<a.length;c++){this.list.appendChild(this.t[a[c][0]].item)}};dhtmlXCombo.prototype.enableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.conf.f_ac=a};dhtmlXCombo.prototype.disableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.enableAutocomplete(!a)};dhtmlXCombo.prototype.allowFreeText=function(a){this.conf.allow_free_text=(typeof(a)=="undefined"?true:window.dhx4.s2b(a))};dhtmlXCombo.prototype._checkForMatch=function(j){var a=window.dhx4.trim(this.base.firstChild.value).toLowerCase();var l=null;var c=this.list.firstChild;while(c!=null){if(c.style.display==""&&c._optId!=null){var g=window.dhx4.trim(this.t[c._optId].obj.getText(c,true)).toLowerCase();if(a==g){l=c._optId;c=null}}if(c!=null){c=c.nextSibling}}if(this.conf.last_match==null){if(l!=null){this._setSelected(l,true,true);this.conf.last_match=l}else{if(this.conf.f_mode!="between"||j==true){this._setSelected(null,true,true);this.conf.last_match=null}}}else{if(l!=null){if(l!=this.conf.last_match){this._setSelected(l,true,true);this.conf.last_match=l}}else{this._setSelected(null,true,true);this.conf.last_match=null}}};dhtmlXCombo.prototype._selectRange=function(c,a){if(this.conf.combo_focus==true){window.dhx4.selectTextRange(this.base.firstChild,c,a)}};dhtmlXCombo.prototype.openSelect=function(){if(!this._isListVisible()){this._showList()}};dhtmlXCombo.prototype.closeAll=function(){this._hideList()};dhtmlXCombo.prototype._showList=function(a){if(this._getListVisibleCount()==0){if(a&&this._isListVisible()){this._hideList()}return}if(this._isListVisible()){this._checkListHeight();return}this.list.style.zIndex=window.dhx4.zim.reserve(this.conf.list_zi_id);if(this.hdr!=null){this.hdr.style.zIndex=Number(this.list.style.zIndex)+1}this.list.style.visibility="hidden";this.list.style.display="";if(this.hdr!=null){this.hdr.style.visibility=this.list.style.visibility;this.hdr.style.display=this.list.style.display}var c=(this.hdr!=null?this.hdr.offsetHeight:0);this.list.style.width=Math.max(this.conf.opts_width||this.conf.col_w||0,this.conf.combo_width)+"px";this.list.style.top=window.dhx4.absTop(this.base)+c+this.base.offsetHeight-1+"px";this.list.style.left=window.dhx4.absLeft(this.base)+"px";if(this.hdr!=null){this.hdr.style.width=this.list.style.width;this.hdr.style.left=this.list.style.left;this.hdr.style.top=parseInt(this.list.style.top)-c+"px"}this._checkListHeight();this.list.style.visibility="visible";if(this.hdr!=null){this.hdr.style.visibility="visible"}this.callEvent("onOpen",[])};dhtmlXCombo.prototype._hideList=function(){if(!this._isListVisible()){return}window.dhx4.zim.clear(this.conf.list_zi_id);this.list.style.display="none";if(this.hdr!=null){this.hdr.style.display="none"}this.conf.clear_click=false;this.callEvent("onClose",[])};dhtmlXCombo.prototype._isListVisible=function(){return(this.list.style.display=="")};dhtmlXCombo.prototype._getListVisibleCount=function(){var a=0;for(var c=0;c<this.list.childNodes.length;c++){a+=(this.list.childNodes[c].style.display==""?1:0)}return a};dhtmlXCombo.prototype._checkListHeight=function(){if(!this._isListVisible()){return}if(this.conf.item_h==null){var q=this.list.firstChild;while(q!=null){if(q.style.display==""){this.conf.item_h=q.offsetHeight+(this.hdr!=null?-1:0);q=null}else{q=q.nextSibling}}q=null}var r=window.dhx4.screenDim();var m=window.dhx4.absTop(this.base);var c=this.base.offsetHeight;var a=(this.hdr!=null?this.hdr.offsetHeight:0);var g=Math.max(0,Math.floor((m+a-r.top)/this.conf.item_h));var o=Math.max(0,Math.floor((r.bottom-(m+c+a))/this.conf.item_h));var u=this._getListVisibleCount();if(o<Math.min(this.conf.opts_count_min,u)&&g>o){o=null}var n=Math.min((o==null?g:o),this.conf.opts_count,u);var j=(n<u?(n*this.conf.item_h)+"px":"");var l=this.conf.sp[this.conf.skin][this.hdr!=null?"hdr_ofs":"list_ofs"];this.list.style.height=j;this.list.style.top=(o==null?m-this.list.offsetHeight+l:m+c+a-l)+"px";if(this.hdr!=null){this.hdr.style.top=(o==null?m-a-this.list.offsetHeight+l:m+c-l)+"px"}};dhtmlXCombo.prototype._scrollToItem=function(l){var j=this.t[l].item.offsetTop;var g=j+this.t[l].item.offsetHeight;var c=this.list.scrollTop;var a=c+this.list.clientHeight;if(j<c){this.list.scrollTop=j+(this.hdr!=null?1:0)}else{if(g>a){this.list.scrollTop=g-this.list.clientHeight+(this.hdr!=null?-this.conf.sp[this.conf.skin].scr_ofs:0)}}};dhtmlXCombo.prototype._setSelected=function(g,c,a){if(a){this._updateTopImage(g)}if(g!=null&&this.conf.last_hover==g){if(c){this._scrollToItem(g)}return}if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null;if(g==null){this.callEvent("onSelectionChange",[])}}if(g!=null){this.t[g].obj.setSelected(this.t[g].item,true);this.conf.last_hover=g;this.callEvent("onSelectionChange",[]);if(this.conf.s_mode=="select"&&this.t[g].item==this.t[g].item.parentNode.lastChild){this._subloadRequest()}if(c){this._scrollToItem(g)}}};dhtmlXCombo.prototype._subloadRequest=function(){if(this.conf.f_url!=null&&this.conf.f_dyn==true&&this.conf.f_dyn_end==false){var g="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(l){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(l.xmlDoc.responseXML)}var j=a.list.childNodes.length;a.conf.f_loading=true;a.load(l.xmlDoc.responseXML);a.conf.f_loading=false;if(j==a.list.childNodes.length){a.conf.f_dyn_end=true;if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].dyn_end=true}}c=a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.f_url,g,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+g,c)}}}};dhtmlXCombo.prototype.addOption=function(m,n,c,a,j){var g=null;if(!(m instanceof Array)){var o=this._renderOption({value:m,text:n,css:c,img:a});if(g==null&&window.dhx4.s2b(j)==true){g=o}}else{for(var l=0;l<m.length;l++){if(typeof(m[l])=="undefined"){continue}if(m[l] instanceof Array){o=this._renderOption({value:m[l][0],text:m[l][1],css:m[l][2],img:m[l][3]});if(g==null&&window.dhx4.s2b(m[l][4])==true){g=o}}else{var o=this._renderOption(m[l]);if(g==null&&window.dhx4.s2b(m[l].selected)==true){g=o}}}}if(g!=null){this._setSelected(g,this._isListVisible(),true);this._confirmSelect("onInit")}};dhtmlXCombo.prototype.updateOption=function(a,g,c,j){var l=this._getOptionId(a);if(l==null){return}this.t[l].obj.update(this.t[l].item,{value:g,text:c,css:j});if(this.conf.last_selected==l){this.conf.last_text=this.base.firstChild.value=this.t[l].obj.getText(this.t[l].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}};dhtmlXCombo.prototype.deleteOption=function(j){for(var c in this.t){var g=this.t[c].obj.getValue(this.t[c].item);if(g==j){this._removeOption(c)}}if(this._isListVisible()){this._showList(true)}};dhtmlXCombo.prototype.clearAll=function(c){c=(typeof(c)=="undefined"?true:window.dhx4.s2b(c));for(var g in this.t){this._removeOption(g)}if(this.conf.tm_hover){window.clearTimeout(this.conf.tm_hover)}this.conf.last_hover=null;this.conf.last_selected=null;this.list.scrollTop=0;if(c==true){this._hideList()}};dhtmlXCombo.prototype._renderOption=function(j){var l=window.dhx4.newId();var g=document.createElement("DIV");g._optId=l;g._tpl=this.conf.template;if(typeof(j.img)=="undefined"&&typeof(j.img_src)!="undefined"){j.img=j.img_src;delete j.img_src}if(typeof(j.img_dis)=="undefined"&&typeof(j.img_src_dis)!="undefined"){j.img_dis=j.img_src_dis;delete j.img_src_dis}j.img_path=this.conf.img_path;j.img_def=this.conf.img_def;j.img_def_dis=this.conf.img_def_dis;this.list.appendChild(g);var c=(this._isListVisible()&&window.dhx4.isFF==true);if(c==true){var a=this.list.scrollTop;this.list.scrollTop-=1}if(this.hdr!=null){j.multicol=true}this.t[g._optId]={obj:this.modes[this.conf.opts_type].render(g,j),item:g,conf:{type:this.conf.opts_type}};g=null;if(c==true){this.list.scrollTop+=1}return l};dhtmlXCombo.prototype._removeOption=function(a){this.t[a].obj.destruct(this.t[a].item);this.t[a].obj=null;this.t[a].item.parentNode.removeChild(this.t[a].item);this.t[a].item=null;this.t[a].conf=null;this.t[a]=null;delete this.t[a];if(this.conf.last_hover==a){this.conf.last_hover=null}if(this.conf.last_selected==a){this.conf.last_selected=null;this._confirmSelect("onDelete")}};dhtmlXCombo.prototype._confirmSelect=function(c){var a=false;if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}if(this.conf.last_hover!=null){a=a||(this.conf.last_value!=this._getOptionValue(this.conf.last_hover));this.conf.last_match=this.conf.last_selected=this.conf.last_hover;this.conf.last_value=this._getOptionValue(this.conf.last_selected);this.conf.last_text=this.base.firstChild.value=this.t[this.conf.last_selected].obj.getText(this.t[this.conf.last_selected].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="false"}else{if(this.conf.allow_free_text||(this.base.firstChild.value==""&&this.conf.allow_empty_value)){a=a||(this.conf.last_text!=this.base.firstChild.value);this.conf.last_match=this.conf.last_value=this.conf.last_selected=null;this.conf.last_text=this.base.firstChild.value;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_text;this.base.childNodes[2].value="true"}else{this._cancelSelect();this._updateTopImage(this.conf.last_selected);return}}if(this.conf.f_ac&&this.conf.f_mode=="start"){this.conf.f_ac_text="";if(c!="blur"){this._selectRange(this.base.firstChild.value.length,this.base.firstChild.value.length)}}this._hideList();if(a==true&&c!="onInit"&&c!="onDelete"){this.callEvent("onChange",[this.conf.last_value,this.conf.last_text])}};dhtmlXCombo.prototype._cancelSelect=function(){this._hideList();this.base.firstChild.value=this.conf.last_text;if(this.conf.f_mode!=false){this._filterOpts(true)}};dhtmlXCombo.prototype._getOption=function(n,j){if(!this.t[n]){return null}if(typeof(j)=="undefined"){j=-1}if(j<0){for(var m=0;m<this.list.childNodes.length;m++){if(j<0&&this.list.childNodes[m]._optId==n){j=m}}}var l={value:this.t[n].obj.getValue(this.t[n].item),text:this.t[n].obj.getText(this.t[n].item),text_input:this.t[n].obj.getText(this.t[n].item,true),text_option:this.t[n].obj.getText(this.t[n].item,null,true),css:this.t[n].obj.getCss(this.t[n].item),selected:(n==this.conf.last_selected),index:j};if(typeof(this.t[n].obj.getExtraData)=="function"){var g=this.t[n].obj.getExtraData(this.t[n].item);for(var c in g){if(typeof(l[c])=="undefined"){l[c]=g[c]}}}return l};dhtmlXCombo.prototype._getOptionProp=function(j,g,c){if(j!=null){var a=this._getOption(j);if(a!=null){return a[g]}}return c};dhtmlXCombo.prototype._getOptionId=function(c){var j=null;for(var a=0;a<this.list.childNodes.length;a++){if(j==null){var g=this.list.childNodes[a]._optId;if(c==this.t[g].obj.getValue(this.t[g].item)){j=g}}}return j};dhtmlXCombo.prototype._getOptionValue=function(a){return this._getOptionProp(a,"value",null)};dhtmlXCombo.prototype.setSize=function(a){this.conf.combo_width=parseInt(a)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0);this.base.style.width=Math.max(0,this.conf.combo_width)+"px";this._adjustBase()};dhtmlXCombo.prototype._adjustBase=function(){this.base.firstChild.style.width=Math.max(0,(this.conf.combo_width-24-(this.conf.combo_image?23:0)))+"px";this.base.firstChild.style.marginLeft=(this.conf.combo_image?"23px":"0px")};dhtmlXCombo.prototype.setOptionWidth=function(a){this.conf.opts_width=(parseInt(a)||null)};dhtmlXCombo.prototype.setOptionIndex=function(g,a){if(isNaN(a)||a<0){return}var j=this.getOption(g);if(j==null){return}if(a==j.index){return}var c=this.list.childNodes[j.index];c.parentNode.removeChild(c);if(this.list.childNodes[a]!=null){this.list.insertBefore(c,this.list.childNodes[a])}else{this.list.appendChild(c)}c=null};dhtmlXCombo.prototype.getOptionsCount=function(){return this.list.childNodes.length};dhtmlXCombo.prototype._mcMakeTemplate=function(o){var l="";var j="";this.conf.col_w=0;for(var m=0;m<o.length;m++){var a=Number(parseInt(o[m].width)||50);var g=(o[m].css||"");var n=(m==0&&window.dhx4.isIE6==true?"_first":"");j+="<div class='dhxcombo_cell"+n+" "+g+"' style='width:"+a+"px;'><div class='dhxcombo_cell_text'>"+(o[m].option||"&nbsp;")+"</div></div>";l+="<div class='dhxcombo_hdrcell"+n+" "+g+"' style='width:"+a+"px;'><div class='dhxcombo_hdrcell_text'>"+(o[m].header||"&nbsp;")+"</div></div>";this.conf.col_w+=a+1}var a=500;var c=document.createElement("DIV");c.style.position="absolute";c.style.top="10px";c.style.left=-a*2+"px";c.style.width=a+"px";c.style.height="50px";c.style.overflowY="scroll";c.innerHTML="<div>&nbsp;</div>";document.body.appendChild(c);this.conf.col_w+=a-c.firstChild.offsetWidth+10;c.parentNode.removeChild(c);c=null;this.conf.template.option=j;this._mcAttachHeader(l);this.list.className+=" dhxcombolist_multicolumn"};dhtmlXCombo.prototype._mcAttachHeader=function(a){if(this.hdr==null){this.hdr=document.createElement("DIV");this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr";this.hdr.style.display="none";this.list.parentNode.insertBefore(this.hdr,this.list);if(typeof(window.addEventListener)=="function"){this.hdr.addEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.attachEvent("onmousedown",this._doOnListMouseDown)}if(this.conf.opts_type=="checkbox"&&this.conf.combo_image==true){this.conf.combo_image=false;if(this.base.lastChild.className.match(/dhxcombo_top_image/)!=null){this.base.removeChild(this.base.lastChild)}this._adjustBase()}}this.hdr.innerHTML="<div class='dhxcombo_hdrtext'>"+a+"</div>"};dhtmlXCombo.prototype._mcDetachHeader=function(){if(this.hdr!=null){if(typeof(window.addEventListener)=="function"){this.hdr.removeEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.detachEvent("onmousedown",this._doOnListMouseDown)}this.hdr.parentNode.removeChild(this.hdr);this.hdr=null}this.conf.col_w=null;this.conf.item_h=null};dhtmlXCombo.prototype.modes={};dhtmlXCombo.prototype.doWithItem=function(a,n,l,g){var m=(a>=0&&a<this.list.childNodes.length?this.list.childNodes[a]._optId:null);if(m==null){return null}if(typeof(this.t[m].obj[n])!="function"){return null}var j=[this.t[m].item];for(var c=2;c<arguments.length;c++){j.push(arguments[c])}return this.t[m].obj[n].apply(this.t[m].obj,j)};function dhtmlXComboExtend(j,g){for(var c in dhtmlXCombo.prototype.modes[g]){if(typeof(dhtmlXCombo.prototype.modes[j][c])=="undefined"){dhtmlXCombo.prototype.modes[j][c]=dhtmlXCombo.prototype.modes[g][c]}}}dhtmlXCombo.prototype.modes.option={image:false,option_css:"dhxcombo_option_text",render:function(a,c){a._conf={value:c.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.option_css+"'>&nbsp;</div>";if(c.css!=null){a.lastChild.style.cssText=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},destruct:function(a){a._conf=null},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text)},setText:function(c,g){c._conf.text=g;var a=(typeof(g)=="object"?window.dhx4.template(c._tpl.option,c._conf.text,true):window.dhx4.trim(c._conf.text||""));c.lastChild.innerHTML=(a.length==0?"&nbsp;":a)},getText:function(g,a,c){if(window.dhx4.s2b(a)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.input,g._conf.text,true)}if(window.dhx4.s2b(c)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.option,g._conf.text,true)}return g._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,c){a.className="dhxcombo_option"+(c?" dhxcombo_option_selected":"")},isSelected:function(a){return String(a.className).indexOf("dhxcombo_option_selected")>=0},getExtraData:function(a){return{type:"option"}}};dhtmlXCombo.prototype.modes.checkbox={image:true,image_css:"dhxcombo_checkbox dhxcombo_chbx_#state#",option_css:"dhxcombo_option_text dhxcombo_option_text_chbx",render:function(a,c){if(this.image_css_regexp==null){this.image_css_regexp=new RegExp(this.image_css.replace("#state#","\\d*"))}a._conf={value:c.value,css:"",checked:window.dhx4.s2b(c.checked)};a.className="dhxcombo_option";if(c.multicol==true){c.text.checkbox="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div>&nbsp;";a.innerHTML="<div class='"+dhtmlXCombo.prototype.modes.option.option_css+"'></div>"}else{a.innerHTML="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div><div class='"+this.option_css+"'>&nbsp;</div>"}if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},setChecked:function(c,g){c._conf.checked=window.dhx4.s2b(g);var a=String(this.image_css).replace("#state#",(c._conf.checked?"1":"0"));this._changeChbxCss(c.childNodes,a)},_changeChbxCss:function(a,c){for(var g=0;g<a.length;g++){if(a[g].tagName!=null&&a[g].className!=null&&a[g].className.match(this.image_css_regexp)!=null){a[g].className=c}else{if(a[g].childNodes.length>0){this._changeChbxCss(a[g].childNodes,c)}}}},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(j,g,l){var c=true;var a=(g.target||g.srcElement);while(c==true&&a!=null&&a!=j&&a.className!=null){if(a.className.match(this.image_css_regexp)!=null){if(l.callEvent("onCheck",[j._conf.value,!j._conf.checked])===true){this.setChecked(j,!this.isChecked(j))}c=false}else{a=a.parentNode}}a=l=j=null;return c},getTopImage:function(c,a){return""},topImageClick:function(a,c){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,c){this.doWithItem(a,"setChecked",c)};dhtmlXCombo.prototype.getChecked=function(a){var c=[];for(var g=0;g<this.list.childNodes.length;g++){if(this.isChecked(g)){c.push(this._getOptionProp(this.list.childNodes[g]._optId,"value",""))}}return c};dhtmlXCombo.prototype.isChecked=function(a){return this.doWithItem(a,"isChecked")};dhtmlXCombo.prototype.modes.image={image:true,image_css:"dhxcombo_image",option_css:"dhxcombo_option_text dhxcombo_option_text_image",render:function(a,c){a._conf={value:c.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.image_css+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis);return this},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis)},setImage:function(g,a,l,m,j,c){if(a!=null&&a.length>0){a=m+a}else{if(j!=null&&j.length>0){a=m+j}else{a=null}}if(l!=null&&l.length>0){l=m+l}else{if(c!=null&&c.length>0){l=m+c}else{if(c==true){l=a}else{l=null}}}g._conf.img=a;g._conf.img_dis=l;g.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(j,g){var c=(g?"img":"img_dis");if(j!=null&&j._conf[c]!=null){return"<div class='"+this.image_css+"' style='background-image:url("+j._conf[c]+");'></div>"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,c){if(a!=null){this.conf.img_def=a}if(c!=null){this.conf.img_def_dis=c}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXColorPicker(o){if(!(this instanceof dhtmlXColorPicker)){return new dhtmlXColorPicker(o)}dhx4._eventable(this);var m=this,j=undefined,n=null,g,a,c;this._nodes=[];this.activeNode=null;this._inputListenerId=null;this.base=null;this._globalNode=null;this.memory=null;this.skin=null;this.conf={cp_id:dhx4.newId(),x:0,y:0,c:0,indent:2,position:"right",customColors:false,selectedColor:null,hide:false,hideOnSelect:false,lang:"en",closeable:true};this.value={red:-1,blue:-1,green:-1,hue:-1,sat:-1,lum:-1};this._initMoveSelection=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){m._controllerNodes.colorArea.addEventListener("mousemove",m._setMoveSelection,false);document.body.addEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.attachEvent("onmousemove",m._setMoveSelection);document.body.attachEvent("onmouseup",m._cleanMoveSelection)}m._setMoveSelection(l,m._controllerNodes.colorArea);return false};this._cleanMoveSelection=function(){if(typeof(window.removeEventListener)=="function"){m._controllerNodes.colorArea.removeEventListener("mousemove",m._setMoveSelection,false);document.body.removeEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.detachEvent("onmousemove",m._setMoveSelection);document.body.detachEvent("onmouseup",m._cleanMoveSelection)}return false};this._setMoveSelection=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.colorArea);if(m._controllerNodes.fr_cover){setTimeout(function(){m._setColorAreaXY(q.x,q.y);m._setColorByXYC()},0)}else{m._setColorAreaXY(q.x,q.y);m._setColorByXYC()}return false};this._initMoveContrast=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",m._setMoveContrast,false);document.body.addEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.attachEvent("onmousemove",m._setMoveContrast);document.body.attachEvent("onmouseup",m._cleanMoveContrast)}m._setMoveContrast(l,m._controllerNodes.contrastArea)};this._cleanMoveContrast=function(){if(typeof(window.removeEventListener)=="function"){document.body.removeEventListener("mousemove",m._setMoveContrast,false);document.body.removeEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.detachEvent("onmousemove",m._setMoveContrast);document.body.detachEvent("onmouseup",m._cleanMoveContrast)}};this._setMoveContrast=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.contrastArea);m._setContrastY(q.y);m._setColorByXYC(true)};this._doOnSelectColor=function(){var l=m.colorAIP.rgb2hex({r:m.value.red,g:m.value.green,b:m.value.blue});if(m.activeNode!=null){if(m.activeNode.valueCont){m.activeNode.valueCont.value=l}if(m.activeNode.valueColor){m.activeNode.valueColor.style.backgroundColor=l}}if(m.base._dhx_remove||m.conf.hideOnSelect){m.hide()}m.callEvent("onSelect",[l,((m.activeNode)?m.activeNode.node:null)])};this._doOnCancel=function(){if(m.callEvent("onCancel",[((m.activeNode)?m.activeNode.node:null)])==true&&m.conf.closeable==true){m.hide()}};this._doOnFocusByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);m.activeNode=l;if(l&&l==m.activeNode){m._initListenerInput()}};this._doOnBlurByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);if(l&&l==m.activeNode){m._removeListenerInput()}};this._doOnClickByNode=function(q){q=q||event;var l=(this!=window)?this:event.srcElement;m.activeNode=(m.activeNode.node!=l)?m._getNodeByElement(l):m.activeNode;if(!m.isVisible()){m.show()}};this.saveColor=function(){m.memory.setValue(m.value)};this._onSelectMemoryEl=function(q){var l;m._refreshCoordinatesByHSL(q.value.hue,q.value.sat,q.value.lum);for(l in q.value){m.value[l]=q.value[l]}m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnClickByBody=function(r){r=r||event;var l=true,q=r.target||r.srcElement;if(m._isBaseNode(q)){l=false}if(l&&m.activeNode&&(m.activeNode.node==q||m.activeNode.valueCont==q)){l=false}if(l){m.hide()}};this._doOnChangeHSL=function(){var r=parseInt(m._controllerNodes.hue.value),q=parseInt(m._controllerNodes.sat.value),l=parseInt(m._controllerNodes.lum.value),s;if(isNaN(r)||r>359||r<0){m._controllerNodes.hue.value=m.value.hue}else{m.value.hue=r}if(isNaN(q)||q>100||q<0){m._controllerNodes.sat.value=m.value.sat}else{m.value.sat=q}if(isNaN(l)||l>100||l<0){m._controllerNodes.lum.value=m.value.lum}else{m.value.lum=l}s=m.colorAIP.hsl2rgb(m.value.hue,m.value.sat/100,m.value.lum/100);m.value.red=Math.round(255*s.r);m.value.green=Math.round(255*s.g);m.value.blue=Math.round(255*s.b);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeRGB=function(){var s=parseInt(m._controllerNodes.red.value),r=parseInt(m._controllerNodes.green.value),l=parseInt(m._controllerNodes.blue.value),q;if(isNaN(s)||s>255||s<0){m._controllerNodes.red.value=m.value.red}else{m.value.red=s}if(isNaN(r)||r>255||r<0){m._controllerNodes.green.value=m.value.green}else{m.value.green=r}if(isNaN(l)||l>255||l<0){m._controllerNodes.blue.value=m.value.blue}else{m.value.blue=l}q=m.colorAIP.rgb2hsl(m.value.red/255,m.value.green/255,m.value.blue/255);m.value.hue=Math.round(q.h);m.value.sat=Math.round(q.s*100);m.value.lum=Math.round(q.l*100);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeHSV=function(){m._controllerNodes.hsv.value=m.setColor(m._controllerNodes.hsv.value)};this._checkType=function(q){var l;if(q instanceof Array){l=m._checkType(q[0]);switch(l){case"string":return"array_string";break;case"input":case"textarea":return"array_input";break;case"object":return"array_object";break;default:return undefined}}else{if(q==undefined){return null}else{if(typeof(q)=="string"){return"string"}else{if(q.tagName&&q.tagName.toLowerCase()=="input"){return"input"}else{if(q.tagName&&q.tagName.toLowerCase()=="textarea"){return"textarea"}else{if(q.tagName){return"container"}else{if(typeof(q)=="object"){return"object"}else{return undefined}}}}}}}};this._initByObject=function(l){if(l.parent&&l.parent.tagName){m.base=l.parent}else{if(typeof(l.parent)=="string"){m.base=document.getElementById(l.parent)}else{m.base=document.createElement("div");m.base._dhx_remove=true}}if(l.color){m.conf.selectedColor=l.color}if(typeof(l.closeable)!="undefined"){this.conf.closeable=dhx4.s2b(l.closeable)}if(l.custom_colors){this._tempInitCC=function(){var s,r;this.initMemoryColors();this.conf.customColors=true;if(l.custom_colors instanceof Array){r=l.custom_colors.length;for(s=0;s<r;s++){this.setCustomColors(l.custom_colors[s])}}if(this.base.parentNode){this.showMemory()}delete this._tempInitCC}}if(l.hide){m.conf.hide=true}if(l.input){m._addNode(l.input,l.target_color,l.target_value)}var q=l.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcolorpicker")||"dhx_skyblue";m.setSkin(q);if(l.colors){m.initMemoryColors();m.conf.customColors=true}if(l.link){m._addNode(l.link)}};this.unload=function(){var s,q,r;if(this.isVisible()){this.hide()}this.destructMemory();q=this._nodes.length;for(s=0;s<q;s++){this._detachEventsFromNode(this._nodes[s]);for(r in this._nodes[s]){this._nodes[s][r]=null}delete this._nodes[s]}this._nodes=null;if(!this.base._dhx_remove){this.base.className=this.base.className.replace(/\s?dhtmlxcp_\S*/,"")}else{delete this.base._dhx_remove}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.removeEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.removeEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.removeEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.removeEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.removeEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.removeEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.detachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.detachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.detachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.detachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.detachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.detachEvent("onchange",this._doOnChangeHSV)}if(this._controllerNodes.fr_cover){if(this._controllerNodes.fr_cover.parentNode){this._controllerNodes.fr_cover.parentNode.removeChild(this._controllerNodes.fr_cover)}delete this._controllerNodes.fr_cover}dhx4.zim.clear(this.conf.cp_id);dhx4._eventable(this,"clear");for(r in this){this[r]=null}m=null,n=null,c=null};j=this._checkType(o);switch(j){case"object":m._initByObject(o);break;case"input":case"textarea":m._initByObject({});this._addNode(o);break;case"string":n=document.getElementById(o);return new dhtmlXColorPicker(n);break;case"container":m._initByObject({parent:o});break;case null:m._initByObject({});break;case"array_string":case"array_input":m._initByObject({});a=o.length;for(g=0;g<a;g++){this._addNode(o[g])}break;case"array_object":m._initByObject({});a=o.length;for(g=0;g<a;g++){c=this._addNode(o[g].input,o[g].target_color,o[g].target_value).conf;c.customColors=(o[g].custom_colors!=undefined)?dhx4.s2b(o[g].custom_colors):c.customColors;c.selectedColor=(o[g].color!=undefined)?o[g].color:c.selectedColor}break}this.base.innerHTML="<div class='dhxcp_g_area'><div class='dhxcp_sub_area'><div class='dhxcp_g_color_area'><div class='dhxcp_color_selector'><div class='dhxcp_v_line'></div><div class='dhxcp_h_line'></div></div><div class='dhxcp_contrast_area'><div class='dhxcp_h_line'></div></div></div><div class='dhxcp_g_input_area'><div class='dhxcp_value_cont'><div class='dhxcp_value_color'></div><input type='text' class='dhxcp_value'/></div><table class='dhxcp_inputs_cont' cellpadding='0' cellspacing='0' border='0'><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelHue+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelRed+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelSat+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelGreen+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelLum+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelBlue+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr></table></div><div class='dhxcp_g_memory_area'></div><div class='dhxcp_buttons_area'><button class='dhx_button_save'>"+this.i18n[this.conf.lang].btnSelect+"</button><button class='dhx_button_cancel'>"+this.i18n[this.conf.lang].btnCancel+"</button></div></div>";"</div>";this._globalNode=this.base.firstChild;this._controllerNodes={colorArea:this._globalNode.firstChild.firstChild.firstChild,v_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[0],h_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[1],contrastArea:this._globalNode.firstChild.firstChild.childNodes[1],contrast_line:this._globalNode.firstChild.firstChild.childNodes[1].firstChild,color:this._globalNode.firstChild.childNodes[1].childNodes[0].firstChild,hsv:this._globalNode.firstChild.childNodes[1].childNodes[0].childNodes[1],hue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[1].firstChild,sat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[1].firstChild,lum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[1].firstChild,red:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[3].firstChild,green:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[3].firstChild,blue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[3].firstChild,memory_block:this._globalNode.firstChild.childNodes[2],button_save:this._globalNode.firstChild.childNodes[3].firstChild,button_cancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};this._labelNodes={labelHue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].firstChild,labelSat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].firstChild,labelLum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].firstChild,labelRed:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[2],labelGreen:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[2],labelBlue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[2],btnAddColor:null,btnSelect:this._globalNode.firstChild.childNodes[3].firstChild,btnCancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};if(typeof(this._tempInitCC)=="function"){this._tempInitCC()}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.addEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.addEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.addEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.addEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.addEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.addEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.attachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.attachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.attachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.attachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.attachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.attachEvent("onchange",this._doOnChangeHSV)}this.setColor(this.conf.selectedColor||"#ffffff");if(this._nodes.length){for(var g=0;g<this._nodes.length;g++){this._attachEventsToNode(this._nodes[g])}}if(this.conf.hide){this.hide()}if(typeof(this._cpInitFRM)=="function"){this._cpInitFRM()}}dhtmlXColorPicker.prototype.linkTo=function(c,g,j){if(arguments.length==1){g=j=c}var a;c=c||null;j=j||null;if(typeof(g)=="string"){g=document.getElementById(g)}a=this._addNode(g,c,j);if(a){this._attachEventsToNode(a)}return a};dhtmlXColorPicker.prototype._isBaseNode=function(a){if(a==this.base){return true}if(a.parentElement==document.body){return false}else{if(!a.parentElement){return false}else{return this._isBaseNode(a.parentElement)}}};dhtmlXColorPicker.prototype._hasInput=function(g){var c,a,j=false;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].valueCont==g){j=true;break}}return j};dhtmlXColorPicker.prototype._findNodesByArray=function(m){var g,a,c,j=[];a=m.length;for(g=0;g<a;g++){if(typeof(m[g])=="string"){c=document.getElementById(m[g])}else{c=m[g]}if(c){this._addNode(c)}}};dhtmlXColorPicker.prototype._addNode=function(l,n,m){var c,j,g,a;if(typeof(l)=="string"){c=document.getElementById(l)}else{c=l}if(typeof(n)=="string"){n=document.getElementById(n)}if(typeof(m)=="string"){m=document.getElementById(m)}if(!c){return null}if(dhx4.s2b(c.getAttribute("colorbox"))){j=document.createElement("div");j.style.width=c.offsetWidth+"px";j.style.height=c.offsetHeight+"px";c.style.width=c.offsetWidth-(c.offsetHeight+8)+"px";c.parentNode.insertBefore(j,c);j.style.position="relative";g=document.createElement("div");j.appendChild(c);j.appendChild(g);g.className="dhxcp_colorBox";c.className+=" dhxcp_colorInput";g.style.width=g.style.height=c.offsetHeight+"px"}a={node:c,valueColor:(n!=undefined)?n:g||c,valueCont:(m!=undefined)?m:c,conf:{customColors:(c.getAttribute("customcolors")!=null)?dhx4.s2b(c.getAttribute("customcolors")):null,selectedColor:c.getAttribute("selectedcolor")}};this._nodes.push(a);if(!this.activeNode){this.activeNode=a}return a};dhtmlXColorPicker.prototype.getNode=function(g){var a=null,c=null;if(typeof(g)=="string"){a=document.getElementById(g)}else{a=g}if(a.tagName!=undefined){c=this._getNodeByElement(a)}return c};dhtmlXColorPicker.prototype._getNodeByElement=function(g){var j=null,c,a;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].node==g){j=this._nodes[c]}}return j};dhtmlXColorPicker.prototype._getNodeByValueCont=function(g){var j=null,c,a;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].valueCont&&this._nodes[c].valueCont==g){j=this._nodes[c]}}return j};dhtmlXColorPicker.prototype.initMemoryColors=function(){var c=this;this._controllerNodes.memory_block.innerHTML="<div class='dhxcp_memory_button_cont'><button class='dhxcp_save_to_memory'><div class='dhxcp_label_bm'>"+this.i18n[this.conf.lang].btnAddColor+"</div></button></div><div class='dhxcp_memory_els_cont'><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a></div>";this.memory=new this.Memory(this._controllerNodes.memory_block.childNodes[1]);this.memory.onSelect=this._onSelectMemoryEl;this.memory.onSave=function(j){var g=c.colorAIP.rgb2hex({r:j.red,g:j.green,b:j.blue});c.callEvent("onSaveColor",[g])};var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=this._controllerNodes.memory_block.childNodes[0].firstChild.firstChild;if(typeof(window.addEventListener)=="function"){a.addEventListener("click",this.saveColor,false)}else{a.attachEvent("onclick",this.saveColor)}};dhtmlXColorPicker.prototype._refreshCoordinatesByHSL=function(n,m,c){var a,j,g;a=Math.round((this.configColorArea.maxX-this.configColorArea.minX)*n/359)+this.configColorArea.minX;j=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-c)/100)+this.configColorArea.minY;g=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-m)/100)+this.configColorArea.minY;this._setColorAreaXY(a,j);this._setContrastY(g)};dhtmlXColorPicker.prototype._parseColor=function(g){if(g instanceof Array){var c={r:parseInt(g[0]),g:parseInt(g[1]),b:parseInt(g[2])}}else{if(typeof(g)=="string"){g=g.replace(/\s/g,"");if(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i.test(g)){var a=g.match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);var c={r:parseInt(a[1]),g:parseInt(a[2]),b:parseInt(a[3])}}else{var c=this.colorAIP.hex2rgb(g)}}}return c};dhtmlXColorPicker.prototype.setColor=function(m){var c=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});var g=this._parseColor(m);var l=(g instanceof Object);l=l&&(0<=g.r&&g.r<=255);l=l&&(0<=g.g&&g.g<=255);l=l&&(0<=g.b&&g.b<=255);if(!l){return c}var j=this.colorAIP.rgb2hex({r:g.r,g:g.g,b:g.b});if(j==c){return c}this.value.red=g.r;this.value.green=g.g;this.value.blue=g.b;var a=this.colorAIP.rgb2hsl(g.r/255,g.g/255,g.b/255);this.value.hue=Math.round(a.h);this.value.sat=Math.round(a.s*100);this.value.lum=Math.round(a.l*100);this._refreshCoordinatesByHSL(this.value.hue,this.value.sat,this.value.lum);this._refreshContrast();this._refreshInputValues();this._refreshColorValue();return j};dhtmlXColorPicker.prototype.getSelectedColor=function(){return[this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue}),[this.value.red,this.value.green,this.value.blue],[this.value.hue,this.value.sat,this.value.lum]]};dhtmlXColorPicker.prototype._attachEventsToNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.addEventListener("click",this._doOnClickByNode,false)}else{a.node.attachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.addEventListener("focus",this._doOnFocusByInput,false);a.valueCont.addEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.attachEvent("onfocus",this._doOnFocusByInput);a.valueCont.attachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype._detachEventsFromNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.removeEventListener("click",this._doOnClickByNode,false)}else{a.node.detachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.removeEventListener("focus",this._doOnFocusByInput,false);a.valueCont.removeEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.detachEvent("onfocus",this._doOnFocusByInput);a.valueCont.detachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype.show=function(c){var a=false;if(c!=undefined){this.activeNode=this.getNode(c)||this.activeNode}if(this.activeNode&&this.activeNode.valueCont&&this.activeNode.valueCont.value){this.setColor(this.activeNode.valueCont.value)}if(this.activeNode){a=(this.activeNode.conf.customColors!=null?this.activeNode.conf.customColors:this.conf.customColors);this.setColor(this.activeNode.conf.selectedColor)}else{a=this.conf.customColors}if(a){this.showMemory()}else{this.hideMemory()}if(this.base._dhx_remove){this.base.firstChild.style.zIndex=dhx4.zim.reserve(this.conf.cp_id);this.base.style.visibility="hidden";if(document.body.firstChild){document.body.insertBefore(this.base,document.body.firstChild)}else{document.body.appendChild(this.base)}this._refreshPosition();this.base.style.visibility="visible";if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.attachEvent("onmousedown",this._doOnClickByBody)}}else{this.base.appendChild(this._globalNode)}if(this._controllerNodes.fr_cover){this.base.insertBefore(this._controllerNodes.fr_cover,this._globalNode)}this.callEvent("onShow",[((this.activeNode)?this.activeNode.node:null)])};dhtmlXColorPicker.prototype.setPosition=function(c,l){var j=null;var a=parseInt(c);var g=parseInt(l);if(isNaN(a)){j=({right:"right",bottom:"bottom"}[c.toLowerCase()]?c:null)}if(this.base._dhx_remove){if(j==null){}else{this.conf.position=j;this._refreshPosition(j)}}else{if(isNaN(a)||isNaN(g)){}else{this._globalNode.style.left=a+"px";this._globalNode.style.top=g+"px";if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}}}};dhtmlXColorPicker.prototype._initListenerInput=function(){var a=this;this._inputListenerId=this._inputListenerId||setInterval(function(){a._refreshValueByInput()},70)};dhtmlXColorPicker.prototype._removeListenerInput=function(){if(this._inputListenerId){clearInterval(this._inputListenerId);this._inputListenerId=null}};dhtmlXColorPicker.prototype._refreshValueByInput=function(){var c=this.activeNode.valueCont.value,a=this.getSelectedColor()[0];if(this._inputListenerId){if(/^#[\da-f]{6}$/i.test(c)&&c!=a){this.setColor(c);this.callEvent("onSelect",[c,this.activeNode.node])}}};dhtmlXColorPicker.prototype._refreshPosition=function(c){if(this.activeNode==null){return}var o=dhx4.absTop(this.activeNode.node);var a=dhx4.absLeft(this.activeNode.node);var j=dhx4.screenDim();var g=this._globalNode.offsetWidth;var l=this._globalNode.offsetHeight;var n=0;c=c||this.conf.position;switch(c){case"bottom":var n=o+this.activeNode.node.offsetHeight+this.conf.indent;var m=a;if(m+g>j.left+j.right){m=a+this.activeNode.node.offsetWidth-g}if(m<j.left){m=a}if(n+l>j.top+j.bottom){n=o-l-this.conf.indent}if(n-j.top<0){n=j.top+this.conf.indent}this._globalNode.style.top=n+"px";this._globalNode.style.left=m+"px";break;default:var m=a+this.activeNode.node.offsetWidth+this.conf.indent;n=o;if(c=="right"){if(m+g>j.left+j.right){m=a-g-this.conf.indent}if(m<j.left){m=a+this.activeNode.node.offsetWidth+this.conf.indent}}if(j.bottom-(n+l)<=0){n=o+this.activeNode.node.offsetHeight-l}if(n-j.top<0){n=j.top+this.conf.indent}this._globalNode.style.left=m+"px";this._globalNode.style.top=n+"px"}if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}};dhtmlXColorPicker.prototype.isVisible=function(){var a=false;if(this.base._dhx_remove){a=this.base.parentNode==document.body}else{a=this._globalNode.parentNode==this.base}return a};dhtmlXColorPicker.prototype.hide=function(){if(this.base._dhx_remove){if(this.base.parentNode){this.base.parentNode.removeChild(this.base);dhx4.zim.clear(this.conf.cp_id);if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.detachEvent("onmousedown",this._doOnClickByBody)}}}else{if(this.isVisible()==false){return}this.base.removeChild(this._globalNode)}if(this._controllerNodes.fr_cover&&this._controllerNodes.fr_cover.parentNode){this._controllerNodes.fr_cover.parentNode.removeChild(this._controllerNodes.fr_cover)}if(this.callEvent!=undefined){this.callEvent("onHide",[((this.activeNode)?this.activeNode.node:null)])}};dhtmlXColorPicker.prototype.configColorArea={minX:1,maxX:209,minY:1,maxY:119};dhtmlXColorPicker.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXColorPicker.prototype.i18n={en:{labelHue:"Hue",labelSat:"Sat",labelLum:"Lum",labelRed:"Red",labelGreen:"Green",labelBlue:"Blue",btnAddColor:"Save the color",btnSelect:"Select",btnCancel:"Cancel"}};dhtmlXColorPicker.prototype.loadUserLanguage=function(a){if(typeof(this._mergeLangModules)=="function"){this._mergeLangModules()}this.conf.lang=a;this._refreshLanguage()};dhtmlXColorPicker.prototype._refreshLanguage=function(){var a,c=this.i18n[this.conf.lang];for(a in c){if(this._labelNodes[a]){this._labelNodes[a].innerHTML=c[a]}}};dhtmlXColorPicker.prototype._setColorAreaXY=function(a,g){var c=this.configColorArea;a=parseInt(a);if(c.minX>a){this.conf.x=c.minX}else{if(a>c.maxX){this.conf.x=c.maxX}else{if(!isNaN(a)){this.conf.x=a}}}g=parseInt(g);if(c.minY>g){this.conf.y=c.minY}else{if(g>c.maxY){this.conf.y=c.maxY}else{if(!isNaN(g)){this.conf.y=g}}}this._refreshLines()};dhtmlXColorPicker.prototype._setColorByXYC=function(c){c=c||false;this.value.hue=Math.round((359*(this.conf.x-this.configColorArea.minX))/(this.configColorArea.maxX-this.configColorArea.minX));this.value.lum=Math.round(100-(100*(this.conf.y-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));this.value.sat=Math.round(100-(100*(this.conf.c-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));var a=this.colorAIP.hsl2rgb(this.value.hue,this.value.sat/100,this.value.lum/100);this.value.red=Math.round(255*a.r);this.value.green=Math.round(255*a.g);this.value.blue=Math.round(255*a.b);if(!c){this._refreshContrast()}this._refreshInputValues();this._refreshColorValue()};dhtmlXColorPicker.prototype._setContrastY=function(c){var a=this.configColorArea;c=parseInt(c);if(!isNaN(c)){this.conf.c=Math.min(Math.max(a.minY,c),a.maxY)}this._refreshContrastLine()};dhtmlXColorPicker.prototype._refreshInputValues=function(){this._controllerNodes.hue.value=this.value.hue;this._controllerNodes.sat.value=this.value.sat;this._controllerNodes.lum.value=this.value.lum;this._controllerNodes.red.value=this.value.red;this._controllerNodes.green.value=this.value.green;this._controllerNodes.blue.value=this.value.blue};dhtmlXColorPicker.prototype._refreshColorValue=function(){this._controllerNodes.color.style.backgroundColor="rgb("+[this.value.red,this.value.green,this.value.blue].join(", ")+")";var a=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});this._controllerNodes.hsv.value=a;this.callEvent("onChange",[a])};dhtmlXColorPicker.prototype._refreshContrast=function(){var j=this.colorAIP.hsl2rgb(this.value.hue,0,this.value.lum/100);var l=this.colorAIP.hsl2rgb(this.value.hue,1,this.value.lum/100);var g=this._checkIeVersion();if(g&&g<=9){var m=this._controllerNodes.contrastArea.firstChild;if(m==this._controllerNodes.contrast_line){m=document.createElement("div");m.className+="dhxcp_ie_gradient";this._controllerNodes.contrastArea.appendChild(m);this._controllerNodes.contrastArea.appendChild(this._controllerNodes.contrast_line)}var c=this.colorAIP.rgb2hex({r:Math.round(255*j.r),g:Math.round(255*j.g),b:Math.round(255*j.b)});var a=this.colorAIP.rgb2hex({r:Math.round(255*l.r),g:Math.round(255*l.g),b:Math.round(255*l.b)});m.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', endColorstr='"+c+"', GradientType=0)"}else{j=[Math.round(255*j.r),Math.round(255*j.g),Math.round(255*j.b)];l=[Math.round(255*l.r),Math.round(255*l.g),Math.round(255*l.b)];this._controllerNodes.contrastArea.style.backgroundImage="linear-gradient(to top, rgb("+j.join(",")+"), rgb("+l.join(",")+"))"}};dhtmlXColorPicker.prototype._refreshLines=function(){this._controllerNodes.v_line.style.left=this.conf.x+"px";this._controllerNodes.h_line.style.top=this.conf.y+"px"};dhtmlXColorPicker.prototype._refreshContrastLine=function(){this._controllerNodes.contrast_line.style.top=this.conf.c+"px"};dhtmlXColorPicker.prototype._getOffsetPosition=function(j,a){var c={x:NaN,y:NaN},g=j.target||j.srcElement;if(g==a){c.x=(j.offsetX!=undefined)?j.offsetX:j.layerX;c.y=(j.offsetY!=undefined)?j.offsetY:j.layerY}else{if(g==this._controllerNodes.v_line){c.y=(j.offsetY!=undefined)?j.offsetY:j.layerY}else{c.x=(j.offsetX!=undefined)?j.offsetX:j.layerX}}return c};dhtmlXColorPicker.prototype.colorAIP={hex2rgb:function(c){var a=c.match(/^(#)([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(a!=null){return{r:parseInt("0x"+a[2]),g:parseInt("0x"+a[3]),b:parseInt("0x"+a[4])}}else{return null}},rgb2hex:function(l){var j=parseInt(l.r),c=parseInt(l.g),a=parseInt(l.b);j=j||0,c=c||0,a=a||0;return"#"+((j)?((j<16)?"0"+j.toString(16):j.toString(16)):"00")+((c)?((c<16)?"0"+c.toString(16):c.toString(16)):"00")+((a)?((a<16)?"0"+a.toString(16):a.toString(16)):"00")},rgb2hsl:function(q,o,j){var n,m,c;var a=Math.max(q,o,j),l=Math.min(q,o,j);c=0.5*(a+l);if(a==l){n=0}else{if(a==q){n=60*(o-j)/(a-l);if(o<j){n+=360}}else{if(a==o){n=60*(j-q)/(a-l)+120}else{n=60*(q-o)/(a-l)+240}}}if(c==0||a==l){m=0}else{if(c<=0.5){m=0.5*(a-l)/c}else{m=0.5*(a-l)/(1-c)}}return{h:n,s:m,l:c}},hsl2rgb:function(q,g,n){var l,m,o;var c=[],a=[];if(n<=0.5){l=n*(1+g)}else{l=n+g-(n*g)}m=2*n-l;o=q/360;c.push(o+1/3);c.push(o);c.push(o-1/3);for(var j=0;j<3;j++){if(c[j]<0){c[j]+=1}else{if(c[j]>1){c[j]-=1}}if(c[j]<1/6){a.push(m+(l-m)*6*c[j])}else{if(c[j]<0.5){a.push(l)}else{if(c[j]<2/3){a.push(m+(l-m)*(2/3-c[j])*6)}else{a.push(m)}}}}return{r:a[0],g:a[1],b:a[2]}}};dhtmlXColorPicker.prototype._checkIeVersion=function(){var a;var c=navigator.userAgent.match(/(MSIE)\s(\d\.\d)/i);a=(c&&c[2])?parseInt(c[2]):null;return a};dhtmlXColorPicker.prototype.setCustomColors=function(){if(this.memory==null){this.initMemoryColors();this.conf.customColors=true}var j,g,n,c,m,a;g=arguments.length;for(j=0;j<g;j++){if(arguments[j] instanceof Array){n=this._rgb2value(arguments[j][0],arguments[j][1],arguments[j][2]);this.memory.setValue(n,null,false);continue}else{if(typeof(arguments[j])=="string"){c=arguments[j].match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);if(c instanceof Array){n=this._rgb2value(c[1],c[2],c[3]);this.memory.setValue(n,null,false);continue}c=arguments[j].match(/(#[\da-f]{6})/ig);if(c instanceof Array){a=c.length;for(m=0;m<a;m++){n=this._hex2value(c[m]);this.memory.setValue(n,null,false)}}}}}};dhtmlXColorPicker.prototype.getCustomColors=function(){var c=[];if(this.memory!=null&&this.conf.customColors==true){for(var g=0;g<this.memory.controllers.length;g++){var a=this.memory.controllers[g].value;c.push(this.colorAIP.rgb2hex({r:a.red,g:a.green,b:a.blue}))}}return c};dhtmlXColorPicker.prototype._rgb2value=function(l,j,a){var c=this.colorAIP.rgb2hsl(l/255,j/255,a/255);return{red:l,green:j,blue:a,hue:Math.round(c.h),sat:Math.round(c.s*100),lum:Math.round(c.l*100)}};dhtmlXColorPicker.prototype._hex2value=function(g){var c,a;c=this.colorAIP.hex2rgb(g);a=this.colorAIP.rgb2hsl(c.r/255,c.g/255,c.b/255);return{red:c.r,green:c.g,blue:c.b,hue:Math.round(a.h),sat:Math.round(a.s*100),lum:Math.round(a.l*100)}};dhtmlXColorPicker.prototype.showMemory=function(){if(this.memory==null){this.initMemoryColors()}if(!this._globalNode.className.match(/dhxcp_add_memory/)){this._globalNode.className+=" dhxcp_add_memory"}this.conf.customColors=true};dhtmlXColorPicker.prototype.hideMemory=function(){if(this.memory!=null){this._globalNode.className=this._globalNode.className.replace(/\sdhxcp_add_memory/,"")}this.conf.customColors=false};dhtmlXColorPicker.prototype.setSkin=function(l){l=l.toLowerCase();var g,c=-1,a,j="dhtmlxcp";g=this.base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,j+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=j+"_"+l;this.base.className=g.join(" ");this.skin=l};dhtmlXColorPicker.prototype.hideOnSelect=function(a){a=dhx4.s2b(a);this.conf.hideOnSelect=a};dhtmlXColorPicker.prototype._indexOf=function(a,j){var g,c,m=-1;c=a.length;for(g=c;g>=0;g--){if(a[g]==j){m=g;break}}return m};dhtmlXColorPicker.prototype.destructMemory=function(){if(this.memory==null){return}this.hideMemory();var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=null;if(typeof(window.addEventListener)=="function"){a.removeEventListener("click",this.saveColor,false)}else{a.detachEvent("onclick",this.saveColor)}this.memory.remove();this._controllerNodes.memory_block.innerHTML="";this.memory=null};dhtmlXColorPicker.prototype.Memory=function(g){var c=this,a=null,j={red:255,blue:255,green:255,hue:0,sat:0,lum:100};this.select=function(){var m=(this!=window)?this:event.srcElement;var l=l||m.dhxpc_memory;if(a!=null){c.unSelect()}a=l;l.domElement.className+=" dhxcp_memory_el_select";if(typeof(c.onSelect)=="function"){c.onSelect(l)}};this.onSelect=null;this.onSave=null;this._createMemoryController=function(l){var m={domElement:l,value:dhx4._copyObj(j)};l.dhxpc_memory=m;if(typeof(window.addEventListener)=="function"){l.addEventListener("click",c.select,false)}else{l.attachEvent("onclick",c.select)}return m};this._findMemoryControllers=function(r){var o=r.getElementsByTagName("a"),n,m,q=[];m=o.length;for(n=0;n<m;n++){q.push(this._createMemoryController(o[n]))}return q};this.controllers=this._findMemoryControllers(g);this.unSelect=function(){if(a){a.domElement.className=a.domElement.className.replace(/\s.*$/i,"")}a=null};this.setActiveNext=function(){var n=null,m;if(a==null){a=this.controllers[0]}else{n=this.getIndex(a);m=this.controllers.length;this.unSelect();a=(n+1<m)?this.controllers[n+1]:this.controllers[0]}a.domElement.className+=" dhxcp_memory_el_next";return a};this.setValue=function(m,l,n){a=l||a;if(a==null){a=this.controllers[0]}a.value.red=m.red;a.value.blue=m.blue;a.value.green=m.green;a.value.hue=m.hue;a.value.sat=m.sat;a.value.lum=m.lum;a.domElement.style.backgroundColor="rgb("+[m.red,m.green,m.blue].join(", ")+")";this.setActiveNext();if((n!=false)&&(typeof(this.onSave)=="function")){this.onSave(m)}};this.clean=function(){var m=this.controllers.length,o;for(var n=0;n<m;n++){o=this.controllers[n];o.value=dhx4._copyObj(j);o.domElement.style.backgroundColor="rgb("+[j.red,j.green,j.blue].join(", ")+")"}this.unSelect();a=this.controllers[0]};this.getIndex=function(o){var n,m,q=-1;m=this.controllers.length;for(n=0;n<m;n++){if(this.controllers[n]==o){q=n;break}}return q};this.remove=function(){var n,m;m=this.controllers.length;for(n=0;n<m;n++){if(typeof(window.addEventListener)=="function"){this.controllers[n].domElement.removeEventListener("click",this.select,false)}else{this.controllers[n].domElement.detachEvent("onclick",this.select)}delete this.controllers[n].domElement.dhxpc_memory}delete this.onSelect;delete this.controllers;delete this.onSave}};if(window.dhx4.isIE6){dhtmlXColorPicker.prototype._cpInitFRM=function(){var a;if(!this._controllerNodes.fr_cover){a=document.createElement("IFRAME");a.className="dhxcp_frm";a.border=0;a.frameBorder=0;this._controllerNodes.fr_cover=a}if(!this.base._dhx_remove){this.base.insertBefore(a,this._globalNode)}}}function dhtmlXSlider(c){var a=this;this.conf={size:null,skin:null,vertical:false,min:0,max:99,value:0,step:1,decimals:0,margin:2,border:1,inverse:false,disabled:false,tooltip:false,visible:true,linkTo:undefined};this._attachedNode={};this._movingInitialValues=null;this.base=null;if(arguments.length>1){return new dhtmlXSlider(this._renderArgumets(arguments))}else{if(typeof(c)=="string"||(typeof(c)=="object"&&c.tagName)){return new dhtmlXSlider({parent:c})}}if(typeof(c.parent)=="string"){this.base=document.getElementById(c.parent)}else{this.base=c.parent}this._mergeConfig(this._readAttFormNode(this.base));this._mergeConfig(c);this._detectDecimals();if(this.conf.size==null||this.conf.size==undefined){if(this.conf.vertical){this.conf.size=this.base.offsetHeight}else{this.conf.size=this.base.offsetWidth}}var g=this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxslider")||"dhx_skyblue";this.setSkin(g);this.base.innerHTML="<div class='dhxsl_container'><div class='dhxsl_track'></div><div class='dhxsl_runner'></div></div>";this._nodes={cont:this.base.firstChild,track:this.base.firstChild.firstChild,runner:this.base.firstChild.childNodes[1]};this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=function(j){j=j||event;if(typeof(j.preventDefault)=="function"){j.preventDefault()}else{j.returnValue=false}return false};this.conf.value=this._normalize(this.conf.value);this._setOrient(this.conf.vertical);this.setSize(this.conf.size);this._initMover=function(l){l=l||event;if(typeof(l.preventDefault)=="function"){l.preventDefault()}a._nodes.runner.className="dhxsl_runner dhxsl_runner_actv";var j=(l.type=="mousedown"?"client":"page")+(a.conf.vertical?"Y":"X");a._movingInitialValues={};a._movingInitialValues.value=a.conf.value;a._movingInitialValues.coord=(typeof(l[j])!="undefined"?l[j]:l.touches[0][j]);if(a.conf.disabled==false){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._move,false);window.addEventListener("mouseup",a._cleanMove,false);window.addEventListener("touchmove",a._move,false);window.addEventListener("touchend",a._cleanMove,false)}else{document.body.attachEvent("onmousemove",a._move);document.body.attachEvent("onmouseup",a._cleanMove)}}a.callEvent("_onRunnerMouseDown",[]);return false};this._move=function(q){q=q||event;if(typeof(q.preventDefault)=="function"){q.preventDefault()}var n=(q.type=="mousemove"?"client":"page")+(a.conf.vertical?"Y":"X");var o=(a.conf.vertical)?a._nodes.runner.offsetHeight:a._nodes.runner.offsetWidth;var l=a.conf.max-a.conf.min;var j=(typeof(q[n])!="undefined"?q[n]:q.touches[0][n]);var m=a._movingInitialValues.value+(j-a._movingInitialValues.coord)*l/(a.conf.size-o)*(a.conf.inverse?-1:1);a.setValue(m,true)};this._cleanMove=function(j){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._move,false);window.removeEventListener("mouseup",a._cleanMove,false);window.removeEventListener("touchmove",a._move,false);window.removeEventListener("touchend",a._cleanMove,false)}else{document.body.detachEvent("onmousemove",a._move);document.body.detachEvent("onmouseup",a._cleanMove)}a._movingInitialValues=null;a._nodes.runner.className=a._nodes.runner.className.replace(/\s{0,}dhxsl_runner_actv/gi,"");a.callEvent("onSlideEnd",[a.conf.value]);a.callEvent("_onRunnerMouseUp",[])};this._doOnSetValue=function(o){if(a._movingInitialValues!=null){return false}o=o||event;if(typeof(o.preventDefault)=="function"){o.preventDefault()}var n=(a.conf.vertical)?(o.offsetY||o.layerY):(o.offsetX||o.layerX);var m=(a.conf.vertical)?a._nodes.runner.offoffsetHeightsetHe:a._nodes.runner.offsetWidth;var j=a.conf.max-a.conf.min;var l=n*j/(a.conf.size)+a.conf.min;a.setValue(l,true);if(a._movingInitialValues==null){a._initMover(o)}return false};this._doOnChangeInput=function(l){l=l||event;var j=l.target||l.srcElement;a.setValue(j.value)};this._doOnKeyDown=function(l){l=l||event;var j=l.target||l.srcElement;if(l.keyCode==13){a.setValue(j.value)}};this._attachEvents(this._nodes);this.unload=function(){dhx4._eventable(this,"clear");this._detachNode();this._detachEvents(this._nodes);this.base.removeChild(this._nodes.cont);this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=null;delete this._nodes.cont;delete this._nodes.track;delete this._nodes.max;delete this._nodes.min;delete this._nodes.runner;if(/\s?dhtmlxslider_\S*/.test(this.base.className)){this.base.className=this.base.className.replace(/\s?dhtmlxslider_\S*/,"")}for(var j in this){this[j]=null}a=null};dhx4._eventable(this);if(this.conf.disabled){this.disable()}if(this.conf.tooltip){this.enableTooltip()}if(!this.conf.visible){this.hide()}if(this.conf.linkTo){this.linkTo(this.conf.linkTo)}return this}dhtmlXSlider.prototype._setOrient=function(a){a=a||false;if(/\s?dhxsl_cont_hr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_hr/i,"")}if(/\s?dhxsl_cont_vr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_vr/i,"")}if(a){this._nodes.cont.className+=" dhxsl_cont_vr"}else{this._nodes.cont.className+=" dhxsl_cont_hr"}};dhtmlXSlider.prototype._attachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.addEventListener("mousedown",this._initMover,false);a.runner.addEventListener("touchstart",this._initMover,false);a.cont.addEventListener("mousedown",this._doOnSetValue,false);a.cont.addEventListener("touchstart",this._doOnSetValue,false)}else{a.runner.attachEvent("onmousedown",this._initMover);a.cont.attachEvent("onmousedown",this._doOnSetValue)}};dhtmlXSlider.prototype._detachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.removeEventListener("mousedown",this._initMover,false);a.runner.removeEventListener("touchstart",this._initMover,false);a.cont.removeEventListener("mousedown",this._doOnSetValue,false);a.cont.removeEventListener("touchstart",this._doOnSetValue,false)}else{a.runner.detachEvent("onmousedown",this._initMover);a.cont.detachEvent("onmousedown",this._doOnSetValue)}};dhtmlXSlider.prototype._mergeConfig=function(c){for(var a in c){switch(a.toLowerCase()){case"min":case"max":case"size":case"step":case"value":case"inverse":this.conf[a]=c[a];break;case"tooltip":case"visible":case"vertical":case"disabled":this.conf[a]=dhx4.s2b(c[a]);break;case"parent":continue;break;default:this.conf[a]=c[a]}}};dhtmlXSlider.prototype._readAttFormNode=function(j){var n=j.attributes,a=n.length,g,m={},c;for(g=0;g<a;g++){c=n[g];switch(c.name.toLowerCase()){case"size":case"min":case"max":case"value":case"step":m[c.name]=c.value;break;case"skin":m.skin=c.value;break;case"vertical":case"disabled":case"visible":m[c.name]=dhx4.s2b(c.value);break;case"linkto":m.linkTo=c.value;break;case"tooltip":m.tooltip=dhx4.s2b(c.value);break}}return m};dhtmlXSlider.prototype._renderArgumets=function(a){var j={},g,c;c=a.length;for(g=0;g<c;g++){switch(g){case 0:j.parent=a[g];break;case 1:j.size=a[g];break;case 2:j.skin=a[g];break;case 3:j.vertical=a[g];break;case 4:j.min=a[g];break;case 5:j.max=a[g];break;case 6:j.value=a[g];break;case 7:j.step=a[g];break}}return j};dhtmlXSlider.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXSlider.prototype._indexOf=function(a,j){var g,c,m=-1;c=a.length;for(g=c;g>=0;g--){if(a[g]==j){m=g;break}}return m};dhtmlXSlider.prototype._refreshRunner=function(){var a,c;if(this.conf.vertical){a=this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight;c=this._getCoord(a);this._nodes.runner.style.top=c+this.conf.border+"px";this._nodes.runner.style.left=Math.round((this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)/2)+"px"}else{a=this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth;c=this._getCoord(a);this._nodes.runner.style.left=c+this.conf.border+"px";this._nodes.runner.style.top=Math.round((this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)/2)+"px"}};dhtmlXSlider.prototype._setValueByCoord=function(j){var a=dhx4.absLeft(this._nodes.cont),l=dhx4.absTop(this._nodes.cont),g,c;if(this.conf.vertical){c=(j.y-l-this._nodes.runner.offsetHeight/2)/(this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)}else{c=(j.x-a-this._nodes.runner.offsetWidth/2)/(this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)}g=(this.conf.max-this.conf.min)*c+this.conf.min;this.setValue(g,true)};dhtmlXSlider.prototype._getCoord=function(a){var g=(this.conf.inverse?this._inverseValue(this.conf.value):this.conf.value);var c=(g-this.conf.min)/(this.conf.max-this.conf.min);return Math.round(a*c)};dhtmlXSlider.prototype._normalize=function(c){c=Number(c);c=Math.round(c/this.conf.step)*this.conf.step;var a=Math.pow(10,this.conf.decimals);c=Math.round(c*a)/a;c=Math.max(this.conf.min,Math.min(this.conf.max,c));return c};dhtmlXSlider.prototype._attachNode=function(c){var a=c.tagName.toLowerCase();if(!a){return}this._attachedNode.node=c;switch(a){case"input":case"select":if(typeof(window.addEventListener)=="function"){c.addEventListener("change",this._doOnChangeInput,false);c.addEventListener("keydown",this._doOnKeyDown,false)}else{c.attachEvent("onchange",this._doOnChangeInput);c.attachEvent("onkeydown",this._doOnKeyDown)}this._attachedNode.setValue=function(m,g){m=String(m);if(g>0){var j=m.match(/\.\d{1,}$/);if(j!=null){g=Math.max(g-j[0].length+1)}m+=(m.indexOf(".")<0?".":"");for(var l=0;l<g;l++){m+="0"}}this.node.value=m};break;default:this._attachedNode.setValue=function(g){this.node.innerHTML=g}}this._attachedNode.setValue(this.conf.value,this.conf.decimals)};dhtmlXSlider.prototype._detachNode=function(){var c=this._attachedNode.node;if(!c){return}var a=c.tagName;switch(a){case"input":case"select":if(typeof(window.addEventListener)=="function"){c.removeEventListener("change",this._doOnChangeInput,false);c.removeEventListener("keydown",this._doOnChangeInput,false)}else{c.detachEvent("change",this._doOnChangeInput);c.detachEvent("keydown",this._doOnChangeInput)}break}delete this._attachedNode.node;delete this._attachedNode.setValue};dhtmlXSlider.prototype._detectDecimals=function(){var a=this.conf.step.toString().match(/\.(\d*)$/);this.conf.decimals=(a!=null?a[1].length:0)};dhtmlXSlider.prototype.setSize=function(a){if(!isNaN(a)){if(this.conf.vertical){if(this._nodes.cont.style.width){delete this._nodes.cont.style.width}this._nodes.cont.style.height=a-this.conf.margin+"px"}else{if(this._nodes.cont.style.height){delete this._nodes.cont.style.height}this._nodes.cont.style.width=a-this.conf.margin+"px"}this._refreshRunner()}};dhtmlXSlider.prototype.setSkin=function(l){l=l.toLowerCase();var g,c=-1,a,j="dhtmlxslider";g=this.base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,j+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=j+"_"+l;this.base.className=g.join(" ");this.conf.skin=l;if(this._nodes){this._refreshRunner()}};dhtmlXSlider.prototype.setValue=function(a,c){c=c||false;if(!isNaN(a)){a=this._normalize(a);if(this.conf.value!=a){this.conf.value=a;this._refreshRunner();if(this.conf.tooltip){this._nodes.cont.title=a}if(c){this.callEvent("onChange",[a,this])}}}if(typeof(this._attachedNode.setValue)=="function"){this._attachedNode.setValue(this.conf.value,this.conf.decimals)}};dhtmlXSlider.prototype.getValue=function(){return this.conf.value};dhtmlXSlider.prototype._inverseValue=function(){return this.conf.max+this.conf.min-this.conf.value};dhtmlXSlider.prototype.disable=function(g){g=(g==false)?false:true;var c=null;if(g){for(var a in this._nodes){if(a=="cont"){continue}c=new RegExp("\\s?dhxsl_"+a+"_dis","i");if(!c.test(this._nodes[a].className)){this._nodes[a].className+=" dhxsl_"+a+"_dis"}}this.conf.disabled=true}else{this.enable()}};dhtmlXSlider.prototype.enable=function(){var c;for(var a in this._nodes){if(a=="cont"){continue}c=new RegExp("\\s?dhxsl_"+a+"_dis","i");if(c.test(this._nodes[a].className)){this._nodes[a].className=this._nodes[a].className.replace(c,"")}}this.conf.disabled=false};dhtmlXSlider.prototype.isEnabled=function(){return !this.conf.disabled};dhtmlXSlider.prototype.disableTooltip=function(){this._nodes.cont.removeAttribute("title");this.conf.tooltip=false};dhtmlXSlider.prototype.enableTooltip=function(a){if(typeof(a)=="undefined"){a=true}else{a=dhx4.s2b(a)}if(a){this._nodes.cont.title=this.conf.value;this.conf.tooltip=true}else{this.disableTooltip()}};dhtmlXSlider.prototype.setMax=function(a){if(!isNaN(a)&&this.conf.min<a){this.conf.max=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMax=function(){return this.conf.max};dhtmlXSlider.prototype.setMin=function(a){if(!isNaN(a)&&this.conf.max>a){this.conf.min=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMin=function(){return this.conf.min};dhtmlXSlider.prototype.setStep=function(a){var c=this.conf.max-this.conf.min;if(!isNaN(a)&&a<c){this.conf.step=a;this._detectDecimals();this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getStep=function(){return this.conf.step};dhtmlXSlider.prototype.show=function(){if(/\s?dhxsl_hidden/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_hidden/i,"")}this.conf.visible=true};dhtmlXSlider.prototype.hide=function(){if(!/\s?dhxsl_hidden/i.test(this._nodes.cont.className)){this._nodes.cont.className+=" dhxsl_hidden"}this.conf.visible=false};dhtmlXSlider.prototype.isVisible=function(){return this.conf.visible};dhtmlXSlider.prototype.linkTo=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(this._attachedNode.node){this._detachNode()}this._attachNode(a)};function dhtmlXPopup(g){var j=this;this.conf=g||{};g=null;this.mode=(this.conf.mode||"bottom");this.conf.zi=window.dhx4.newId();this.conf.context=(this.conf.context==null?true:window.dhx4.s2b(this.conf.context));this.conf.IE6_display_fix=(this.conf.IE6_display_fix==null?false:window.dhx4.s2b(this.conf.IE6_display_fix));this.conf.last_p_click=this.conf.last_body_click=null;this.p=document.createElement("DIV");this.p.style.display="none";this.p.innerHTML="<div class='dhx_popup_area"+(window.dhx4.isIE?" dhx_popup_area_ie":"")+"'><table cellspacing='0' cellpadding='0' border='0' class='dhx_popup_table'><tbody></tbody></table></div><div class='dhx_popup_arrow dhx_popup_arrow_"+this.mode+"'></div>";document.body.appendChild(this.p);this.p.oncontextmenu=function(a){if(j.conf.context==false){a=a||event;a.returnValue=false;return false}};this.skinParams={dhx_terrace:{t0:19,t1:9,t2:19,t3:9},dhx_skyblue:{t0:12,t1:9,t2:12,t3:9},dhx_web:{t0:12,t1:9,t2:12,t3:9}};this.p.ontouchstart=this.p.onclick=function(m){m=m||event;var l=(j.conf.last_p_click!=null&&j.conf.last_p_click!=m.type);j.conf.last_p_click=m.type;if(l==true){return}j._clearClick=true;if(j._nodeObj!=null){j.callEvent("onContentClick",[]);return true}var a=(m.target||m.srcElement);var n=null;while(a!=j.p&&a!=null){if(typeof(a._idd)!="undefined"&&!a._isSeparator){n=a._idd;a=null}else{a=a.parentNode}}a=null;if(n!=null){j.callEvent("onClick",[n]);if(j!=null&&j.isVisible!=null&&j.isVisible()&&j.callEvent("onBeforeHide",["select",m,n])===true){m.cancelBubble=true;j.hide()}}};this.separator="DHXSEP_"+window.dhx4.newId();this.tpl=[];this._setTemplate=function(a){this.tpl=a.split(",")};this.show=function(l){var a=null;if(arguments.length==1){if(!l){l=this.conf.id[0]}else{if(!this._idExists(l)){return}}if(this.conf.toolbar){a=this.conf.toolbar._getItemDim(l)}if(this.conf.ribbon){a=this.conf.ribbon._getItemDim(l)}if(this.conf.form){a=this.conf.form._getItemDim(l)}}else{if(arguments.length==4){this._clearClick=true;a={left:arguments[0],top:arguments[1],width:arguments[2],height:arguments[3]};l=null}}if(!a){return}this.p.style.visibility="hidden";this.p.style.display="";this._setPos(a);this.p.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this.p.style.visibility="visible";this._lastId=l;this.callEvent("onShow",[l])};this._setPos=function(I,n){var v=I.left;var s=I.top;var C=I.width;var L=I.height;this._posData={left:v,top:s,width:C,height:L};var N=window.dhx4.screenDim();var F=n||this.mode;if(typeof(n)=="undefined"){n=false}var P={top:(s-this.p.offsetHeight)-N.top,bottom:N.bottom-(s+L+this.p.offsetHeight),left:v-this.p.offsetWidth-N.left,right:N.right-(v+C+this.p.offsetWidth)};if(!n&&P[F]<0){var J=this._getAvailPos(F,P);if(J!==false){this._setPos(I,J);return}}if(F=="top"||F=="bottom"){var D=this.skinParams[this.conf.skin].t2;var A=this.skinParams[this.conf.skin].t3;var r=Math.round(this.p.offsetWidth/2);var a=Math.round(this.p.lastChild.offsetWidth/2);if(v<N.left){var M=Math.min(v+C,N.left);C=v+C-M;v=M}if(v+C>N.right){C=N.right-v}var u=Math.round(v+C/2);var m=u-r;var K=u-D-a;var q=u+a+D-this.p.offsetWidth;if(m<N.left-A){m=Math.min(N.left-A,K)}else{if(m+this.p.offsetWidth>N.right+A){m=Math.max(q,N.right+A-this.p.offsetWidth)}}this.p.style.left=m+"px";this.p.style.top=(F=="top"?s-this.p.offsetHeight:s+L)+"px";u=u-m-a;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.top=(F=="top"?this.p.offsetHeight-this.p.lastChild.offsetHeight:0)+"px";this.p.lastChild.style.left=u+"px"}if(F=="left"||F=="right"){var D=this.skinParams[this.conf.skin].t0;var A=this.skinParams[this.conf.skin].t1;var o=Math.round(this.p.offsetHeight/2);var S=Math.round(this.p.lastChild.offsetHeight/2);if(s<N.top){var l=Math.min(s+L,N.top);L=s+L-l;s=l}if(s+L>N.bottom){L=N.bottom-s}var u=Math.round(s+L/2);var H=u-o;var Q=u-D-S;var O=u+S+D-this.p.offsetHeight;if(H<N.top-A){H=Math.min(N.top-A,Q)}else{if(H+this.p.offsetHeight>N.bottom+A){H=Math.max(O,N.bottom+A-this.p.offsetHeight)}}this.p.style.left=(F=="left"?v-this.p.offsetWidth:v+C)+"px";this.p.style.top=H+"px";u=u-H-S;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.left=(F=="left"?this.p.offsetWidth-this.p.lastChild.offsetWidth:0)+"px";this.p.lastChild.style.top=u+"px"}if(this._IEDisp&&this._nodeId!=null){var E=document.getElementById(this._nodeId);if(this.conf.IE6_display_fix==true){E.style.visibility="hidden"}window.setTimeout(function(){E.style.visibility="visible";E=null},1)}};this._getAvailPos=function(s,r){var m={top:["bottom","right","left"],bottom:["top","right","left"],left:["right","bottom","top"],right:["left","bottom","top"]};var n=null;for(var o=0;o<m[s].length;o++){if(n==null&&r[m[s][o]]>0){n=m[s][o]}}if(n==null){n="bottom";for(var l in r){if(r[l]>r[n]){n=l}}}if(n==s){return false}return n};this._repaint=function(){if(this.isVisible()){this._setPos(this._posData)}};this.clear=function(){if(this._nodeObj){if(window.dhx4.isIE&&typeof(window.dhtmlXLayoutObject)!="undefined"&&this._nodeObj instanceof dhtmlXLayoutObject){this.p.onmousedown=null}if(this._nodeObj.unload){this._nodeObj.unload()}else{if(this._nodeObj.destruct){this._nodeObj.destruct()}}this._nodeObj=this._nodeId=null;if(this._nodeObjEv!=null){for(var l=0;l<this._nodeObjEv.length;l++){this.detachEvent(this._nodeObjEv[l])}this._nodeObjEv=null}}if(this._IEHoverInited){this._IEHoverClear()}var a=this.p.firstChild.firstChild.firstChild;while(a.childNodes.length>0){a.removeChild(a.lastChild)}a=null;this.itemData={}};this.hide=function(){if(this.p.style.display!="none"){this.p.style.display="none";window.dhx4.zim.clear(this.conf.zi);var a=this._lastId;this._lastId=null;this.callEvent("onHide",[a]);this.conf.last_p_click=this.conf.last_body_click=null}};this.isVisible=function(){return(this.p.style.display=="")};this.itemData={};this.getItemData=function(a){if(!a){return this.itemData}if(this.itemData[a]){return this.itemData[a]}return{}};this.setSkin=function(a){this.conf.skin=a;this.p.className="dhx_popup_"+this.conf.skin;if(this._nodeObj!=null&&typeof(this._nodeObj.setSkin)=="function"){this._nodeObj.setSkin(this.conf.skin)}this._repaint()};this.attachList=function(m,u){this._setTemplate(m);this.clear();var n=this.p.firstChild.firstChild.firstChild;for(var s=0;s<u.length;s++){var o=document.createElement("TR");if(u[s]!=this.separator){if(typeof(u[s].id)=="undefined"||u[s].id==null){o._idd=window.dhx4.newId();while(this.itemData[o._idd]!=null){o._idd=window.dhx4.newId()}}else{o._idd=u[s].id}this.itemData[o._idd]=u[s]}n.appendChild(o);if(u[s]==this.separator){o.className="dhx_popup_sep";o._isSeparator=true;var v=document.createElement("TD");v.className="dhx_popup_sep";v.colSpan=this.tpl.length;v.innerHTML="<div class='dhx_popup_sep'>&nbsp;</div>";o.appendChild(v);v=null}else{for(var a=0;a<this.tpl.length;a++){var l="dhx_popup_td";if(this._IEFirstLast&&(this.tpl.length==1||a==0||a==this.tpl.length-1)){if(this.tpl.length==1){l+=" dhx_popup_td_single"}else{l+=(a==0?" dhx_popup_td_first":" dhx_popup_td_last")}}var v=document.createElement("TD");v.className=l;v.innerHTML=u[s][this.tpl[a]]||"&nbsp;";o.appendChild(v);v=null}if(this._IEHover){o._IEHover=true;if(!this._IEHoverInited){this._IEHoverInit()}}}o=null}n=null;this._repaint()};this._attachNode=function(n,m){this.clear();this._nodeId="dhxpopup_node_"+window.dhx4.newId();var a=this.p.firstChild.firstChild.firstChild;var l=document.createElement("TR");l.className="dhxnode";a.appendChild(l);var o=document.createElement("TD");o.className="dhx_popup_td";o.innerHTML="<div id='"+this._nodeId+"' style='position:relative;'></div>";if(m.width){o.firstChild.style.width=m.width+"px"}if(m.height){o.firstChild.style.height=m.height+"px"}l.appendChild(o);o=l=a=null;if(typeof(this["_attach_init_"+n])=="function"){this["_attach_init_"+n](m);this._enableIEVFix()}this._repaint();return this._nodeObj};this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("touchstart",this._doOnClick,false);window.removeEventListener("click",this._doOnClick,false);window.removeEventListener("keyup",this._doOnKeyUp,false);window.removeEventListener("unload",this._doOnUnload,false)}else{document.body.detachEvent("onclick",this._doOnClick,false);document.body.detachEvent("onkeyup",this._doOnKeyUp,false);document.body.detachEvent("onunload",this._doOnUnload,false)}this.clear();if(this.conf.toolbarEvent!=null&&this.conf.toolbar!=null){if(this.conf.toolbar.detachEvent!=null){this.conf.toolbar.detachEvent(this.conf.toolbarEvent)}else{this.conf.toolbar._getItemDim=null}}if(this.conf.ribbonEvent!=null&&this.conf.ribbon!=null){if(this.conf.ribbon.detachEvent!=null){this.conf.ribbon.detachEvent(this.conf.ribbonEvent)}else{this.conf.ribbon._getItemDim=null}}if(this.conf.slider!=null){for(var m=0;m<this.conf.slider_events.length;m++){this.conf.slider.detachEvent(this.conf.slider_events[m])}this.conf.slider_events=null;this._sliderShow=this._sliderHide=null;this.conf.slider=null}window.dhx4._eventable(this,"clear");this.p.onclick=this.p.ontouchstart=this.p.oncontextmenu=null;this.p.parentNode.removeChild(this.p);this.p=null;for(var l in this.conf){this.conf[l]=null}for(var l in this){this[l]=null}j=null};window.dhx4._eventable(this);this._doOnClick=function(s){s=s||event;var a=(j.conf.last_body_click!=null&&j.conf.last_body_click!=s.type);j.conf.last_body_click=s.type;if(a==true){return}if(j._clearClick==true){j._clearClick=false;return}if(j.conf.form!=null){var m;var u=(s.target||s.srcElement);if((u.tagName||"").toLowerCase()=="option"){u=u.parentNode}if(u.className!=null&&u.className.search("dhxform")>=0){if(u.parentNode!=null&&u.parentNode.parentNode!=null&&u.parentNode.parentNode._idd!=null){m=u.parentNode.parentNode._idd;if(u.parentNode.parentNode._type=="ra"){m=[u.parentNode.parentNode._group,u.parentNode.parentNode._value]}}}else{var o=true;var q=false;while(o&&!q){var n=(u.className||"").toLowerCase();if(n.length>0){q=(n=="dhxform_btn"||n.search(/dhxeditor_inside/gi)>=0||n=="dhxcombo_input"||n.search(/dhxcombolist/gi)>=0)}u=u.parentNode;o=(u!=null)}if(q){return}}u=null;if(m!=null&&j._idExists(m)){return}}if(typeof(window.dhtmlXForm)!="undefined"&&j._nodeObj instanceof window.dhtmlXForm){var v={};var n=0;var l=j._nodeObj;l.forEachItem(function(r){if(l.getItemType(r)=="combo"){v[l.getCombo(r).list._listId]=true;n++}});l=null;if(n>0){var u=(s.target||s.srcElement);var o=true;var q=false;while(o==true&&q!=true){var n=(u.className||"").toLowerCase();if(n.length>0&&n.search(/^dhxcombolist/gi)>=0&&u._listId!=null&&v[u._listId]==true){q=true;u=null}else{u=u.parentNode;o=(u!=null)}}if(q==true){return}}}if(j.isVisible()&&j.callEvent("onBeforeHide",["click",s])===true){j.hide()}};this._doOnKeyUp=function(a){a=a||event;if(a.keyCode==27){if(j.isVisible()&&j.callEvent("onBeforeHide",["esc",a])===true){j.hide()}}};this._doOnUnload=function(){j.unload()};if(typeof(window.addEventListener)=="function"){window.addEventListener("touchstart",this._doOnClick,false);window.addEventListener("click",this._doOnClick,false);window.addEventListener("keyup",this._doOnKeyUp,false);window.addEventListener("unload",this._doOnUnload,false)}else{document.body.attachEvent("onclick",this._doOnClick,false);document.body.attachEvent("onkeyup",this._doOnKeyUp,false);document.body.attachEvent("onunload",this._doOnUnload,false)}this._idExists=function(m){var a=false;for(var l=0;l<this.conf.id.length;l++){if(this.conf.id[l] instanceof Array){a=a||(this.conf.id[l][0]==m[0]&&this.conf.id[l][1]==m[1])}else{a=a||this.conf.id[l]==m}}return a};this._IEDisp=(window.dhx4.isIE6||document.compatMode!="CSS1Compat");this._IEHover=(window.dhx4.isIE6==true);if(this._IEHover){this._IEHoverInit=function(){this.p.onmouseover=function(){var a=event.srcElement;while(a!=this&&a._IEHover!=true){a=a.parentNode}if(a._IEHover){if(j._IEHoverTM){window.clearTimeout(j._IEHoverTM)}if(j._lastIEHover==a){return}j._IEHoverRender(a);a=null}};this.p.onmouseout=function(){if(j._IEHoverTM){window.clearTimeout(j._IEHoverTM)}j._IEHoverTM=window.setTimeout(function(){j._IEHoverRender(null)},1)};this._IEHoverRender=function(a){if(this._lastIEHover!=null){if(this._lastIEHover.className.search(/tr_hover/gi)>=0){this._lastIEHover.className=this._lastIEHover.className.replace(/\s{0,}tr_hover/gi,"");this._lastIEHover=null}}if(a!=null&&a.className.search(/tr_hover/gi)<0){a.className+=" tr_hover";j._lastIEHover=a}};this._IEHoverInited=true};this._IEHoverClear=function(){this.p.onmouseover=null;this.p.onmouseout=null;this._IEHoverInited=false}}this._IEFirstLast=(window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8);this._enableIEVFix=function(){if(window.dhx4.isIE6||window.dhx4.isIE7){var l=this.attachEvent("onHide",function(){document.getElementById(this._nodeId).style.visibility="hidden"});var a=this.attachEvent("onShow",function(){document.getElementById(this._nodeId).style.visibility="visible"});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(l,a)}};if(typeof(window.dhtmlXToolbarObject)!="undefined"&&this.conf.toolbar!=null&&this.conf.toolbar instanceof window.dhtmlXToolbarObject&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.toolbar.conf.skin;this._doOnToolbarClick=function(l){for(var a=0;a<j.conf.id.length;a++){if(l==j.conf.id[a]){if(l!=j._lastId){j.show(l);j._clearClick=true}}}};if(typeof(dhtmlXToolbarObject.prototype._getItemDim)=="undefined"){dhtmlXToolbarObject.prototype._getItemDim=function(m){var a=this.objPull[this.idPrefix+m];var l={left:window.dhx4.absLeft(a.obj),top:window.dhx4.absTop(a.obj),width:a.obj.offsetWidth+(a.arw?a.arw.offsetWidth:0),height:a.obj.offsetHeight};a=null;return l}}this.conf.toolbarEvent=this.conf.toolbar.attachEvent("onClick",this._doOnToolbarClick)}if(typeof(window.dhtmlXRibbon)!="undefined"&&this.conf.ribbon!=null&&this.conf.ribbon instanceof window.dhtmlXRibbon&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.ribbon.conf.skin;this._doOnRibbonClick=function(l){for(var a=0;a<j.conf.id.length;a++){if(l==j.conf.id[a]){if(l!=j._lastId){j.show(l);j._clearClick=true}}}};if(typeof(dhtmlXRibbon.prototype._getItemDim)=="undefined"){dhtmlXRibbon.prototype._getItemDim=function(m){var a=this._items[m].base;var l={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};a=null;return l}}this.conf.ribbonEvent=this.conf.ribbon.attachEvent("_showPopup",this._doOnRibbonClick)}if(typeof(window.dhtmlXForm)!="undefined"&&this.conf.form!=null&&this.conf.form instanceof window.dhtmlXForm&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}if(!this.conf.mode){this.mode="right"}this.skinParent=this.conf.form.skin;if(typeof(dhtmlXForm.prototype._getItemDim)=="undefined"){dhtmlXForm.prototype._getItemDim=function(a,l){return this.doWithItem(a,"_getDim")};for(var c in {input:1,password:1,select:1,multiselect:1,checkbox:1,radio:1,button:1,combo:1,btn2state:1,calendar:1,colorpicker:1,editor:1}){if(dhtmlXForm.prototype.items[c]!=null){dhtmlXForm.prototype.items[c]._getDim=function(l){var a=l;if({ta:true,pw:true,se:true,calendar:true,colorpicker:1,editor:true}[l._type]){a=l.childNodes[l._ll?1:0].childNodes[0]}if({ch:true,ra:true,btn2state:true}[l._type]){a=l.childNodes[l._ll?1:0].childNodes[1]}if({bt:true}[l._type]){a=l.firstChild}if({combo:true}[l._type]){a=l._combo.DOMParent.firstChild}var m={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};a=null;return m}}}}}if(typeof(window.dhtmlXSlider)!="undefined"&&this.conf.slider!=null&&this.conf.slider instanceof window.dhtmlXSlider){if(!this.conf.mode){this.mode="top"}this.conf.slider_tm=null;this._sliderShow=function(){if(j.conf.slider_tm){window.clearTimeout(j.conf.slider_tm)}var a=j.conf.slider._nodes.runner;var l={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};j.show(l.left,l.top,l.width,l.height)};this._sliderHide=function(){j.conf.slider_tm=window.setTimeout(function(){j.hide()},200)};this.conf.slider_events=[this.conf.slider.attachEvent("_onRunnerMouseDown",this._sliderShow),this.conf.slider.attachEvent("_onRunnerMouseUp",this._sliderHide),this.conf.slider.attachEvent("onChange",this._sliderShow)]}this.setSkin(this.skinParent||this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_popup")||"dhx_skyblue");return this}dhtmlXPopup.prototype.attachObject=function(a){return this._attachNode("object",{obj:a})};dhtmlXPopup.prototype._attach_init_object=function(a){this._nodeObj=(typeof(a.obj)=="string"?document.getElementById(a.obj):a.obj);a.obj=null;document.getElementById(this._nodeId).appendChild(this._nodeObj);this._nodeObj.style.display="";this._nodeObj.style.visibility="visible"};dhtmlXPopup.prototype.attachHTML=function(a){return this._attachNode("html",{html:a})};dhtmlXPopup.prototype._attach_init_html=function(a){document.getElementById(this._nodeId).innerHTML=a.html;this._nodeObj={text:a.html}};dhtmlXPopup.prototype.attachForm=function(c,a){return this._attachNode("form",{struct:c,width:a})};dhtmlXPopup.prototype._attach_init_form=function(c){var a=this;this._nodeObj=new dhtmlXForm(this._nodeId,c.struct);this._nodeObj.setSkin(this.conf.skin);this._nodeObj.attachEvent("_onBeforeEditorAccess",function(){a._clearClick=true});if(this.conf.editorEv!=null&&this.checkEvent(this.conf.editorEv)==false){this.conf.editorEv=null}if(dhtmlXForm.prototype.items.editor!=null&&this.conf.editorEv==null){this.conf.editorEv=this.attachEvent("onShow",function(){var l=dhtmlXForm.prototype.items.editor.editor;for(var g in l){var m=l[g].base;var j=false;while(m!=null){if(m==this.p){j=true;m=null}else{m=m.parentNode}}m=null;if(j==true){l[g].cell.conf.cells_cont=null;l[g].setSizes()}}l=null;this.detachEvent(this.conf.editorEv);this.conf.editorEv=null});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(this.conf.editorEv)}};dhtmlXPopup.prototype.attachCalendar=function(){return this._attachNode("calendar",{})};dhtmlXPopup.prototype._attach_init_calendar=function(a){this._nodeObj=new dhtmlXCalendarObject(this._nodeId);this._nodeObj.setSkin(this.conf.skin);this._nodeObj.show()};dhtmlXPopup.prototype.attachGrid=function(c,a){return this._attachNode("grid",{width:c||400,height:a||200})};dhtmlXPopup.prototype._attach_init_grid=function(){this._nodeObj=new dhtmlXGridObject(this._nodeId);this._nodeObj.setSkin(this.conf.skin)};dhtmlXPopup.prototype.attachTree=function(g,c,a){return this._attachNode("tree",{width:g||400,height:c||200,rootId:a||0})};dhtmlXPopup.prototype._attach_init_tree=function(a){this._nodeObj=new dhtmlXTreeObject(this._nodeId,"100%","100%",(a.rootId))};dhtmlXPopup.prototype.attachLayout=function(c,a,g){return this._attachNode("layout",{width:c||400,height:a||200,pattern:g||"3L"})};dhtmlXPopup.prototype._attach_init_layout=function(a){this._nodeObj=new dhtmlXLayoutObject(this._nodeId,a.pattern,this.conf.skin)};dhtmlXPopup.prototype.attachAccordion=function(g,a,c){return this._attachNode("accordion",{width:g||400,height:a||200,conf:c||{}})};dhtmlXPopup.prototype._attach_init_accordion=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXAccordion(a.conf)};dhtmlXPopup.prototype.attachTabbar=function(g,a,c){if(typeof(c)=="string"){c={mode:c}}else{if(typeof(c)!="object"||c==null){c={}}}return this._attachNode("tabbar",{width:g||400,height:a||200,conf:c})};dhtmlXPopup.prototype._attach_init_tabbar=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXTabBar(a.conf)};dhtmlXPopup.prototype.attachSidebar=function(g,a,c){if(c==null){c={}}return this._attachNode("tabbar",{width:g||400,height:a||200,conf:c})};dhtmlXPopup.prototype._attach_init_tabbar=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXSideBar(a.conf)};dhtmlXPopup.prototype.attachEditor=function(g,a,c){return this._attachNode("editor",{width:g||400,height:a||200,conf:c||{}})};dhtmlXPopup.prototype._attach_init_editor=function(c){document.getElementById(this._nodeId).className="dhxeditor_"+this.conf.skin;c.conf.parent=this._nodeId;if(c.conf.skin==null){c.conf.skin=this.conf.skin}this._nodeObj=new dhtmlXEditor(c.conf);var a=this.attachEvent("onShow",function(){if(this._nodeObj instanceof window.dhtmlXEditor){this._nodeObj.setSizes()}});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(a)};dhtmlXPopup.prototype.attachColorPicker=function(a){if(typeof(a)!="object"||a==null){a={}}return this._attachNode("colorpicker",{conf:a})};dhtmlXPopup.prototype._attach_init_colorpicker=function(a){a.conf.skin=this.conf.skin;a.conf.parent=this._nodeId;this._nodeObj=new dhtmlXColorPicker(a.conf)};function dhtmlXMenuObject(l,m){var j=this;this.conf={skin:(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxmenu")||"dhx_skyblue"),mode:"web",align:"left",is_touched:false,selected:-1,last_click:-1,fixed_pos:false,rtl:false,icons_path:"",arrow_ff_fix:(navigator.userAgent.indexOf("MSIE")>=0&&document.compatMode=="BackCompat"),live_id:window.dhx4.newId(),tags:{root:"menu",item:"item",text_ext:"itemtext",userdata:"userdata",tooltip:"tooltip",hotkey:"hotkey",href:"href"},autoload:{},hide_tm:{},top_mode:true,top_tmtime:200,v_enabled:false,v:{x1:null,x2:null,y1:null,y2:null},dir_toplv:"bottom",dir_sublv:"right",auto_overflow:false,overflow_limit:0,of_utm:null,of_utime:20,of_ustep:3,of_dtm:null,of_dtime:20,of_dstep:3,tm_sec:400,tm_handler:null,dload:false,dload_url:"",dload_icon:false,dload_params:{action:"loadMenu"},dload_pid:"parentId",tl_botmarg:1,tl_rmarg:0,tl_ofsleft:1,context:false,ctx_zoneid:false,ctx_autoshow:true,ctx_autohide:true,ctx_hideall:true,ctx_zones:{},ctx_baseid:null,selected_sub:[],opened_poly:[]};if(typeof(l)=="object"&&l!=null&&typeof(l.tagName)=="undefined"){if(l.icons_path!=null||l.icon_path!=null){this.conf.icons_path=(l.icons_path||l.icon_path)}if(l.skin!=null){this.conf.skin=l.skin}if(l.visible_area){this.conf.v_enabled=true;this.conf.v={x1:l.visible_area.x1,x2:l.visible_area.x2,y1:l.visible_area.y1,y2:l.visible_area.y2}}for(var g in {json:1,xml:1,items:1,top_text:1,align:1,open_mode:1,overflow:1,dynamic:1,dynamic_icon:1,context:1,onload:1,onclick:1,oncheckboxclick:1,onradioclick:1}){if(l[g]!=null){this.conf.autoload[g]=l[g]}}l=l.parent}if(l==null){this.base=document.body}else{var c=(typeof(l)=="string"?document.getElementById(l):l);if(c!=null){this.base=c;if(!this.base.id){this.base.id=(new Date()).valueOf()}this.base.className+=" dhtmlxMenu_"+this.conf.skin+"_Middle dir_left";this.base._autoSkinUpdate=true;if(this.base.oncontextmenu){this.base._oldContextMenuHandler=this.base.oncontextmenu}this.conf.ctx_baseid=this.base.id;this.base.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.oncontextmenu=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false}}else{this.base=document.body}}this.idPrefix="";this.topId="dhxWebMenuTopId";this.idPull={};this.itemPull={};this.userData={};this.radio={};this.setSkin=function(o){var q=this.conf.skin;this.conf.skin=o;switch(this.conf.skin){case"dhx_skyblue":case"dhx_web":this.conf.tl_botmarg=2;this.conf.tl_rmarg=1;this.conf.tl_ofsleft=1;break;case"dhx_terrace":this.conf.tl_botmarg=0;this.conf.tl_rmarg=0;this.conf.tl_ofsleft=0;break}if(this.base._autoSkinUpdate){this.base.className=this.base.className.replace("dhtmlxMenu_"+q+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var n in this.idPull){this.idPull[n].className=String(this.idPull[n].className).replace(q,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(o,n){var a=true;for(var r=0;r<this.conf.selected_sub.length;r++){if((this.conf.selected_sub[r][0]==o)&&(this.conf.selected_sub[r][1]==n)){a=false}}if(a==true){this.conf.selected_sub.push(new Array(o,n))}return a};this._removeSubItemFromSelected=function(r,o){var a=new Array();var n=false;for(var s=0;s<this.conf.selected_sub.length;s++){if((this.conf.selected_sub[s][0]==r)&&(this.conf.selected_sub[s][1]==o)){n=true}else{a[a.length]=this.conf.selected_sub[s]}}if(n==true){this.conf.selected_sub=a}return n};this._getSubItemToDeselectByPolygon=function(r){var a=new Array();for(var s=0;s<this.conf.selected_sub.length;s++){if(this.conf.selected_sub[s][1]==r){a[a.length]=this.conf.selected_sub[s][0];a=a.concat(this._getSubItemToDeselectByPolygon(this.conf.selected_sub[s][0]));var o=true;for(var n=0;n<this.conf.opened_poly.length;n++){if(this.conf.opened_poly[n]==this.conf.selected_sub[s][0]){o=false}}if(o==true){this.conf.opened_poly[this.conf.opened_poly.length]=this.conf.selected_sub[s][0]}this.conf.selected_sub[s][0]=-1;this.conf.selected_sub[s][1]=-1}}return a};this._hidePolygon=function(a){if(this.idPull["polygon_"+a]!=null){if(this.idPull["polygon_"+a]._zId!=null){window.dhx4.zim.clear(this.idPull["polygon_"+a]._zId)}if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._hidePolygonEffect("polygon_"+a)}else{if(this.idPull["polygon_"+a].style.display=="none"){return}this.idPull["polygon_"+a].style.display="none";if(this.idPull["arrowup_"+a]!=null){this.idPull["arrowup_"+a].style.display="none"}if(this.idPull["arrowdown_"+a]!=null){this.idPull["arrowdown_"+a].style.display="none"}this._updateItemComplexState(a,true,false);if(window.dhx4.isIE6&&this.idPull["polygon_"+a+"_ie6cover"]!=null){this.idPull["polygon_"+a+"_ie6cover"].style.display="none"}}a=String(a).replace(this.idPrefix,"");if(a==this.topId){a=null}this.callEvent("onHide",[a]);if(a!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+a,true)}}};this._showPolygon=function(I,o){var N=this._countVisiblePolygonItems(I);if(N==0){return}var J="polygon_"+I;if((this.idPull[J]!=null)&&(this.idPull[I]!=null)){if(this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){if(!this.idPull[I]._mouseOver&&o==this.conf.dir_toplv){return}}if(!this.conf.fixed_pos){this._autoDetectVisibleArea()}var K=0;var M=0;var P=null;var E=null;if(this.idPull[J]._zId==null){this.idPull[J]._zId=window.dhx4.newId()}this.idPull[J]._zInd=window.dhx4.zim.reserve(this.idPull[J]._zId);this.idPull[J].style.visibility="hidden";this.idPull[J].style.left="0px";this.idPull[J].style.top="0px";this.idPull[J].style.display="";this.idPull[J].style.zIndex=this.idPull[J]._zInd;if(this.conf.auto_overflow){if(this.idPull[J].childNodes[1].childNodes[0].offsetHeight>this.conf.v.y1+this.conf.v.y2){var D=Math.floor((this.conf.v.y2-this.conf.v.y1-35)/24);this.conf.overflow_limit=D}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+I]!=null){this._removeUpArrow(String(I).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+I]!=null){this._removeDownArrow(String(I).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit<N){if(this.idPull["arrowup_"+I]==null){this._addUpArrow(String(I).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+I]==null){this._addDownArrow(String(I).replace(this.idPrefix,""))}P=this.idPull["arrowup_"+I];P.style.display="none";E=this.idPull["arrowdown_"+I];E.style.display="none"}if(this.conf.overflow_limit>0){if(this.conf.overflow_limit<N){this.idPull[J].childNodes[1].style.height=24*this.conf.overflow_limit+"px";P.style.width=E.style.width=this.idPull[J].childNodes[1].style.width=this.idPull[J].childNodes[1].childNodes[0].offsetWidth+"px";this.idPull[J].childNodes[1].scrollTop=0;P.style.display="";K=P.offsetHeight;E.style.display="";M=E.offsetHeight}else{this.idPull[J].childNodes[1].style.height="";this.idPull[J].childNodes[1].style.width=""}}if(this.itemPull[I]!=null){var A="polygon_"+this.itemPull[I]["parent"]}else{if(this.conf.context){var A=this.idPull[this.idPrefix+this.topId]}}var a=(this.idPull[I].tagName!=null?window.dhx4.absLeft(this.idPull[I]):this.idPull[I][0]);var O=(this.idPull[I].tagName!=null?window.dhx4.absTop(this.idPull[I]):this.idPull[I][1]);var n=(this.idPull[I].tagName!=null?this.idPull[I].offsetWidth:0);var q=(this.idPull[I].tagName!=null?this.idPull[I].offsetHeight:0);var v=0;var u=0;var C=this.idPull[J].offsetWidth;var L=this.idPull[J].childNodes[1].offsetHeight+K+M;if(o=="bottom"){if(this.conf.rtl){v=a+(n!=null?n:0)-C}else{if(this.conf.align=="right"){v=a+n-C}else{v=a-1+(o==this.conf.dir_toplv?this.conf.tl_rmarg:0)}}u=O-1+q+this.conf.tl_botmarg}if(o=="right"){v=a+n-1;u=O+2}if(o=="left"){v=a-this.idPull[J].offsetWidth+2;u=O+2}if(o=="top"){v=a-1;u=O-L+2}if(this.conf.fixed_pos){var H=65536;var F=65536}else{var H=(this.conf.v.x2!=null?this.conf.v.x2:0);var F=(this.conf.v.y2!=null?this.conf.v.y2:0);if(H==0){if(window.innerWidth){H=window.innerWidth;F=window.innerHeight}else{H=document.body.offsetWidth;F=document.body.scrollHeight}}}if(v+C>H&&!this.conf.rtl){v=a-C+2}if(v<this.conf.v.x1&&this.conf.rtl){v=a+n-2}if(v<0){v=0}if(u+L>F&&this.conf.v.y2!=null){u=Math.max(O+q-L+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==I&&E!=null){u=u-2}if(this.itemPull[I]!=null&&!this.conf.context){if(this.itemPull[I]["parent"]==this.idPrefix+this.topId){u=u-this.base.offsetHeight}}}this.idPull[J].style.left=v+"px";this.idPull[J].style.top=u+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(J)}else{this.idPull[J].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit<N){this.idPull[J].childNodes[1].scrollTop=0;this._checkArrowsState(I)}if(window.dhx4.isIE6){var s=J+"_ie6cover";if(this.idPull[s]==null){var r=document.createElement("IFRAME");r.className="dhtmlxMenu_IE6CoverFix_"+this.conf.skin;r.frameBorder=0;r.setAttribute("src","javascript:false;");document.body.insertBefore(r,document.body.firstChild);this.idPull[s]=r}this.idPull[s].style.left=v+"px";this.idPull[s].style.top=u+"px";this.idPull[s].style.width=this.idPull[J].offsetWidth+"px";this.idPull[s].style.height=this.idPull[J].offsetHeight+"px";this.idPull[s].style.zIndex=this.idPull[J].style.zIndex-1;this.idPull[s].style.display=""}}I=String(I).replace(this.idPrefix,"");if(I==this.topId){I=null}this.callEvent("onShow",[I]);if(I!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+I].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+I,false)}}};this._redistribSubLevelSelection=function(s,r){while(this.conf.opened_poly.length>0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(r);this._removeSubItemFromSelected(-1,-1);for(var n=0;n<a.length;n++){if((this.idPull[a[n]]!=null)&&(a[n]!=s)){if(this.itemPull[a[n]]["state"]=="enabled"){this.idPull[a[n]].className="sub_item"}}}for(var n=0;n<this.conf.opened_poly.length;n++){if(this.conf.opened_poly[n]!=r){this._hidePolygon(this.conf.opened_poly[n])}}if(this.itemPull[s]["state"]=="enabled"){this.idPull[s].className="sub_item_selected";if(this.itemPull[s]["complex"]&&this.conf.dload&&(this.itemPull[s]["loaded"]=="no")){if(this.conf.dload_icon==true){this._updateLoaderIcon(s,true)}this.itemPull[s].loaded="get";var o=s.replace(this.idPrefix,"");this._dhxdataload.onBeforeXLS=function(){var u={params:{}};u.params[this.conf.dload_pid]=o;for(var q in this.conf.dload_params){u.params[q]=this.conf.dload_params[q]}return u};this.loadStruct(this.conf.dload_url)}if(this.itemPull[s]["complex"]||(this.conf.dload&&(this.itemPull[s]["loaded"]=="yes"))){if((this.itemPull[s]["complex"])&&(this.idPull["polygon_"+s]!=null)){this._updateItemComplexState(s,true,true);this._showPolygon(s,this.conf.dir_sublv)}}this._addSubItemToSelected(s,r);this.conf.selected=s}};this._doOnClick=function(n,x,r){this.conf.last_click=n;if(this.itemPull[this.idPrefix+n]["href_link"]!=null&&this.itemPull[this.idPrefix+n].state=="enabled"){var s=document.createElement("FORM");var v=String(this.itemPull[this.idPrefix+n]["href_link"]).split("?");s.action=v[0];if(v[1]!=null){var o=String(v[1]).split("&");for(var a=0;a<o.length;a++){var w=String(o[a]).split("=");var u=document.createElement("INPUT");u.type="hidden";u.name=(w[0]||"");u.value=(w[1]||"");s.appendChild(u)}}if(this.itemPull[this.idPrefix+n]["href_target"]!=null){s.target=this.itemPull[this.idPrefix+n]["href_target"]}s.style.display="none";document.body.appendChild(s);s.submit();if(s!=null){document.body.removeChild(s);s=null}return}if(x.charAt(0)=="c"){return}if(x.charAt(1)=="d"){return}if(x.charAt(2)=="s"){return}if(this.checkEvent("onClick")){this.callEvent("onClick",[n,this.conf.ctx_zoneid,r])}else{if((x.charAt(1)=="d")||(this.conf.mode=="win"&&x.charAt(2)=="t")){return}}if(this.conf.context&&this._isContextMenuVisible()&&this.conf.ctx_autohide){this._hideContextMenu()}else{if(this._clearAndHide){this._clearAndHide()}}};this._doOnTouchMenu=function(a){if(this.conf.is_touched==false){this.conf.is_touched=true;if(this.checkEvent("onTouch")){this.callEvent("onTouch",[a])}}};this._searchMenuNode=function(o,s){var a=new Array();for(var r=0;r<s.length;r++){if(typeof(s[r])=="object"){if(s[r].length==5){if(typeof(s[r][0])!="object"){if((s[r][0].replace(this.idPrefix,"")==o)&&(r==0)){a=s}}}var n=this._searchMenuNode(o,s[r]);if(n.length>0){a=n}}}return a};this._getMenuNodes=function(q){var n=new Array;for(var o in this.itemPull){if(this.itemPull[o]["parent"]==q){n[n.length]=o}}return n};this._genStr=function(a){var n="";var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=0;o<a;o++){n+=r.charAt(Math.round(Math.random()*(r.length-1)))}return n};this.getItemType=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return this.itemPull[a]["type"]};this.forEachItem=function(o){for(var n in this.itemPull){o(String(n).replace(this.idPrefix,""))}};this._clearAndHide=function(){j.conf.selected=-1;j.conf.last_click=-1;while(j.conf.opened_poly.length>0){j.conf.opened_poly.pop()}for(var a=0;a<j.conf.selected_sub.length;a++){var n=j.conf.selected_sub[a][0];if(j.idPull[n]!=null){if(j.itemPull[n]["state"]=="enabled"){if(j.idPull[n].className=="sub_item_selected"){j.idPull[n].className="sub_item"}if(j.idPull[n].className=="dhtmlxMenu_"+j.conf.skin+"_TopLevel_Item_Selected"){if(j.itemPull[n]["cssNormal"]!=null){j.idPull[n].className=j.itemPull[n]["cssNormal"]}else{j.idPull[n].className="dhtmlxMenu_"+j.conf.skin+"_TopLevel_Item_Normal"}}}}j._hidePolygon(n)}j.conf.is_touched=false;if(j.conf.context&&j.conf.ctx_hideall){j._hidePolygon(j.idPrefix+j.topId)}};this._showSubLevelItem=function(n,a){if(document.getElementById("arrow_"+this.idPrefix+n)!=null){document.getElementById("arrow_"+this.idPrefix+n).style.display=(a?"none":"")}if(document.getElementById("image_"+this.idPrefix+n)!=null){document.getElementById("image_"+this.idPrefix+n).style.display=(a?"none":"")}if(document.getElementById(this.idPrefix+n)!=null){document.getElementById(this.idPrefix+n).style.display=(a?"":"none")}};this._hideSubLevelItem=function(a){this._showSubLevelItem(a,true)};this.idPrefix=this._genStr(12)+"_";this._bodyClick=function(a){a=a||event;if(a.button==2||(window.dhx4.isOpera&&a.ctrlKey==true)){return}if(j.conf.context){if(j.conf.ctx_autohide&&(!window.dhx4.isOpera||(j._isContextMenuVisible()&&window.dhx4.isOpera))){j._hideContextMenu()}}else{if(j._clearAndHide){j._clearAndHide()}}};this._bodyContext=function(o){o=o||event;var n=String((o.srcElement||o.target).className);if(n.search("dhtmlxMenu")!=-1&&n.search("SubLevelArea")!=-1){return}var a=true;var q=o.target||o.srcElement;while(q!=null){if(q.id!=null){if(j.isContextZone(q.id)){a=false}}if(q==document.body){a=false}q=q.parentNode}if(a){j.hideContextMenu()}};if(typeof(window.addEventListener)!="undefined"){window.addEventListener("click",this._bodyClick,false);window.addEventListener("contextmenu",this._bodyContext,false)}else{document.body.attachEvent("onclick",this._bodyClick);document.body.attachEvent("oncontextmenu",this._bodyContext)}this.unload=function(){window.dhx4._eventable(this,"clear");dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]=null;try{delete dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]}catch(o){}this.conf.live_id=null;if(typeof(window.addEventListener)=="function"){window.removeEventListener("click",this._bodyClick,false);window.removeEventListener("contextmenu",this._bodyContext,false)}else{document.body.detachEvent("onclick",this._bodyClick);document.body.detachEvent("oncontextmenu",this._bodyContext)}this._bodyClick=null;this._bodyContext=null;this.removeItem(this.idPrefix+this.topId,true);this.itemPull=null;this.idPull=null;if(this.conf.context){for(var n in this.conf.ctx_zones){this.removeContextZone(n)}}if(this.cont!=null){this.cont.className="";this.cont.parentNode.removeChild(this.cont);this.cont=null}if(this.base!=null){if(!this.conf.context){this.base.className=""}if(!this.conf.context){this.base.oncontextmenu=(this.base._oldContextMenuHandler||null)}this.base.onselectstart=null;this.base=null}for(var n in this){this[n]=null}j=null};dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]=this;window.dhx4._enableDataLoading(this,"_initObj","_xmlToJson",this.conf.tags.root,{struct:true});window.dhx4._eventable(this);if(window.dhx4.s2b(this.conf.autoload.context)==true){this.renderAsContextMenu()}if(this.conf.autoload.dynamic!=null){this.enableDynamicLoading(this.conf.autoload.dynamic,window.dhx4.s2b(this.conf.autoload.dynamic_icon))}else{if(this.conf.autoload.items!=null){this.loadStruct(this.conf.autoload.items,this.conf.autoload.onload)}else{if(this.conf.autoload.json!=null){this.loadStruct(this.conf.autoload.json,this.conf.autoload.onload)}else{if(this.conf.autoload.xml!=null){this.loadStruct(this.conf.autoload.xml,this.conf.autoload.onload)}}}}for(var g in {onclick:1,oncheckboxclick:1,onradioclick:1}){if(this.conf.autoload[g]!=null){if(typeof(this.conf.autoload[g])=="function"){this.attachEvent(g,this.conf.autoload[g])}else{if(typeof(window[this.conf.autoload[g]])=="function"){this.attachEvent(g,window[this.conf.autoload[g]])}}}}if(this.conf.autoload.top_text!=null){this.setTopText(this.conf.autoload.top_text)}if(this.conf.autoload.align!=null){this.setAlign(this.conf.autoload.align)}if(this.conf.autoload.open_mode!=null){this.setOpenMode(this.conf.autoload.open_mode)}if(this.conf.autoload.overflow!=null){this.setOverflowHeight(this.conf.autoload.overflow)}for(var g in this.conf.autoload){this.conf.autoload[g]=null;delete this.conf.autoload[g]}this.conf.autoload=null;return this}dhtmlXMenuObject.prototype._init=function(){if(this._isInited==true){return}if(this.conf.dload){this._dhxdataload.onBeforeXLS=function(){var g={params:{}};for(var c in this.conf.dload_params){g.params[c]=this.conf.dload_params[c]}return g};this.loadStruct(this.conf.dload_url)}else{this._initTopLevelMenu();this._isInited=true}};dhtmlXMenuObject.prototype._countVisiblePolygonItems=function(m){var j=0;for(var c in this.itemPull){var g=this.itemPull[c]["parent"];var l=this.itemPull[c]["type"];if(this.idPull[c]!=null){if(g==m&&(l=="item"||l=="radio"||l=="checkbox")&&this.idPull[c].style.display!="none"){j++}}}return j};dhtmlXMenuObject.prototype._redefineComplexState=function(c){if(this.idPrefix+this.topId==c){return}if((this.idPull["polygon_"+c]!=null)&&(this.idPull[c]!=null)){var a=this._countVisiblePolygonItems(c);if((a>0)&&(!this.itemPull[c]["complex"])){this._updateItemComplexState(c,true,false)}if((a==0)&&(this.itemPull[c]["complex"])){this._updateItemComplexState(c,false,false)}}};dhtmlXMenuObject.prototype._updateItemComplexState=function(l,g,j){if((!this.conf.context)&&(this._getItemLevelType(l.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[l]["complex"]=g;return}if((this.idPull[l]==null)||(this.itemPull[l]==null)){return}this.itemPull[l]["complex"]=g;if(l==this.idPrefix+this.topId){return}var a=null;var c=this.idPull[l].childNodes[this.conf.rtl?0:2];if(c.childNodes[0]){if(String(c.childNodes[0].className).search("complex_arrow")===0){a=c.childNodes[0]}}if(this.itemPull[l]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+l;while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(a)}if(this.conf.dload&&(this.itemPull[l].loaded=="get")&&this.conf.dload_icon){if(a.className!="complex_arrow_loading"){a.className="complex_arrow_loading"}}else{a.className="complex_arrow"}return}if((!this.itemPull[l]["complex"])&&(a!=null)){c.removeChild(a);if(this.itemPull[l]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(l.replace(this.idPrefix,""),this.itemPull[l]["hotkey_backup"])}}};dhtmlXMenuObject.prototype._getItemLevelType=function(a){return(this.itemPull[this.idPrefix+a]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea")};dhtmlXMenuObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXMenuObject.prototype._updateItemImage=function(g,j){g=this.idPrefix+g;var o=this.itemPull[g]["type"];if(o=="checkbox"||o=="radio"){return}var l=(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var m=null;if(l){for(var a=0;a<this.idPull[g].childNodes.length;a++){try{if(this.idPull[g].childNodes[a].className=="dhtmlxMenu_TopLevel_Item_Icon"){m=this.idPull[g].childNodes[a]}}catch(n){}}}else{try{var m=this.idPull[g].childNodes[this.conf.rtl?2:0].childNodes[0]}catch(n){}if(!(m!=null&&typeof(m.className)!="undefined"&&m.className=="sub_icon")){m=null}}var s=this.itemPull[g][(this.itemPull[g]["state"]=="enabled"?"imgen":"imgdis")];if(s.length>0){if(m!=null){m.src=this.conf.icons_path+s}else{if(l){var m=document.createElement("IMG");m.className="dhtmlxMenu_TopLevel_Item_Icon";m.src=this.conf.icons_path+s;m.border="0";m.id="image_"+g;if(!this.conf.rtl&&this.idPull[g].childNodes.length>0){this.idPull[g].insertBefore(m,this.idPull[g].childNodes[0])}else{this.idPull[g].appendChild(m)}}else{var m=document.createElement("IMG");m.className="sub_icon";m.src=this.conf.icons_path+s;m.border="0";m.id="image_"+g;var r=this.idPull[g].childNodes[this.conf.rtl?2:0];while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}r.appendChild(m)}}}else{if(m!=null){var c=m.parentNode;c.removeChild(m);c.innerHTML="&nbsp;";c=m=null}}};dhtmlXMenuObject.prototype._getAllParents=function(m){var g=new Array();for(var c in this.itemPull){if(this.itemPull[c]["parent"]==m){g[g.length]=this.itemPull[c]["id"];if(this.itemPull[c]["complex"]){var j=this._getAllParents(this.itemPull[c]["id"]);for(var l=0;l<j.length;l++){g[g.length]=j[l]}}}}return g};dhtmlXMenuObject.prototype._autoDetectVisibleArea=function(){if(this.conf.v_enabled){return}var a=window.dhx4.screenDim();this.conf.v.x1=a.left;this.conf.v.x2=a.right;this.conf.v.y1=a.top;this.conf.v.y2=a.bottom};dhtmlXMenuObject.prototype.getItemPosition=function(l){l=this.idPrefix+l;var j=-1;if(this.itemPull[l]==null){return j}var a=this.itemPull[l]["parent"];var g=(this.idPull["polygon_"+a]!=null?this.idPull["polygon_"+a].tbd:this.cont);for(var c=0;c<g.childNodes.length;c++){if(g.childNodes[c]==this.idPull["separator_"+l]||g.childNodes[c]==this.idPull[l]){j=c}}return j};dhtmlXMenuObject.prototype.setItemPosition=function(n,m){n=this.idPrefix+n;if(this.idPull[n]==null){return}var c=(this.itemPull[n]["parent"]==this.idPrefix+this.topId);var a=this.idPull[n];var j=this.getItemPosition(n.replace(this.idPrefix,""));var g=this.itemPull[n]["parent"];var l=(this.idPull["polygon_"+g]!=null?this.idPull["polygon_"+g].tbd:this.cont);l.removeChild(l.childNodes[j]);if(m<0){m=0}if(c&&m<1){m=1}if(m<l.childNodes.length){l.insertBefore(a,l.childNodes[m])}else{l.appendChild(a)}};dhtmlXMenuObject.prototype.getParentId=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return((this.itemPull[a]["parent"]!=null?this.itemPull[a]["parent"]:this.topId).replace(this.idPrefix,""))};dhtmlXMenuObject.prototype.hide=function(){this._clearAndHide()};dhtmlXMenuObject.prototype.clearAll=function(){this.removeItem(this.idPrefix+this.topId,true);this._isInited=false;this.idPrefix=this._genStr(12)+"_";this.itemPull={}};if(typeof(dhtmlXMenuObject.prototype.liveInst)=="undefined"){dhtmlXMenuObject.prototype.liveInst={}}dhtmlXMenuObject.prototype._redistribTopLevelSelection=function(j,c){var a=this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1,-1);for(var g=0;g<a.length;g++){if(a[g]!=j){this._hidePolygon(a[g])}if((this.idPull[a[g]]!=null)&&(a[g]!=j)){this.idPull[a[g]].className=this.idPull[a[g]].className.replace(/Selected/g,"Normal")}}if(this.itemPull[this.idPrefix+j]["state"]=="enabled"){this.idPull[this.idPrefix+j].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+j,"parent");this.conf.selected=(this.conf.mode=="win"?(this.conf.selected!=-1?j:this.conf.selected):j);if((this.itemPull[this.idPrefix+j]["complex"])&&(this.conf.selected!=-1)){this._showPolygon(this.idPrefix+j,this.conf.dir_toplv)}}};dhtmlXMenuObject.prototype._initTopLevelMenu=function(){this.conf.dir_toplv="bottom";this.conf.dir_sublv=(this.conf.rtl?"left":"right");if(this.conf.context){this.idPull[this.idPrefix+this.topId]=new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId,this.idPrefix+this.topId)}else{var a=this._getMenuNodes(this.idPrefix+this.topId);for(var c=0;c<a.length;c++){if(this.itemPull[a[c]]["type"]=="item"){this._renderToplevelItem(a[c],null)}if(this.itemPull[a[c]]["type"]=="separator"){this._renderSeparator(a[c],null)}}}};dhtmlXMenuObject.prototype._renderToplevelItem=function(o,n){var l=this;var a=document.createElement("DIV");a.id=o;if(this.itemPull[o]["state"]=="enabled"&&this.itemPull[o]["cssNormal"]!=null){a.className=this.itemPull[o]["cssNormal"]}else{a.className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[o]["state"]=="enabled"?"Normal":"Disabled")}if(this.itemPull[o]["title"]!=""){var j=document.createElement("DIV");j.className="top_level_text";j.innerHTML=this.itemPull[o]["title"];a.appendChild(j)}if(this.itemPull[o]["tip"].length>0){a.title=this.itemPull[o]["tip"]}if((this.itemPull[o]["imgen"]!="")||(this.itemPull[o]["imgdis"]!="")){var g=this.itemPull[o][(this.itemPull[o]["state"]=="enabled")?"imgen":"imgdis"];if(g){var c=document.createElement("IMG");c.border="0";c.id="image_"+o;c.src=this.conf.icons_path+g;c.className="dhtmlxMenu_TopLevel_Item_Icon";if(a.childNodes.length>0&&!this.conf.rtl){a.insertBefore(c,a.childNodes[0])}else{a.appendChild(c)}}}a.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};a.oncontextmenu=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};if(!this.cont){this.cont=document.createElement("DIV");this.cont.dir="ltr";this.cont.className=(this.conf.align=="right"?"align_right":"align_left");this.base.appendChild(this.cont)}if(n!=null){n++;if(n<0){n=0}if(n>this.cont.childNodes.length-1){n=null}}if(n!=null){this.cont.insertBefore(a,this.cont.childNodes[n])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[o]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[o]["id"],this.itemPull[o]["id"])}a.onmouseover=function(){if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler)}var m=l._getSubItemToDeselectByPolygon("parent");l._removeSubItemFromSelected(-1,-1);for(var s=0;s<m.length;s++){if(m[s]!=this.id){l._hidePolygon(m[s])}if((l.idPull[m[s]]!=null)&&(m[s]!=this.id)){if(l.itemPull[m[s]]["cssNormal"]!=null){l.idPull[m[s]].className=l.itemPull[m[s]]["cssNormal"]}else{if(l.idPull[m[s]].className=="sub_item_selected"){l.idPull[m[s]].className="sub_item"}l.idPull[m[s]].className=l.idPull[m[s]].className.replace(/Selected/g,"Normal")}}}if(l.itemPull[this.id]["state"]=="enabled"){this.className="dhtmlxMenu_"+l.conf.skin+"_TopLevel_Item_Selected";l._addSubItemToSelected(this.id,"parent");l.conf.selected=(l.conf.mode=="win"?(l.conf.selected!=-1?this.id:l.conf.selected):this.id);if(l.conf.dload){if(l.itemPull[this.id].loaded=="no"){this._dynLoadTM=new Date().getTime();l.itemPull[this.id].loaded="get";var u=this.id.replace(l.idPrefix,"");l._dhxdataload.onBeforeXLS=function(){var v={params:{}};v.params[this.conf.dload_pid]=u;for(var q in this.conf.dload_params){v.params[q]=this.conf.dload_params[q]}return v};l.loadStruct(l.conf.dload_url)}if(l.conf.top_mode&&l.conf.mode=="web"&&!l.conf.context){this._mouseOver=true}}if((!l.conf.dload)||(l.conf.dload&&(!l.itemPull[this.id]["loaded"]||l.itemPull[this.id]["loaded"]=="yes"))){if((l.itemPull[this.id]["complex"])&&(l.conf.selected!=-1)){if(l.conf.top_mode&&l.conf.mode=="web"&&!l.conf.context){this._mouseOver=true;var r=this.id;this._menuOpenTM=window.setTimeout(function(){l._showPolygon(r,l.conf.dir_toplv)},l.conf.top_tmtime)}else{l._showPolygon(this.id,l.conf.dir_toplv)}}}}l._doOnTouchMenu(this.id.replace(l.idPrefix,""))};a.onmouseout=function(){if(!((l.itemPull[this.id]["complex"])&&(l.conf.selected!=-1))&&(l.itemPull[this.id]["state"]=="enabled")){if(l.itemPull[this.id]["cssNormal"]!=null){a.className=l.itemPull[this.id]["cssNormal"]}else{a.className="dhtmlxMenu_"+l.conf.skin+"_TopLevel_Item_Normal"}}if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler);l.conf.tm_handler=window.setTimeout(function(){l._clearAndHide()},l.conf.tm_sec,"JavaScript")}if(l.conf.top_mode&&l.conf.mode=="web"&&!l.conf.context){this._mouseOver=false;window.clearTimeout(this._menuOpenTM)}};a.onclick=function(u){if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler)}if(l.conf.mode!="web"&&l.itemPull[this.id]["state"]=="disabled"){return}u=u||event;u.cancelBubble=true;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}if(l.conf.mode=="win"){if(l.itemPull[this.id]["complex"]){if(l.conf.selected==this.id){l.conf.selected=-1;var r=false}else{l.conf.selected=this.id;var r=true}if(r){l._showPolygon(this.id,l.conf.dir_toplv)}else{l._hidePolygon(this.id)}}}var m=(l.itemPull[this.id]["complex"]?"c":"-");var v=(l.itemPull[this.id]["state"]!="enabled"?"d":"-");var q={ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey};l._doOnClick(this.id.replace(l.idPrefix,""),m+v+"t",q);return false};if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addSubMenuPolygon=function(n,m){var c=this._renderSublevelPolygon(n,m);var a=this._getMenuNodes(m);for(g=0;g<a.length;g++){if(this.itemPull[a[g]]["type"]=="separator"){this._renderSeparator(a[g],null)}else{this._renderSublevelItem(a[g],null)}}if(n==m){var l="topLevel"}else{var l="subLevel"}for(var g=0;g<a.length;g++){if(this.itemPull[a[g]]["complex"]){this._addSubMenuPolygon(n,this.itemPull[a[g]]["id"])}}};dhtmlXMenuObject.prototype._renderSublevelPolygon=function(l,j){var c=document.createElement("DIV");c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Polygon "+(this.conf.rtl?"dir_right":"");c.dir="ltr";c.oncontextmenu=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}m.cancelBubble=true;return false};c.id="polygon_"+j;c.onclick=function(m){m=m||event;m.cancelBubble=true};c.style.display="none";document.body.insertBefore(c,document.body.firstChild);c.innerHTML='<div style="position:relative;"></div><div style="position: relative; overflow:hidden;"></div><div style="position:relative;"></div>';var g=document.createElement("TABLE");g.className="dhtmlxMebu_SubLevelArea_Tbl";g.cellSpacing=0;g.cellPadding=0;g.border=0;var a=document.createElement("TBODY");g.appendChild(a);c.childNodes[1].appendChild(g);c.tbl=g;c.tbd=a;this.idPull[c.id]=c;if(this.sxDacProc!=null){this.idPull["sxDac_"+j]=new this.sxDacProc(c,c.className);if(window.dhx4.isIE){this.idPull["sxDac_"+j]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+j]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+j]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+j]._setCustomCycle(this.dacCycles)}}return c};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,r){var o=this;var q=document.createElement("TR");q.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var n=document.createElement("TD");n.className="sub_item_icon";var s=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(s!=""){var w=this.itemPull[a]["type"];if(w=="checkbox"||w=="radio"){var l=document.createElement("DIV");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon "+s;n.appendChild(l)}if(!(w=="checkbox"||w=="radio")){var l=document.createElement("IMG");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon";l.src=this.conf.icons_path+s;n.appendChild(l)}}else{n.innerHTML="&nbsp;"}var m=document.createElement("TD");m.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var v=document.createElement("DIV");v.className="sub_item_text";v.innerHTML=this.itemPull[a]["title"];m.appendChild(v)}else{m.innerHTML="&nbsp;"}var j=document.createElement("TD");j.className="sub_item_hk";if(this.itemPull[a]["complex"]){var c=document.createElement("DIV");c.className="complex_arrow";c.id="arrow_"+this.itemPull[a]["id"];j.appendChild(c)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var g=document.createElement("DIV");g.className="sub_item_hk";g.innerHTML=this.itemPull[a]["hotkey"];j.appendChild(g)}else{j.innerHTML="&nbsp;"}}q.appendChild(this.conf.rtl?j:n);q.appendChild(m);q.appendChild(this.conf.rtl?n:j);q.id=this.itemPull[a]["id"];q.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){q.title=this.itemPull[a]["tip"]}q.onselectstart=function(x){x=x||event;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}return false};q.onmouseover=function(x){if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}if(o.conf.mode=="web"){window.clearTimeout(o.conf.tm_handler)}if(!this._visible){o._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};q.onmouseout=function(){if(o.conf.mode=="web"){if(o.conf.tm_handler){window.clearTimeout(o.conf.tm_handler)}o.conf.tm_handler=window.setTimeout(function(){if(o&&o._clearAndHide){o._clearAndHide()}},o.conf.tm_sec,"JavaScript")}var x=this;if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}o.conf.hide_tm[this.id]=window.setTimeout(function(){x._visible=false},50)};q.onclick=function(y){if(!o.checkEvent("onClick")&&o.itemPull[this.id]["complex"]){return}y=y||event;y.cancelBubble=true;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}tc=(o.itemPull[this.id]["complex"]?"c":"-");td=(o.itemPull[this.id]["state"]=="enabled"?"-":"d");var x={ctrl:y.ctrlKey,alt:y.altKey,shift:y.shiftKey};switch(o.itemPull[this.id]["type"]){case"checkbox":o._checkboxOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"radio":o._radioOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"item":o._doOnClick(this.id.replace(o.idPrefix,""),tc+td+"n",x);break}return false};var u=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(r!=null){r++;if(r<0){r=0}if(r>u.tbd.childNodes.length-1){r=null}}if(r!=null&&u.tbd.childNodes[r]!=null){u.tbd.insertBefore(q,u.tbd.childNodes[r])}else{u.tbd.appendChild(q)}this.idPull[q.id]=q};dhtmlXMenuObject.prototype._renderSeparator=function(c,n){var a=(this.conf.context?"SubLevelArea":(this.itemPull[c]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var l=this;if(a!="TopLevel"){var m=document.createElement("TR");m.className="sub_sep";var g=document.createElement("TD");g.colSpan="3";m.appendChild(g)}var j=document.createElement("DIV");j.id="separator_"+c;j.className=(a=="TopLevel"?"top_sep":"sub_sep");j.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}};j.onclick=function(s){s=s||event;s.cancelBubble=true;var r={ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey};l._doOnClick(this.id.replace("separator_"+l.idPrefix,""),"--s",r)};if(a=="TopLevel"){if(n!=null){n++;if(n<0){n=0}if(this.cont.childNodes[n]!=null){this.cont.insertBefore(j,this.cont.childNodes[n])}else{this.cont.appendChild(j)}}else{var q=this.cont.childNodes[this.cont.childNodes.length-1];if(String(q).search("TopLevel_Text")==-1){this.cont.appendChild(j)}else{this.cont.insertBefore(j,q)}}this.idPull[j.id]=j}else{var o=this.idPull["polygon_"+this.itemPull[c]["parent"]];if(n!=null){n++;if(n<0){n=0}if(n>o.tbd.childNodes.length-1){n=null}}if(n!=null&&o.tbd.childNodes[n]!=null){o.tbd.insertBefore(m,o.tbd.childNodes[n])}else{o.tbd.appendChild(m)}g.appendChild(j);this.idPull[j.id]=m}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,c){c=this.idPrefix+(c!=null?c:this._genStr(24));var g=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(c,g,"","separator",false,"","");this._renderSeparator(c,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(u,v,n){if(!(u instanceof Array)){n=u.parentId;if(n!=null&&String(n).indexOf(this.idPrefix)!==0){n=this.idPrefix+String(n)}u=u.items}for(var g=0;g<u.length;g++){if(typeof(u[g].id)=="undefined"||u[g].id==null){u[g].id=this._genStr(24)}if(u[g].text==null){u[g].text=""}if(String(u[g].id).indexOf(this.idPrefix)!==0){u[g].id=this.idPrefix+String(u[g].id)}var j={type:"item",tip:"",hotkey:"",state:"enabled",imgen:"",imgdis:""};for(var w in j){if(typeof(u[g][w])=="undefined"){u[g][w]=j[w]}}if(u[g].imgen==""&&u[g].img!=null){u[g].imgen=u[g].img}if(u[g].imgdis==""&&u[g].img_disabled!=null){u[g].imgdis=u[g].img_disabled}if(u[g].title==null&&u[g].text!=null){u[g].title=u[g].text}if(u[g].href!=null){if(u[g].href.link!=null){u[g].href_link=u[g].href.link}if(u[g].href.target!=null){u[g].href_target=u[g].href.target}}if(u[g].userdata!=null){for(var w in u[g].userdata){this.userData[u[g].id+"_"+w]=u[g].userdata[w]}}if(typeof(u[g].enabled)!="undefined"&&window.dhx4.s2b(u[g].enabled)==false){u[g].state="disabled"}else{if(typeof(u[g].disabled)!="undefined"&&window.dhx4.s2b(u[g].disabled)==true){u[g].state="disabled"}}if(typeof(u[g].parent)=="undefined"){u[g].parent=(n!=null?n:this.idPrefix+this.topId)}if(u[g].type=="checkbox"){u[g].checked=window.dhx4.s2b(u[g].checked);u[g].imgen=u[g].imgdis="chbx_"+(u[g].checked?"1":"0")}if(u[g].type=="radio"){u[g].checked=window.dhx4.s2b(u[g].checked);u[g].imgen=u[g].imgdis="rdbt_"+(u[g].checked?"1":"0");if(typeof(u[g].group)=="undefined"||u[g].group==null){u[g].group=this._genStr(24)}if(this.radio[u[g].group]==null){this.radio[u[g].group]=[]}this.radio[u[g].group].push(u[g].id)}this.itemPull[u[g].id]=u[g];if(u[g].items!=null&&u[g].items.length>0){this.itemPull[u[g].id].complex=true;this._initObj(u[g].items,true,u[g].id)}else{if(this.conf.dload&&u[g].complex==true){this.itemPull[u[g].id].loaded="no"}}this.itemPull[u[g].id].items=null}if(v!==true){if(this.conf.dload==true){if(n==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(n,n);if(this.conf.selected==n){var s=(this.itemPull[n].parent==this.idPrefix+this.topId);var c=(s&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var l=false;if(s&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var x=this.idPull[n];if(x._mouseOver==true){var m=this.conf.top_tmtime-(new Date().getTime()-x._dynLoadTM);if(m>1){var r=n;var o=this;x._menuOpenTM=window.setTimeout(function(){o._showPolygon(r,c);o=r=null},m);l=true}}}if(!l){this._showPolygon(n,c)}}this.itemPull[n].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(n,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(l,j){var n=[];if(j==null){var o=l.getElementsByTagName(this.conf.tags.root);if(o==null||(o!=null&&o.length==0)){return{items:[]}}o=o[0]}else{o=l}if(o.getAttribute("parentId")!=null){j=this.idPrefix+o.getAttribute("parentId")}for(var c=0;c<o.childNodes.length;c++){if(typeof(o.childNodes[c].tagName)!="undefined"&&String(o.childNodes[c].tagName).toLowerCase()==this.conf.tags.item){var a=o.childNodes[c];var v={id:this.idPrefix+(a.getAttribute("id")||this._genStr(24)),title:a.getAttribute("text")||"",imgen:a.getAttribute("img")||"",imgdis:a.getAttribute("imgdis")||"",tip:"",hotkey:"",type:a.getAttribute("type")||"item"};if(a.getAttribute("cssNormal")!=null){v.cssNormal=a.getAttribute("cssNormal")}if(v.type=="checkbox"){v.checked=a.getAttribute("checked")}if(v.type=="radio"){v.checked=a.getAttribute("checked");v.group=a.getAttribute("group")}v.state="enabled";if(a.getAttribute("enabled")!=null&&window.dhx4.s2b(a.getAttribute("enabled"))==false){v.state="disabled"}else{if(a.getAttribute("disabled")!=null&&window.dhx4.s2b(a.getAttribute("disabled"))==true){v.state="disabled"}}v.parent=(j!=null?j:this.idPrefix+this.topId);if(this.conf.dload){v.complex=(a.getAttribute("complex")!=null);if(v.complex){v.loaded="no"}}else{var g=this._xmlToJson(a,v.id);v.items=g.items;v.complex=(v.items.length>0)}for(var s=0;s<a.childNodes.length;s++){if(typeof(a.childNodes[s].tagName)!="undefined"){var u=String(a.childNodes[s].tagName||"").toLowerCase();if(u==this.conf.tags.userdata){var m=a.childNodes[s];if(m.getAttribute("name")!=null){this.userData[v.id+"_"+m.getAttribute("name")]=(m.firstChild!=null&&m.firstChild.nodeValue!=null?m.firstChild.nodeValue:"")}}if(u==this.conf.tags.text_ext){v.title=a.childNodes[s].firstChild.nodeValue}if(u==this.conf.tags.tooltip){v.tip=a.childNodes[s].firstChild.nodeValue}if(u==this.conf.tags.hotkey){v.hotkey=a.childNodes[s].firstChild.nodeValue}if(u==this.conf.tags.href&&v.type=="item"){v.href_link=a.childNodes[s].firstChild.nodeValue;if(a.childNodes[s].getAttribute("target")!=null){v.href_target=a.childNodes[s].getAttribute("target")}}}}n.push(v)}}var a={parentId:j,items:n};return a};dhtmlXMenuObject.prototype.enableDynamicLoading=function(a,c){this.conf.dload=true;this.conf.dload_url=a;this.conf.dload_sign=(String(this.conf.dload_url).search(/\?/)==-1?"?":"&");this.conf.dload_icon=c;this._init()};dhtmlXMenuObject.prototype._updateLoaderIcon=function(j,g){if(this.idPull[j]==null){return}if(String(this.idPull[j].className).search("TopLevel_Item")>=0){return}var c=(this.conf.rtl?0:2);if(!this.idPull[j].childNodes[c]){return}if(!this.idPull[j].childNodes[c].childNodes[0]){return}var a=this.idPull[j].childNodes[c].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(g?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(j,l,a,c,g,o){var n=this.idPrefix+(l!=null?l:this._genStr(24));var m=this.idPrefix+(j!=null?this.getParentId(j):this.topId);this._addItemIntoGlobalStrorage(n,m,a,"item",c,g,o);if((m==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(n,this.getItemPosition(j))}else{this._renderSublevelItem(n,this.getItemPosition(j))}};dhtmlXMenuObject.prototype.addNewChild=function(n,m,j,a,c,g,l){if(n==null){if(this.conf.context){n=this.topId}else{this.addNewSibling(n,j,a,c,g,l);if(m!=null){this.setItemPosition(j,m)}return}}j=this.idPrefix+(j!=null?j:this._genStr(24));if(this.setHotKey){this.setHotKey(n,"")}n=this.idPrefix+n;this._addItemIntoGlobalStrorage(j,n,a,"item",c,g,l);if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(j,m-1);this._redefineComplexState(n)};dhtmlXMenuObject.prototype.removeItem=function(j,m,l){if(!m){j=this.idPrefix+j}var n=null;if(j!=this.idPrefix+this.topId){if(this.itemPull[j]==null){return}if(this.idPull["polygon_"+j]&&this.idPull["polygon_"+j]._tmShow){window.clearTimeout(this.idPull["polygon_"+j]._tmShow)}var v=this.itemPull[j]["type"];if(v=="separator"){var u=this.idPull["separator_"+j];if(this.itemPull[j]["parent"]==this.idPrefix+this.topId){u.onclick=null;u.onselectstart=null;u.id=null;u.parentNode.removeChild(u)}else{u.childNodes[0].childNodes[0].onclick=null;u.childNodes[0].childNodes[0].onselectstart=null;u.childNodes[0].childNodes[0].id=null;u.childNodes[0].removeChild(u.childNodes[0].childNodes[0]);u.removeChild(u.childNodes[0]);u.parentNode.removeChild(u)}this.idPull["separator_"+j]=null;this.itemPull[j]=null;delete this.idPull["separator_"+j];delete this.itemPull[j];u=null}else{n=this.itemPull[j]["parent"];var u=this.idPull[j];u.onclick=null;u.oncontextmenu=null;u.onmouseover=null;u.onmouseout=null;u.onselectstart=null;u.id=null;while(u.childNodes.length>0){u.removeChild(u.childNodes[0])}u.parentNode.removeChild(u);this.idPull[j]=null;this.itemPull[j]=null;delete this.idPull[j];delete this.itemPull[j];u=null}v=null}for(var r in this.itemPull){if(this.itemPull[r]["parent"]==j){this.removeItem(r,true,true)}}var s=new Array(j);if(n!=null&&!l){if(this.idPull["polygon_"+n]!=null){if(this.idPull["polygon_"+n].tbd.childNodes.length==0){s.push(n);this._updateItemComplexState(n,false,false)}}}for(var c=0;c<s.length;c++){if(this.idPull["polygon_"+s[c]]){var g=this.idPull["polygon_"+s[c]];g.onclick=null;g.oncontextmenu=null;g.tbl.removeChild(g.tbd);g.tbd=null;g.childNodes[1].removeChild(g.tbl);g.tbl=null;g.id=null;g.parentNode.removeChild(g);g=null;if(window.dhx4.isIE6){var o="polygon_"+s[c]+"_ie6cover";if(this.idPull[o]!=null){document.body.removeChild(this.idPull[o]);delete this.idPull[o]}}if(this.idPull["arrowup_"+j]!=null&&this._removeArrow){this._removeArrow("arrowup_"+j)}if(this.idPull["arrowdown_"+j]!=null&&this._removeArrow){this._removeArrow("arrowdown_"+j)}this.idPull["polygon_"+s[c]]=null;delete this.idPull["polygon_"+s[c]]}}s=null;if(this.conf.skin=="dhx_terrace"&&arguments.length==1){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage=function(o,a,g,n,j,c,m){var l={id:o,title:g,imgen:(c!=null?c:""),imgdis:(m!=null?m:""),type:n,state:(j==true?"disabled":"enabled"),parent:a,complex:false,hotkey:"",tip:""};this.itemPull[l.id]=l};dhtmlXMenuObject.prototype.renderAsContextMenu=function(){this.conf.context=true;if(this.base._autoSkinUpdate==true){this.base.className=this.base.className.replace("dhtmlxMenu_"+this.conf.skin+"_Middle","");this.base._autoSkinUpdate=false}if(this.conf.ctx_baseid!=null){this.addContextZone(this.conf.ctx_baseid)}};dhtmlXMenuObject.prototype.addContextZone=function(c){if(c==document.body){c="document.body."+this.idPrefix;var j=document.body}else{if(typeof(c)=="string"){var j=document.getElementById(c)}else{var j=c}}var m=false;for(var g in this.conf.ctx_zones){m=m||(g==c)||(this.conf.ctx_zones[g]==j)}if(m==true){return false}this.conf.ctx_zones[c]=j;var l=this;if(window.dhx4.isOpera){this.operaContext=function(a){l._doOnContextMenuOpera(a,l)};j.addEventListener("mouseup",this.operaContext,false)}else{if(j.oncontextmenu!=null&&!j._oldContextMenuHandler){j._oldContextMenuHandler=j.oncontextmenu}j.oncontextmenu=function(n){for(var a in dhtmlXMenuObject.prototype.liveInst){if(a!=l.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[a].context){dhtmlXMenuObject.prototype.liveInst[a]._hideContextMenu()}}}n=n||event;n.cancelBubble=true;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}l._doOnContextBeforeCall(n,this);return false}}};dhtmlXMenuObject.prototype._doOnContextMenuOpera=function(g,a){for(var c in dhtmlXMenuObject.prototype.liveInst){if(c!=a.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[c].context){dhtmlXMenuObject.prototype.liveInst[c]._hideContextMenu()}}}g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}if(g.button==0&&g.ctrlKey==true){a._doOnContextBeforeCall(g,this)}return false};dhtmlXMenuObject.prototype.removeContextZone=function(a){if(!this.isContextZone(a)){return false}if(a==document.body){a="document.body."+this.idPrefix}var c=this.conf.ctx_zones[a];if(window.dhx4.isOpera){c.removeEventListener("mouseup",this.operaContext,false)}else{c.oncontextmenu=(c._oldContextMenuHandler!=null?c._oldContextMenuHandler:null);c._oldContextMenuHandler=null}try{this.conf.ctx_zones[a]=null;delete this.conf.ctx_zones[a]}catch(g){}return true};dhtmlXMenuObject.prototype.isContextZone=function(a){if(a==document.body&&this.conf.ctx_zones["document.body."+this.idPrefix]!=null){return true}var c=false;if(this.conf.ctx_zones[a]!=null){if(this.conf.ctx_zones[a]==document.getElementById(a)){c=true}}return c};dhtmlXMenuObject.prototype._isContextMenuVisible=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}return(this.idPull["polygon_"+this.idPrefix+this.topId].style.display=="")};dhtmlXMenuObject.prototype._showContextMenu=function(c,g,a){this._clearAndHide();if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}window.clearTimeout(this.conf.tm_handler);this.idPull[this.idPrefix+this.topId]=new Array(c,g);this._showPolygon(this.idPrefix+this.topId,"bottom");this.callEvent("onContextMenu",[a])};dhtmlXMenuObject.prototype._hideContextMenu=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}this._clearAndHide();this._hidePolygon(this.idPrefix+this.topId)};dhtmlXMenuObject.prototype._doOnContextBeforeCall=function(l,n){this.conf.ctx_zoneid=n.id;this._clearAndHide();this._hideContextMenu();var j=(l.srcElement||l.target);var c=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML?l.offsetX:l.layerX);var a=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML?l.offsetY:l.layerY);var m=window.dhx4.absLeft(j)+c;var g=window.dhx4.absTop(j)+a;if(this.checkEvent("onBeforeContextMenu")){if(this.callEvent("onBeforeContextMenu",[n.id,l])){if(this.conf.ctx_autoshow){this._showContextMenu(m,g,n.id);this.callEvent("onAfterContextMenu",[n.id,l])}}}else{if(this.conf.ctx_autoshow){this._showContextMenu(m,g,n.id);this.callEvent("onAfterContextMenu",[n.id])}}};dhtmlXMenuObject.prototype.showContextMenu=function(a,c){this._showContextMenu(a,c,false)};dhtmlXMenuObject.prototype.hideContextMenu=function(){this._hideContextMenu()};dhtmlXMenuObject.prototype.setAutoShowMode=function(a){this.conf.ctx_autoshow=(a==true?true:false)};dhtmlXMenuObject.prototype.setAutoHideMode=function(a){this.conf.ctx_autohide=(a==true?true:false)};dhtmlXMenuObject.prototype.setContextMenuHideAllMode=function(a){this.conf.ctx_hideall=(a==true?true:false)};dhtmlXMenuObject.prototype.getContextMenuHideAllMode=function(){return this.conf.ctx_hideall};dhtmlXMenuObject.prototype._improveTerraceSkin=function(){for(var g in this.itemPull){if(this.itemPull[g].parent==this.idPrefix+this.topId&&this.idPull[g]!=null){var l=false;var j=false;if(this.idPull[g].parentNode.firstChild==this.idPull[g]){l=true}if(this.idPull[g].parentNode.lastChild==this.idPull[g]){j=true}for(var c in this.itemPull){if(this.itemPull[c].type=="separator"&&this.itemPull[c].parent==this.idPrefix+this.topId){if(this.idPull[g].nextSibling==this.idPull["separator_"+c]){j=true}if(this.idPull[g].previousSibling==this.idPull["separator_"+c]){l=true}}}this.idPull[g].style.borderLeftWidth=(l?"1px":"0px");this.idPull[g].style.borderTopLeftRadius=this.idPull[g].style.borderBottomLeftRadius=(l?"3px":"0px");this.idPull[g].style.borderTopRightRadius=this.idPull[g].style.borderBottomRightRadius=(j?"3px":"0px");this.idPull[g]._bl=l;this.idPull[g]._br=j}}};dhtmlXMenuObject.prototype._improveTerraceButton=function(c,a){if(a){this.idPull[c].style.borderBottomLeftRadius=(this.idPull[c]._bl?"3px":"0px");this.idPull[c].style.borderBottomRightRadius=(this.idPull[c]._br?"3px":"0px")}else{this.idPull[c].style.borderBottomLeftRadius="0px";this.idPull[c].style.borderBottomRightRadius="0px"}};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_menu=function(l,c,j,a,g){if(typeof(g)!="undefined"){l=g}else{l=document.createElement("DIV");l.className="dhx_cell_menu_"+(this.conf.borders?"def":"no_borders");l.appendChild(document.createElement("DIV"))}this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont]);this.conf.ofs_nodes.t.menu=true;this._updateIdx();return l};dhtmlXCellObject.prototype.attachMenu=function(a){if(this.dataNodes.menu){return}this.callEvent("_onBeforeContentAttach",["menu"]);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("menu").firstChild;this.dataNodes.menu=new dhtmlXMenuObject(a);this._adjustCont(this._idd);a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataNodes.menu};dhtmlXCellObject.prototype.detachMenu=function(){if(!this.dataNodes.menu){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;delete this.dataNodes.menu;this._detachObject("menu")};dhtmlXCellObject.prototype.showMenu=function(){this._mtbShowHide("menu","")};dhtmlXCellObject.prototype.hideMenu=function(){this._mtbShowHide("menu","none")};dhtmlXCellObject.prototype.getAttachedMenu=function(){return this.dataNodes.menu}}dhtmlXMenuObject.prototype.setItemEnabled=function(a){this._changeItemState(a,"enabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.setItemDisabled=function(a){this._changeItemState(a,"disabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.isItemEnabled=function(a){return(this.itemPull[this.idPrefix+a]!=null?(this.itemPull[this.idPrefix+a]["state"]=="enabled"):false)};dhtmlXMenuObject.prototype._changeItemState=function(m,l,c){var g=false;var a=this.idPrefix+m;if((this.itemPull[a]!=null)&&(this.idPull[a]!=null)){if(this.itemPull[a]["state"]!=l){this.itemPull[a]["state"]=l;if(this.itemPull[a]["parent"]==this.idPrefix+this.topId&&!this.conf.context){this.idPull[a].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[a]["state"]=="enabled"?"Normal":"Disabled")}else{this.idPull[a].className="sub_item"+(this.itemPull[a]["state"]=="enabled"?"":"_dis")}this._updateItemComplexState(this.idPrefix+m,this.itemPull[this.idPrefix+m]["complex"],false);this._updateItemImage(m,c);if((this.idPrefix+this.conf.last_click==a)&&(c!="TopLevel")){this._redistribSubLevelSelection(a,this.itemPull[a]["parent"])}if(c=="TopLevel"&&!this.conf.context){}}}return g};dhtmlXMenuObject.prototype.getItemText=function(a){return(this.itemPull[this.idPrefix+a]!=null?this.itemPull[this.idPrefix+a]["title"]:"")};dhtmlXMenuObject.prototype.setItemText=function(l,j){l=this.idPrefix+l;if((this.itemPull[l]!=null)&&(this.idPull[l]!=null)){this._clearAndHide();this.itemPull[l]["title"]=j;if(this.itemPull[l]["parent"]==this.idPrefix+this.topId&&!this.conf.context){var g=null;for(var a=0;a<this.idPull[l].childNodes.length;a++){try{if(this.idPull[l].childNodes[a].className=="top_level_text"){g=this.idPull[l].childNodes[a]}}catch(c){}}if(String(this.itemPull[l]["title"]).length==""||this.itemPull[l]["title"]==null){if(g!=null){g.parentNode.removeChild(g)}}else{if(!g){g=document.createElement("DIV");g.className="top_level_text";if(this.conf.rtl&&this.idPull[l].childNodes.length>0){this.idPull[l].insertBefore(g,this.idPull[l].childNodes[0])}else{this.idPull[l].appendChild(g)}}g.innerHTML=this.itemPull[l]["title"]}}else{var g=null;for(var a=0;a<this.idPull[l].childNodes[1].childNodes.length;a++){if(String(this.idPull[l].childNodes[1].childNodes[a].className||"")=="sub_item_text"){g=this.idPull[l].childNodes[1].childNodes[a]}}if(String(this.itemPull[l]["title"]).length==""||this.itemPull[l]["title"]==null){if(g){g.parentNode.removeChild(g);g=null;this.idPull[l].childNodes[1].innerHTML="&nbsp;"}}else{if(!g){g=document.createElement("DIV");g.className="sub_item_text";this.idPull[l].childNodes[1].innerHTML="";this.idPull[l].childNodes[1].appendChild(g)}g.innerHTML=this.itemPull[l]["title"]}}}};dhtmlXMenuObject.prototype.loadFromHTML=function(g,m,j){var c=this.conf.tags.item;this.conf.tags.item="div";var l=(typeof(g)=="string"?document.getElementById(g):g);var a=this._xmlToJson(l,this.idPrefix+this.topId);this._initObj(a);this.conf.tags.item=c;if(m){l.parentNode.removeChild(l)}l=objOd=null;if(onload!=null){if(typeof(j)=="function"){j()}else{if(typeof(window[j])=="function"){window[j]()}}}};dhtmlXMenuObject.prototype.hideItem=function(a){this._changeItemVisible(a,false)};dhtmlXMenuObject.prototype.showItem=function(a){this._changeItemVisible(a,true)};dhtmlXMenuObject.prototype.isItemHidden=function(c){var a=null;if(this.idPull[this.idPrefix+c]!=null){a=(this.idPull[this.idPrefix+c].style.display=="none")}return a};dhtmlXMenuObject.prototype._changeItemVisible=function(g,c){var a=this.idPrefix+g;if(this.itemPull[a]==null){return}if(this.itemPull[a]["type"]=="separator"){a="separator_"+a}if(this.idPull[a]==null){return}this.idPull[a].style.display=(c?"":"none");this._redefineComplexState(this.itemPull[this.idPrefix+g]["parent"])};dhtmlXMenuObject.prototype.setUserData=function(g,a,c){this.userData[this.idPrefix+g+"_"+a]=c};dhtmlXMenuObject.prototype.getUserData=function(c,a){return(this.userData[this.idPrefix+c+"_"+a]!=null?this.userData[this.idPrefix+c+"_"+a]:null)};dhtmlXMenuObject.prototype.setOpenMode=function(a){this.conf.mode=(a=="win"?"win":"web")};dhtmlXMenuObject.prototype.setWebModeTimeout=function(a){this.conf.tm_sec=(!isNaN(a)?a:400)};dhtmlXMenuObject.prototype.getItemImage=function(c){var a=new Array(null,null);c=this.idPrefix+c;if(this.itemPull[c]["type"]=="item"){a[0]=this.itemPull[c]["imgen"];a[1]=this.itemPull[c]["imgdis"]}return a};dhtmlXMenuObject.prototype.setItemImage=function(g,a,c){if(this.itemPull[this.idPrefix+g]["type"]!="item"){return}this.itemPull[this.idPrefix+g]["imgen"]=a;this.itemPull[this.idPrefix+g]["imgdis"]=c;this._updateItemImage(g,this._getItemLevelType(g))};dhtmlXMenuObject.prototype.clearItemImage=function(a){this.setItemImage(a,"","")};dhtmlXMenuObject.prototype.setVisibleArea=function(c,a,j,g){this.conf.v_enabled=true;this.conf.v.x1=c;this.conf.v.x2=a;this.conf.v.y1=j;this.conf.v.y2=g};dhtmlXMenuObject.prototype.setTooltip=function(c,a){c=this.idPrefix+c;if(!(this.itemPull[c]!=null&&this.idPull[c]!=null)){return}this.idPull[c].title=(a.length>0?a:null);this.itemPull[c]["tip"]=a};dhtmlXMenuObject.prototype.getTooltip=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["tip"]};dhtmlXMenuObject.prototype.setTopText=function(a){if(this.conf.context){return}if(this._topText==null){this._topText=document.createElement("DIV");this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.rtl?"left":(this.conf.align=="left"?"right":"left"));this.base.appendChild(this._topText)}this._topText.innerHTML=a};dhtmlXMenuObject.prototype.setAlign=function(a){if(this.conf.align==a){return}if(a=="left"||a=="right"){this.conf.align=a;if(this.cont){this.cont.className=(this.conf.align=="right"?"align_right":"align_left")}if(this._topText!=null){this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.align=="left"?"right":"left")}}};dhtmlXMenuObject.prototype.setHref=function(g,a,c){if(this.itemPull[this.idPrefix+g]==null){return}this.itemPull[this.idPrefix+g]["href_link"]=a;if(c!=null){this.itemPull[this.idPrefix+g]["href_target"]=c}};dhtmlXMenuObject.prototype.clearHref=function(a){if(this.itemPull[this.idPrefix+a]==null){return}delete this.itemPull[this.idPrefix+a]["href_link"];delete this.itemPull[this.idPrefix+a]["href_target"]};dhtmlXMenuObject.prototype.getCircuit=function(c){var a=new Array(c);while(this.getParentId(c)!=this.topId){c=this.getParentId(c);a[a.length]=c}return a.reverse()};dhtmlXMenuObject.prototype._getCheckboxState=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["checked"]};dhtmlXMenuObject.prototype._setCheckboxState=function(c,a){if(this.itemPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["checked"]=a};dhtmlXMenuObject.prototype._updateCheckboxImage=function(c){if(this.idPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["imgen"]="chbx_"+(this._getCheckboxState(c)?"1":"0");this.itemPull[this.idPrefix+c]["imgdis"]=this.itemPull[this.idPrefix+c]["imgen"];try{this.idPull[this.idPrefix+c].childNodes[(this.conf.rtl?2:0)].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+c]["imgen"]}catch(a){}};dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(j,a,c){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+j]==null){return}var g=this._getCheckboxState(j);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[j,g,this.conf.ctx_zoneid,c])){this.setCheckboxState(j,!g)}}else{this.setCheckboxState(j,!g)}if(this.checkEvent("onClick")){this.callEvent("onClick",[j])}};dhtmlXMenuObject.prototype.setCheckboxState=function(c,a){this._setCheckboxState(c,a);this._updateCheckboxImage(c)};dhtmlXMenuObject.prototype.getCheckboxState=function(a){return this._getCheckboxState(a)};dhtmlXMenuObject.prototype.addCheckbox=function(o,j,q,r,s,a,l){if(this.conf.context&&j==this.topId){}else{if(this.itemPull[this.idPrefix+j]==null){return}if(o=="child"&&this.itemPull[this.idPrefix+j]["type"]!="item"){return}}var m="chbx_"+(a?"1":"0");var g=m;if(o=="sibling"){var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+this.getParentId(j);this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;this._renderSublevelItem(c,this.getItemPosition(j))}else{var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+j;this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(c,q-1);this._redefineComplexState(n)}};dhtmlXMenuObject.prototype.setHotKey=function(m,a){m=this.idPrefix+m;if(!(this.itemPull[m]!=null&&this.idPull[m]!=null)){return}if(this.itemPull[m]["parent"]==this.idPrefix+this.topId&&!this.conf.context){return}if(this.itemPull[m]["complex"]){return}var c=this.itemPull[m]["type"];if(!(c=="item"||c=="checkbox"||c=="radio")){return}var l=null;try{if(this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0].className=="sub_item_hk"){l=this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0]}}catch(j){}if(a.length==0){this.itemPull[m]["hotkey_backup"]=this.itemPull[m]["hotkey"];this.itemPull[m]["hotkey"]="";if(l!=null){l.parentNode.removeChild(l)}}else{this.itemPull[m]["hotkey"]=a;this.itemPull[m]["hotkey_backup"]=null;if(l==null){l=document.createElement("DIV");l.className="sub_item_hk";var g=this.idPull[m].childNodes[this.conf.rtl?0:2];while(g.childNodes.length>0){g.removeChild(g.childNodes[0])}g.appendChild(l)}l.innerHTML=a}};dhtmlXMenuObject.prototype.getHotKey=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["hotkey"]};dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon=function(a){var g=this._getSubItemToDeselectByPolygon(a);for(var c=0;c<this.conf.opened_poly.length;c++){if(this.conf.opened_poly[c]!=a){this._hidePolygon(this.conf.opened_poly[c])}}for(var c=0;c<g.length;c++){if(this.idPull[g[c]]!=null&&this.itemPull[g[c]]["state"]=="enabled"){this.idPull[g[c]].className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Item_Normal"}}};dhtmlXMenuObject.prototype._checkArrowsState=function(j){var c=this.idPull["polygon_"+j].childNodes[1];var g=this.idPull["arrowup_"+j];var a=this.idPull["arrowdown_"+j];if(c.scrollTop==0){g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp_Disabled"}else{g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp"+(g.over?"_Over":"")}if(c.scrollTop+c.offsetHeight<c.scrollHeight){a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown"+(a.over?"_Over":"")}else{a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown_Disabled"}c=g=a=null};dhtmlXMenuObject.prototype._addUpArrow=function(j){var c=this;var g=document.createElement("DIV");g.pId=this.idPrefix+j;g.id="arrowup_"+this.idPrefix+j;g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp";g.over=false;g.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.oncontextmenu=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.onmouseover=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler)}c._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Over";this.over=true;c._canScrollUp=true;c._doScrollUp(this.pId,true)};g.onmouseout=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler);c.conf.tm_handler=window.setTimeout(function(){c._clearAndHide()},c.conf.tm_sec,"JavaScript")}this.over=false;c._canScrollUp=false;if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp";window.clearTimeout(c.conf.of_utm)};g.onclick=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+j];a.childNodes[0].appendChild(g);this.idPull[g.id]=g;a=g=null};dhtmlXMenuObject.prototype._addDownArrow=function(j){var c=this;var g=document.createElement("DIV");g.pId=this.idPrefix+j;g.id="arrowdown_"+this.idPrefix+j;g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown";g.over=false;g.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.oncontextmenu=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.onmouseover=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler)}c._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Over";this.over=true;c._canScrollDown=true;c._doScrollDown(this.pId,true)};g.onmouseout=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler);c.conf.tm_handler=window.setTimeout(function(){c._clearAndHide()},c.conf.tm_sec,"JavaScript")}this.over=false;c._canScrollDown=false;if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown";window.clearTimeout(c.conf.of_dtm)};g.onclick=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+j];a.childNodes[2].appendChild(g);this.idPull[g.id]=g;a=g=null};dhtmlXMenuObject.prototype._removeUpArrow=function(c){var a="arrowup_"+this.idPrefix+c;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeDownArrow=function(c){var a="arrowdown_"+this.idPrefix+c;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeArrow=function(a){var c=this.idPull[a];c.onselectstart=null;c.oncontextmenu=null;c.onmouseover=null;c.onmouseout=null;c.onclick=null;if(c.parentNode){c.parentNode.removeChild(c)}c=null;this.idPull[a]=null;try{delete this.idPull[a]}catch(g){}};dhtmlXMenuObject.prototype._isArrowExists=function(a){if(this.idPull["arrowup_"+a]!=null&&this.idPull["arrowdown_"+a]!=null){return true}return false};dhtmlXMenuObject.prototype._doScrollUp=function(m,j){var a=this.idPull["polygon_"+m].childNodes[1];if(this._canScrollUp&&a.scrollTop>0){var g=false;var l=a.scrollTop-this.conf.of_ustep;if(l<0){g=true;l=0}a.scrollTop=l;if(!g){var c=this;this.conf.of_utm=window.setTimeout(function(){c._doScrollUp(m,false);c=null},this.conf.of_utime)}else{j=true}}else{this._canScrollUp=false;this._checkArrowsState(m)}if(j){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._doScrollDown=function(m,j){var a=this.idPull["polygon_"+m].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var g=false;var l=a.scrollTop+this.conf.of_dstep;if(l+a.offsetHeight>=a.scrollHeight){g=true;l=a.scrollHeight-a.offsetHeight}a.scrollTop=l;if(!g){var c=this;this.conf.of_dtm=window.setTimeout(function(){c._doScrollDown(m,false);c=null},this.conf.of_dtime)}else{j=true}}else{this._canScrollDown=false;this._checkArrowsState(m)}if(j){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._countPolygonItems=function(m){var j=0;for(var c in this.itemPull){var g=this.itemPull[c]["parent"];var l=this.itemPull[c]["type"];if(g==this.idPrefix+m&&(l=="item"||l=="radio"||l=="checkbox")){j++}}return j};dhtmlXMenuObject.prototype.setOverflowHeight=function(j){if(j==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&j<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&j>0){this.conf.overflow_limit=j;return}if(this.conf.overflow_limit>0&&j<=0){for(var g in this.itemPull){if(this._isArrowExists(g)){var c=String(g).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+g].childNodes[1].style.height=""}}this.conf.overflow_limit=0;return}};dhtmlXMenuObject.prototype._getRadioImgObj=function(g){try{var a=this.idPull[this.idPrefix+g].childNodes[(this.conf.rtl?2:0)].childNodes[0]}catch(c){var a=null}return a};dhtmlXMenuObject.prototype._setRadioState=function(j,g){var c=this._getRadioImgObj(j);if(c!=null){var a=this.itemPull[this.idPrefix+j];a.checked=g;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;c.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(j,a,c){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+j]["group"]==null){return}var g=this.itemPull[this.idPrefix+j]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[g,this.getRadioChecked(g),j,this.conf.ctx_zoneid,c])){this.setRadioChecked(g,j)}}else{this.setRadioChecked(g,j)}if(this.checkEvent("onClick")){this.callEvent("onClick",[j])}};dhtmlXMenuObject.prototype.getRadioChecked=function(j){var m=null;for(var g=0;g<this.radio[j].length;g++){var l=this.radio[j][g].replace(this.idPrefix,"");var a=this._getRadioImgObj(l);if(a!=null){var c=(a.className).match(/rdbt_1$/gi);if(c!=null){m=l}}}return m};dhtmlXMenuObject.prototype.setRadioChecked=function(c,j){if(this.radio[c]==null){return}for(var a=0;a<this.radio[c].length;a++){var g=this.radio[c][a].replace(this.idPrefix,"");this._setRadioState(g,(g==j))}};dhtmlXMenuObject.prototype.addRadioButton=function(q,l,r,s,u,v,a,m){if(this.conf.context&&l==this.topId){}else{if(this.itemPull[this.idPrefix+l]==null){return}if(q=="child"&&this.itemPull[this.idPrefix+l]["type"]!="item"){return}}var g=this.idPrefix+(s!=null?s:this._genStr(24));var n="rdbt_"+(a?"1":"0");var c=n;if(q=="sibling"){var o=this.idPrefix+this.getParentId(l);this._addItemIntoGlobalStrorage(g,o,u,"radio",m,n,c);this._renderSublevelItem(g,this.getItemPosition(l))}else{var o=this.idPrefix+l;this._addItemIntoGlobalStrorage(g,o,u,"radio",m,n,c);if(this.idPull["polygon_"+o]==null){this._renderSublevelPolygon(o,o)}this._renderSublevelItem(g,r-1);this._redefineComplexState(o)}var j=(v!=null?v:this._genStr(24));this.itemPull[g]["group"]=j;if(this.radio[j]==null){this.radio[j]=new Array()}this.radio[j][this.radio[j].length]=g;if(a==true){this.setRadioChecked(j,String(g).replace(this.idPrefix,""))}};dhtmlXMenuObject.prototype.serialize=function(){var a="<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return a};dhtmlXMenuObject.prototype._readLevel=function(j){var l="";for(var q in this.itemPull){if(this.itemPull[q]["parent"]==j){var c="";var g="";var s="";var o=String(this.itemPull[q]["id"]).replace(this.idPrefix,"");var n="";var r=(this.itemPull[q]["title"]!=""?' text="'+this.itemPull[q]["title"]+'"':"");var m="";if(this.itemPull[q]["type"]=="item"){if(this.itemPull[q]["imgen"]!=""){c=' img="'+this.itemPull[q]["imgen"]+'"'}if(this.itemPull[q]["imgdis"]!=""){g=' imgdis="'+this.itemPull[q]["imgdis"]+'"'}if(this.itemPull[q]["hotkey"]!=""){s="<hotkey>"+this.itemPull[q]["hotkey"]+"</hotkey>"}}if(this.itemPull[q]["type"]=="separator"){n=' type="separator"'}else{if(this.itemPull[q]["state"]=="disabled"){m=' enabled="false"'}}if(this.itemPull[q]["type"]=="checkbox"){n=' type="checkbox"'+(this.itemPull[q]["checked"]?' checked="true"':"")}if(this.itemPull[q]["type"]=="radio"){n=' type="radio" group="'+this.itemPull[q]["group"]+'" '+(this.itemPull[q]["checked"]?' checked="true"':"")}l+="<item id='"+o+"'"+r+n+c+g+m+">";l+=s;if(this.itemPull[q]["complex"]){l+=this._readLevel(q)}l+="</item>"}}return l};dhtmlXMenuObject.prototype.enableEffect=function(g,l,j){this._menuEffect=(g=="opacity"||g=="slide"||g=="slide+"?g:false);this._pOpStyleIE=(navigator.userAgent.search(/MSIE\s[678]\.0/gi)>=0);for(var c in this.idPull){if(c.search(/polygon/)===0){this._pOpacityApply(c,(this._pOpStyleIE?100:1));this.idPull[c].style.height=""}}this._pOpMax=(typeof(l)=="undefined"?100:l)/(this._pOpStyleIE?1:100);this._pOpStyleName=(this._pOpStyleIE?"filter":"opacity");this._pOpStyleValue=(this._pOpStyleIE?"progid:DXImageTransform.Microsoft.Alpha(Opacity=#)":"#");this._pSlSteps=(this._pOpStyleIE?10:20);this._pSlTMTimeMax=j||50};dhtmlXMenuObject.prototype._showPolygonEffect=function(a){this._pShowHide(a,true)};dhtmlXMenuObject.prototype._hidePolygonEffect=function(a){this._pShowHide(a,false)};dhtmlXMenuObject.prototype._pOpacityApply=function(a,c){this.idPull[a].style[this._pOpStyleName]=String(this._pOpStyleValue).replace("#",c||this.idPull[a]._op)};dhtmlXMenuObject.prototype._pShowHide=function(a,c){if(!this.idPull){return}if(this.idPull[a]._tmShow!=null){if((this.idPull[a]._step_h>0&&c==true)||(this.idPull[a]._step_h<0&&c==false)){return}window.clearTimeout(this.idPull[a]._tmShow);this.idPull[a]._tmShow=null;this.idPull[a]._max_h=null}if(c==false&&(this.idPull[a].style.visibility=="hidden"||this.idPull[a].style.display=="none")){return}if(c==true&&this.idPull[a].style.display=="none"){this.idPull[a].style.visibility="hidden";this.idPull[a].style.display=""}if(this.idPull[a]._max_h==null){this.idPull[a]._max_h=parseInt(this.idPull[a].offsetHeight);this.idPull[a]._h=(c==true?0:this.idPull[a]._max_h);this.idPull[a]._step_h=Math.round(this.idPull[a]._max_h/this._pSlSteps)*(c==true?1:-1);if(this.idPull[a]._step_h==0){return}this.idPull[a]._step_tm=Math.round(this._pSlTMTimeMax/this._pSlSteps);if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[a].op_tm=this.idPull[a]._step_tm;this.idPull[a].op_step=(this._pOpMax/this._pSlSteps)*(c==true?1:-1);if(this._pOpStyleIE){this.idPull[a].op_step=Math.round(this.idPull[a].op_step)}this.idPull[a]._op=(c==true?0:this._pOpMax);this._pOpacityApply(a)}else{this.idPull[a]._op=(this._pOpStyleIE?100:1);this._pOpacityApply(a)}if(this._menuEffect.search(/slide/)===0){this.idPull[a].style.height="0px"}this.idPull[a].style.visibility="visible"}this._pEffectSet(a,this.idPull[a]._h+this.idPull[a]._step_h)};dhtmlXMenuObject.prototype._pEffectSet=function(g,c){if(!this.idPull){return}if(this.idPull[g]._tmShow){window.clearTimeout(this.idPull[g]._tmShow)}this.idPull[g]._h=Math.max(0,Math.min(c,this.idPull[g]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=this.idPull[g]._h+"px"}c+=this.idPull[g]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[g]._op+this.idPull[g].op_step));this._pOpacityApply(g)}if((this.idPull[g]._step_h>0&&c<=this.idPull[g]._max_h)||(this.idPull[g]._step_h<0&&c>=0)){var a=this;this.idPull[g]._tmShow=window.setTimeout(function(){a._pEffectSet(g,c)},this.idPull[g]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=""}if(this.idPull[g]._step_h<0){this.idPull[g].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=(this.idPull[g]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(g)}this.idPull[g]._tmShow=null;this.idPull[g]._h=null;this.idPull[g]._max_h=null;this.idPull[g]._step_tm=null}};function dhtmlXRibbon(j){var g=this,c,a;this.conf={type:"ribbon",icons_path:(j&&j.icons_path)?j.icons_path:"",arrows_mode:(j&&j.arrows_mode)?j.arrows_mode:null,skin:"dhx_skyblue"};this._eventHandlers={};this._base=null;this._items={};this._tabbar=null;this.childIds=[];if(typeof(j)=="string"){a=j}else{if(j&&j.tagName){a=j}else{if(j&&j.parent){if(j.parent.tagName||typeof(j.parent)=="string"){a=j.parent}}}}this._doOnHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseover)=="function"){if(g.items[m.type].mouseover(m,g,o)!=true){return false}}if(!/dhxrb_highlight0/.test(l.className)){l.className+=" dhxrb_highlight0"}};this._doOffHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseout)=="function"){if(g.items[m.type].mouseout(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}if(/dhxrb_highlight0/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight0/,"")}};this._doOnHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].mousedown)=="function"){if(g.items[m.type].mousedown(m,g,o)!=true){return false}}if(!/dhxrb_highlight1/.test(l.className)){l.className+=" dhxrb_highlight1"}};this._doOffHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseup)=="function"){if(g.items[m.type].mouseup(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}};this._doOnClick=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].click)=="function"){g.items[m.type].click(m,g,o)}};this._doOnFocus=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].focus)=="function"){g.items[m.type].focus(m,g,o)}};this._doOnBlur=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].blur)=="function"){g.items[m.type].blur(m,g,o)}};this._doOnChange=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].change)=="function"){g.items[m.type].change(m,g,o)}};this._doOnKeydown=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].keydown)=="function"){g.items[m.type].keydown(m,g,o)}};this._tabCustomApi={enable:function(o,n){var m=null,l=null;n=n||false;if(n!=true){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.enable(m.childIds[l])}}return g._tabOriginalApi.enable.apply(this,[o])},disable:function(o,n){var m=null,l=null;if(n!=false){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.disable(m.childIds[l])}}return g._tabOriginalApi.disable.apply(this,[o])},close:function(n){var m=g._items[this._idd],l;g._removeTab(m);g._tabOriginalApi.close.apply(this,[n]);for(l in g._tabOriginalApi){this[l]=null}}};this._attachEventTabbar=function(){this._tabbar.attachEvent("onSelect",function(){return g.callEvent("onSelect",arguments)});this._tabbar.attachEvent("onTabClick",function(){return g.callEvent("onTabClick",arguments)});this._tabbar.attachEvent("onTabClose",function(){return g.callEvent("onTabClose",arguments)})};if(typeof(a)=="string"){this._base=document.getElementById(a)}else{if(a&&a.tagName){this._base=a}else{this._base=document.createElement("div");this._base._dhx_remove=true;if(document.body.firstChild){document.body.insertBefore(this._base,document.body.firstChild)}else{document.body.appendChild(this._base)}}}c=dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||dhx4.skinDetect("dhtmlxribbon")||"dhx_skyblue";if(typeof(j)=="object"&&j.skin){c=j.skin}this.setSkin(c);dhx4._eventable(this);dhx4._enableDataLoading(this,"_renderData","_xmlToJson","ribbon",{struct:true});this.attachEvent("_onHeightChanged",function(){this.conf.inited=true});this._base.className+=" dhxrb_without_tabbar";this._base.innerHTML="<div class='dhxrb_background_area'></div>";if(j!=null){if(j.json){this.loadStruct(j.json,j.onload)}else{if(j.xml){this.loadStruct(j.xml,j.onload)}else{this._renderData(j)}}}this.unload=function(){var m=null,l=[];for(m in this.childIds){m=parseInt(m);l.push(this.childIds[m])}dhx4._enableDataLoading(this,null,null,null,"clear");dhx4._eventable(this,"clear");for(m in l){m=parseInt(m);if(this._items[l[m]].type=="tab"){this.tabs(l[m]).close(false)}else{this.removeItem(l[m])}}if(this._tabbar){this._tabbar.unload();this._tabbar=null}this._base.innerHTML="";if(this._base._dhx_remove){this._base.parentNode.removeChild(this._base)}else{this._base.className=this._base.className.replace(/\s?(dhtmlx|dhxrb)(\S*)/ig,"")}for(m in this){this[m]=null}g=null}}dhtmlXRibbon.prototype.setSizes=function(){if(this._tabbar!=null&&typeof(this.setSizes)=="function"){this._tabbar.setSizes()}};dhtmlXRibbon.prototype._renderData=function(c){var a=this._base.firstChild;if(c!=null){this.conf.icons_path=c.icons_path||this.conf.icons_path;if(c.tabs instanceof Array){this._base.className=this._base.className.replace(/\s?dhxrb_without_tabbar/i,"");a.className="dhxrb_with_tabbar";this._tabbar=new dhtmlXTabBar(a);this._attachEventTabbar();this._tabbar.setSkin(this.conf.skin);if(this.conf.arrows_mode!=null){this._tabbar.setArrowsMode(this.conf.arrows_mode)}this.childIds=this._appendTabs(c.tabs)}else{if(c.items instanceof Array){if(!/\s?dhxrb_without_tabbar/i.test(this._base.className)){this._base.className+=" dhxrb_without_tabbar"}if(/\s?dhxrb_background_area/i.test(a.className)){a.className="dhxrb_background_area"}a.innerHTML="<div class='dhxrb_g_area'></div>";this.childIds=this._appendBlocks(c.items,a.firstChild)}}this.callEvent("_onHeightChanged",[])}};dhtmlXRibbon.prototype._xmlToJson=function(c){var a=c.lastChild||null,j={},g=[];if(a&&a.tagName=="ribbon"){g=this._convertXmlNodeListIntoObject(a.childNodes)}if(g[0]&&g[0].type&&g[0].type.toLowerCase()=="block"){j.items=g}else{j.tabs=g}return j};dhtmlXRibbon.prototype._convertXmlNodeListIntoObject=function(c){var g,a,m=[],j;a=c.length;for(g=0;g<a;g++){j=this._covertXmlNodeToObject(c[g]);if(j){m.push(j)}}return m};dhtmlXRibbon.prototype._covertXmlNodeToObject=function(j){if(!j||!j.tagName||!(j.tagName.toLowerCase()=="item"||j.tagName.toLowerCase()=="tab")){return null}var g,a,c=j.attributes,m={};a=c.length;for(g=0;g<a;g++){switch(c[g].name){case"isbig":m.isbig=dhx4.s2b(c[g].value);break;case"state":m.state=dhx4.s2b(c[g].value);break;default:m[c[g].name]=c[g].value}}if(j.childNodes.length){if(j.getAttribute("type")=="buttonCombo"||j.getAttribute("type")=="buttonSelect"){m.data=j}else{if(j.tagName.toLowerCase()=="tab"){m.items=this._convertXmlNodeListIntoObject(j.childNodes)}else{m.list=this._convertXmlNodeListIntoObject(j.childNodes)}}}return m};dhtmlXRibbon.prototype._appendTabs=function(m){var c,a,g,j=[];a=m.length;for(c=0;c<a;c++){g=this._addTab(m[c]);if(m[c].items instanceof Array){g.childIds=this._appendBlocks(m[c].items,g.base,g)}j.push(g.id)}return j};dhtmlXRibbon.prototype._addTab=function(g){var a,j,c={conf:{active:false,text:"",width:null,position:null,disable:false},base:document.createElement("div"),type:"tab",childIds:[]};for(a in g){if(a=="items"){continue}c.conf[a]=g[a]}if(!g.id){c.id=dhx4.newId()}else{c.id=g.id}while(this._items[c.id]){c.id=dhx4.newId()}this._tabbar.addTab(c.id,c.conf.text,c.conf.width,c.conf.position,c.conf.active);c.base.className="dhxrb_g_area";c.base._dhx_ribbonId=c.id;this.tabs(c.id).attachObject(c.base);this._changeApiForTab(this.tabs(c.id));this._items[c.id]=c;return c};dhtmlXRibbon.prototype._changeApiForTab=function(c){var a;for(a in this._tabOriginalApi){this._tabOriginalApi[a]=this._tabOriginalApi[a]||c[a];c[a]=this._tabCustomApi[a]}};dhtmlXRibbon.prototype._tabOriginalApi={enable:null,disable:null,close:null};dhtmlXRibbon.prototype._appendBlocks=function(a,u,g){var n,j,o,m,r,c,s=[];g=g||null;j=a.length;for(n=0;n<j;n++){if(typeof(a[n])=="object"&&a[n].type=="block"){o=this._addBlock(a[n],u);if(a[n].list&&(a[n].list instanceof Array)){m=a[n].list;r=m.length;for(c=0;c<r;c++){this._addItem(o.id,null,null,m[c])}}if(g!=null){o.parentId=g.id}if(o.conf.disable){this.disable(o.id)}s.push(o.id)}}return s};dhtmlXRibbon.prototype._addBlock=function(m,j){var g,a,n,c;n={conf:{text:"",text_pos:"bottom",type:"block",mode:"cols",disable:false},type:"block",childIds:[],base:document.createElement("div"),contForItems:document.createElement("div"),contForText:document.createElement("div")};for(c in m){if(c=="list"||c=="type"||c=="id"){continue}n.conf[c]=m[c]}if(!m.id){n.id=dhx4.newId()}else{n.id=m.id}while(this._items[n.id]){n.id=dhx4.newId()}n.base.className="dhxrb_block_base";j.appendChild(n.base);n.contForItems.className="dhxrb_block_items";n.contForText.className="dhxrb_block_label";n.base.appendChild(n.contForItems);if(n.conf.text){n.contForText.innerHTML=n.conf.text;if(n.conf.text_pos=="top"){n.base.insertBefore(n.contForText,n.contForItems)}else{n.base.appendChild(n.contForText)}}n.base._dhx_ribbonId=n.id;this._items[n.id]=n;return n};dhtmlXRibbon.prototype._addItem=function(g,c,q,n){var l=this._items[g],a,m,s=null,o=this,j;if(n.type!="newLevel"&&!this.items[n.type]){return null}if(n.type=="newLevel"){this._addNewLevel(l)}else{if(l.type=="group"){a=document.createElement("div");a.className="dhxrb_in_group";l.base.appendChild(a)}else{if(n.isbig){a=document.createElement("div");a.className="dhxrb_big_button";l.contForItems.appendChild(a)}else{m=this._getContainerForSmallItem(l);a=document.createElement("div");a.className=(l.conf.mode=="rows")?"dhxrb_in_row":"dhxrb_3rows_button";m.appendChild(a)}}}if(a){this._attachEventForItem(a);j={icons_path:n.icons_path||this.conf.icons_path,skin:this.conf.skin};for(var r in n){j[r]=n[r]}if(!j.id){j.id=dhx4.newId()}while(this._items[j.id]){j.id=dhx4.newId()}s=(this.items[j.type]&&this.items[j.type].render)?this.items[j.type].render(a,j):null}if(s!=null){this._items[s.id]=s;s.parentId=l.id;l.childIds.push(s.id);a._dhx_ribbonId=s.id;if(j.onclick&&(typeof(j.onclick)=="function")){this._eventHandlers[s.id]=this._eventHandlers[s.id]||{};this._eventHandlers[s.id]["onclick"]=j.onclick}s.callEvent=function(){o.callEvent.apply(o,arguments)};s._callHandler=function(){o._callHandler.apply(o,arguments)};if(this.items[j.type]&&typeof(this.items[j.type].callAfterInit)=="function"){this.items[j.type].callAfterInit.apply(this,[s])}}return s};dhtmlXRibbon.prototype._callHandler=function(c,a){if(this._eventHandlers[c]&&this._eventHandlers[c].onclick){this._eventHandlers[c].onclick.apply(this,a)}};dhtmlXRibbon.prototype.items={};dhtmlXRibbon.prototype.items.button={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",img:null,imgdis:null,isbig:false,disable:false,skin:a.skin}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="<img class='dhxrb_image"+((j.conf.img)?"'":" dhxrb_invisible'")+" src='"+((j.conf.img)?j.conf.icons_path+j.conf.img:"")+"' /><div class='dhxrb_label_button'>"+j.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}return j},getText:function(a){return a.conf.text},setText:function(c,g){var a=c.base.childNodes[1];c.conf.text=g;a.innerHTML=g},setImage:function(c,a){c.conf.img=a;if(c.conf.disable==false){c.base.childNodes[0].src=c.conf.icons_path+c.conf.img}},setImageDis:function(c,a){c.conf.imgdis=a;if(c.conf.disable==true){c.base.childNodes[0].src=c.conf.icons_path+c.conf.imgdis}},mousedown:function(a,g,c){return true},click:function(a,g,c){if(c.button!=0){return false}g._callHandler(a.id,[a.id]);a.callEvent("onClick",[a.id]);return false},disable:function(c){var g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.imgdis){g.src=c.conf.icons_path+c.conf.imgdis;if(/\s?dhxrb_invisible/i.test(g.className)){g.className=g.className.replace(/\s?dhxrb_invisible/i,"")}}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.img){g.src=c.conf.icons_path+c.conf.img}else{if(!/\s?dhxrb_invisible/i.test(g.className)){g.className+=" dhxrb_invisible"}}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true}};dhtmlXRibbon.prototype.items.buttonTwoState={click:function(a,g,c){return false},afterRender:function(a){if(a.conf.state){this.setState(a,a.conf.state)}},mouseover:function(a){if(!/dhxrb_highlight0/.test(a.base.className)){a.base.className+=" dhxrb_highlight0"}return false},mouseout:function(a){if(/dhxrb_highlight0/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight0/,"")}return false},mousedown:function(a,g,c){g._callHandler(a.id,[a.id,!a.conf.state]);this.setState(a,!a.conf.state,true);return false},mouseup:function(a){return false},setState:function(a,c,g){g=g||false;c=dhx4.s2b(c);if(c){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}a.conf.state=c;if(g){a.callEvent("onStateChange",[a.id,a.conf.state])}},getState:function(a){return(a.conf.state==true)}};dhtmlXRibbon.prototype.items.buttonSegment={click:function(a,g,c){return false},mousedown:function(a,g,c){this.setState(a,g,true);return false},callAfterInit:function(a){if(a.conf.state||dhtmlXRibbon.prototype.items.buttonSegment._getSelectedNeighbor(a,this)==null){if(a.conf.state){a.conf.state=false}dhtmlXRibbon.prototype.items.buttonSegment.setState(a,this,false)}},afterRender:function(){},setState:function(a,l,j){j=j||false;var g=null,c=dhx4.s2b(a.conf.state);if(c==false){g=this._getSelectedNeighbor(a,l);if(g!=null){this._unSelect(g)}if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}a.conf.state=true;if(j){l._callHandler(a.id,[a.id,(g?g.id:null)]);l.callEvent("onStateChange",[a.id,(g?g.id:null)])}}},remove:function(g,n){var l=dhx4.s2b(g.conf.state),m=null,a=0,c=n._items[g.parentId],j;if(l){while(c.childIds[a]&&m==null){j=n._items[c.childIds[a]];if(j.type=="buttonSegment"&&j!=g){m=j}a++}if(m){this.setState(m,n)}}},_unSelect:function(a){var c=dhx4.s2b(a.conf.state);if(c){if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}a.conf.state=false}},_getSelectedNeighbor:function(j,o){var g=o._items[j.parentId],c,a,n,m=null;a=g.childIds.length;for(c=0;c<a;c++){n=o._items[g.childIds[c]];if(n.type=="buttonSegment"&&n.conf.state){m=n;break}}return m}};dhtmlXRibbon.prototype.items.buttonSelect={itemCollection:[],_isAttachedEventInWindow:false,afterRender:function(c){var a=c.base.childNodes[1];a.innerHTML+="<span class='dhxrb_arrow'>&nbsp;</span>";c.menu=null;this.itemCollection.push(c);this._attachEventToWindow();a=null},setText:function(a,g){var c=a.base.childNodes[1].lastChild;a.conf.text=g;a.base.childNodes[1].innerHTML=g;a.base.childNodes[1].appendChild(c)},setOptionText:function(a,g,c){if(a.menu!=null){a.menu.setItemText(g,c)}else{this._loopThroughItems(a.conf.items,g,c,false)}},getOptionText:function(a,c){if(a.menu!=null){return a.menu.getItemText(c)}return this._loopThroughItems(a.conf.items,c,null,true)},_loopThroughItems:function(a,m,l,j){for(var g=0;g<a.length;g++){if(a[g].id==m){if(j!=true){a[g].text=l;return true}else{return a[g].text}}if(a[g].items!=null){var c=this._loopThroughItems(a[g].items,m,l,j);if(c!=null){return c}}}return null},_attachEventToWindow:function(){if(this._isAttachedEventInWindow==false){if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._hideAllMenus,false)}else{document.body.attachEvent("onmousedown",this._hideAllMenus)}this._isAttachedEventInWindow=true}},_detachEventFromWindow:function(){if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousedown",this._hideAllMenus,false)}else{document.body.detachEvent("onmousedown",this._hideAllMenus)}this._isAttachedEventInWindow=false},_hideAllMenus:function(l){l=l||event;var g=l.target||l.srcElement;var a=true;while(g!=null&&a==true){if(g.className!=null&&/SubLevelArea_Polygon/i.test(g.className)){a=false}else{g=g.parentNode}}if(a==false){return}var c=dhtmlXRibbon.prototype.items.buttonSelect.itemCollection;for(var n in c){var j=c[n];if(j.menu instanceof dhtmlXMenuObject){if(j._skipHiding){j._skipHiding=false}else{dhtmlXRibbon.prototype.items.buttonSelect.hideMenu(j)}}}},mousedown:function(a,g,c){a._skipHiding=true;this.showMenu(a);return false},mouseup:function(a){return false},click:function(){},setState:function(){},showMenu:function(c){var a=dhx4.absLeft(c.base),g=dhx4.absTop(c.base)+c.base.offsetHeight;if(!(c.menu instanceof dhtmlXMenuObject)){c.menu=new dhtmlXMenuObject({parent:c.base,icons_path:c.conf.icons_path,context:true,items:c.conf.items,skin:c.conf.skin});if(c.conf.data){c.menu.loadStruct(c.conf.data);delete c.conf.data}c.menu.setAutoHideMode(false);c.menu.attachEvent("onHide",function(j){if(j==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnHideMenu(c)}});c.menu.attachEvent("onShow",function(j){if(j==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnShowMenu(c)}});c.menu.attachEvent("onClick",function(j){c.callEvent("onClick",[j,c.id])});c.base.oncontextmenu=function(){return false};dhtmlXRibbon.prototype.items.buttonSelect.showMenu(c)}else{c.menu.showContextMenu(a,g)}},hideMenu:function(a){if(a.menu instanceof dhtmlXMenuObject){a.menu.hideContextMenu()}},remove:function(c){var g,a;if(c.menu instanceof dhtmlXMenuObject){c.menu.unload();c.menu=null}c.base.oncontextmenu=null;g=dhtmlXRibbon.prototype._indexOf(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection,c);if(g!=-1){dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.splice(g,1)}if(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.length==0){this._detachEventFromWindow()}},setSkin:function(a,c){if(a.menu instanceof dhtmlXMenuObject){a.menu.setSkin(c)}},_doOnHideMenu:function(a){if(a._skipHiding){a._skipHiding=false}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}},_doOnShowMenu:function(a){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}};dhtmlXRibbon.prototype.items.group={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{disable:false,skin:a.skin},childIds:[]};c.className="dhxrb_group";for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}return j},callAfterInit:function(m){this._detachEventFromItem(m.base);var j,a,n=m.conf.list,o,g,c;a=(n)?n.length:0;for(j=0;j<a;j++){o=this._addItem(m.id,null,null,n[j]);if(o==null){continue}g=o.base.childNodes[1];if(g&&!g.innerHTML&&!/\s?dhxrb_label_hide/i.test(g.className)){g.className+=" dhxrb_label_hide"}}dhtmlXRibbon.prototype.items.group.normalize(m);if(m.conf.disable){this.disable(m.id)}n=undefined},normalize:function(o){var a=o.base.children;var g=a.length,c=false,q=0;var j,n;for(var m=0;m<g;m++){if(!/dhxrb_separator_group/i.test(a[m].className)){if(/dhxrb_item_hide/i.test(a[m].className)){q++;continue}}if((Math.ceil((m-q)/2)-Math.floor((m-q)/2))==0){if(/dhxrb_separator_group/i.test(a[m].className)){a[m].parentNode.removeChild(a[m]);c=true;break}}else{if(!/dhxrb_separator_group/i.test(a[m].className)){j=document.createElement("div");j.className="dhxrb_separator_groupp";o.base.insertBefore(j,a[m]);c=true;break}}}if(c){this.normalize(o)}else{n=o.base.lastChild;if(n&&/dhxrb_separator_group/i.test(n.className)){n.parentNode.removeChild(n)}}},hideChild:function(c,j){var a=dhtmlXRibbon.prototype._indexOf(c.base.children,j.base);if(a==0){a++}else{if(a!=-1){a--}else{return}}var g=c.base.children[a];if(g&&/dhxrb_separator_group/i.test(g.className)){g.parentNode.removeChild(g)}},showChild:function(a){this.normalize(a)}};dhtmlXRibbon.prototype.items.input={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",img:null,imgdis:null,isbig:false,disable:false,skin:a.skin,value:""}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="<input type='text' class='dhxrb_input'><div class='dhxrb_label_button'>"+j.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}if(j.conf.width){this.setWidth(j,j.conf.width)}if(j.conf.value){this.setValue(j,j.conf.value)}return j},callAfterInit:function(c){var a=c.base.childNodes[0];this._detachEventFromItem(c.base);this._attachEventsToInput(a)},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,change:function(c){var a=c.base.childNodes[0];c.conf.value=a.value},keydown:function(c,j,g){if(g.keyCode==13){var a=c.base.childNodes[0];c.conf.value=a.value;j.callEvent("onEnter",[c.id,c.conf.value])}},remove:function(c,g){var a=c.base.childNodes[0];g._detachEventsFromInput(a)},getValue:function(c){var a=c.base.childNodes[0],g;g=a.value;a=undefined;return g},setValue:function(c,g){var a=c.base.childNodes[0],g;a.value=g;c.conf.value=g},setWidth:function(c,g){var a=c.base.childNodes[0];a.style.width=parseInt(g)+"px"},disable:function(g){var c=g.base.childNodes[0],a=g.base.childNodes[1];c.disabled=true;if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(g){var c=g.base.childNodes[0],a=g.base.childNodes[1];c.disabled=false;if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},getInput:function(a){return a.base.childNodes[0]}};dhtmlXRibbon.prototype.getInput=function(c){var a=this._items[c];if(a==null||a.type!="input"){return null}return this.items[a.type].getInput(a)};dhtmlXRibbon.prototype.items.checkbox={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",disable:false,checked:false}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="<div class='dhxrb_checkbox'></div><div class='dhxrb_label_checkbox'>"+j.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.checked){this.check(j)}return j},callAfterInit:function(a){if(a.conf.disable){this.disable(a.id)}},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,mousedown:function(a){return false},mouseup:function(a){return false},click:function(a,g,c){if(c.button!=0){return false}if(a.type=="checkbox"){if(a.conf.checked){this.uncheck(a,true)}else{this.check(a,true)}}},check:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=true;if(!/\s?dhxrb_checked/i.test(a.base.className)){a.base.className+=" dhxrb_checked"}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},uncheck:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=false;if(/\s?dhxrb_checked/i.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_checked/i,"")}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},isChecked:function(a){if(a.type!="checkbox"){return false}return(a.conf.checked==true)},disable:function(a){return true},enable:function(a){return true}};dhtmlXRibbon.prototype.items.text={render:function(a,j){var g={base:a,id:j.id,type:j.type,conf:{text:""}};for(var c in j){if(c=="id"||c=="type"){continue}g.conf[c]=j[c]}a.innerHTML="<div class='dhxrb_item_text'>"+g.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(g)}return g},callAfterInit:function(a){this._detachEventFromItem(a.base)},getText:function(a){return a.conf.text},setText:function(a,c){a.conf.text=c;a.base.innerHTML=c}};dhtmlXRibbon.prototype.items.buttonCombo={render:function(a,c){var g,j,l={};j={base:a,id:c.id,type:c.type,conf:{text:"",text_pos:"right",width:140,skin:c.skin,callEvent:true}};for(g in c){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=c[g]}for(g in j.conf){if(g=="text"||g=="text_pos"||g=="disable"||g=="data"){continue}l[g]=j.conf[g]}j.base.className+=" dhxrb_buttoncombo_cont";j.base.innerHTML="<div class='dhxrb_buttoncombo'></div><div class='dhxrb_label_button'>"+j.conf.text+"</div>";l.parent=j.base.firstChild;j.combo=new dhtmlXCombo(l);j.combo.setSkin(l.skin);j.combo.attachEvent("onChange",function(m,n){j._callHandler(j.id,[m,n]);if(j.conf.callEvent==true){j.callEvent("onSelectOption",[j.id,m,n])}j.conf.callEvent=true});if(j.conf.data){j.combo.load(j.conf.data);delete j.conf.data}if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}return j},callAfterInit:function(a){this._detachEventFromItem(a.base)},disable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.combo instanceof dhtmlXCombo){a.combo.unload();a.combo=null}},getValue:function(a){var c=null;if(a.combo instanceof dhtmlXCombo){c=a.combo.getSelectedValue()}return c},setValue:function(a,c,g){if(a.combo instanceof dhtmlXCombo){a.conf.callEvent=g;a.combo.setComboValue(c)}},setSkin:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setSkin(c)}}};dhtmlXRibbon.prototype.items.slider={render:function(a,l){var g,j,c={};j={base:a,id:l.id,type:l.type,conf:{text:"",text_pos:"right",size:150,vertical:false,min:0,max:99,value:0,step:1,margin:10,disabled:false,enableTooltip:false}};for(g in l){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=l[g]}for(g in j.conf){if(g=="text"||g=="text_pos"||g=="isbig"){continue}c[g]=j.conf[g]}j.base.innerHTML="<center><div class='dhxrb_slider'></div></center><div class='dhxrb_label_button'>"+j.conf.text+"</div>";c.parent=j.base.firstChild.firstChild;j.slider=new dhtmlXSlider(c);if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}j.slider.attachEvent("onChange",function(m){j._callHandler(j.id,[m]);j.callEvent("onValueChange",[j.id,m])});return j},callAfterInit:function(a){this._detachEventFromItem(a.base)},setSkin:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setSkin(c)}},disable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.slider instanceof dhtmlXSlider){a.slider.unload();a.slider=null}},getValue:function(a){var c=null;if(a.slider instanceof dhtmlXSlider){c=a.slider.getValue()}return c},setValue:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setValue(c)}}};dhtmlXRibbon.prototype.items._extends=function(g,c){var a;for(a in c){g[a]=g[a]||c[a]}return g};dhtmlXRibbon.prototype._addNewLevel=function(g){var c,a;if(g.conf.mode=="rows"){c=g.contForItems.lastChild;if(c&&/dhxrb_block_rows/i.test(c.className)&&(c.childNodes.length<3)){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}else{c=document.createElement("div");c.className="dhxrb_block_rows";g.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{var a=document.createElement("div");a.className="dhxrb_3rows_block";g.contForItems.appendChild(a)}};dhtmlXRibbon.prototype._attachEventForItem=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("mouseover",this._doOnHighlight0,false);a.addEventListener("mouseout",this._doOffHighlight0,false);a.addEventListener("mousedown",this._doOnHighlight1,false);a.addEventListener("mouseup",this._doOffHighlight1,false);a.addEventListener("click",this._doOnClick,false)}else{a.attachEvent("onmouseover",this._doOnHighlight0);a.attachEvent("onmouseout",this._doOffHighlight0);a.attachEvent("onmousedown",this._doOnHighlight1);a.attachEvent("onmouseup",this._doOffHighlight1);a.attachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._detachEventFromItem=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("mouseover",this._doOnHighlight0,false);a.removeEventListener("mouseout",this._doOffHighlight0,false);a.removeEventListener("mousedown",this._doOnHighlight1,false);a.removeEventListener("mouseup",this._doOffHighlight1,false);a.removeEventListener("click",this._doOnClick,false)}else{a.detachEvent("onmouseover",this._doOnHighlight0);a.detachEvent("onmouseout",this._doOffHighlight0);a.detachEvent("onmousedown",this._doOnHighlight1);a.detachEvent("onmouseup",this._doOffHighlight1);a.detachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._attachEventsToInput=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",this._doOnFocus,false);a.addEventListener("blur",this._doOnBlur,false);a.addEventListener("change",this._doOnChange,false);a.addEventListener("keydown",this._doOnKeydown,false)}else{a.attachEvent("onfocus",this._doOnFocus);a.attachEvent("onblur",this._doOnBlur);a.attachEvent("onchange",this._doOnChange);a.attachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._detachEventsFromInput=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",this._doOnFocus,false);a.removeEventListener("blur",this._doOnBlur,false);a.removeEventListener("change",this._doOnChange,false);a.removeEventListener("keydown",this._doOnKeydown,false)}else{a.detachEvent("onfocus",this._doOnFocus);a.detachEvent("onblur",this._doOnBlur);a.detachEvent("onchange",this._doOnChange);a.detachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._getContainerForSmallItem=function(g){var c=g.contForItems.lastChild,a=null;if(g.conf.mode=="rows"){if(c&&/\s?dhxrb_block_rows/i.test(c.className)){a=c.lastChild;if(!a){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{c=document.createElement("div");c.className="dhxrb_block_rows";g.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{if(c&&/dhxrb_3rows_block/i.test(c.className)&&(c.childNodes.length<3)){a=c}else{a=document.createElement("div");a.className="dhxrb_3rows_block";g.contForItems.appendChild(a)}}return a};dhtmlXRibbon.prototype._findItemByNode=function(a){while(a&&!a._dhx_ribbonId){a=a.parentNode}return a};dhtmlXRibbon.prototype._indexOf=function(a,j){var g,c;c=a.length;for(g=0;g<c;g++){if(a[g]==j){return g}}return -1};dhtmlXRibbon.prototype._removeItem=function(g){var a,j=-1,c=this._items[g.parentId];if(g.type=="group"){this._removeGroup(g);return}delete this._items[g.id];a=g.base.parentNode;this._detachEventFromItem(g.base);a.removeChild(g.base);if(c.type=="block"){if(a!=c.contForItems&&a.childNodes.length==0){a.parentNode.removeChild(a)}}else{if(c.type=="group"){dhtmlXRibbon.prototype.items.group.normalize(c)}}j=this._indexOf(c.childIds,g.id);if(j!=-1){c.childIds.splice(j,1)}if(this.items[g.type]&&(typeof(this.items[g.type].remove)=="function")){this.items[g.type].remove(g,this)}};dhtmlXRibbon.prototype._removeGroup=function(j){var c=[],l,g=this._items[j.parentId],a=j.base.parentNode;for(l in j.childIds){l=parseInt(l);c.push(this._items[j.childIds[l]])}for(l in c){l=parseInt(l);this._removeItem(c[l])}delete this._items[j.id];if(j.base.parentNode){a.removeChild(j.base)}if(a.childNodes.length==0){a.parentNode.removeChild(a)}l=this._indexOf(g.childIds,j.id);if(l!=-1){g.childIds.splice(l,1)}if(this.items[j.type]&&(typeof(this.items[j.type].remove)=="function")){this.items[j.type].remove(j)}};dhtmlXRibbon.prototype._removeBlock=function(j){var a=[],g,c;for(g in j.childIds){g=parseInt(g);a.push(this._items[j.childIds[g]])}for(g in a){g=parseInt(g);this._removeItem(a[g])}delete this._items[j.id];j.base.parentNode.removeChild(j.base);if(j.parentId){c=this._items[j.parentId]}else{c=this}g=this._indexOf(c.childIds,j.id);if(g!=-1){c.childIds.splice(g,1)}};dhtmlXRibbon.prototype._removeTab=function(c,a){var j=[],g;for(g in c.childIds){g=parseInt(g);j.push(this._items[c.childIds[g]])}for(g in j){g=parseInt(g);this._removeBlock(j[g])}delete this._items[c.id];g=this._indexOf(this.childIds,c.id);if(g!=-1){this.childIds.splice(g,1)}};dhtmlXRibbon.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXRibbon.prototype._setSkinForItems=function(g){var a,c;for(a in this._items){c=this._items[a];c.conf.skin=g;if(dhtmlXRibbon.prototype.items[c.type]&&typeof(dhtmlXRibbon.prototype.items[c.type].setSkin)=="function"){dhtmlXRibbon.prototype.items[c.type].setSkin(c,g)}}c=undefined,a=undefined};dhtmlXRibbon.prototype._setBlockText=function(a,c){a.conf.text=c;a.contForText.innerHTML=c;if(!c&&(c!=0)&&a.contForText.parentNode){a.contForText.parentNode.removeChild(a.contForText)}else{if(!a.contForText.parentNode){if(a.conf.text_pos=="top"){a.base.insertBefore(a.contForText,a.contForItems)}else{a.base.appendChild(a.contForText)}}}};dhtmlXRibbon.prototype.hide=function(g){var c=this._items[g];if(this.items[c.type]&&(typeof(this.items[c.type].hide)=="function")){if(this.items[c.type].hide(c)!=true){return}}if(c.type=="tab"){return}else{if(!/\s?dhxrb_item_hide/i.test(c.base.className)){c.base.className+=" dhxrb_item_hide"}}var a=this._items[c.parentId];if(a&&this.items[a.type]&&(typeof(this.items[a.type].hideChild)=="function")){this.items[a.type].hideChild(a,c)}};dhtmlXRibbon.prototype.show=function(g){var c=this._items[g];if(this.items[c.type]&&(typeof(this.items[c.type].show)=="function")){if(this.items[c.type].show(c)!=true){return}}if(c.type=="tab"){return}else{if(/\s?dhxrb_item_hide/i.test(c.base.className)){c.base.className=c.base.className.replace(/\s?dhxrb_item_hide/i,"")}}var a=this._items[c.parentId];if(a&&this.items[a.type]&&(typeof(this.items[a.type].showChild)=="function")){this.items[a.type].showChild(a,c)}};dhtmlXRibbon.prototype.check=function(g,c){c=dhx4.s2b(c);var a=this._items[g];if(a&&!a.conf.checked&&typeof(this.items[a.type].check)=="function"){this.items[a.type].check(a);if(c){this.callEvent("onCheck",[a.id,a.conf.checked])}}};dhtmlXRibbon.prototype.uncheck=function(g,c){c=dhx4.s2b(c);var a=this._items[g];if(a&&a.conf.checked&&typeof(this.items[a.type].uncheck)=="function"){this.items[a.type].uncheck(a);if(c){this.callEvent("onCheck",[a.id,a.conf.checked])}}};dhtmlXRibbon.prototype.isChecked=function(c){var a=this._items[c];if(a&&typeof(this.items[a.type].isChecked)=="function"){return this.items[a.type].isChecked(a)}};dhtmlXRibbon.prototype.disable=function(j,c){var g=this._items[j],a;if(this.items[g.type]&&(typeof(this.items[g.type].disable)=="function")){if(this.items[g.type].disable(g)!=true){return}}if(g.type=="tab"){return}else{if(g.type=="block"||g.type=="group"){for(a in g.childIds){a=parseInt(a);this.disable(g.childIds[a])}}}if(!/\s?dhxrb_item_disable/i.test(g.base.className)){g.base.className+=" dhxrb_item_disable"}g.conf.disable=true};dhtmlXRibbon.prototype.enable=function(j,c){var g=this._items[j],a;if(this.items[g.type]&&(typeof(this.items[g.type].enable)=="function")){if(this.items[g.type].enable(g)!=true){return}}if(g.type=="tab"){return}else{if(g.type=="block"||g.type=="group"){for(a in g.childIds){a=parseInt(a);this.enable(g.childIds[a])}}}if(/\s?dhxrb_item_disable/i.test(g.base.className)){g.base.className=g.base.className.replace(/\s?dhxrb_item_disable/i,"")}g.conf.disable=false};dhtmlXRibbon.prototype.isEnabled=function(c){var a=this._items[c];if(this.items[a.type]&&typeof(this.items[a.type].isEnabled)=="function"){return this.items[a.type].isEnabled(a)}if(a.type=="tab"){return}else{return a.conf.disable!=true}};dhtmlXRibbon.prototype.isVisible=function(c){var a=this._items[c];if(this.items[a.type]&&(typeof(this.items[a.type].isVisible)=="function")){return this.items[a.type].isVisible(a)}if(a.type=="tab"){return}else{return !/\s?dhxrb_item_hide/i.test(a.base.className)}};dhtmlXRibbon.prototype.setItemState=function(j,c,g){c=dhx4.s2b(c);g=dhx4.s2b(g);var a=this._items[j];if(a&&(typeof(this.items[a.type].setState)=="function")){switch(a.type){case"buttonSegment":this.items[a.type].setState(a,this,g);break;default:this.items[a.type].setState(a,c,g)}}};dhtmlXRibbon.prototype.getItemState=function(c){var a=this._items[c];if(a&&(typeof(this.items[a.type].getState)=="function")){switch(a.type){case"buttonTwoState":case"buttonSegment":return this.items[a.type].getState(a);break}}return null};dhtmlXRibbon.prototype.setIconPath=function(a){this.conf.icons_path=a};dhtmlXRibbon.prototype.removeItem=function(c){var a=this._items[c];switch(a.type){case"tab":break;case"block":this._removeBlock(a);break;case"group":this._removeGroup(a);break;default:this._removeItem(a)}};dhtmlXRibbon.prototype.setSkin=function(l){l=(typeof(l)=="string")?l.toLowerCase():"";if(this._skinCollection[l]!=true){return}var g,c=-1,a,j="dhtmlxribbon";g=this._base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,j+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=j+"_"+l;this._base.className=g.join(" ");this.conf.skin=l;if(this._tabbar!=null){this._tabbar.setSkin(l)}this._setSkinForItems(l)};dhtmlXRibbon.prototype.tabs=function(a){if(this._tabbar instanceof dhtmlXTabBar){return this._tabbar.tabs(a)}else{return undefined}};dhtmlXRibbon.prototype.getItemType=function(c){var a=this._items[c];if(a){return a.type}else{return undefined}};dhtmlXRibbon.prototype.getValue=function(g){var a=this._items[g],c=undefined;if(a&&this.items[a.type]&&typeof(this.items[a.type].getValue)=="function"){c=this.items[a.type].getValue(a)}return c};dhtmlXRibbon.prototype.setValue=function(j,c,g){var a=this._items[j];g=(g===false?false:true);if(a&&this.items[a.type]&&typeof(this.items[a.type].setValue)=="function"){this.items[a.type].setValue(a,c,g)}};dhtmlXRibbon.prototype.getItemText=function(c){var a=this._items[c];if(!a){return null}else{if(a.type=="tab"){return this.tabs(a.id).getText()}else{if(a.type=="block"){return this.items.button.getText(a)}else{if(this.items[a.type]&&typeof(this.items[a.type].getText)=="function"){return this.items[a.type].getText(a)}else{return null}}}}};dhtmlXRibbon.prototype.setItemText=function(g,c){var a=this._items[g];if(!a){return}else{if(a.type=="tab"){this.tabs(a.id).setText(c)}else{if(a.type=="block"){this._setBlockText(a,c)}else{if(this.items[a.type]&&typeof(this.items[a.type].setText)=="function"){this.items[a.type].setText(a,c)}}}}};dhtmlXRibbon.prototype.setItemOptionText=function(j,g,c){var a=this._items[j];if(a.type=="buttonSelect"){this.items[a.type].setOptionText(a,g,c)}};dhtmlXRibbon.prototype.getItemOptionText=function(g,c){var a=this._items[g];if(a.type=="buttonSelect"){return this.items[a.type].getOptionText(a,c)}return null};dhtmlXRibbon.prototype.setItemImage=function(g,a){var c=this._items[g];if(c!=null&&this.items[c.type]!=null&&typeof(this.items[c.type].setImage)=="function"){this.items[c.type].setImage(c,a)}};dhtmlXRibbon.prototype.setItemImageDis=function(g,a){var c=this._items[g];if(c!=null&&this.items[c.type]!=null&&typeof(this.items[c.type].setImageDis)=="function"){this.items[c.type].setImageDis(c,a)}};(function(){var a=dhtmlXRibbon.prototype.items;a.buttonTwoState=a._extends(a.buttonTwoState,a.button);a.buttonSelect=a._extends(a.buttonSelect,a.buttonTwoState);a.buttonSegment=a._extends(a.buttonSegment,a.buttonTwoState)})();if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_ribbon=function(l,c,j,a,g){if(typeof(g)!="undefined"){l=g}else{l=document.createElement("DIV");l.className="dhx_cell_ribbon_"+(this.conf.borders?"def":"no_borders");l.appendChild(document.createElement("DIV"))}this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.ribbon=true;this._updateIdx();this._adjustCont(this._idd);return l};dhtmlXCellObject.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.callEvent("_onBeforeContentAttach",["ribbon"]);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("ribbon").firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c._adjustCont(c._idd)});this._adjustCont();a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataNodes.ribbon};dhtmlXCellObject.prototype.detachRibbon=function(){if(!this.dataNodes.ribbon){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;delete this.dataNodes.ribbon;this._detachObject("ribbon")};dhtmlXCellObject.prototype.showRibbon=function(){this._mtbShowHide("ribbon","")};dhtmlXCellObject.prototype.hideRibbon=function(){this._mtbShowHide("ribbon","none")};dhtmlXCellObject.prototype.getAttachedRibbon=function(){return this.dataNodes.ribbon}}function dhtmlXToolbarObject(c,g){var a=this;this.conf={skin:(g||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtoolbar")||"dhx_skyblue"),align:"left",align_autostart:"left",icons_path:"",iconSize:18,sel_ofs_x:0,sel_ofs_y:0,xml_autoload:null,items_autoload:null};if(typeof(c)=="object"&&c!=null&&typeof(c.tagName)=="undefined"){if(c.icons_path!=null||c.icon_path!=null){this.conf.icons_path=(c.icons_path||c.icon_path)}if(c.icons_size!=null){this.conf.icons_size_autoload=c.icons_size}if(c.json!=null){this.conf.json_autoload=c.json}if(c.xml!=null){this.conf.xml_autoload=c.xml}if(c.onload!=null){this.conf.onload_autoload=c.onload}if(c.onclick!=null||c.onClick!=null){this.conf.auto_onclick=(c.onclick||c.onClick)}if(c.items!=null){this.conf.items_autoload=c.items}if(c.skin!=null){this.conf.skin=c.skin}if(c.align!=null){this.conf.align_autostart=c.align}c=c.parent}this.cont=(typeof(c)!="object")?document.getElementById(c):c;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}c=null;this.cont.dir="ltr";this.base=document.createElement("DIV");this.base.className="dhxtoolbar_float_left";this.cont.appendChild(this.base);if(window.dhx4.isIPad){this.cont.ontouchstart=function(j){j=j||event;if((String(j.target.tagName||"").toLowerCase()=="input")){return true}if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(j){var l="";var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var m=0;m<j;m++){l+=n.charAt(Math.round(Math.random()*(n.length-1)))}return l};this.rootTypes=new Array("button","buttonSelect","buttonTwoState","separator","label","slider","text","buttonInput");this.idPrefix=this._genStr(12);window.dhx4._enableDataLoading(this,"_initObj","_xmlToJson","toolbar",{struct:true});window.dhx4._eventable(this);this._getObj=function(n,j){var l=null;for(var m=0;m<n.childNodes.length;m++){if(n.childNodes[m].tagName!=null){if(String(n.childNodes[m].tagName).toLowerCase()==String(j).toLowerCase()){l=n.childNodes[m]}}}return l};this._addImgObj=function(l){var j=document.createElement("IMG");if(l.childNodes.length>0){l.insertBefore(j,l.childNodes[0])}else{l.appendChild(j)}return j};this._setItemImage=function(n,l,j){if(j==true){n.imgEn=l}else{n.imgDis=l}if((!n.state&&j==true)||(n.state&&j==false)){return}var m=this._getObj(n.obj,"img");if(m==null){m=this._addImgObj(n.obj)}m.src=this.conf.icons_path+l};this._clearItemImage=function(m,j){if(j==true){m.imgEn=""}else{m.imgDis=""}if((!m.state&&j==true)||(m.state&&j==false)){return}var l=this._getObj(m.obj,"img");if(l!=null){l.parentNode.removeChild(l)}};this._setItemText=function(j,m){var l=this._getObj(j.obj,"div");if(m==null||m.length==0){if(l!=null){l.parentNode.removeChild(l)}return}if(l==null){l=document.createElement("DIV");l.className="dhxtoolbar_text";j.obj.appendChild(l)}l.innerHTML=m};this._getItemText=function(j){var l=this._getObj(j.obj,"div");if(l!=null){return l.innerHTML}return""};this._enableItem=function(l){if(l.state){return}l.state=true;if(this.objPull[l.id]["type"]=="buttonTwoState"&&this.objPull[l.id]["obj"]["pressed"]==true){l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.renderAs=l.obj.className}if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var j=this._getObj(l.obj,"img");if(l.imgEn!=""){if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+l.imgEn}else{if(j!=null){j.parentNode.removeChild(j)}}};this._disableItem=function(l){if(!l.state){return}l.state=false;l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[l.id]["type"]=="buttonTwoState"&&l.obj.pressed?"pres_":"")+"dis";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var j=this._getObj(l.obj,"img");if(l.imgDis!=""){if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+l.imgDis}else{if(j!=null){j.parentNode.removeChild(j)}}if(l.polygon!=null){if(l.polygon.style.display!="none"){window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(l.id,true)}}}this.anyUsed="none"};this.clearAll=function(){for(var j in this.objPull){this._removeItem(String(j).replace(this.idPrefix,""))}};this._doOnClick=function(j){if(a&&a.forEachItem){a.forEachItem(function(m){if(a.objPull[a.idPrefix+m]["type"]=="buttonSelect"){var l=a.objPull[a.idPrefix+m];if(l.arw._skip===true){l.arw._skip=false}else{if(l.polygon.style.display!="none"){l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.className=l.obj.renderAs;l.arw.className=String(l.obj.renderAs).replace("btn","arw");a.anyUsed="none";window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(l.id,true)}}}}})}};if(window.dhx4.isIPad){document.addEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousedown",this._doOnClick,false)}else{document.body.attachEvent("onmousedown",this._doOnClick)}}if(this.conf.icons_size_autoload!=null){this.setIconSize(this.conf.icons_size_autoload);this.conf.icons_size_autoload=null}if(this.conf.items_autoload!=null){this.loadStruct(this.conf.items_autoload,this.conf.onload_autoload);this.conf.items_autoload=null}else{if(this.conf.json_autoload!=null){this.loadStruct(this.conf.json_autoload,this.conf.onload_autoload);this.conf.json_autoload=null}else{if(this.conf.xml_autoload!=null){this.loadStruct(this.conf.xml_autoload,this.conf.onload_autoload);this.conf.xml_autoload=null}}}if(this.conf.align_autostart!=this.conf.align){this.setAlign(this.conf.align_autostart);this.conf.align_autostart=null}if(typeof(this.conf.auto_onclick)=="function"){this.attachEvent("onClick",this.conf.auto_onclick)}else{if(typeof(this.conf.auto_onclick)=="string"&&typeof(window[this.conf.auto_onclick])=="function"){this.attachEvent("onClick",window[this.conf.auto_onclick])}}return this}dhtmlXToolbarObject.prototype.addSpacer=function(g){var c=this.idPrefix+g;if(this._spacer!=null){if(this._spacer.idd==g){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var n=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(n==g||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=g;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var m=(this.objPull[c].arw!=null);while(a){var j=this.base.childNodes.length-1;if(m==true){if(this.base.childNodes[j]==this.objPull[c].arw){a=false}}if(this.base.childNodes[j].idd==g){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[j],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[j])}}}this._spacer.idd=g;this._fixSpacer();return}}else{var l=null;for(var j=0;j<this.base.childNodes.length;j++){if(this.base.childNodes[j]==this.objPull[this.idPrefix+g].obj){l=j;if(this.objPull[this.idPrefix+g].arw!=null){l=j+1}}}if(l!=null){this._spacer=document.createElement("DIV");this._spacer.className=(this.conf.align=="right"?" dhxtoolbar_float_left":" dhxtoolbar_float_right");this._spacer.dir="ltr";this._spacer.idd=g;while(this.base.childNodes.length>l+1){this._spacer.appendChild(this.base.childNodes[l+1])}this.cont.appendChild(this._spacer);this._fixSpacer()}}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.removeSpacer=function(){if(!this._spacer){return}while(this._spacer.childNodes.length>0){this.base.appendChild(this._spacer.childNodes[0])}this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._fixSpacer=function(){if(typeof(window.addEventListener)=="undefined"&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var a=this._spacer;window.setTimeout(function(){a.style.borderLeft="0px solid #a4bed4";a=null},1)}};dhtmlXToolbarObject.prototype.getType=function(g){var j=this.getParentId(g);if(j!=null){var c=null;var a=this.objPull[this.idPrefix+j]._listOptions[g];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+g]==null){return null}return this.objPull[this.idPrefix+g]["type"]}};dhtmlXToolbarObject.prototype.getTypeExt=function(c){var a=this.getType(c);if(a=="buttonSelectButton"||a=="buttonSelectSeparator"){if(a=="buttonSelectButton"){a="button"}else{a="separator"}return a}return null};dhtmlXToolbarObject.prototype.inArray=function(g,c){for(var a=0;a<g.length;a++){if(g[a]==c){return true}}return false};dhtmlXToolbarObject.prototype.getParentId=function(j){var l=null;for(var g in this.objPull){if(this.objPull[g]._listOptions){for(var c in this.objPull[g]._listOptions){if(c==j){l=String(g).replace(this.idPrefix,"")}}}}return l};dhtmlXToolbarObject.prototype._addItem=function(a,c){if(typeof(a.text)=="string"){a.text=window.dhx4.trim(a.text);if(a.text.length==0){a.text=null}}this._addItemToStorage(a,c);if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.addButton=function(l,j,c,a,g){this._addItem({id:l,type:"button",text:c,img:a,imgdis:g},j)};dhtmlXToolbarObject.prototype.addText=function(g,c,a){this._addItem({id:g,type:"text",text:a},c)};dhtmlXToolbarObject.prototype.addButtonSelect=function(j,o,v,a,c,r,n,x,l,m){var w=[];for(var g=0;g<a.length;g++){var s={};if(a[g] instanceof Array){s.id=a[g][0];s.type=(a[g][1]=="obj"?"button":"separator");s.text=(a[g][2]||null);s.img=(a[g][3]||null)}else{if(a[g] instanceof Object&&a[g]!=null&&typeof(a[g].id)!="undefined"&&typeof(a[g].type)!="undefined"){s.id=a[g].id;s.type=(a[g].type=="obj"?"button":"separator");s.text=a[g].text;s.img=a[g].img}}w.push(s)}this._addItem({id:j,type:"buttonSelect",text:v,img:c,imgdis:r,renderSelect:n,openAll:x,options:w,maxOpen:l,mode:m},o)};dhtmlXToolbarObject.prototype.addButtonTwoState=function(l,j,c,a,g){this._addItem({id:l,type:"buttonTwoState",img:a,imgdis:g,text:c},j)};dhtmlXToolbarObject.prototype.addSeparator=function(c,a){this._addItem({id:c,type:"separator"},a)};dhtmlXToolbarObject.prototype.addSlider=function(c,n,l,j,q,g,m,a,o){this._addItem({id:c,type:"slider",length:l,valueMin:j,valueMax:q,valueNow:g,textMin:m,textMax:a,toolTip:o},n)};dhtmlXToolbarObject.prototype.addInput=function(j,g,c,a){this._addItem({id:j,type:"buttonInput",value:c,width:a},g)};dhtmlXToolbarObject.prototype.forEachItem=function(g){for(var c in this.objPull){if(this.inArray(this.rootTypes,this.objPull[c]["type"])){g(this.objPull[c]["id"].replace(this.idPrefix,""))}}};(function(){var m="isVisible,enableItem,disableItem,isEnabled,setItemText,getItemText,setItemToolTip,getItemToolTip,getInput,setItemImage,setItemImageDis,clearItemImage,clearItemImageDis,setItemState,getItemState,setItemToolTipTemplate,getItemToolTipTemplate,setValue,getValue,setMinValue,getMinValue,setMaxValue,getMaxValue,setWidth,getWidth,setMaxOpen".split(",");var g=[false,"","",false,"","","","","","","","","",false,"","","",null,"",[null,null],"",[null,null],"",null];var c=function(n,o){return function(s,r,q){s=this.idPrefix+s;if(this.objPull[s][n]!=null){return this.objPull[s][n].call(this.objPull[s],r,q)}else{return o}}};for(var l=0;l<m.length;l++){var a=m[l];var j=g[l];dhtmlXToolbarObject.prototype[a]=c(a,j)}})();dhtmlXToolbarObject.prototype.showItem=function(a){a=this.idPrefix+a;if(this.objPull[a]!=null&&this.objPull[a].showItem!=null){this.objPull[a].showItem();if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}}};dhtmlXToolbarObject.prototype.hideItem=function(a){a=this.idPrefix+a;if(this.objPull[a]!=null&&this.objPull[a].hideItem!=null){this.objPull[a].hideItem();if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}}};dhtmlXToolbarObject.prototype.getPosition=function(a){return this._getPosition(a)};dhtmlXToolbarObject.prototype._getPosition=function(l,g){if(this.objPull[this.idPrefix+l]==null){return null}var j=null;var a=0;for(var c=0;c<this.base.childNodes.length;c++){if(this.base.childNodes[c].idd!=null){if(this.base.childNodes[c].idd==l){j=a}a++}}if(!j&&this._spacer!=null){for(var c=0;c<this._spacer.childNodes.length;c++){if(this._spacer.childNodes[c].idd!=null){if(this._spacer.childNodes[c].idd==l){j=a}a++}}}return j};dhtmlXToolbarObject.prototype.setPosition=function(a,c){this._setPosition(a,c)};dhtmlXToolbarObject.prototype._setPosition=function(l,j){if(this.objPull[this.idPrefix+l]==null){return}if(isNaN(j)){j=this.base.childNodes.length}if(j<0){j=0}var a=null;if(this._spacer){a=this._spacer.idd;this.removeSpacer()}var g=this.objPull[this.idPrefix+l];this.base.removeChild(g.obj);if(g.arw){this.base.removeChild(g.arw)}var c=this._getIdByPosition(j,true);if(c[0]==null){this.base.appendChild(g.obj);if(g.arw){this.base.appendChild(g.arw)}}else{this.base.insertBefore(g.obj,this.base.childNodes[c[1]]);if(g.arw){this.base.insertBefore(g.arw,this.base.childNodes[c[1]+1])}}if(a!=null){this.addSpacer(a)}};dhtmlXToolbarObject.prototype._getIdByPosition=function(m,c){var l=null;var a=0;var g=0;for(var j=0;j<this.base.childNodes.length;j++){if(this.base.childNodes[j]["idd"]!=null&&l==null){if((a++)==m){l=this.base.childNodes[j]["idd"]}}if(l==null){g++}}g=(l==null?null:g);return(c==true?new Array(l,g):l)};dhtmlXToolbarObject.prototype.removeItem=function(a){this._removeItem(a);if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._removeItem=function(l){var g=this.getType(l);l=this.idPrefix+l;var j=this.objPull[l];if(g=="button"){j.obj._doOnMouseOver=null;j.obj._doOnMouseOut=null;j.obj._doOnMouseUp=null;j.obj._doOnMouseUpOnceAnywhere=null;j.obj.onclick=null;j.obj.onmouseover=null;j.obj.onmouseout=null;j.obj.onmouseup=null;j.obj.onmousedown=null;j.obj.onselectstart=null;j.obj.renderAs=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.state=null;j.img=null;j.imgEn=null;j.imgDis=null;j.type=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemText=null;j.getItemText=null;j.setItemImage=null;j.clearItemImage=null;j.setItemImageDis=null;j.clearItemImageDis=null;j.setItemToolTip=null;j.getItemToolTip=null}if(g=="buttonTwoState"){j.obj._doOnMouseOver=null;j.obj._doOnMouseOut=null;j.obj.onmouseover=null;j.obj.onmouseout=null;j.obj.onmousedown=null;j.obj.onselectstart=null;j.obj.renderAs=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.state=null;j.img=null;j.imgEn=null;j.imgDis=null;j.type=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemText=null;j.getItemText=null;j.setItemImage=null;j.clearItemImage=null;j.setItemImageDis=null;j.clearItemImageDis=null;j.setItemToolTip=null;j.getItemToolTip=null;j.setItemState=null;j.getItemState=null}if(g=="buttonSelect"){for(var c in j._listOptions){this.removeListOption(l,c)}j._listOptions=null;if(j.polygon._ie6cover){document.body.removeChild(j.polygon._ie6cover);j.polygon._ie6cover=null}j.p_tbl.removeChild(j.p_tbody);j.polygon.removeChild(j.p_tbl);j.polygon.onselectstart=null;document.body.removeChild(j.polygon);j.p_tbody=null;j.p_tbl=null;j.polygon=null;j.obj.onclick=null;j.obj.onmouseover=null;j.obj.onmouseout=null;j.obj.onmouseup=null;j.obj.onmousedown=null;j.obj.onselectstart=null;j.obj.idd=null;j.obj.iddPrefix=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.arw.onclick=null;j.arw.onmouseover=null;j.arw.onmouseout=null;j.arw.onmouseup=null;j.arw.onmousedown=null;j.arw.onselectstart=null;j.arw.parentNode.removeChild(j.arw);j.arw=null;j.renderSelect=null;j.state=null;j.type=null;j.id=null;j.img=null;j.imgEn=null;j.imgDis=null;j.openAll=null;j._isListButton=null;j._separatorButtonSelectObject=null;j._buttonButtonSelectObject=null;j.setWidth=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemText=null;j.getItemText=null;j.setItemImage=null;j.clearItemImage=null;j.setItemImageDis=null;j.clearItemImageDis=null;j.setItemToolTip=null;j.getItemToolTip=null;j.addListOption=null;j.removeListOption=null;j.showListOption=null;j.hideListOption=null;j.isListOptionVisible=null;j.enableListOption=null;j.disableListOption=null;j.isListOptionEnabled=null;j.setListOptionPosition=null;j.getListOptionPosition=null;j.setListOptionImage=null;j.getListOptionImage=null;j.clearListOptionImage=null;j.setListOptionText=null;j.getListOptionText=null;j.setListOptionToolTip=null;j.getListOptionToolTip=null;j.forEachListOption=null;j.getAllListOptions=null;j.setListOptionSelected=null;j.getListOptionSelected=null}if(g=="buttonInput"){j.obj.childNodes[0].onkeydown=null;j.obj.removeChild(j.obj.childNodes[0]);j.obj.w=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemToolTip=null;j.getItemToolTip=null;j.setWidth=null;j.getWidth=null;j.setValue=null;j.getValue=null;j.setItemText=null;j.getItemText=null}if(g=="slider"){if(window.dhx4.isIPad){document.removeEventListener("touchmove",pen._doOnMouseMoveStart,false);document.removeEventListener("touchend",pen._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",j.pen._doOnMouseMoveStart,false);window.removeEventListener("mouseup",j.pen._doOnMouseMoveEnd,false)}else{document.body.detachEvent("onmousemove",j.pen._doOnMouseMoveStart);document.body.detachEvent("onmouseup",j.pen._doOnMouseMoveEnd)}}j.pen.allowMove=null;j.pen.initXY=null;j.pen.maxX=null;j.pen.minX=null;j.pen.nowX=null;j.pen.newNowX=null;j.pen.valueMax=null;j.pen.valueMin=null;j.pen.valueNow=null;j.pen._definePos=null;j.pen._detectLimits=null;j.pen._doOnMouseMoveStart=null;j.pen._doOnMouseMoveEnd=null;j.pen.onmousedown=null;j.obj.removeChild(j.pen);j.pen=null;j.label.tip=null;document.body.removeChild(j.label);j.label=null;j.obj.onselectstart=null;j.obj.idd=null;while(j.obj.childNodes.length>0){j.obj.removeChild(j.obj.childNodes[0])}j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.state=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.setItemToolTipTemplate=null;j.getItemToolTipTemplate=null;j.setMaxValue=null;j.setMinValue=null;j.getMaxValue=null;j.getMinValue=null;j.setValue=null;j.getValue=null;j.showItem=null;j.hideItem=null;j.isVisible=null}if(g=="separator"){j.obj.onselectstart=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.showItem=null;j.hideItem=null;j.isVisible=null}if(g=="text"){j.obj.onselectstart=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setWidth=null;j.setItemText=null;j.getItemText=null}g=null;j=null;this.objPull[this.idPrefix+l]=null;delete this.objPull[this.idPrefix+l]};(function(){var j="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",");var c=function(l){return function(s,n,m,r,q,o){s=this.idPrefix+s;if(this.objPull[s]==null){return}if(this.objPull[s]["type"]!="buttonSelect"){return}return this.objPull[s][l].call(this.objPull[s],n,m,r,q,o)}};for(var g=0;g<j.length;g++){var a=j[g];dhtmlXToolbarObject.prototype[a]=c(a)}})();dhtmlXToolbarObject.prototype._rtlParseBtn=function(c,a){return c+a};dhtmlXToolbarObject.prototype._separatorObject=function(a,g,c){this.id=a.idPrefix+g;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_sep";this.obj.style.display=(c.hidden!=null?"none":"");this.obj.idd=String(g);this.obj.title=(c.title||"");this.obj.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}};if(window.dhx4.isIPad){this.obj.ontouchstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};return this};dhtmlXToolbarObject.prototype._textObject=function(a,g,c){this.id=a.idPrefix+g;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_text";this.obj.style.display=(c.hidden!=null?"none":"");this.obj.idd=String(g);this.obj.title=(c.title||"");this.obj.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}};if(window.dhx4.isIPad){this.obj.ontouchstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}this.obj.innerHTML=(c.text||"");a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(j){this.obj.innerHTML=j};this.getItemText=function(){return this.obj.innerHTML};this.setWidth=function(j){this.obj.style.width=j+"px"};this.setItemToolTip=function(j){this.obj.title=j};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonObject=function(a,j,c){this.id=a.idPrefix+j;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img||"");this.imgDis=(c.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(c.hidden!=null?"none":"");this.obj.allowClick=false;this.obj.extAction=(c.action||null);this.obj.renderAs=this.obj.className;this.obj.idd=String(j);this.obj.title=(c.title||"");this.obj.pressed=false;this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"<img src='"+a.conf.icons_path+this.img+"'>":""),(c.text!=null?"<div class='dhxtoolbar_text'>"+c.text+"</div>":""));var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){this.allowClick=false;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(l){if(g.state==false){return}if(this.allowClick==false){return}l=l||event;var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m)}catch(l){}}if(a&&a.callEvent){a.callEvent("onClick",[m])}};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(g.state==false){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false}if(a.anyUsed!="none"){return}a.anyUsed=this.idd;this.className="dhx_toolbar_btn dhxtoolbar_btn_pres";this.pressed=true;this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){a.anyUsed="none";this._doOnMouseOut()};return false};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){if(g.state==false){return}if(a.anyUsed!="none"){if(a.anyUsed!=this.idd){return}}var l=a.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&l!="none"){a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(l){this._doOnMouseUp()}}this.obj._doOnMouseUp=function(){a.anyUsed="none";this.className=this.renderAs;this.pressed=false};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};a.base.appendChild(this.obj);this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(g,m,l){this.id=g.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.imgEn=(l.img||"");this.imgDis=(l.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(l.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!l.text||l.text.length==0){l.text="&nbsp;"}}else{this.openAll=(window.dhx4.s2b(l.openAll)==true);this.renderSelect=(l.renderSelect==null?true:window.dhx4.s2b(l.renderSelect))}this.maxOpen=(!isNaN(l.maxOpen?l.maxOpen:"")?l.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!g._sbw){var o=document.createElement("DIV");o.className="dhxtoolbar_maxopen_test";document.body.appendChild(o);var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test2";o.appendChild(n);g._sbw=o.offsetWidth-n.offsetWidth;o.removeChild(n);n=null;document.body.removeChild(o);o=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(l.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.title=(l.title||"");this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=g._rtlParseBtn((this.img!=""?"<img src='"+g.conf.icons_path+this.img+"'>":""),(l.text!=null?"<div class='dhxtoolbar_text'>"+l.text+"</div>":""));g.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="<div class='arwimg'>&nbsp;</div>";this.arw.title=this.obj.title;this.arw.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};g.base.appendChild(this.arw);var a=this;this.obj.onmouseover=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){a.obj.allowClick=false;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");a.callEvent=false};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll==true){}else{this.obj.onclick=function(n){n=n||event;if(!a.obj.allowClick){return}if(!a.state){return}if(g.anyUsed!="none"){return}var o=a.obj.idd.replace(g.idPrefix,"");if(a.obj.extAction){try{window[a.obj.extAction](o)}catch(n){}}g.callEvent("onClick",[o])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.allowClick=true;a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";a.callEvent=true};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");if(window.dhx4.isIPad&&a.callEvent){var o=a.obj.idd.replace(g.idPrefix,"");g.callEvent("onClick",[o])}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(q){q=q||event;var x=(this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling);if(x._skip){q=q||event;q.cancelBubble=true}else{x._skip=true}x=null;if(!a.state){return}if(g.anyUsed==a.obj.idd){a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");g.anyUsed="none";window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}}else{if(g.anyUsed!="none"){if(g.objPull[g.idPrefix+g.anyUsed]["type"]=="buttonSelect"){var w=g.objPull[g.idPrefix+g.anyUsed];if(w.polygon.style.display!="none"){w.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";w.obj.className=w.obj.renderAs;w.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(w.polygon._idd);w.polygon.style.display="none";if(w.polygon._ie6cover){w.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(w.id,true)}}}}a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";g.anyUsed=a.obj.idd;a.polygon.style.top="0px";a.polygon.style.visibility="hidden";a.polygon.style.zIndex=window.dhx4.zim.reserve(a.polygon._idd);a.polygon.style.display="";if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,false)}a._fixMaxOpenHeight(a.maxOpen||null);g._autoDetectVisibleArea();var r=window.dhx4.absTop(a.obj)+a.obj.offsetHeight+g.conf.sel_ofs_y;var u=a.polygon.offsetHeight;if(r+u>g.tY2){var s=(a.maxOpen!=null?Math.floor((g.tY2-r)/22):0);if(s>=1){a._fixMaxOpenHeight(s)}else{r=window.dhx4.absTop(a.obj)-u-g.conf.sel_ofs_y;if(r<0){r=0}}}a.polygon.style.top=r+"px";if(g.rtl){a.polygon.style.left=window.dhx4.absLeft(a.obj)+a.obj.offsetWidth-a.polygon.offsetWidth+g.conf.sel_ofs_x+"px"}else{var o=document.body.scrollLeft;var n=o+(window.innerWidth||document.body.clientWidth);var v=window.dhx4.absLeft(a.obj)+g.conf.sel_ofs_x;if(v+a.polygon.offsetWidth>n){v=window.dhx4.absLeft(a.arw)+a.arw.offsetWidth-a.polygon.offsetWidth}a.polygon.style.left=Math.max(v,5)+"px"}a.polygon.style.visibility="visible";if(a.polygon._ie6cover){a.polygon._ie6cover.style.left=a.polygon.style.left;a.polygon._ie6cover.style.top=a.polygon.style.top;a.polygon._ie6cover.style.width=a.polygon.offsetWidth+"px";a.polygon._ie6cover.style.height=a.polygon.offsetHeight+"px";a.polygon._ie6cover.style.display=""}}return false};this.arw.onclick=function(n){n=n||event;n.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true};if(this.openAll===true){this.obj.onclick=this.arw.onclick;this.obj.onmousedown=this.arw.onmousedown;this.obj.onmouseup=this.arw.onmouseup;if(window.dhx4.isIPad){this.obj.ontouchstart=this.arw.ontouchstart;this.obj.ontouchend=this.arw.ontouchend}}this.obj.iddPrefix=g.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(s){var r="auto";var q=false;if(s!==null){var o=0;for(var n in this._listOptions){o++}if(o>s){this._ph=22*s;r=this._ph+"px"}else{q=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!q&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+g._sbw+"px";this.polygon.style.height=r}};this._separatorButtonSelectObject=function(q,n,o){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};if(isNaN(o)){o=a.p_tbody.childNodes.length+1}else{if(o<1){o=1}}if(o>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[o-1])}this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td.appendChild(this.obj.sep);a._listOptions[q]=this.obj;return this};this._buttonButtonSelectObject=function(s,q,r){var o=true;if(typeof(q.enabled)!="undefined"){o=window.dhx4.s2b(q.enabled)}else{if(typeof(q.disabled)!="undefined"){o=window.dhx4.s2b(q.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=o;this.obj.tr.extAction=(q.action||null);this.obj.tr._selected=(q.selected!=null);this.obj.tr.className="tr_btn"+(this.obj.tr.en?(this.obj.tr._selected&&a.renderSelect?" tr_btn_selected":""):" tr_btn_disabled");this.obj.tr.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.tr.idd=String(s);if(isNaN(r)){r=a.p_tbody.childNodes.length+1}else{if(r<1){r=1}}if(r>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[r-1])}this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};if(g.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(q.img!=null){this.obj.td_a.innerHTML="<img class='btn_sel_img' src='"+g.conf.icons_path+q.img+"' border='0'>";this.obj.tr._img=q.img}else{this.obj.td_a.innerHTML="&nbsp;"}var n=(q.text!=null?q.text:(q.itemText||""));this.obj.td_b.innerHTML="<div class='btn_sel_text'>"+n+"</div>";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||(this._selected&&a.renderSelect)){return}this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(!this.en){return}if(this._selected&&a.renderSelect){if(String(this.className).search("tr_btn_selected")==-1){this.className="tr_btn tr_btn_selected"}}else{this.className="tr_btn"}};this.obj.tr[window.dhx4.isIPad?"ontouchend":"onclick"]=function(u){u=u||event;u.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(g.idPrefix,""));a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}g.anyUsed="none";var v=this.idd.replace(g.idPrefix,"");if(this.extAction){try{window[this.extAction](v)}catch(u){}}g.callEvent("onClick",[v])};a._listOptions[s]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+g.conf.skin+" dhxtoolbar_icons_"+g.conf.iconSize;this.polygon.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.polygon.onmousedown=function(n){n=n||event;n.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}n.cancelBubble=true;return false}}this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(l.options!=null){for(var j=0;j<l.options.length;j++){var c="_"+(l.options[j].type||"")+"ButtonSelectObject";if(l.options[j].id==null){l.options[j].id=g._genStr(24)}if(typeof(this[c])=="function"){new this[c](l.options[j].id,l.options[j])}}}document.body.appendChild(this.polygon);if(window.dhx4.isIE6){this.polygon._ie6cover=document.createElement("IFRAME");this.polygon._ie6cover.frameBorder=0;this.polygon._ie6cover.style.position="absolute";this.polygon._ie6cover.style.border="none";this.polygon._ie6cover.style.backgroundColor="#000000";this.polygon._ie6cover.style.filter="alpha(opacity=100)";this.polygon._ie6cover.style.display="none";this.polygon._ie6cover.setAttribute("src","javascript:false;");document.body.appendChild(this.polygon._ie6cover)}this.setWidth=function(n){this.obj.style.width=n-this.arw.offsetWidth+"px";this.polygon.style.width=this.obj.offsetWidth+this.arw.offsetWidth-2+"px";this.p_tbl.style.width=this.polygon.style.width};this.enableItem=function(){g._enableItem(this)};this.disableItem=function(){g._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display="";this.arw.style.display=""};this.hideItem=function(){this.obj.style.display="none";this.arw.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(n){g._setItemText(this,n)};this.getItemText=function(){return g._getItemText(this)};this.setItemImage=function(n){g._setItemImage(this,n,true)};this.clearItemImage=function(){g._clearItemImage(this,true)};this.setItemImageDis=function(n){g._setItemImage(this,n,false)};this.clearItemImageDis=function(){g._clearItemImage(this,false)};this.setItemToolTip=function(n){this.obj.title=n;this.arw.title=n};this.getItemToolTip=function(){return this.obj.title};this.addListOption=function(u,s,q,r,n){if(!(q=="button"||q=="separator")){return}var o={id:u,type:q,text:r,img:n};new this["_"+q+"ButtonSelectObject"](u,o,s)};this.removeListOption=function(q){if(!this._isListButton(q,true)){return}var n=this._listOptions[q];if(n.td_a!=null&&n.td_b!=null){n.td_a.onselectstart=null;n.td_b.onselectstart=null;while(n.td_a.childNodes.length>0){n.td_a.removeChild(n.td_a.childNodes[0])}while(n.td_b.childNodes.length>0){n.td_b.removeChild(n.td_b.childNodes[0])}n.tr.onselectstart=null;n.tr.onmouseover=null;n.tr.onmouseout=null;n.tr.onclick=null;while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.td_a=null;n.td_b=null;n.tr=null}else{n.sep.onselectstart=null;n.td.onselectstart=null;n.tr.onselectstart=null;while(n.td.childNodes.length>0){n.td.removeChild(n.td.childNodes[0])}while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.sep=null;n.td=null;n.tr=null}n=null;this._listOptions[q]=null;try{delete this._listOptions[q]}catch(o){}};this.showListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display=""};this.hideListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display="none"};this.isListOptionVisible=function(n){if(!this._isListButton(n,true)){return}return(this._listOptions[n].tr.style.display!="none")};this.enableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=true;this._listOptions[n].tr.className="tr_btn"+(this._listOptions[n].tr._selected&&g.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=false;this._listOptions[n].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.en};this.setListOptionPosition=function(q,o){if(!this._listOptions[q]||this.getListOptionPosition(q)==o||isNaN(o)){return}if(o<1){o=1}var n=this._listOptions[q].tr;this.p_tbody.removeChild(n);if(o>this.p_tbody.childNodes.length){this.p_tbody.appendChild(n)}else{this.p_tbody.insertBefore(n,this.p_tbody.childNodes[o-1])}n=null};this.getListOptionPosition=function(r){var o=-1;if(!this._listOptions[r]){return o}for(var n=0;n<this.p_tbody.childNodes.length;n++){if(this.p_tbody.childNodes[n]==this._listOptions[r].tr){o=n+1}}return o};this.setListOptionImage=function(r,n){if(!this._isListButton(r)){return}var q=this._listOptions[r].tr.childNodes[(g.rtl?1:0)];if(q.childNodes.length>0){q.childNodes[0].src=g.conf.icons_path+n}else{var o=document.createElement("IMG");o.className="btn_sel_img";o.src=g.conf.icons_path+n;q.appendChild(o)}q=null};this.getListOptionImage=function(q){if(!this._isListButton(q)){return}var o=this._listOptions[q].tr.childNodes[(g.rtl?1:0)];var n=null;if(o.childNodes.length>0){n=o.childNodes[0].src}o=null;return n};this.clearListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(g.rtl?1:0)];while(n.childNodes.length>0){n.removeChild(n.childNodes[0])}n.innerHTML="&nbsp;";n=null};this.setListOptionText=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML=n};this.getListOptionText=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.title=n};this.getListOptionToolTip=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.title};this.forEachListOption=function(o){for(var n in this._listOptions){o(n)}};this.getAllListOptions=function(){var o=new Array();for(var n in this._listOptions){o[o.length]=n}return o};this.setListOptionSelected=function(q){for(var n in this._listOptions){var o=this._listOptions[n];if(o.td_a!=null&&o.td_b!=null&&o.tr.en){if(n==q){o.tr._selected=true;o.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(o.tr._img){this.setItemImage(o.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(q))}}else{o.tr._selected=false;o.tr.className="tr_btn"}}o=null}};this.getListOptionSelected=function(){var o=null;for(var n in this._listOptions){if(this._listOptions[n].tr._selected==true){o=n}}return o};this._isListButton=function(o,n){if(this._listOptions[o]==null){return false}if(!n&&this._listOptions[o].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(n){this._ph=null;if(typeof(n)=="number"){this.maxOpen=n;this._maxOpenTest();return}this.maxOpen=null};if(l.width){this.setWidth(l.width)}if(this.mode=="select"&&typeof(l.selected)!="undefined"){this.setListOptionSelected(l.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(g,l,j){this.id=g.idPrefix+l;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(j.hidden!=null?"none":"");this.obj.idd=String(l);this.obj.w=(j.width!=null?j.width:100);this.obj.title=(j.title!=null?j.title:"");this.obj.innerHTML="<input class='dhxtoolbar_input' type='text' style='width:"+this.obj.w+"px;'"+(j.value!=null?" value='"+j.value+"'":"")+">";var c=g;var a=this;this.obj.childNodes[0].onkeydown=function(m){m=m||event;if(m.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};g.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return(!this.obj.childNodes[0].disabled)};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display!="none")};this.setValue=function(m){this.obj.childNodes[0].value=m};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(m){this.obj.w=m;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(m){this.obj.title=m};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(j.enabled)!="undefined"&&window.dhx4.s2b(j.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,j,c){this.id=a.idPrefix+j;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img!=null?c.img:"");this.imgDis=(c.imgdis!=null?c.imgdis:"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.pressed=(c.selected!=null);this.obj.extAction=(c.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):(this.state?"def":"dis"));this.obj.style.display=(c.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.idd=String(j);this.obj.title=(c.title||"");if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"<img src='"+a.conf.icons_path+this.img+"'>":""),(c.text!=null?"<div class='dhxtoolbar_text'>"+c.text+"</div>":""));a.base.appendChild(this.obj);var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(a.checkEvent("onBeforeStateChange")){if(!a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed])){return}}if(g.state==false){return}if(a.anyUsed!="none"){return}this.pressed=!this.pressed;this.className=(this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs);var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m,this.pressed)}catch(l){}}a.callEvent("onStateChange",[m,this.pressed]);return false};this.setItemState=function(l,n){if(this.obj.pressed!=l){if(l==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(n==true){var o=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](o,this.obj.pressed)}catch(m){}}a.callEvent("onStateChange",[o,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(j,m,l){this.id=j.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.len=(l.length!=null?Number(l.length):50);this.obj.innerHTML="<div class='dhxtoolbar_text'>"+(l.textMin||"")+"</div><div class='dhxtoolbar_sl_bg_l'></div><div class='dhxtoolbar_sl_bg_m' style='width:"+this.obj.len+"px;'></div><div class='dhxtoolbar_sl_bg_r'></div><div class='dhxtoolbar_text'>"+(l.textMax||"")+"</div>";j.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var g=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+j.conf.skin+(j.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(l.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(l.valueMin!=null?Number(l.valueMin):0);this.pen.valueMax=(l.valueMax!=null?Number(l.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(l.valueNow!=null?Number(l.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNow<this.pen.valueMin){this.pen.valueNow=this.pen.valueMin}this.pen._detectLimits=function(){this.minX=a.obj.childNodes[1].offsetLeft+2;this.maxX=a.obj.childNodes[3].offsetLeft-this.offsetWidth+1};this.pen._detectLimits();this.pen._definePos=function(){this.nowX=Math.round((this.valueNow-this.valueMin)*(this.maxX-this.minX)/(this.valueMax-this.valueMin)+this.minX);this.style.left=this.nowX+"px";this.newNowX=this.nowX};this.pen._definePos();this.pen.initXY=0;this.pen.allowMove=false;this.pen[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(n){if(a.state==false){return}n=n||event;this.initXY=(window.dhx4.isIPad?n.touches[0].clientX:n.clientX);this.newValueNow=this.valueNow;this.allowMove=true;this.className="dhxtoolbar_sl_pen dhxtoolbar_over";if(c.tip!=""){c.style.visibility="hidden";c.style.display="";c.innerHTML=c.tip.replace("%v",this.valueNow);c.style.left=Math.round(window.dhx4.absLeft(this)+this.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(this)-c.offsetHeight-3+"px";c.style.visibility="";c.style.zIndex=window.dhx4.zim.reserve(c._zi)}};this.pen._doOnMouseMoveStart=function(o){o=o||event;if(!g.allowMove){return}var n=(window.dhx4.isIPad?o.touches[0].clientX:o.clientX);var q=n-g.initXY;if(n<window.dhx4.absLeft(g)+Math.round(g.offsetWidth/2)&&g.nowX==g.minX){return}if(n>window.dhx4.absLeft(g)+Math.round(g.offsetWidth/2)&&g.nowX==g.maxX){return}g.newNowX=g.nowX+q;if(g.newNowX<g.minX){g.newNowX=g.minX}if(g.newNowX>g.maxX){g.newNowX=g.maxX}g.nowX=g.newNowX;g.style.left=g.nowX+"px";g.initXY=n;g.newValueNow=Math.round((g.valueMax-g.valueMin)*(g.newNowX-g.minX)/(g.maxX-g.minX)+g.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,g.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(g)+g.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(g)-c.offsetHeight-3+"px"}o.cancelBubble=true;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!g.allowMove){return}g.className="dhxtoolbar_sl_pen";g.allowMove=false;g.nowX=g.newNowX;g.valueNow=g.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}j.callEvent("onValueChange",[a.obj.idd.replace(j.idPrefix,""),g.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",g._doOnMouseMoveStart,false);document.addEventListener("touchend",g._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",g._doOnMouseMoveStart,false);window.addEventListener("mouseup",g._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",g._doOnMouseMoveStart);document.body.attachEvent("onmouseup",g._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state){return}this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state){return}this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setValue=function(n,o){n=Number(n);if(n<this.pen.valueMin){n=this.pen.valueMin}if(n>this.pen.valueMax){n=this.pen.valueMax}this.pen.valueNow=n;this.pen._definePos();if(o==true){j.callEvent("onValueChange",[this.obj.idd.replace(j.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(o,n){o=Number(o);if(o>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=n;this.obj.childNodes[0].style.display=(n.length>0?"":"none");this.pen.valueMin=o;if(this.pen.valueNow<this.pen.valueMin){this.pen.valueNow=this.pen.valueMin}this.pen._detectLimits();this.pen._definePos()};this.setMaxValue=function(o,n){o=Number(o);if(o<this.pen.valueMin){return}this.obj.childNodes[4].innerHTML=n;this.obj.childNodes[4].style.display=(n.length>0?"":"none");this.pen.valueMax=o;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var n=this.obj.childNodes[0].innerHTML;var o=this.pen.valueMin;return new Array(o,n)};this.getMaxValue=function(){var n=this.obj.childNodes[4].innerHTML;var o=this.pen.valueMax;return new Array(o,n)};this.setItemToolTipTemplate=function(n){this.label.tip=n};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var a=window.dhx4.screenDim();this.tX1=a.left;this.tX2=a.right;this.tY1=a.top;this.tY2=a.bottom};dhtmlXToolbarObject.prototype._initObj=function(c){for(var a=0;a<c.length;a++){this._addItemToStorage(c[a])}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._xmlToJson=function(s){var n=[];var y=s.getElementsByTagName("toolbar");if(y!=null&&y[0]!=null){y=y[0];var D=["id","type","hidden","title","text","enabled","img","imgdis","action","openAll","renderSelect","mode","maxOpen","width","value","selected","length","textMin","textMax","toolTip","valueMin","valueMax","valueNow"];var g=["id","type","enabled","disabled","action","selected","img","text"];for(var c=0;c<y.childNodes.length;c++){if(y.childNodes[c].tagName=="item"){var m={};for(var A=0;A<D.length;A++){var j=y.childNodes[c].getAttribute(D[A]);if(j!=null){m[D[A]]=j}}for(var x=0;x<y.childNodes[c].childNodes.length;x++){if(y.childNodes[c].childNodes[x].tagName=="item"&&m.type=="buttonSelect"){var C={};for(var A=0;A<g.length;A++){var j=y.childNodes[c].childNodes[x].getAttribute(g[A]);if(j!=null){C[g[A]]=j}}var v=y.childNodes[c].childNodes[x].getElementsByTagName("itemText");if(v!=null&&v[0]!=null){C.itemText=v[0].firstChild.nodeValue}var o=y.childNodes[c].childNodes[x].getElementsByTagName("userdata");for(var A=0;A<o.length;A++){if(!C.userdata){C.userdata={}}var a={};try{a.name=o[A].getAttribute("name")}catch(l){a.name=null}try{a.value=o[A].firstChild.nodeValue}catch(l){a.value=""}if(a.name!=null){C.userdata[a.name]=a.value}}if(m.options==null){m.options=[]}m.options.push(C)}if(y.childNodes[c].childNodes[x].tagName=="userdata"){if(m.userdata==null){m.userdata={}}var C={};try{C.name=y.childNodes[c].childNodes[x].getAttribute("name")}catch(l){C.name=null}try{C.value=y.childNodes[c].childNodes[x].firstChild.nodeValue}catch(l){C.value=""}if(C.name!=null){m.userdata[C.name]=C.value}}}n.push(m)}}}return n};dhtmlXToolbarObject.prototype._addItemToStorage=function(m,o){var n=(m.id||this._genStr(24));var j=(m.type||"");if(j=="spacer"){this.addSpacer(this._lastId)}else{this._lastId=n}if(j!=""&&this["_"+j+"Object"]!=null){if(j=="buttonSelect"){if(m.options!=null){for(var l=0;l<m.options.length;l++){if(m.options[l].type=="obj"){m.options[l].type="button"}if(m.options[l].type=="sep"){m.options[l].type="separator"}}}}if(j=="slider"){var g={tip_template:"toolTip",value_min:"valueMin",value_max:"valueMax",value_now:"valueNow",text_min:"textMin",text_max:"textMax"};for(var c in g){if(m[g[c]]==null&&m[c]!=null){m[g[c]]=m[c]}}}if(j=="buttonInput"){if(m.value==null&&m.text!=null){m.value=m.text}}if(j=="buttonTwoState"){if(typeof(m.selected)=="undefined"&&typeof(m.pressed)!="undefined"&&window.dhx4.s2b(m.pressed)){m.selected=true}}if(typeof(m.enabled)=="undefined"&&typeof(m.disabled)!="undefined"&&window.dhx4.s2b(m.disabled)){m.enabled=false}if(m.imgDis==null&&m.img_disabled!=null){m.imgdis=m.img_disabled}if((typeof(m.openAll)=="undefined"||m.openAll==null)&&this.conf.skin=="dhx_terrace"){m.openAll=true}this.objPull[this.idPrefix+n]=new this["_"+j+"Object"](this,n,m);this.objPull[this.idPrefix+n]["type"]=j;this.setPosition(n,o)}if(m.userdata!=null){for(var c in m.userdata){this.setUserData(n,c,m.userdata[c])}}if(m.options!=null){for(var l=0;l<m.options.length;l++){if(m.options[l].userdata!=null){for(var c in m.options[l].userdata){this.setListOptionUserData(m.id,m.options[l].id,c,m.options[l].userdata[c])}}}}};dhtmlXToolbarObject.prototype.setSkin=function(l,g){if(g===true){this.cont.className=this.cont.className.replace(/dhxtoolbar_icons_\d{1,}/,"dhxtoolbar_icons_"+this.conf.iconSize)}else{this.conf.skin=l;if(this.conf.skin=="dhx_skyblue"){this.conf.sel_ofs_y=1}if(this.conf.skin=="dhx_web"){this.conf.sel_ofs_y=1;this.conf.sel_ofs_x=1}if(this.conf.skin=="dhx_terrace"){this.conf.sel_ofs_y=-1;this.conf.sel_ofs_x=0}this.cont.className="dhx_toolbar_"+this.conf.skin+" dhxtoolbar_icons_"+this.conf.iconSize}for(var c in this.objPull){var j=this.objPull[c];if(j.type=="slider"){j.pen._detectLimits();j.pen._definePos();j.label.className="dhx_toolbar_slider_label_"+this.conf.skin}if(j.type=="buttonSelect"){j.polygon.className="dhx_toolbar_poly_"+this.conf.skin+" dhxtoolbar_icons_"+this.conf.iconSize}}if(l=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.setAlign=function(a){this.conf.align=(a=="right"?"right":"left");this.base.className=(a=="right"?"dhxtoolbar_float_right":"dhxtoolbar_float_left");if(this._spacer){this._spacer.className=(a=="right"?" dhxtoolbar_float_left":" dhxtoolbar_float_right")}};dhtmlXToolbarObject.prototype.setIconSize=function(a){this.conf.iconSize=({18:true,24:true,32:true,48:true}[a]?a:18);this.setSkin(this.conf.skin,true);this.callEvent("_onIconSizeChange",[this.conf.iconSize])};dhtmlXToolbarObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXToolbarObject.prototype.setUserData=function(g,a,c){g=this.idPrefix+g;if(this.objPull[g]!=null){if(this.objPull[g].userData==null){this.objPull[g].userData={}}this.objPull[g].userData[a]=c}};dhtmlXToolbarObject.prototype.getUserData=function(c,a){c=this.idPrefix+c;if(this.objPull[c]!=null&&this.objPull[c].userData!=null){return this.objPull[c].userData[a]||null}return null};dhtmlXToolbarObject.prototype._isListOptionExists=function(a,g){if(this.objPull[this.idPrefix+a]==null){return false}var c=this.objPull[this.idPrefix+a];if(c.type!="buttonSelect"){return false}if(c._listOptions[g]==null){return false}return true};dhtmlXToolbarObject.prototype.setListOptionUserData=function(a,l,c,j){if(!this._isListOptionExists(a,l)){return}var g=this.objPull[this.idPrefix+a]._listOptions[l];if(g.userData==null){g.userData={}}g.userData[c]=j};dhtmlXToolbarObject.prototype.getListOptionUserData=function(a,j,c){if(!this._isListOptionExists(a,j)){return null}var g=this.objPull[this.idPrefix+a]._listOptions[j];if(!g.userData){return null}return(g.userData[c]?g.userData[c]:null)};dhtmlXToolbarObject.prototype._improveTerraceSkin=function(){if(this.conf.terrace_radius==null){this.conf.terrace_radius="3px"}var g=[];var j={separator:true,text:true};var m=[this.base];if(this._spacer!=null){m.push(this._spacer)}for(var o=0;o<m.length;o++){g[o]=[];for(var c=0;c<m[o].childNodes.length;c++){if(m[o].childNodes[c].idd!=null&&m[o].childNodes[c].style.display!="none"){var n=this.idPrefix+m[o].childNodes[c].idd;if(this.objPull[n]!=null&&this.objPull[n].obj==m[o].childNodes[c]){g[o].push({a:n,type:this.objPull[n].type,node:this.objPull[n][this.objPull[n].type=="buttonSelect"?"arw":"obj"]})}}}m[o]=null}for(var o=0;o<g.length;o++){for(var c=0;c<g[o].length;c++){var r=g[o][c];var s=false;var l=false;if(!j[r.type]){if(c==g[o].length-1||(g[o][c+1]!=null&&j[g[o][c+1].type])){s=true}if(c==0||(c-1>=0&&g[o][c-1]!=null&&j[g[o][c-1].type])){l=true}}r.node.style.borderRightWidth=(s?"1px":"0px");r.node.style.borderTopRightRadius=r.node.style.borderBottomRightRadius=(s?this.conf.terrace_radius:"0px");if(r.type=="buttonSelect"){r.node.previousSibling.style.borderTopLeftRadius=r.node.previousSibling.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px");r.node.previousSibling._br=s;r.node.previousSibling._bl=l}else{r.node.style.borderTopLeftRadius=r.node.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px")}r.node._br=s;r.node._bl=l}}for(var o=0;o<g.length;o++){for(var c=0;c<g[o].length;c++){for(var n in g[o][c]){g[o][c][n]=null}g[o][c]=null}g[o]=null}g=m=null};dhtmlXToolbarObject.prototype._improveTerraceButtonSelect=function(g,c){var a=this.objPull[g];if(c==true){a.obj.style.borderBottomLeftRadius=(a.obj._bl?this.conf.terrace_radius:"0px");a.arw.style.borderBottomRightRadius=(a.obj._br?this.conf.terrace_radius:"0px")}else{a.obj.style.borderBottomLeftRadius="0px";a.arw.style.borderBottomRightRadius="0px"}a=null};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_toolbar=function(l,c,j,a,g){if(typeof(g)!="undefined"){l=g}else{l=document.createElement("DIV");l.className="dhx_cell_toolbar_"+(this.conf.borders?"def":"no_borders");l.appendChild(document.createElement("DIV"));l.firstChild.className="dhx_toolbar_base_18_dhx_skyblue"}this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.toolbar=true;this._updateIdx();return l};dhtmlXCellObject.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.callEvent("_onBeforeContentAttach",["toolbar"]);if(typeof(a)=="undefined"){a={}}else{if(typeof(a)=="string"){a={skin:a}}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("toolbar").firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this._adjustCont(this._idd);this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell._adjustCont()});a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataNodes.toolbar};dhtmlXCellObject.prototype.detachToolbar=function(){if(!this.dataNodes.toolbar){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;delete this.dataNodes.toolbar;this._detachObject("toolbar")};dhtmlXCellObject.prototype.showToolbar=function(){this._mtbShowHide("toolbar","")};dhtmlXCellObject.prototype.hideToolbar=function(){this._mtbShowHide("toolbar","none")};dhtmlXCellObject.prototype.getAttachedToolbar=function(){return this.dataNodes.toolbar}}function dhtmlXEditor(g,j){var c=this;this.conf={content:"",contentHTML:"",resizeTM:null,resizeTMTime:100,roMode:false,toolbar:false,iconsPath:"",evs:["focus","blur","keydown","keyup","keypress","mouseup","mousedown","click"]};this._doOnFocusChanged=null;this._doOnAccess=null;if(typeof(g)=="object"&&g!=null&&g.tagName==null){j=g.skin;if(g.content!=null){this.conf.content=g.content}if(g.contentHTML!=null){this.conf.contentHTML=g.contentHTML}if(g.iconsPath!=null){this.conf.iconsPath=g.iconsPath}if(g.toolbar!=null){this.conf.toolbar=window.dhx4.s2b(g.toolbar)}if(g.onFocusChanged!=null){this._doOnFocusChanged=g.onFocusChanged}if(g.onAccess!=null){this._doOnAccess=g.onAccess}g=g.parent}this.conf.skin=(j||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxeditor")||"dhx_skyblue");if(typeof(g)=="string"){g=document.getElementById(g)}this.base=g;this.base.className+=" dhxeditor_"+this.conf.skin;while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}var l=(window.dhx4.isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position"));if(!(l=="relative"||l=="absolute")){this.base.style.position="relative"}this.cell=new dhtmlXEditorCell(window.dhx4.newId(),this);this.base.appendChild(this.cell.cell);this.cBlock=document.createElement("DIV");this.cBlock.className="dhxcont_content_blocker";this.cBlock.style.display="none";this.base.appendChild(this.cBlock);this.editor=document.createElement("IFRAME");this.editor.className="dhxeditor_mainiframe";this.editor.frameBorder=0;if(window.dhx4.isOpera){this.editor.scrolling="yes"}this.setSizes();var a=this.editor;if(typeof(window.addEventListener)!="undefined"){a.onload=function(){for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.addEventListener(c.conf.evs[m],c._ev,false)}}}else{a.onreadystatechange=function(m){if(typeof(a.readyState)!="undefined"&&a.readyState=="complete"){try{for(var n=0;n<c.conf.evs.length;n++){a.contentWindow.document.body.attachEvent("on"+c.conf.evs[n],c._ev)}}catch(o){}}}}this._ev=function(n){n=n||event;var m=n.type;c.callEvent("onAccess",[m,n]);if(typeof(c._doOnAccess)=="function"){c._doOnAccess(m,n)}else{if(typeof(c._doOnAccess)=="string"&&typeof(window[c._doOnAccess])=="function"){window[c._doOnAccess](m,n)}}};this._focus=function(){if(window.dhx4.isIE){this.editor.contentWindow.document.body.focus()}else{this.editor.contentWindow.focus()}};this.cell.attachObject(this.editor);this.edWin=this.editor.contentWindow;this.edDoc=this.edWin.document;this._prepareContent=function(o,r){var n="";if(o===true&&this.getContent!=null){n=this.getContent()}var m=this.editor.contentWindow.document;m.open("text/html","replace");if(window.dhx4.isOpera){m.write("<html><head><style> html, body { overflow:auto;-webkit-overflow-scrolling: touch; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{if(window.dhx4.isKHTML){m.write("<html><head><style> html {overflow-x: auto;-webkit-overflow-scrolling: touch; overflow-y: auto;} body { overflow: auto; overflow-y: scroll;} html,body { padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{if(window.dhx4.isIE){m.write("<html><head><style> html {overflow-y: auto;} body {overflow-y: scroll;-webkit-overflow-scrolling: touch;} html,body { overflow-x: auto; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color: #ffffff; outline: none;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{m.write("<html><head><style> html,body { overflow-x: auto; overflow-y:-webkit-overflow-scrolling: touch; scroll; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}}}m.close();if(window.dhx4.isIE){m.contentEditable=(r!==true)}else{m.designMode=(r!==true?"On":"Off")}if(window.dhx4.isFF){try{m.execCommand("useCSS",false,true)}catch(q){}}if(o===true&&this.setContent!=null){this.setContent(n)}};this._prepareContent();this._doOnResize=function(){window.clearTimeout(c.conf.resizeTM);c.conf.resizeTM=window.setTimeout(function(){if(c.setSizes){c.setSizes()}},c.conf.resizeTMTime)};this._runCommand=function(o,r){if(this.conf.roMode===true){return}if(arguments.length<2){r=null}if(window.dhx4.isIE){this.edWin.focus()}try{var n=this.editor.contentWindow.document;n.execCommand(o,false,r)}catch(q){}if(window.dhx4.isIE){this.edWin.focus();var m=this;window.setTimeout(function(){m.edWin.focus();m=null},1)}};this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.clearFormatting=function(){this._runCommand("RemoveFormat");var m=this.getContent();m=m.replace(/<\/?h\d>/gi,"");this.setContent(m)};this._doOnClick=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnMouseDown=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnKeyUp=function(q){var o=q||window.event;var m=o.keyCode;var n=o.target||o.srcElement;if({37:1,38:1,39:1,40:1,13:1}[m]==1){c._showInfo(n)}};this._getParentByTag=function(m,o){o=o.toLowerCase();var n=m;do{if(o==""||n.nodeName.toLowerCase()==o){return n}}while(n=n.parentNode);return m};this._isStyleProperty=function(o,r,m,q){r=r.toLowerCase();var s=o;do{if((s.nodeName.toLowerCase()==r)&&(s.style[m]==q)){return true}}while(s=s.parentNode);return false};this._setStyleProperty=function(m,q){this.style[q]=false;var o=this._getParentByTag(m,q);if(o&&(o.tagName.toLowerCase()==q)){this.style[q]=true}if(q=="del"&&this._getParentByTag(m,"strike")&&this._getParentByTag(m,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(n){var n=(this._getSelectionBounds().end)?this._getSelectionBounds().end:n;if(!n||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var m=this.edWin.getComputedStyle(n,null);var o=((m.getPropertyValue("font-weight")==401)?700:m.getPropertyValue("font-weight"));this.style={fontStyle:m.getPropertyValue("font-style"),fontSize:m.getPropertyValue("font-size"),textDecoration:m.getPropertyValue("text-decoration"),fontWeight:o,fontFamily:m.getPropertyValue("font-family"),textAlign:m.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=m.getPropertyValue("font-style");this.style.vAlign=m.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(n,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(n,"span","textDecoration","underline")}}else{var m=n.currentStyle;this.style={fontStyle:m.fontStyle,fontSize:m.fontSize,textDecoration:m.textDecoration,fontWeight:m.fontWeight,fontFamily:m.fontFamily,textAlign:m.textAlign}}this._setStyleProperty(n,"h1");this._setStyleProperty(n,"h2");this._setStyleProperty(n,"h3");this._setStyleProperty(n,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(n,"del");this._setStyleProperty(n,"sub");this._setStyleProperty(n,"sup");this._setStyleProperty(n,"u")}this.callEvent("onFocusChanged",[this.style,m])}catch(q){return null}};this._getSelectionBounds=function(){var r,o,u,n;if(this.edWin.getSelection){var s=this.edWin.getSelection();r=s.getRangeAt(s.rangeCount-1);u=r.startContainer;n=r.endContainer;o=r.commonAncestorContainer;if(u.nodeName=="#text"){o=o.parentNode}if(u.nodeName=="#text"){u=u.parentNode}if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName=="#text"){n=n.parentNode}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}else{if(this.edWin.document.selection){r=this.edDoc.selection.createRange();if(!r.duplicate){return null}o=r.parentElement();var q=r.duplicate();var m=r.duplicate();q.collapse(true);m.moveToElementText(q.parentElement());m.setEndPoint("EndToStart",q);u=q.parentElement();q=r.duplicate();m=r.duplicate();m.collapse(false);q.moveToElementText(m.parentElement());q.setEndPoint("StartToEnd",m);n=m.parentElement();if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}}return null};this.getContent=function(){if(!this.edDoc.body){return""}else{if(window.dhx4.isFF){return this.editor.contentWindow.document.body.innerHTML.replace(/<\/{0,}br\/{0,}>\s{0,}$/gi,"")}if(window.dhx4.isIE&&this.edDoc.body.innerText.length==0){return""}return this.edDoc.body.innerHTML}};this.setContent=function(o){o=o||"";if(this.edDoc.body){var n=false;if(window.dhx4.isFF){var m=navigator.userAgent.match(/Firefox\/(\d*)/);n=(m!=null&&m[1]<28)}if(n){if(typeof(this.conf.ffTest)=="undefined"){this.editor.contentWindow.document.body.innerHTML="";this._runCommand("InsertHTML","test");this.conf.ffTest=(this.editor.contentWindow.document.body.innerHTML.length>0)}if(this.conf.ffTest){this.editor.contentWindow.document.body.innerHTML=o}else{this.editor.contentWindow.document.body.innerHTML="";if(o.length==0){o=" "}this._runCommand("InsertHTML",o)}}else{this.editor.contentWindow.document.body.innerHTML=o}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=o;this._onFirstLoad=function(){c.setContent(c.conf.firstLoadData);if(typeof(window.addEventListener)=="function"){c.edWin.removeEventListener("load",c._onFirstLoad,false)}else{c.edWin.detachEvent("onload",c._onFirstLoad)}c.conf.firstLoadData=null;c.conf.firstLoadEv=false;c._onFirstLoad=null};if(typeof(window.addEventListener)=="function"){this.edWin.addEventListener("load",this._onFirstLoad,false)}else{this.edWin.attachEvent("onload",this._onFirstLoad)}}}};this.setContentHTML=function(m){window.dhx4.ajax.get(m,function(n){if(n.xmlDoc.responseText!=null){c.setContent(n.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(m){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(m)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](m)}}});if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResize,false);this.edDoc.addEventListener("click",this._doOnClick,false);this.edDoc.addEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.addEventListener("mousedown",this._doOnMouseDown,false)}}else{window.attachEvent("onresize",this._doOnResize);this.edDoc.attachEvent("onclick",this._doOnClick);this.edDoc.attachEvent("onkeyup",this._doOnKeyUp)}this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResize,false);this.edDoc.removeEventListener("click",this._doOnClick,false);this.edDoc.removeEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.removeEventListener("mousedown",this._doOnMouseDown,false)}for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.removeEventListener(c.conf.evs[m],c._ev,false)}}else{window.detachEvent("onresize",this._doOnResize,false);this.edDoc.detachEvent("onclick",this._doOnClick);this.edDoc.detachEvent("onkeyup",this._doOnKeyUp);for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.document.body.detachEvent("on"+c.conf.evs[m],c._ev)}}this._doOnAccess=null;this._doOnFocusChanged=null;if(typeof(window.addEventListener)=="function"){this.editor.onload=null}else{this.editor.onreadystatechange=null}this.editor.parentNode.removeChild(this.editor);this.editor=null;this.edDoc=null;this.edWin=null;this.cell._unload();this.cell=null;this.tb=null;window.dhx4._eventable(this,"clear");this.cBlock.parentNode.removeChild(this.cBlock);this.cBlock=null;this.base.className=String(this.base.className).replace(new RegExp("\\s{0,}dhxeditor_"+this.conf.skin),"");while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.base=null;this._doOnClick=null;this._doOnKeyUp=null;this._doOnMouseDown=null;this._ev=null;this._focus=null;this._prepareContent=null;this._doOnResize=null;this.setIconsPath=null;this.init=null;this.setSizes=null;this._runCommand=null;this.applyBold=null;this.applyItalic=null;this.applyUnderscore=null;this.clearFormatting=null;this._showInfo=null;this._getSelectionBounds=null;this.getContent=null;this.setContent=null;this.setContentHTML=null;this.setReadonly=null;this.isReadonly=null;this.unload=null;c=a=null};if(this.conf.toolbar==true&&typeof(this.attachToolbar)=="function"&&typeof(window.dhtmlXToolbarObject)=="function"){this.attachToolbar(this.conf.iconsPath)}this.setIconsPath=function(m){this.conf.iconsPath=m};if(this.conf.content.length>0){this.setContent(this.conf.content);this.conf.content=""}else{if(this.conf.contentHTML.length>0){this.setContentHTML(this.conf.contentHTML);this.conf.contentHTML=""}}return this}dhtmlXEditor.prototype.setSizes=function(){this.cell._setSize(0,0,this.base.clientWidth,this.base.clientHeight);if(this.editor!=null){this.editor.style.left="5px";this.editor.style.width=this.base.clientWidth-5+"px"}};dhtmlXEditor.prototype.setReadonly=function(a){this.conf.roMode=(a===true);this._prepareContent(true,this.conf.roMode);this.cBlock.style.display=(this.conf.roMode?"":"none")};dhtmlXEditor.prototype.isReadonly=function(a){return(this.conf.roMode||false)};dhtmlXEditor.prototype.setSkin=function(a){this.base.className=String(this.base.className).replace(new RegExp("dhxeditor_"+this.conf.skin),"dhxeditor_"+a);this.conf.skin=this.cell.conf.skin=a;if(this.tb){this.cell.detachToolbar(a);this.tb=null;this.attachToolbar()}this.setSizes()};window.dhtmlXEditorCell=function(g,a){dhtmlXCellObject.apply(this,[g,"_editor"]);var c=this;this.editor=a;this.conf.skin=this.editor.conf.skin;this.attachEvent("_onCellUnload",function(){this._stbUnload();this.editor=null;c=null});this._stbInit();return this};dhtmlXEditorCell.prototype=new dhtmlXCellObject();dhtmlXEditorCell.prototype._stbInit=function(){var m=this;var l=document.createElement("DIV");l.className="dhx_cell_stb";this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);l.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var j={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var g in j){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;l.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var n=document.createElement("DIV");n.className="dhx_cell_stb_button btn_"+g;n._actv=g.charAt(0);n._cmd=j[g];c.appendChild(n);n.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};n.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}m.editor[this._cmd]();m.editor.callEvent("onToolbarClick",[this._actv])};n=c=null}l=null;this._stbUnload=function(){var a=this.cell.childNodes[this.conf.idx.stb];a.onselectstart=null;while(a.childNodes.length>0){a.lastChild.onmousedown=a.lastChild.onclick=null;a.lastChild.firstChild.onmousedown=a.lastChild.firstChild.onclick=null;a.lastChild.firstChild._actv=a.lastChild.firstChild._cmd=null;a.lastChild.removeChild(a.lastChild.firstChild);a.removeChild(a.lastChild)}a.parentNode.removeChild(a);a=m=null;this.conf.idx_data.stb=this.conf.ofs_nodes.t._getStbHeight=null;delete this.conf.ofs_nodes.t._getStbHeight;delete this.conf.idx_data.stb;this._updateIdx()};this.conf.ofs_nodes.t._getStbHeight="func";this.conf.idx_data.stb="dhx_cell_stb";this._updateIdx()};dhtmlXEditorCell.prototype._stbHide=function(){this.cell.childNodes[this.conf.idx.stb].style.display="none"};dhtmlXEditorCell.prototype._getStbHeight=function(){return this.cell.childNodes[this.conf.idx.stb].offsetHeight};dhtmlXCellObject.prototype.attachEditor=function(a){this.callEvent("_onBeforeContentAttach",["editor"]);var g=document.createElement("DIV");g.style.width="100%";g.style.height="100%";g.style.position="relative";g.style.overflow="hidden";this._attachObject(g);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=g;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);g=null;a.parent=null;a=null;if(typeof(window.dhtmlXPortalCell)!="undefined"&&this instanceof window.dhtmlXPortalCell){if(this.portal.conf.editor_ev==null){var j=this.portal.attachEvent("onBeforeDrag",function(l){if(this.cdata[l].dataType=="editor"){this.cdata[l].conf.editor_cont=this.cdata[l].dataObj.getContent()}return true});var c=this.portal.attachEvent("onDrop",function(l){if(this.cdata[l].dataType=="editor"){this.cdata[l].dataObj.setContent(this.cdata[l].conf.editor_cont);this.cdata[l].dataObj._prepareContent(true);this.cdata[l].conf.editor_cont=null}});this.portal.conf.editor_ev=[j,c]}this.conf.editor_ev=this.attachEvent("_onBeforeContentDetach",function(){this.detachEvent(this.conf.editor_ev);this.conf.editor_ev=null;if(this instanceof window.dhtmlXPortalCell){var m=false;for(var l in this.portal.cdata){if(this.portal.cdata[l]!=this&&this.portal.cdata[l].dataType=="editor"){m=true}}if(m==false){for(var n=0;n<this.portal.conf.editor_ev.length;n++){this.portal.detachEvent(this.portal.conf.editor_ev[n])}this.portal.conf.editor_ev=null}}})}this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXEditor.prototype.attachToolbar=function(c){if(this.tb!=null){return}if(c!=null){this.conf.iconsPath=c}this.cell._stbHide();this.tb=this.cell.attachToolbar({icons_path:this.conf.iconsPath+"/dhxeditor_"+String(this.conf.skin).replace(/^dhx_/,"")+"/",skin:this.conf.skin});this.setSizes();this._availFonts=new Array("Arial","Arial Narrow","Comic Sans MS","Courier","Georgia","Impact","Tahoma","Times New Roman","Verdana");this._initFont=this._availFonts[0];this._xmlFonts="";for(var m=0;m<this._availFonts.length;m++){var j=String(this._availFonts[m]).replace(/\s/g,"_");this._xmlFonts+='<item type="button" id="applyFontFamily:'+j+'"><itemText><![CDATA[<img src="'+this.tb.imagePath+"font_"+String(j).toLowerCase()+'.gif" border="0" style="/*margin-top:1px;margin-bottom:1px;*/width:110px;height:16px;">]]></itemText></item>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var g in this._availSizes){this._xmlSizes+='<item type="button" id="applyFontSize:'+g+":"+this._availSizes[g]+'" text="'+this._availSizes[g]+'"/>'}this.tbXML='<toolbar><item id="applyH1" type="buttonTwoState" img="h1.gif" imgdis="h4_dis.gif" title="H1"/><item id="applyH2" type="buttonTwoState" img="h2.gif" imgdis="h4_dis.gif" title="H2"/><item id="applyH3" type="buttonTwoState" img="h3.gif" imgdis="h4_dis.gif" title="H3"/><item id="applyH4" type="buttonTwoState" img="h4.gif" imgdis="h4_dis.gif" title="H4"/><item id="separ01" type="separator"/><item id="applyBold" type="buttonTwoState" img="bold.gif" imgdis="bold_dis.gif" title="Bold Text"/><item id="applyItalic" type="buttonTwoState" img="italic.gif" imgdis="italic_dis.gif" title="Italic Text"/><item id="applyUnderscore" type="buttonTwoState" img="underline.gif" imgdis="underline_dis.gif" title="Underscore Text"/><item id="applyStrikethrough" type="buttonTwoState" img="strike.gif" imgdis="strike_dis.gif" title="Strikethrough Text"/><item id="separ02" type="separator"/><item id="alignLeft" type="buttonTwoState" img="align_left.gif" imgdis="align_left_dis.gif" title="Left Alignment"/><item id="alignCenter" type="buttonTwoState" img="align_center.gif" imgdis="align_center_dis.gif" title="Center Alignment"/><item id="alignRight" type="buttonTwoState" img="align_right.gif" imgdis="align_right_dis.gif" title="Right Alignment"/><item id="alignJustify" type="buttonTwoState" img="align_justify.gif" title="Justified Alignment"/><item id="separ03" type="separator"/><item id="applySub" type="buttonTwoState" img="script_sub.gif" imgdis="script_sub.gif" title="Subscript"/><item id="applySuper" type="buttonTwoState" img="script_super.gif" imgdis="script_super_dis.gif" title="Superscript"/><item id="separ04" type="separator"/><item id="createNumList" type="button" img="list_number.gif" imgdis="list_number_dis.gif" title="Number List"/><item id="createBulList" type="button" img="list_bullet.gif" imgdis="list_bullet_dis.gif" title="Bullet List"/><item id="separ05" type="separator"/><item id="increaseIndent" type="button" img="indent_inc.gif" imgdis="indent_inc_dis.gif" title="Increase Indent"/><item id="decreaseIndent" type="button" img="indent_dec.gif" imgdis="indent_dec_dis.gif" title="Decrease Indent"/><item id="separ06" type="separator"/><item id="clearFormatting" type="button" img="clear.gif" title="Clear Formatting"/></toolbar>';this.tb.loadStruct(this.tbXML);this._checkAlign=function(a){this.tb.setItemState("alignCenter",false);this.tb.setItemState("alignRight",false);this.tb.setItemState("alignJustify",false);this.tb.setItemState("alignLeft",false);if(a){this.tb.setItemState(a,true)}};this._checkH=function(a){this.tb.setItemState("applyH1",false);this.tb.setItemState("applyH2",false);this.tb.setItemState("applyH3",false);this.tb.setItemState("applyH4",false);if(a){this.tb.setItemState(a,true)}};this._doOnFocusChanged=function(o){if(!o.h1&&!o.h2&&!o.h3&&!o.h4){var a=(String(o.fontWeight).search(/bold/i)!=-1)||(Number(o.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var n="alignLeft";if(String(o.textAlign).search(/center/)!=-1){n="alignCenter"}if(String(o.textAlign).search(/right/)!=-1){n="alignRight"}if(String(o.textAlign).search(/justify/)!=-1){n="alignJustify"}this.tb.setItemState(n,true);this._checkAlign(n);this.tb.setItemState("applyH1",o.h1);this.tb.setItemState("applyH2",o.h2);this.tb.setItemState("applyH3",o.h3);this.tb.setItemState("applyH4",o.h4);if(window._KHTMLrv){o.sub=(o.vAlign=="sub");o.sup=(o.vAlign=="super")}this.tb.setItemState("applyItalic",(o.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",o.del);this.tb.setItemState("applySub",o.sub);this.tb.setItemState("applySuper",o.sup);this.tb.setItemState("applyUnderscore",o.u)};this._doOnToolbarClick=function(n){var a=String(n).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[n])}}};this._doOnStateChange=function(n,a){this[n]();switch(n){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(n);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(n);break}this.callEvent("onToolbarClick",[n])};this._doOnBeforeStateChange=function(n,a){if((n=="alignLeft"||n=="alignCenter"||n=="alignRight"||n=="alignJustify")&&a==true){return false}return true};var l=this;this.tb.attachEvent("onClick",function(a){l._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(n,a){l._doOnStateChange(n,a)});this.tb.attachEvent("onBeforeStateChange",function(n,a){return l._doOnBeforeStateChange(n,a)});this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.applyStrikethrough=function(){this._runCommand("StrikeThrough")};this.alignLeft=function(){this._runCommand("JustifyLeft")};this.alignRight=function(){this._runCommand("JustifyRight")};this.alignCenter=function(){this._runCommand("JustifyCenter")};this.alignJustify=function(){this._runCommand("JustifyFull")};this.applySub=function(){this._runCommand("Subscript")};this.applySuper=function(){this._runCommand("Superscript")};this.applyH1=function(){this._runCommand("FormatBlock","<H1>")};this.applyH2=function(){this._runCommand("FormatBlock","<H2>")};this.applyH3=function(){this._runCommand("FormatBlock","<H3>")};this.applyH4=function(){this._runCommand("FormatBlock","<H4>")};this.createNumList=function(){this._runCommand("InsertOrderedList")};this.createBulList=function(){this._runCommand("InsertUnorderedList")};this.increaseIndent=function(){this._runCommand("Indent")};this.decreaseIndent=function(){this._runCommand("Outdent")};this.clearFormatting=function(){this._runCommand("RemoveFormat");this.tb.setItemState("applyBold",false);this.tb.setItemState("applyItalic",false);this.tb.setItemState("applyStrikethrough",false);this.tb.setItemState("applySub",false);this.tb.setItemState("applySuper",false);this.tb.setItemState("applyUnderscore",false);var a=this.getContent();a=a.replace(/<\/?h\d>/gi,"");this.setContent(a)}};dhtmlx.Group={_init:function(){dhtmlx.assert(this.data,"DataStore required for grouping");this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){if(this._settings.group){this.group(this._settings.group,false)}},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this._settings.sort){a.block();a.sort(this._settings.sort);a.unblock()}},this));this.data.attachEvent("onClearAll",dhtmlx.bind(function(){this.data._not_grouped_order=this.data._not_grouped_pull=null},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this._settings.sort=null},this))},_init_group_data_event:function(c,a){c.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false);this.block();this.clearAll();this.unblock()},a))},sum:function(c,a){c=dhtmlx.Template.setter(c);a=a||this.data;var g=0;a.each(function(j){g+=c(j)*1});return g},min:function(g,c){g=dhtmlx.Template.setter(g);c=c||this.data;var a=Infinity;c.each(function(j){if(g(j)*1<a){a=g(j)*1}});return a*1},max:function(g,c){g=dhtmlx.Template.setter(g);c=c||this.data;var a=-Infinity;c.each(function(j){if(g(j)*1>a){a=g(j)*1}});return a},_split_data_by:function(m){var o=function(s,r){s=dhtmlx.Template.setter(s);return s(r[0])};var q=dhtmlx.Template.setter(m.by);if(!m.map[q]){m.map[q]=[q,o]}var g={};var n=[];this.data.each(function(r){var s=q(r);if(!g[s]){n.push({id:s});g[s]=dhtmlx.toArray()}g[s].push(r)});for(var a in m.map){var l=(m.map[a][1]||o);if(typeof l!="function"){l=this[l]}for(var j=0;j<n.length;j++){n[j][a]=l.call(this,m.map[a][0],g[n[j].id])}}this.data._not_grouped_order=this.data.order;this.data._not_grouped_pull=this.data.pull;this.data.order=dhtmlx.toArray();this.data.pull={};for(var j=0;j<n.length;j++){var c=this.data.id(n[j]);this.data.pull[c]=n[j];this.data.order.push(c)}this.callEvent("onStoreUpdated",[])},group:function(a,c){this.ungroup(false);this._split_data_by(a);if(c!==false){this.data.callEvent("onStoreUpdated",[])}},ungroup:function(a){if(this.data._not_grouped_order){this.data.order=this.data._not_grouped_order;this.data.pull=this.data._not_grouped_pull;this.data._not_grouped_pull=this.data._not_grouped_order=null}if(a!==false){this.data.callEvent("onStoreUpdated",[])}},group_setter:function(a){dhtmlx.assert(typeof a=="object","Incorrect group value");dhtmlx.assert(a.by,"group.by is mandatory");dhtmlx.assert(a.map,"group.map is mandatory");return a},sort_setter:function(a){if(typeof a!="object"){a={by:a}}this._mergeSettings(a,{as:"string",dir:"asc"});return a}};dhtmlx.Date={Locale:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},time_part:function(a){return(a.valueOf()/1000-a.getTimezoneOffset()*60)%86400},week_start:function(c){var a=c.getDay();if(this.config.start_on_monday){if(a===0){a=6}else{a--}}return this.date_part(this.add(c,-1*a,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(c,g,j){var a=new Date(c.valueOf());switch(j){case"day":a.setDate(a.getDate()+g);break;case"week":a.setDate(a.getDate()+7*g);break;case"month":a.setMonth(a.getMonth()+g);break;case"year":a.setYear(a.getFullYear()+g);break;case"hour":a.setHours(a.getHours()+g);break;case"minute":a.setMinutes(a.getMinutes()+g);break;default:return dhtmlx.Date["add_"+j](c,g,j)}return a},to_fixed:function(a){if(a<10){return"0"+a}return a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(c,a){c=c.replace(/%[a-zA-Z]/g,function(g){switch(g){case"%d":return'"+dhtmlx.Date.to_fixed(date.getDate())+"';case"%m":return'"+dhtmlx.Date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+dhtmlx.Date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+dhtmlx.Date.Locale.day_short[date.getDay()]+"';case"%l":return'"+dhtmlx.Date.Locale.day_full[date.getDay()]+"';case"%M":return'"+dhtmlx.Date.Locale.month_short[date.getMonth()]+"';case"%F":return'"+dhtmlx.Date.Locale.month_full[date.getMonth()]+"';case"%h":return'"+dhtmlx.Date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+dhtmlx.Date.to_fixed(date.getHours())+"';case"%i":return'"+dhtmlx.Date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+dhtmlx.Date.to_fixed(date.getSeconds())+"';case"%W":return'"+dhtmlx.Date.to_fixed(dhtmlx.Date.getISOWeek(date))+"';default:return g}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(l,g){var m="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=l.match(/%[a-zA-Z]/g);for(var c=0;c<a.length;c++){switch(a[c]){case"%j":case"%d":m+="set[2]=temp["+c+"]||1;";break;case"%n":case"%m":m+="set[1]=(temp["+c+"]||1)-1;";break;case"%y":m+="set[0]=temp["+c+"]*1+(temp["+c+"]>50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":m+="set[3]=temp["+c+"]||0;";break;case"%i":m+="set[4]=temp["+c+"]||0;";break;case"%Y":m+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":m+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":m+="set[5]=temp["+c+"]||0;";break}}var j="set[0],set[1],set[2],set[3],set[4],set[5]";if(g){j=" Date.UTC("+j+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+m+" return new Date("+j+");")},getISOWeek:function(g){if(!g){return false}var c=g.getDay();if(c===0){c=7}var j=new Date(g.valueOf());j.setDate(g.getDate()+(4-c));var a=j.getFullYear();var m=Math.floor((j.getTime()-new Date(a,0,1).getTime())/86400000);var l=1+Math.floor(m/7);return l},getUTCISOWeek:function(a){return this.getISOWeek(a)}};dhtmlx.math={};dhtmlx.math._toHex=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(c,a){c=parseInt(c,10);str="";while(c>0){str=this._toHex[c%16]+str;c=Math.floor(c/16)}while(str.length<a){str="0"+str}return str};dhtmlx.math.hexToDec=function(a){return parseInt(a,16)};dhtmlx.math.toRgb=function(c){var l,j,a,m;if(typeof(c)!="string"){l=c[0];j=c[1];a=c[2]}else{if(c.indexOf("rgb")!=-1){m=c.substr(c.indexOf("(")+1,c.lastIndexOf(")")-c.indexOf("(")-1).split(",");l=m[0];j=m[1];a=m[2]}else{if(c.substr(0,1)=="#"){c=c.substr(1)}l=this.hexToDec(c.substr(0,2));j=this.hexToDec(c.substr(2,2));a=this.hexToDec(c.substr(4,2))}}l=(parseInt(l,10)||0);j=(parseInt(j,10)||0);a=(parseInt(a,10)||0);if(l<0||l>255){l=0}if(j<0||j>255){j=0}if(a<0||a>255){a=0}return[l,j,a]};dhtmlx.math.hsvToRgb=function(m,y,w){var l,o,j,c,x,a,n,u;l=Math.floor((m/60))%6;o=m/60-l;j=w*(1-y);c=w*(1-o*y);x=w*(1-(1-o)*y);a=0;n=0;u=0;switch(l){case 0:a=w;n=x;u=j;break;case 1:a=c;n=w;u=j;break;case 2:a=j;n=w;u=x;break;case 3:a=j;n=c;u=w;break;case 4:a=x;n=j;u=w;break;case 5:a=w;n=j;u=c;break}a=Math.floor(a*255);n=Math.floor(n*255);u=Math.floor(u*255);return[a,n,u]};dhtmlx.math.rgbToHsv=function(c,n,o){var l,j,q,a,u,x,m,w;l=c/255;j=n/255;q=o/255;var a=Math.min(l,j,q);var u=Math.max(l,j,q);m=0;x=u==0?0:(1-a/u);w=u;if(u==a){m=0}else{if(u==l&&j>=q){m=60*(j-q)/(u-a)+0}else{if(u==l&&j<q){m=60*(j-q)/(u-a)+360}else{if(u==j){m=60*(q-l)/(u-a)+120}else{if(u==q){m=60*(l-j)/(u-a)+240}}}}}return[m,x,w]};if(!dhtmlx.presets){dhtmlx.presets={}}dhtmlx.presets.chart={simple:{item:{borderColor:"#ffffff",color:"#2b7100",shadow:false,borderWidth:2},line:{color:"#8ecf03",width:2}},plot:{color:"#1293f8",item:{borderColor:"#636363",borderWidth:1,color:"#ffffff",type:"r",shadow:false},line:{color:"#1293f8",width:2}},diamond:{color:"#b64040",item:{borderColor:"#b64040",color:"#b64040",type:"d",radius:3,shadow:true},line:{color:"#ff9000",width:2}},point:{color:"#fe5916",disableLines:true,fill:false,disableItems:false,item:{color:"#feb916",borderColor:"#fe5916",radius:2,borderWidth:1,type:"r"},alpha:1},line:{line:{color:"#3399ff",width:2},item:{color:"#ffffff",borderColor:"#3399ff",radius:2,borderWidth:2,type:"d"},fill:false,disableItems:false,disableLines:false,alpha:1},area:{fill:"#3399ff",line:{color:"#3399ff",width:1},disableItems:true,alpha:0.2,disableLines:false},round:{item:{radius:3,borderColor:"#3f83ff",borderWidth:1,color:"#3f83ff",type:"r",shadow:false,alpha:0.6}},square:{item:{radius:3,borderColor:"#447900",borderWidth:2,color:"#69ba00",type:"s",shadow:false,alpha:1}},column:{color:"RAINBOW",gradient:false,width:45,radius:0,alpha:1,border:true},stick:{width:5,gradient:false,color:"#67b5c9",radius:2,alpha:1,border:false},alpha:{color:"#b9a8f9",width:70,gradient:"falling",radius:0,alpha:0.5,border:true}};dhtmlx.ui.Map=function(a){this.name="Map";this._id="map_"+dhtmlx.uid();this._key=a;this._map=[]};dhtmlx.ui.Map.prototype={addRect:function(g,c,a){this._createMapArea(g,"RECT",c,a)},addPoly:function(g,c,a){this._createMapArea(g,"POLY",c,a)},_createMapArea:function(l,c,j,g){var a="";if(arguments.length==4){a="userdata='"+g+"'"}this._map.push("<area "+this._key+"='"+l+"' shape='"+c+"' coords='"+j.join()+"' "+a+"></area>")},addSector:function(a,r,q,n,l,g,j,m){var o=[];o.push(n);o.push(Math.floor(l*j));for(var c=r;c<q;c+=Math.PI/18){o.push(Math.floor(n+g*Math.cos(c)));o.push(Math.floor((l+g*Math.sin(c))*j))}o.push(Math.floor(n+g*Math.cos(q)));o.push(Math.floor((l+g*Math.sin(q))*j));o.push(n);o.push(Math.floor(l*j));return this.addPoly(a,o,m)},render:function(a){var g=dhtmlx.html.create("DIV");g.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(g);var c=dhtmlx._isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";g.innerHTML="<map id='"+this._id+"' name='"+this._id+"'>"+this._map.join("\n")+"</map><img "+c+" class='dhx_map_img' usemap='#"+this._id+"' onmousedown='return false;'>";a._htmlmap=g;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(r,m,q,o,n,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var g=this._getLimits();var l=this._getLimits("h","xValue");if(!n){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}this._drawYAxis(this.canvases.y.getCanvas(),m,q,o,g.min,g.max);this._drawHXAxis(this.canvases.x.getCanvas(),m,q,o,l.min,l.max)}g={min:this._settings.yAxis.start,max:this._settings.yAxis.end};l={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(r,m,q,o,l,g);this._mapStart=q;for(var j=0;j<m.length;j++){this._drawScatterItem(r,a,q,o,c,l,g,m[j],n)}},_getScatterParams:function(a,j,g,c,n,m){var l={};l.totalHeight=c.y-g.y;l.totalWidth=c.x-g.x;this._calcScatterUnit(l,n.min,n.max,l.totalWidth,"X");this._calcScatterUnit(l,m.min,m.max,l.totalHeight,"Y");return l},_drawScatterItem:function(s,a,q,o,g,l,j,m,n){var c=this._calculateScatterItemPosition(g,o,q,l,m,"X");var r=this._calculateScatterItemPosition(g,q,o,j,m,"Y");this._drawItem(s,c,r,m,this._settings.label.call(this,m),n,a)},_calculateScatterItemPosition:function(g,o,n,a,l,c){var r=this._settings[c=="X"?"xValue":"value"].call(this,l);var j=g["valueFactor"+c];var s=(parseFloat(r||0)-a.min)*j;var q=g["unit"+c];var m=n[c.toLowerCase()]-(c=="X"?(-1):1)*Math.floor(q*s);if(s<0){m=n[c.toLowerCase()]}if(r>a.max){m=o[c.toLowerCase()]}if(r<a.min){m=n[c.toLowerCase()]}return m},_calcScatterUnit:function(m,g,a,c,j){var l=this._getRelativeValue(g,a);j=(j||"");m["relValue"+j]=l[0];m["valueFactor"+j]=l[1];m["unit"+j]=(m["relValue"+j]?c/m["relValue"+j]:10)}};dhtmlx.chart.radar={pvt_render_radar:function(c,j,a,m,g,l){this._renderRadarChart(c,j,a,m,g,l)},_renderRadarChart:function(v,l,s,r,q,a){if(!l.length){return}var n=this._getPieParameters(s,r);var o=(this._settings.radius?this._settings.radius:n.radius);var c=(this._settings.x?this._settings.x:n.x);var u=(this._settings.y?this._settings.y:n.y);var g=[];for(var j=0;j<l.length;j++){g.push(1)}var m=this._getRatios(g,l.length);this._mapStart=s;if(!q){this._drawRadarAxises(m,c,u,o,l)}this._drawRadarData(v,m,c,u,o,l,q,a)},_drawRadarData:function(D,u,o,n,l,O,E,N){var C,w,M,K,F,J,j,g,H,L,I,v,c,A,r,q,a,s,m;M=this._settings;F=M.yAxis.start;J=M.yAxis.end;m=this._getRelativeValue(F,J);v=m[0];s=(v?l/v:l/2);a=m[1];c=-Math.PI/2;C=w=c;H=[];g=0;for(K=0;K<O.length;K++){if(!q){A=M.value(O[K]);r=(parseFloat(A||0)-F)*a}else{r=q}L=Math.floor(s*r);A=M.value((K!=(O.length-1))?O[K+1]:O[0]);q=(parseFloat(A||0)-F)*a;I=Math.floor(s*q);C=w;w=((K!=(O.length-1))?(c+u[K]-0.0001):c);j=(g||this._getPositionByAngle(C,o,n,L));g=this._getPositionByAngle(w,o,n,I);H.push(j)}if(M.fill){this._fillRadarChart(D,H,O)}if(!M.disableLines){this._strokeRadarChart(D,H,O)}if(!M.disableItems){this._drawRadarItemMarkers(D,H,O,E,N)}H=null},_drawRadarItemMarkers:function(a,g,l,j,m){for(var c=0;c<g.length;c++){this._drawItem(a,g[c].x,g[c].y,l[c],this._settings.label.call(this,l),j,m)}},_fillRadarChart:function(a,j,m){var l,g;a.globalAlpha=this._settings.alpha.call(this,{});a.beginPath();for(var c=0;c<j.length;c++){a.fillStyle=this._settings.fill.call(this,m[c]);l=j[c];g=(j[c+1]||j[0]);if(!c){a.moveTo(l.x,l.y)}a.lineTo(g.x,g.y)}a.fill();a.globalAlpha=1},_strokeRadarChart:function(a,j,m){var l,g;for(var c=0;c<j.length;c++){l=j[c];g=(j[c+1]||j[0]);this._drawLine(a,l.x,l.y,g.x,g.y,this._settings.line.color.call(this,m[c]),this._settings.line.width)}},_drawRadarAxises:function(D,A,w,o,Q){var a=this._settings.yAxis;var l=this._settings.xAxis;var q=a.start;var n=a.end;var s=a.step;var E={};var P=this._configYAxis;if(typeof P.step=="undefined"||typeof P.start=="undefined"||typeof P.end=="undefined"){var u=this._getLimits();E=this._calculateScale(u.min,u.max);q=E.start;n=E.end;s=E.step;a.end=n;a.start=q}var K=[];var N,M,F;var O=0;var g=o*s/(n-q);var v,C;if(s<1){v=Math.min(this._log10(s),(q<=0?0:this._log10(q)));C=Math.pow(10,-v)}var L=[];if(!this.canvases.scale){this.canvases.scale=new dhtmlx.ui.Canvas(this._obj,"radar_scale")}var J=this.canvases.scale.getCanvas();for(N=n;N>=q;N-=s){if(E.fixNum){N=parseFloat((new Number(N)).toFixed(E.fixNum))}K.push(Math.floor(O*g)+0.5);if(C){N=Math.round(N*C)/C}var r=w-o+K[K.length-1];this.canvases.scale.renderTextAt("middle","left",A,r,a.template(N.toString()),"dhx_axis_item_y dhx_radar");if(D.length<2){this._drawScaleSector(J,"arc",A,w,o-K[K.length-1],-Math.PI/2,3*Math.PI/2,N);return}var m=-Math.PI/2;var I=m;var H;for(M=0;M<D.length;M++){if(N==n){L.push(I)}H=m+D[M]-0.0001;this._drawScaleSector(J,(P.lineShape||"line"),A,w,o-K[K.length-1],I,H,N,M,Q[N]);I=H}O++}for(N=0;N<L.length;N++){F=this._getPositionByAngle(L[N],A,w,o);if(l.lines.call(this,Q[N],N)){this._drawLine(J,A,w,F.x,F.y,(l?l.lineColor.call(this,Q[N]):"#cfcfcf"),1)}this._drawRadarScaleLabel(J,A,w,o,L[N],(l?l.template.call(this,Q[N]):"&nbsp;"))}},_drawScaleSector:function(v,n,u,r,m,c,a,l,g){var s,q;if(m<0){return false}s=this._getPositionByAngle(c,u,r,m);q=this._getPositionByAngle(a,u,r,m);var o=this._settings.yAxis;if(o.bg){v.beginPath();v.moveTo(u,r);if(n=="arc"){v.arc(u,r,m,c,a,false)}else{v.lineTo(s.x,s.y);v.lineTo(q.x,q.y)}v.fillStyle=o.bg(l,g);v.moveTo(u,r);v.fill();v.closePath()}if(o.lines.call(this,l)){v.lineWidth=1;v.beginPath();if(n=="arc"){v.arc(u,r,m,c,a,false)}else{v.moveTo(s.x,s.y);v.lineTo(q.x,q.y)}v.strokeStyle=o.lineColor.call(this,l);v.stroke()}},_drawRadarScaleLabel:function(A,q,n,c,o,v){var w=this.canvases.scale.renderText(0,0,v,"dhx_axis_radar_title",1);var g=w.scrollWidth;var u=w.offsetHeight;var s=0.001;var m=this._getPositionByAngle(o,q,n,c+5);var l=0,j=0;if(o<0||o>Math.PI){j=-u}if(o>Math.PI/2){l=-g}if(Math.abs(o+Math.PI/2)<s||Math.abs(o-Math.PI/2)<s){l=-g/2}else{if(Math.abs(o)<s||Math.abs(o-Math.PI)<s){j=-u/2}}w.style.top=m.y+j+"px";w.style.left=m.x+l+"px";w.style.width=g+"px";w.style.whiteSpace="nowrap"}};dhtmlx.chart.area={pvt_render_area:function(o,F,l,j,q,C){var s,A,u,r,m,y,n,E,D,x,w,c,v,a,g;y=this._calculateLineParams(o,F,l,j,q);A=this._settings;r=(A.eventRadius||Math.floor(y.cellWidth/2));if(F.length){n=[];x=(!A.offset?l.x:l.x+y.cellWidth*0.5);for(u=0;u<F.length;u++){m=F[u];D=this._getPointY(m,l,j,y);v=x+y.cellWidth*u;if(D){a=(typeof D=="object"?D.y0:D);if(u&&this._settings.fixOverflow){E=this._getPointY(F[u-1],l,j,y);if(E.out&&E.out==D.out){continue}w=y.cellWidth*(u-1)-0.5+x;c=(typeof E=="object"?E.y0:E);if(E.out){g=(E.out=="min"?j.y:l.y);n.push([this._calcOverflowX(w,v,c,a,g),g])}if(D.out){g=(D.out=="min"?j.y:l.y);n.push([this._calcOverflowX(w,v,c,a,g),g]);if(u==(F.length-1)&&g==l.y){n.push([v,l.y])}}}if(!D.out){n.push([v,a]);C.addRect(m.id,[v-r-l.x,a-r-l.y,v+r-l.x,a+r-l.y],q)}if(!A.yAxis){s=(!A.offset&&(u==F.length-1)?"left":"center");this.canvases[q].renderTextAt(false,s,v,a-A.labelOffset,A.label(m))}}}if(n.length){n.push([v,j.y]);n.push([n[0][0],j.y])}o.globalAlpha=this._settings.alpha.call(this,F[0]);o.fillStyle=this._settings.color.call(this,F[0]);o.beginPath();this._path(o,n);o.fill();if(A.border){o.lineWidth=A.borderWidth||1;if(A.borderColor){o.strokeStyle=A.borderColor.call(this,F[0])}else{this._setBorderStyles(o,o.fillStyle)}o.beginPath();this._path(o,n);o.stroke()}o.lineWidth=1;o.globalAlpha=1}}};dhtmlx.chart.stackedArea={pvt_render_stackedArea:function(r,I,c,a,s,F){var K,J,w,E,C,A,m,v,n,D,q,l,g,o;D=this._calculateLineParams(r,I,c,a,s);E=this._settings;v=(E.eventRadius||Math.floor(D.cellWidth/2));if(I.length){q=[];o=[];l=(!E.offset?c.x:c.x+D.cellWidth*0.5);var H=function(j,x){return s?(I[j].$startY?x-a.y+I[j].$startY:0):x};var u=function(j,M,L){var y=(L.y-M.y)/(L.x-M.x);return y*j+M.y-y*M.x};for(C=0;C<I.length;C++){n=I[C];if(!C){g=H(C,a.y);q.push([l,g])}else{l+=D.cellWidth}g=H(C,this._getPointY(n,c,a,D));o.push((isNaN(g)&&!C)?(I[C].$startY||a.y):g);if(g){q.push([l,g]);F.addRect(n.id,[l-v-c.x,g-v-c.y,l+v-c.x,g+v-c.y],s);if(!E.yAxis){w=(!E.offset&&m?"left":"center");this.canvases[s].renderTextAt(false,w,l,g-E.labelOffset,E.label(n))}}}q.push([l,H(C-1,a.y)]);if(s){for(C=I.length-2;C>0;C--){l-=D.cellWidth;g=I[C].$startY;if(g){q.push([l,g])}}}q.push([q[0][0],q[0][1]]);r.globalAlpha=this._settings.alpha.call(this,I[0]);r.fillStyle=this._settings.color.call(this,I[0]);r.beginPath();this._path(r,q);r.fill();for(C=0;C<I.length;C++){g=o[C];if(!g){if(C==I.length-1){g=I[C].$startY}for(A=C+1;A<I.length;A++){if(o[A]){K={x:c.x,y:o[0]};J={x:(c.x+D.cellWidth*A),y:o[A]};g=u(c.x+D.cellWidth*C,K,J);break}}}I[C].$startY=g}}}};dhtmlx.chart.spline={pvt_render_spline:function(r,J,l,g,s,I){var H,v,q,u,F,o,n,C,A,w,m,c,a;F=this._calculateLineParams(r,J,l,g,s);H=this._settings;this._mapStart=l;q=[];if(J.length){C=(H.offset?l.x+F.cellWidth*0.5:l.x);for(v=0;v<J.length;v++){m=this._getPointY(J[v],l,g,F);if(m){n=((!v)?C:F.cellWidth*v-0.5+C);q.push({x:n,y:m,index:v})}}o=this._getSplineParameters(q);for(v=0;v<q.length;v++){A=q[v].x;c=q[v].y;if(v<q.length-1){w=q[v+1].x;a=q[v+1].y;for(u=A;u<w;u++){var E=this._getSplineYPoint(u,A,v,o.a,o.b,o.c,o.d);if(E<l.y){E=l.y}if(E>g.y){E=g.y}var D=this._getSplineYPoint(u+1,A,v,o.a,o.b,o.c,o.d);if(D<l.y){D=l.y}if(D>g.y){D=g.y}this._drawLine(r,u,E,u+1,D,H.line.color(J[v]),H.line.width)}this._drawLine(r,w-1,this._getSplineYPoint(u,A,v,o.a,o.b,o.c,o.d),w,a,H.line.color(J[v]),H.line.width)}this._drawItem(r,A,c,J[q[v].index],H.label(J[q[v].index]),s,I)}}},_getSplineParameters:function(y){var l,C,A,D,x,w,r,q,o=[],j=[],g=y.length;for(l=0;l<g-1;l++){o[l]=y[l+1].x-y[l].x;j[l]=(y[l+1].y-y[l].y)/o[l]}C=[];A=[];C[0]=0;C[1]=2*(o[0]+o[1]);A[0]=0;A[1]=6*(j[1]-j[0]);for(l=2;l<g-1;l++){C[l]=2*(o[l-1]+o[l])-o[l-1]*o[l-1]/C[l-1];A[l]=6*(j[l]-j[l-1])-o[l-1]*A[l-1]/C[l-1]}D=[];D[g-1]=D[0]=0;for(l=g-2;l>=1;l--){D[l]=(A[l]-o[l]*D[l+1])/C[l]}x=[];w=[];r=[];q=[];for(l=0;l<g-1;l++){x[l]=y[l].y;w[l]=-o[l]*D[l+1]/6-o[l]*D[l]/3+(y[l+1].y-y[l].y)/o[l];r[l]=D[l]/2;q[l]=(D[l+1]-D[l])/(6*o[l])}return{a:x,b:w,c:r,d:q}},_getSplineYPoint:function(j,m,n,l,g,q,o){return l[n]+(j-m)*(g[n]+(j-m)*(q[n]+(j-m)*o[n]))}};dhtmlx.chart.barH={pvt_render_barH:function(A,N,m,l,C,M){var r,u,E,D,a,H,o,K,v,L,c,x,n,I,w,j,y,s,J,g,q;E=(l.y-m.y)/N.length;o=this._getLimits("h");K=o.max;v=o.min;j=l.x-m.x;q=!!this._settings.yAxis;if(!C){this._drawHScales(A,N,m,l,v,K,E)}if(q){K=parseFloat(this._settings.xAxis.end);v=parseFloat(this._settings.xAxis.start)}I=this._getRelativeValue(v,K);x=I[0];c=I[1];s=(x?j/x:10);if(!q){w=10;s=(x?(j-w)/x:10)}u=parseInt(this._settings.width,10);if((u*this._series.length+4)>E){u=E/this._series.length-4}r=Math.floor((E-u*this._series.length)/2);n=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));L=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){L=a;a=false}else{if(a){a=A.createLinearGradient(m.x,m.y,l.x,m.y);this._settings.gradient(a)}}if(!q){this._drawLine(A,m.x-0.5,m.y,m.x-0.5,l.y,"#000000",1)}for(H=0;H<N.length;H++){y=parseFloat(this._settings.value(N[H]||0));if(y>K){y=K}y-=v;y*=c;J=m.x;g=m.y+r+H*E+(u+1)*C;if((y<0&&this._settings.origin=="auto")||(this._settings.xAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt("middle","right",J+10,g+u/2+r,this._settings.label(N[H]));continue}if(y<0&&this._settings.origin!="auto"&&this._settings.origin>v){y=0}if(!q){y+=w/s}D=a||this._settings.color.call(this,N[H]);if(this._settings.border){this._drawBarHBorder(A,J,g,u,v,n,s,y,D)}A.globalAlpha=this._settings.alpha.call(this,N[H]);var F=this._drawBarH(A,l,J,g,u,v,n,s,y,D,a,L);if(L!=false){this._drawBarHGradient(A,J,g,u,v,n,s,y,D,L)}A.globalAlpha=1;if(F[3]==g){this.canvases[C].renderTextAt("middle","left",F[0]-5,F[3]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,F[3]-m.y,F[2]-m.x,F[3]+u-m.y],C)}else{this.canvases[C].renderTextAt("middle",false,F[2]+5,F[1]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,g-m.y,F[2]-m.x,F[3]-m.y],C)}}},_setBarHPoints:function(x,j,v,y,n,w,u,m,l){var c=0;if(n>w*u){var s=(n-w*u)/n;c=-Math.asin(s)+Math.PI/2}x.moveTo(j,v+m);var g=j+w*u-n-(n?0:m);if(n<w*u){x.lineTo(g,v+m)}var r=v+n;if(n&&n>0){x.arc(g,r,n-m,-Math.PI/2+c,0,false)}var q=v+y-n-(n?0:m);var a=g+n-(n?m:0);x.lineTo(a,q);if(n&&n>0){x.arc(g,q,n-m,0,Math.PI/2-c,false)}var o=v+y-m;x.lineTo(j,o);if(!l){x.lineTo(j,v+m)}return[a,o]},_drawHScales:function(g,n,m,l,o,c,j){var a=0;if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj)}a=this._drawHXAxis(this.canvases.x.getCanvas(),n,m,l,o,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),n,m,l,j,a)}},_drawHYAxis:function(u,l,q,n,g,a){if(!this._settings.yAxis){return}var m;var c=parseInt((a?a:q.x),10)-0.5;var r=n.y+0.5;var o=q.y;this._drawLine(u,c,r,c,o,this._settings.yAxis.color,1);for(var j=0;j<l.length;j++){var s=((this._settings.origin!="auto")&&(this._settings.view=="barH")&&(parseFloat(this._settings.value(l[j]))<this._settings.origin));m=o+g/2+j*g;this.canvases.y.renderTextAt("middle",(s?false:"left"),(s?c+5:c-5),m,this._settings.yAxis.template(l[j]),"dhx_axis_item_y",(s?0:c-10));if(this._settings.yAxis.lines.call(this,l[j])){this._drawLine(u,q.x,m,n.x,m,this._settings.yAxis.lineColor.call(this,l[j]),1)}}this._drawLine(u,q.x+0.5,o+0.5,n.x,o+0.5,this._settings.yAxis.lineColor.call(this,{}),1);this._setYAxisTitle(q,n)},_drawHXAxis:function(C,u,y,x,g,q){var n;var l={};var o=this._settings.xAxis;if(!o){return}var A=x.y+0.5;var j=y.x-0.5;var a=x.x-0.5;var s=y.x;this._drawLine(C,j,A,a,A,o.color,1);if(o.step){n=parseFloat(o.step)}if(typeof this._configXAxis.step=="undefined"||typeof this._configXAxis.start=="undefined"||typeof this._configXAxis.end=="undefined"){l=this._calculateScale(g,q);g=l.start;q=l.end;n=l.step;this._settings.xAxis.end=q;this._settings.xAxis.start=g;this._settings.xAxis.step=n}if(n===0){return}var m=(a-j)*n/(q-g);var w=0;for(var r=g;r<=q;r+=n){if(l.fixNum){r=parseFloat((new Number(r)).toFixed(l.fixNum))}var v=Math.floor(j+w*m)+0.5;if(!(r==g&&this._settings.origin=="auto")&&o.lines.call(this,r)){this._drawLine(C,v,A,v,y.y,this._settings.xAxis.lineColor.call(this,r),1)}if(r==this._settings.origin){s=v+1}this.canvases.x.renderTextAt(false,true,v,A+2,o.template(r.toString()),"dhx_axis_item_x");w++}this.canvases.x.renderTextAt(true,false,j,x.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",x.x-y.x);if(!o.lines.call(this,{})){this._drawLine(C,j,y.y-0.5,a,y.y-0.5,this._settings.xAxis.color,0.2)}return s},_correctBarHParams:function(o,l,g,m,n,q,j){var a=this._settings.yAxis;var c=l;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>j)){l+=(this._settings.origin-j)*n;c=l;m=m-(this._settings.origin-j);if(m<0){m*=(-1);o.translate(l,g+q);o.rotate(Math.PI);l=0.5;g=0}l+=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBarH:function(v,l,C,j,q,r,m,o,u,w,a,n){v.save();var s=this._correctBarHParams(v,C,j,u,o,q,r);v.fillStyle=w;v.beginPath();var x=this._setBarHPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(l.x,s.y0+(this._settings.border?1:0))}v.fill();v.restore();var g=s.y0;var c=(s.y0!=j?j:x[1]);var A=(s.y0!=j?(s.start-x[0]):s.start);var y=(s.y0!=j?s.start:x[0]);return[A,g,y,c]},_drawBarHBorder:function(q,c,n,r,l,j,o,m,g){q.save();var a=this._correctBarHParams(q,c,n,m,o,r,l);q.beginPath();this._setBorderStyles(q,g);q.globalAlpha=0.9;this._setBarHPoints(q,a.x0,a.y0,r,j,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarHGradient:function(s,g,q,u,n,m,r,o,j,a){s.save();var c=this._correctBarHParams(s,g,q,o,r,u,n);var l=this._setBarGradient(s,c.x0,c.y0+u,c.x0+r*c.value,c.y0,a,j,"x");s.fillStyle=l.gradient;s.beginPath();this._setBarHPoints(s,c.x0,c.y0+l.offset,u-l.offset*2,m,r,c.value,l.offset);s.fill();s.globalAlpha=1;s.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(D,Q,l,j,E,P){var O,w;var c;var x;var A=j.x-l.x;var o=!!this._settings.yAxis;var n=this._getStackedLimits(Q);O=n.max;w=n.min;var H=Math.floor((j.y-l.y)/Q.length);if(!E){this._drawHScales(D,Q,l,j,w,O,H)}if(o){O=parseFloat(this._settings.xAxis.end);w=parseFloat(this._settings.xAxis.start)}var L=this._getRelativeValue(w,O);x=L[0];c=L[1];var u=(x?A/x:10);if(!o){var y=10;u=(x?(A-y)/x:10)}var v=parseInt(this._settings.width,10);if((v+4)>H){v=H-4}var q=(H-v)/2;var m=0;var r=false;var a=this._settings.gradient;if(a){r=true}if(!o){this._drawLine(D,l.x-0.5,l.y,l.x-0.5,j.y,"#000000",1)}var N=0;var K=0;for(J=0;J<this._series.length;J++){if(J==E){K=N}if(this._series[J].view=="stackedBarH"){N++}}for(var J=0;J<Q.length;J++){if(!K){Q[J].$startX=l.x}var C=parseFloat(this._settings.value(Q[J]||0));if(C>O){C=O}C-=w;C*=c;var M=l.x;var g=l.y+q+J*H;if(!K){Q[J].$startX=M}else{M=Q[J].$startX}if(C<0||(this._settings.yAxis&&C===0)){this.canvases.y.renderTextAt("middle",true,M+10,g+v/2,this._settings.label(Q[J]));continue}if(!o){C+=y/u}var F=this._settings.color.call(this,Q[J]);D.globalAlpha=this._settings.alpha.call(this,Q[J]);D.fillStyle=this._settings.color.call(this,Q[J]);D.beginPath();var I=this._setBarHPoints(D,M,g,v,m,u,C,(this._settings.border?1:0));if(a&&!r){D.lineTo(l.x+A,g+(this._settings.border?1:0))}D.fill();if(r!=false){var s=this._setBarGradient(D,M,g+v,M,g,r,F,"x");D.fillStyle=s.gradient;D.beginPath();I=this._setBarHPoints(D,M,g,v,m,u,C,0);D.fill()}if(this._settings.border){this._drawBarHBorder(D,M,g,v,w,m,u,C,F)}D.globalAlpha=1;this.canvases[E].renderTextAt("middle",true,Q[J].$startX+(I[0]-Q[J].$startX)/2-1,g+(I[1]-g)/2,this._settings.label(Q[J]));P.addRect(Q[J].id,[Q[J].$startX-l.x,g-l.y,I[0]-l.x,I[1]-l.y],E);Q[J].$startX=I[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(y,M,j,g,A,L){var J,u;var a;var v;var w=g.y-j.y;var m=!!this._settings.yAxis;var K=!!this._settings.xAxis;var l=this._getStackedLimits(M);J=l.max;u=l.min;var D=Math.floor((g.x-j.x)/M.length);if(!A){this._drawScales(M,j,g,u,J,D)}if(m){J=parseFloat(this._settings.yAxis.end);u=parseFloat(this._settings.yAxis.start)}var H=this._getRelativeValue(u,J);v=H[0];a=H[1];var r=(v?w/v:10);var s=parseInt(this._settings.width,10);if(s+4>D){s=D-4}var n=Math.floor((D-s)/2);var o=(this._settings.gradient?this._settings.gradient:false);if(!K){this._drawLine(y,j.x,g.y+0.5,g.x,g.y+0.5,"#000000",1)}for(var F=0;F<M.length;F++){var x=parseFloat(this._settings.value(M[F]||0));if(!x){if(!A||!M[F].$startY){M[F].$startY=g.y}continue}if(!A){x-=u}x*=a;var I=j.x+n+F*D;var c=g.y;if(!A){M[F].$startY=c}else{c=M[F].$startY}if(c<(j.y+1)){continue}if(x<0||(this._settings.yAxis&&x===0)){this.canvases.y.renderTextAt(true,true,I+Math.floor(s/2),c,this._settings.label(M[F]));continue}var C=this._settings.color.call(this,M[F]);y.globalAlpha=this._settings.alpha.call(this,M[F]);y.fillStyle=this._settings.color.call(this,M[F]);y.beginPath();var E=this._setStakedBarPoints(y,I-(this._settings.border?0.5:0),c,s+(this._settings.border?0.5:0),r,x,0,j.y);y.fill();if(o){y.save();var q=this._setBarGradient(y,I,c,I+s,E[1],o,C,"y");y.fillStyle=q.gradient;y.beginPath();E=this._setStakedBarPoints(y,I+q.offset,c,s-q.offset*2,r,x,(this._settings.border?1:0),j.y);y.fill();y.restore()}if(this._settings.border){y.save();this._setBorderStyles(y,C);y.beginPath();this._setStakedBarPoints(y,I-0.5,c,s+1,r,x,0,j.y,1);y.stroke();y.restore()}y.globalAlpha=1;this.canvases[A].renderTextAt(false,true,I+Math.floor(s/2),(E[1]+(c-E[1])/2)-7,this._settings.label(M[F]));L.addRect(M[F].id,[I-j.x,E[1]-j.y,E[0]-j.x,(M[F].$startY||c)-j.y],A);M[F].$startY=(this._settings.border?(E[1]+1):E[1])}},_setStakedBarPoints:function(u,c,q,v,r,o,j,g,l){u.moveTo(c,q);var n=q-r*o+j;if(n<g){n=g}u.lineTo(c,n);var a=c+v;var m=n;u.lineTo(a,m);var s=c+v;u.lineTo(s,q);if(!l){u.lineTo(c,q)}return[s,m-2*j]}};dhtmlx.chart.line={pvt_render_line:function(n,C,l,j,o,y){var x,q,m,v,u,s,r,c,a,g,A,w;v=this._calculateLineParams(n,C,l,j,o);x=this._settings;if(C.length){u=(x.offset?l.x+v.cellWidth*0.5:l.x);m=[];for(q=0;q<C.length;q++){w=this._getPointY(C[q],l,j,v);if(w){r=((!q)?u:v.cellWidth*q-0.5+u);a=(typeof w=="object"?w.y0:w);if(q&&this._settings.fixOverflow){A=this._getPointY(C[q-1],l,j,v);if(A.out&&A.out==w.out){continue}s=v.cellWidth*(q-1)-0.5+u;c=(typeof A=="object"?A.y0:A);if(A.out){g=(A.out=="min"?j.y:l.y);m.push({x:this._calcOverflowX(s,r,c,a,g),y:g})}if(w.out){g=(w.out=="min"?j.y:l.y);m.push({x:this._calcOverflowX(s,r,c,a,g),y:g})}}if(!w.out){m.push({x:r,y:w,index:q})}}}this._mapStart=l;for(q=1;q<=m.length;q++){s=m[q-1].x;c=m[q-1].y;if(q<m.length){r=m[q].x;a=m[q].y;this._drawLine(n,s,c,r,a,x.line.color.call(this,C[q-1]),x.line.width);if(x.line&&x.line.shadow){n.globalAlpha=0.3;this._drawLine(n,s+2,c+x.line.width+8,r+2,a+x.line.width+8,"#eeeeee",x.line.width+3);n.globalAlpha=1}}if(typeof m[q-1].index!="undefined"){this._drawItem(n,s,c,C[m[q-1].index],x.label(C[m[q-1].index]),o,y,l)}}}},_calcOverflowX:function(c,a,j,g,l){return c+(l-j)*(a-c)/(g-j)},_drawItem:function(v,g,u,q,s,r,c){var j=this._settings.item;var o=parseInt(j.radius.call(this,q),10)||0;var n=this._mapStart;if(o){v.save();if(j.shadow){v.lineWidth=1;v.strokeStyle="#bdbdbd";v.fillStyle="#bdbdbd";var a=[0.1,0.2,0.3];for(var m=(a.length-1);m>=0;m--){v.globalAlpha=a[m];v.strokeStyle="#d0d0d0";v.beginPath();this._strokeChartItem(v,g,u+2*o/3,o+m+1,j.type);v.stroke()}v.beginPath();v.globalAlpha=0.3;v.fillStyle="#bdbdbd";this._strokeChartItem(v,g,u+2*o/3,o+1,j.type);v.fill()}v.restore();v.lineWidth=j.borderWidth;v.fillStyle=j.color.call(this,q);v.strokeStyle=j.borderColor.call(this,q);v.globalAlpha=j.alpha.call(this,q);v.beginPath();this._strokeChartItem(v,g,u,o+1,j.type);v.fill();v.stroke();v.globalAlpha=1}if(s){this.canvases[r].renderTextAt(false,true,g,u-o-this._settings.labelOffset,this._settings.label.call(this,q))}var l=(this._settings.eventRadius||o+1);c.addRect(q.id,[g-l-n.x,u-l-n.y,g+l-n.x,u+l-n.y],r)},_strokeChartItem:function(a,c,l,j,g){var m=[];c=parseInt(c,10);l=parseInt(l,10);if(g&&(g=="square"||g=="s")){j*=Math.sqrt(2)/2;m=[[c-j-a.lineWidth/2,l-j],[c+j,l-j],[c+j,l+j],[c-j,l+j],[c-j,l-j]]}else{if(g&&(g=="diamond"||g=="d")){var n=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);m=[[c,l-j],[c+j,l],[c,l+j],[c-j,l],[c+n,l-j-n]]}else{if(g&&(g=="triangle"||g=="t")){m=[[c,l-j],[c+Math.sqrt(3)*j/2,l+j/2],[c-Math.sqrt(3)*j/2,l+j/2],[c,l-j]]}else{m=[[c,l,j,0,Math.PI*2,true]]}}}this._path(a,m)},_getPointY:function(g,o,m,a){var n=a.minValue;var j=a.maxValue;var r=a.unit;var c=a.valueFactor;var q=this._settings.value(g);var s=(parseFloat(q||0)-n)*c;if(!this._settings.yAxis){s+=a.startValue/r}var l=m.y-r*s;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(q>j){l={y:o.y,y0:l,out:"max"}}else{if(s<0||q<n){l={y:m.y,y0:l,out:"min"}}}}else{if(q>j){l=o.y}if(s<0||q<n){l=m.y}}return l},_calculateLineParams:function(q,j,n,m,l){var c={};var r;c.totalHeight=m.y-n.y;c.cellWidth=(m.x-n.x)/((!this._settings.offset)?(j.length-1):j.length);var g=!!this._settings.yAxis;var a=(this._settings.view.indexOf("stacked")!=-1?this._getStackedLimits(j):this._getLimits());c.maxValue=a.max;c.minValue=a.min;if(!l){this._drawScales(j,n,m,c.minValue,c.maxValue,c.cellWidth)}if(g){c.maxValue=parseFloat(this._settings.yAxis.end);c.minValue=parseFloat(this._settings.yAxis.start)}var o=this._getRelativeValue(c.minValue,c.maxValue);r=o[0];c.valueFactor=o[1];c.unit=(r?c.totalHeight/r:10);c.startValue=0;if(!g){c.startValue=10;if(c.unit!=c.totalHeight){c.unit=(r?(c.totalHeight-c.startValue)/r:10)}}return c}};dhtmlx.chart.bar={pvt_render_bar:function(A,Q,l,j,C,P){var u,E,I,n,N,v,w,c,J,x,s,M,o,O=j.y-l.y;o=!!this._settings.yAxis;M=!!this._settings.xAxis;n=this._getLimits();N=n.max;v=n.min;E=(j.x-l.x)/Q.length;if(!C&&!(this._settings.origin!="auto"&&!o)){this._drawScales(Q,l,j,v,N,E)}if(o){N=parseFloat(this._settings.yAxis.end);v=parseFloat(this._settings.yAxis.start)}J=this._getRelativeValue(v,N);w=J[0];c=J[1];s=(w?O/w:w);if(!o&&!(this._settings.origin!="auto"&&M)){x=10;s=(w?(O-x)/w:x)}if(!C&&(this._settings.origin!="auto"&&!o)&&this._settings.origin>v){this._drawXAxis(A,Q,l,j,E,j.y-s*(this._settings.origin-v))}u=parseInt(this._settings.width,10);var L=0;var H=0;for(I=0;I<this._series.length;I++){if(I==C){H=L}if(this._series[I].view=="bar"){L++}}if(this._series&&(u*L+4)>E){u=parseInt(E/L-4,10)}var q=(E-u*L)/2;var m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));var r=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){r=a;a=false}else{if(a){a=A.createLinearGradient(0,j.y,0,l.y);this._settings.gradient(a)}}if(!M){this._drawLine(A,l.x,j.y+0.5,j.x,j.y+0.5,"#000000",1)}for(I=0;I<Q.length;I++){var y=parseFloat(this._settings.value(Q[I])||0);if(isNaN(y)){continue}if(y>N){y=N}y-=v;y*=c;var K=l.x+q+parseInt(I*E,10)+(u+1)*H;var g=j.y;if(y<0||(this._settings.yAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),g,this._settings.label(Q[I]));continue}if(!o&&!(this._settings.origin!="auto"&&M)){y+=x/s}var D=a||this._settings.color.call(this,Q[I]);A.globalAlpha=this._settings.alpha.call(this,Q[I]);var F=this._drawBar(A,l,K,g,u,v,m,s,y,D,a,r);if(r){this._drawBarGradient(A,K,g,u,v,m,s,y,D,r)}if(this._settings.border){this._drawBarBorder(A,K,g,u,v,m,s,y,D)}A.globalAlpha=1;if(F[0]!=K){this.canvases[C].renderTextAt(false,true,K+Math.floor(u/2),F[1],this._settings.label(Q[I]))}else{this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),F[3],this._settings.label(Q[I]))}P.addRect(Q[I].id,[K-l.x,F[3]-l.y,F[2]-l.x,F[1]-l.y],C)}},_correctBarParams:function(o,l,g,m,n,q,j){var a=this._settings.xAxis;var c=g;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>j)){g-=(this._settings.origin-j)*n;c=g;m=m-(this._settings.origin-j);if(m<0){m*=(-1);o.translate(l+q,g);o.rotate(Math.PI);l=0;g=0}g-=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBar:function(v,l,C,j,q,r,m,o,u,w,a,n){v.save();v.fillStyle=w;var s=this._correctBarParams(v,C,j,u,o,q,r);var x=this._setBarPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(s.x0+(this._settings.border?1:0),l.y)}v.fill();v.restore();var A=s.x0;var y=(s.x0!=C?C+x[0]:x[0]);var g=(s.x0!=C?(s.start-x[1]-s.y0):s.y0);var c=(s.x0!=C?s.start-s.y0:x[1]);return[A,g,y,c]},_drawBarBorder:function(q,c,n,r,l,j,o,m,g){var a;q.save();a=this._correctBarParams(q,c,n,m,o,r,l);this._setBorderStyles(q,g);this._setBarPoints(q,a.x0,a.y0,r,j,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarGradient:function(u,j,r,v,o,n,s,q,l,c){u.save();var g=this._correctBarParams(u,j,r,q,s,v,o);var m=this._setBarGradient(u,g.x0,g.y0,g.x0+v,g.y0-s*g.value+2,c,l,"y");var a=this._settings.border?1:0;u.fillStyle=m.gradient;this._setBarPoints(u,g.x0+m.offset,g.y0,v-m.offset*2,n,s,g.value,m.offset+a);u.fill();u.restore()},_setBarPoints:function(x,j,u,y,o,v,s,l,n){x.beginPath();var c=0;if(o>v*s){var m=(o-v*s)/o;if(m<=1&&m>=-1){c=-Math.acos(m)+Math.PI/2}}x.moveTo(j+l,u);var r=u-Math.floor(v*s)+o+(o?0:l);if(o<v*s){x.lineTo(j+l,r)}var g=j+o;if(o&&o>0){x.arc(g,r,o-l,-Math.PI+c,-Math.PI/2,false)}var a=j+y-o-l;var q=r-o+(o?l:0);x.lineTo(a,q);if(o&&o>0){x.arc(a,r,o-l,-Math.PI/2,0-c,false)}var w=j+y-l;x.lineTo(w,u);if(!n){x.lineTo(j+l,u)}return[w,q]}};dhtmlx.chart.pie={pvt_render_pie:function(c,j,a,m,g,l){this._renderPie(c,j,a,m,1,l,g)},_renderPie:function(s,F,l,j,D,E,u){if(!F.length){return}var v=this._getPieParameters(l,j);var n=(this._settings.radius?this._settings.radius:v.radius);if(n<0){return}var a=this._getValues(F);var m=this._getTotalValue(a);var o=this._getRatios(a,m);var C=(this._settings.x?this._settings.x:v.x);var g=(this._settings.y?this._settings.y:v.y);if(D==1&&this._settings.shadow){this._addShadow(s,C,g,n)}g=g/D;var r=-Math.PI/2;var x=[];s.scale(1,D);if(this._settings.gradient){var A=(D!=1?C+n/3:C);var c=(D!=1?g+n/3:g);this._showRadialGradient(s,C,g,n,A,c)}for(var y=0;y<F.length;y++){if(!a[y]){continue}s.strokeStyle=this._settings.lineColor.call(this,F[y]);s.beginPath();s.moveTo(C,g);x.push(r);alpha1=-Math.PI/2+o[y]-0.0001;s.arc(C,g,n,r,alpha1,false);s.lineTo(C,g);var w=this._settings.color.call(this,F[y]);s.fillStyle=w;s.fill();if(this._settings.pieInnerText){this._drawSectorLabel(C,g,5*n/6,r,alpha1,D,this._settings.pieInnerText(F[y],m),true)}if(this._settings.label){this._drawSectorLabel(C,g,n+this._settings.labelOffset,r,alpha1,D,this._settings.label(F[y]))}if(D!=1){this._createLowerSector(s,C,g,r,alpha1,n,true);s.fillStyle="#000000";s.globalAlpha=0.2;this._createLowerSector(s,C,g,r,alpha1,n,false);s.globalAlpha=1;s.fillStyle=w}E.addSector(F[y].id,r,alpha1,C-l.x,g-l.y/D,n,D,u);r=alpha1}s.globalAlpha=0.8;var q;for(y=0;y<x.length;y++){q=this._getPositionByAngle(x[y],C,g,n);this._drawLine(s,C,g,q.x,q.y,this._settings.lineColor.call(this,F[y]),2)}if(D==1){s.lineWidth=2;s.strokeStyle="#ffffff";s.beginPath();s.arc(C,g,n+1,0,2*Math.PI,false);s.stroke()}s.globalAlpha=1;s.scale(1,1/D)},_getValues:function(g){var a=[];for(var c=0;c<g.length;c++){a.push(parseFloat(this._settings.value(g[c])||0))}return a},_getTotalValue:function(a){var g=0;for(var c=0;c<a.length;c++){g+=a[c]}return g},_getRatios:function(c,a){var m;var l=[];var j=0;a=a||this._getTotalValue(c);for(var g=0;g<c.length;g++){m=c[g];l[g]=Math.PI*2*(a?((m+j)/a):(1/c.length));j+=m}return l},_getPieParameters:function(n,l){var j=l.x-n.x;var c=l.y-n.y;var g=n.x+j/2;var m=n.y+c/2;var a=Math.min(j/2,c/2);return{x:g,y:m,radius:a}},_createLowerSector:function(j,l,n,g,a,m,c){j.lineWidth=1;if(!((g<=0&&a>=0)||(g>=0&&a<=Math.PI)||(Math.abs(g-Math.PI)>0.003&&g<=Math.PI&&a>=Math.PI))){return}if(g<=0&&a>=0){g=0;c=false;this._drawSectorLine(j,l,n,m,g,a)}if(g<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(j,l,n,m,g,a)}var o=(this._settings.height||Math.floor(m/4))/this._settings.cant;j.beginPath();j.arc(l,n,m,g,a,false);j.lineTo(l+m*Math.cos(a),n+m*Math.sin(a)+o);j.arc(l,n+o,m,a,g,true);j.lineTo(l+m*Math.cos(g),n+m*Math.sin(g));j.fill();if(c){j.stroke()}},_drawSectorLine:function(g,j,m,l,c,a){g.beginPath();g.arc(j,m,l,c,a,false);g.stroke()},_addShadow:function(c,a,m,j){c.globalAlpha=0.5;var l=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var g=l.length-1;g>-1;g--){c.beginPath();c.fillStyle=l[g];c.arc(a+1,m+1,j+g,0,Math.PI*2,true);c.fill()}c.globalAlpha=1},_getGrayGradient:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},_showRadialGradient:function(g,c,n,a,j,l){g.beginPath();var m;if(typeof this._settings.gradient!="function"){m=g.createRadialGradient(j,l,a/4,c,n,a);m=this._getGrayGradient(m)}else{m=this._settings.gradient(m)}g.fillStyle=m;g.arc(c,n,a,0,Math.PI*2,true);g.fill();g.globalAlpha=0.7},_drawSectorLabel:function(E,c,j,A,w,F,v,a){var u=this.canvases[0].renderText(0,0,v,0,1);if(!u){return}var H=u.scrollWidth;u.style.width=H+"px";if(H>E){H=E}var C=(w-A<0.2?4:8);if(a){C=H/1.8}var g=A+(w-A)/2;j=j-(C-8)/2;var o=-C;var n=-8;var D="right";if(g>=Math.PI/2&&g<Math.PI||g<=3*Math.PI/2&&g>=Math.PI){o=-H-o+1;D="left"}var l=0;if(!a&&F<1&&(g>0&&g<Math.PI)){l=(this._settings.height||Math.floor(j/4))/F}var q=(c+Math.floor((j+l)*Math.sin(g)))*F+n;var r=E+Math.floor((j+C/2)*Math.cos(g))+o;var m=(w<Math.PI/2+0.01);var s=(A<Math.PI/2);if(s&&m){r=Math.max(r,E+3)}else{if(!s&&!m){r=Math.min(r,E-H)}else{if(!a&&(g>=Math.PI/2&&g<Math.PI||g<=3*Math.PI/2&&g>=Math.PI)){r+=H/3}}}u.style.top=q+"px";u.style.left=r+"px";u.style.width=H+"px";u.style.textAlign=D;u.style.whiteSpace="nowrap"}};dhtmlx.chart.pie3D={pvt_render_pie3D:function(c,j,a,m,g,l){this._renderPie(c,j,a,m,this._settings.cant,l)}};dhtmlx.chart.donut={pvt_render_donut:function(u,l,r,q,n,c){if(!l.length){return}this._renderPie(u,l,r,q,1,c);var j=this._settings;var m=this._getPieParameters(r,q);var a=(j.radius?j.radius:m.radius);var o=((j.innerRadius&&(j.innerRadius<a))?j.innerRadius:a/3);var g=(j.x?j.x:m.x);var s=(j.y?j.y:m.y);u.fillStyle="#ffffff";u.beginPath();u.arc(g,s,o,0,Math.PI*2,true);u.fill()}};dhtmlx.DataDriver.dhtmlxgrid={_grid_getter:"_get_cell_value",toObject:function(a){this._grid=a;return a},getRecords:function(a){return a.rowsBuffer},getDetails:function(g){var a={};for(var c=0;c<this._grid.getColumnsNum();c++){a["data"+c]=this._grid[this._grid_getter](g,c)}return a},getInfo:function(a){return{_size:0,_from:0}}};dhtmlx.ui.Canvas=function(c,g,l){this._canvas_labels=[];this._canvas_name=g;this._obj=c;var j=c.offsetWidth*(window.devicePixelRatio||1);var a=c.offsetHeight*(window.devicePixelRatio||1);var l=l||"";l+=";width:"+c.offsetWidth+"px;height:"+c.offsetHeight+"px;";this._prepareCanvas(g,l,j,a)};dhtmlx.ui.Canvas.prototype={_prepareCanvas:function(c,j,g,a){this._canvas=dhtmlx.html.create("canvas",{width:g,height:a,canvas_id:c,style:(j||"")});this._obj.appendChild(this._canvas);if(!this._canvas.getContext){if(dhtmlx._isIE){dhtmlx.require("thirdparty/excanvas/excanvas.js");G_vmlCanvasManager.init_(document);G_vmlCanvasManager.initElement(this._canvas)}else{dhtmlx.error("Canvas is not supported in the current browser")}}return this._canvas},getCanvas:function(c){var a=(this._canvas||this._prepareCanvas()).getContext(c||"2d");if(!this._webixDevicePixelRatio){this._webixDevicePixelRatio=true;a.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)}return a},_resizeCanvas:function(){if(this._canvas){var a=this._canvas.parentNode.offsetWidth;var c=this._canvas.parentNode.offsetHeight;this._canvas.setAttribute("width",a*(window.devicePixelRatio||1));this._canvas.setAttribute("height",c*(window.devicePixelRatio||1));this._canvas.style.width=a+"px";this._canvas.style.height=c+"px";this._webixDevicePixelRatio=false}},renderText:function(a,m,l,j,c){if(!l){return}var g=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(j?(" "+j):""),style:"left:"+a+"px; top:"+m+"px;"},l);this._obj.appendChild(g);this._canvas_labels.push(g);if(c){g.style.width=c+"px"}return g},renderTextAt:function(l,q,a,o,j,n,g){var m=this.renderText.call(this,a,o,j,n,g);if(m){if(l){if(l=="middle"){m.style.top=parseInt(o-m.offsetHeight/2,10)+"px"}else{m.style.top=o-m.offsetHeight+"px"}}if(q){if(q=="left"){m.style.left=a-m.offsetWidth+"px"}else{m.style.left=parseInt(a-m.offsetWidth/2,10)+"px"}}}return m},clearCanvas:function(a){var c=[],g;for(g=0;g<this._canvas_labels.length;g++){this._obj.removeChild(this._canvas_labels[g])}this._canvas_labels=[];if(!a&&this._obj._htmlmap){c=this._getMapAreas();while(c.length){c[0].parentNode.removeChild(c[0]);c.splice(0,1)}c=null;if(!this._obj._htmlmap.getElementsByTagName("AREA").length){this._obj._htmlmap.parentNode.removeChild(this._obj._htmlmap);this._obj._htmlmap=null}}this.getCanvas().clearRect(0,0,this._obj.offsetWidth*(window.devicePixelRatio||1),this._obj.offsetWidth*(window.devicePixelRatio||1))},toggleCanvas:function(){this._toggleCanvas(this._canvas.style.display=="none")},showCanvas:function(){this._toggleCanvas(true)},hideCanvas:function(){this._toggleCanvas(false)},_toggleCanvas:function(a){var c,g;for(g=0;g<this._canvas_labels.length;g++){this._canvas_labels[g].style.display=(a?"":"none")}if(this._obj._htmlmap){c=this._getMapAreas();for(g=0;g<c.length;g++){if(a){c[g].removeAttribute("disabled")}else{c[g].setAttribute("disabled","true")}}}this._canvas.style.display=(a?"":"none")},_getMapAreas:function(){var g=[],a,c;a=this._obj._htmlmap.getElementsByTagName("AREA");for(c=0;c<a.length;c++){if(a[c].getAttribute("userdata")==this._canvas_name){g.push(a[c])}}return g}};dhtmlXChart=function(a){this.name="Chart";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,true);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);for(var c in dhtmlx.chart){dhtmlx.extend(this,dhtmlx.chart[c])}if(a.preset){this.definePreset(a)}this._parseSettings(a,this.defaults);this._series=[this._settings];this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this));this.attachEvent("onLocateData",this._switchSerie)};dhtmlXChart.prototype={_id:"dhx_area_id",on_click:{dhx_chart_legend_item:function(m,n,l){var j=l.getAttribute("series_id");if(this.callEvent("onLegendClick",[m,j,l])){var g=this._settings;var c=g.legend.values;var a=(c&&(typeof c[j].toggle!="undefined"))?c[j].toggle:g.legend.toggle;if((typeof j!="undefined")&&this._series.length>1){if(a){if(l.className.indexOf("hidden")!=-1){this.showSeries(j)}else{this.hideSeries(j)}}}}}},on_dblclick:{},on_mouse_move:{},bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},resize:function(){for(var a in this.canvases){this.canvases[a]._resizeCanvas()}this.render()},view_setter:function(a){if(!dhtmlx.chart[a]){dhtmlx.error("Chart type extension is not loaded: "+a)}if(typeof this._settings.offset=="undefined"){this._settings.offset=!(a=="area"||a=="stackedArea")}if(a=="radar"&&!this._settings.yAxis){this.define("yAxis",{})}if(a=="scatter"){if(!this._settings.yAxis){this.define("yAxis",{})}if(!this._settings.xAxis){this.define("xAxis",{})}}return a},clearCanvas:function(){if(this.canvases&&typeof this.canvases=="object"){for(var a in this.canvases){this.canvases[a].clearCanvas()}}},render:function(){var g,c,j,l,a;if(!this.callEvent("onBeforeRender",[this.data])){return}if(this.canvases&&typeof this.canvases=="object"){for(c in this.canvases){this.canvases[c].clearCanvas()}}else{this.canvases={}}if(this._settings.legend){if(!this.canvases.legend){this.canvases.legend=new dhtmlx.ui.Canvas(this._obj,"legend")}this._drawLegend(this.data.getRange(),this._obj.offsetWidth)}g=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);l=new dhtmlx.ui.Map(this._id);a=this._settings;j=this._getChartData();for(c=0;c<this._series.length;c++){this._settings=this._series[c];if(!this.canvases[c]){this.canvases[c]=new dhtmlx.ui.Canvas(this._obj,c,"z-index:"+(2+c))}this["pvt_render_"+this._settings.view](this.canvases[c].getCanvas(),j,g.start,g.end,c,l)}l.render(this._obj);this._obj.lastChild.style.zIndex=1000;this._applyBounds(this._obj.lastChild,g);this.callEvent("onAfterRender",[]);this._settings=a},_applyBounds:function(g,c){var a={};a.left=c.start.x;a.top=c.start.y;a.width=c.end.x-c.start.x;a.height=c.end.y-c.start.y;for(var j in a){g.style[j]=a[j]+"px"}},_getChartData:function(){var j,n,g,l,m,r,a,o,q,c;l=this.data.getRange();j=(this._settings.view.toLowerCase().indexOf("barh")!=-1?"yAxis":"xAxis");n=this._settings[j];if(n&&n.units&&(typeof n.units=="object")){g=n.units;o=[];if(typeof g.start!="undefined"&&typeof g.end!="undefined"&&typeof g.next!="undefined"){a=g.start;while(a<=g.end){o.push(a);a=g.next.call(this,a)}}else{if(Object.prototype.toString.call(g)==="[object Array]"){o=g}}r=[];if(o.length){q=n.value;c={};for(m=0;m<l.length;m++){c[q(l[m])]=m}for(m=0;m<o.length;m++){if(typeof c[o[m]]!="undefined"){l[c[o[m]]].$unit=o[m];r.push(l[c[o[m]]])}else{r.push({$unit:o[m]})}}}return r}return l},value_setter:dhtmlx.Template.obj_setter,xValue_setter:dhtmlx.Template.obj_setter,yValue_setter:function(a){this.define("value",a)},alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,borderColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,gradient_setter:function(a){if((typeof(a)!="function")&&a&&(a===true)){a="light"}return a},colormap:{RAINBOW:function(a){var c=Math.floor(this.indexById(a.id)/this.dataCount()*1536);if(c==1536){c-=1}return this._rainbow[Math.floor(c/256)](c%256)}},color_setter:function(a){return this.colormap[a]||dhtmlx.Template.obj_setter(a)},fill_setter:function(a){return((!a||a==0)?false:dhtmlx.Template.obj_setter(a))},definePreset:function(a){this.define("preset",a.preset);delete a.preset},preset_setter:function(l){var g,c,j;this.defaults=dhtmlx.extend({},this.defaults);if(typeof dhtmlx.presets.chart[l]=="object"){j=dhtmlx.presets.chart[l];for(g in j){if(typeof j[g]=="object"){if(!this.defaults[g]||typeof this.defaults[g]!="object"){this.defaults[g]=dhtmlx.extend({},j[g])}else{this.defaults[g]=dhtmlx.extend({},this.defaults[g]);for(c in j[g]){this.defaults[g][c]=j[g][c]}}}else{this.defaults[g]=j[g]}}return l}return false},legend_setter:function(a){if(!a){if(this.legendObj){this.legendObj.innerHTML="";this.legendObj=null}return false}if(typeof(a)!="object"){a={template:a}}this._mergeSettings(a,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:(this._settings.view.toLowerCase().indexOf("stacked")!=-1?"":"hide"),marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3});a.template=dhtmlx.Template.setter(a.template);return a},defaults:{color:"RAINBOW",alpha:"1",label:false,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:30,labelWidth:100,line:{width:2,color:"#1293f8"},item:{radius:3,borderColor:"#636363",borderWidth:1,color:"#ffffff",alpha:1,type:"r",shadow:false},shadow:true,gradient:false,border:true,labelOffset:20,origin:"auto"},item_setter:function(a){if(typeof(a)!="object"){a={color:a,borderColor:a}}this._mergeSettings(a,dhtmlx.extend({},this.defaults.item));var g=["alpha","borderColor","color","radius"];for(var c=0;c<g.length;c++){a[g[c]]=dhtmlx.Template.setter(a[g[c]])}return a},line_setter:function(a){if(typeof(a)!="object"){a={color:a}}dhtmlx.extend(this.defaults.line,a);a=dhtmlx.extend({},this.defaults.line);a.color=dhtmlx.Template.setter(a.color);return a},padding_setter:function(a){if(typeof(a)!="object"){a={left:a,right:a,top:a,bottom:a}}this._mergeSettings(a,{left:50,right:20,top:35,bottom:40});return a},xAxis_setter:function(a){if(!a){return false}if(typeof(a)!="object"){a={template:a}}if(!a.value){a.value=a.template}this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",value:"{obj}",lines:true});var c=["lineColor","template","lines","value"];this._converToTemplate(c,a);this._configXAxis=dhtmlx.extend({},a);return a},yAxis_setter:function(a){this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",lines:true,bg:"#ffffff"});var c=["lineColor","template","lines","bg"];this._converToTemplate(c,a);this._configYAxis=dhtmlx.extend({},a);return a},_converToTemplate:function(a,c){for(var g=0;g<a.length;g++){c[a[g]]=dhtmlx.Template.setter(c[a[g]])}},_drawScales:function(l,j,g,n,a,c){var m=0;if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}m=this._drawYAxis(this.canvases.y.getCanvas(),l,j,g,n,a)}if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}this._drawXAxis(this.canvases.x.getCanvas(),l,j,g,c,m)}return m},_drawXAxis:function(v,m,s,r,j,q){var g=s.x-0.5;var u=parseInt((q?q:r.y),10)+0.5;var c=r.x;var n;var a=true;for(var l=0;l<m.length;l++){if(this._settings.offset===true){n=g+j/2+l*j}else{n=(l==m.length-1)?r.x:g+l*j;a=!!l}n=Math.ceil(n)-0.5;var o=((this._settings.origin!="auto")&&(this._settings.view=="bar")&&(parseFloat(this._settings.value(m[l]))<this._settings.origin));this._drawXAxisLabel(n,u,m[l],a,o);if((this._settings.offset||l)&&this._settings.xAxis.lines.call(this,m[l])){this._drawXAxisLine(v,n,r.y,s.y,m[l])}}this.canvases.x.renderTextAt(true,false,g,r.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",r.x-s.x);this._drawLine(v,g,u,c,u,this._settings.xAxis.color,1);if(!this._settings.xAxis.lines.call(this,{})||!this._settings.offset){return}this._drawLine(v,c+0.5,r.y,c+0.5,s.y+0.5,this._settings.xAxis.color,0.2)},_drawYAxis:function(x,E,m,l,o,n){var q;var v={};if(!this._settings.yAxis){return}var A=m.x-0.5;var j=l.y;var g=m.y;var w=l.y;if(this._settings.yAxis.step){q=parseFloat(this._settings.yAxis.step)}if(typeof this._configYAxis.step=="undefined"||typeof this._configYAxis.start=="undefined"||typeof this._configYAxis.end=="undefined"){v=this._calculateScale(o,n);o=v.start;n=v.end;q=v.step;this._settings.yAxis.end=n;this._settings.yAxis.start=o}this._setYAxisTitle(m,l);if(q===0){n=o;q=1}var a=(n==o?j-g:(j-g)*q/(n-o));var C=0;for(var y=o;y<=n;y+=q){if(v.fixNum){y=parseFloat((new Number(y)).toFixed(v.fixNum))}var D=Math.floor(j-C*a)+0.5;if(!(y==o&&this._settings.origin=="auto")&&this._settings.yAxis.lines.call(this,y)){this._drawLine(x,A,D,l.x,D,this._settings.yAxis.lineColor.call(this,y),1)}if(y==this._settings.origin){w=D}var r=y;if(q<1){var s=Math.min(this._log10(q),(o<=0?0:this._log10(o)));var u=Math.pow(10,-s);r=Math.round(y*u)/u;y=r}this.canvases.y.renderText(0,D-5,this._settings.yAxis.template(r.toString()),"dhx_axis_item_y",m.x-5);C++}this._drawLine(x,A,j+1,A,g,this._settings.yAxis.color,1);return w},_setYAxisTitle:function(g,c){var a="dhx_axis_title_y"+(dhtmlx._isIE&&dhtmlx._isIE!=9?" dhx_ie_filter":"");var j=this.canvases.y.renderTextAt("middle",false,0,parseInt((c.y-g.y)/2+g.y,10),this._settings.yAxis.title,a);if(j){j.style.left=(dhtmlx.env.transform?(j.offsetHeight-j.offsetWidth)/2:0)+"px"}},_calculateScale:function(r,c){if(this._settings.origin!="auto"&&this._settings.origin<r){r=this._settings.origin}var l,j,n;l=((c-r)/8)||1;var g=Math.floor(this._log10(l));var a=Math.pow(10,g);var m=l/a;m=(m>5?10:5);l=parseInt(m,10)*a;if(l>Math.abs(r)){j=(r<0?-l:0)}else{var s=Math.abs(r);var q=Math.floor(this._log10(s));var o=s/Math.pow(10,q);j=Math.ceil(o*10)/10*Math.pow(10,q)-l;if(s>1&&l>0.1){j=Math.ceil(j)}while(r<0?j<=r:j>=r){j-=l}if(r<0){j=-j-2*l}}n=j;while(n<c){n+=l;n=parseFloat((new Number(n)).toFixed(Math.abs(g)))}return{start:j,end:n,step:l,fixNum:Math.abs(g)}},_getLimits:function(c,n){var o,m;var l=((arguments.length&&c=="h")?this._configXAxis:this._configYAxis);n=n||"value";if(l&&(typeof l.end!="undefined")&&(typeof l.start!="undefined")&&l.step){o=parseFloat(l.end);m=parseFloat(l.start)}else{o=this.max(this._series[0][n]);m=(l&&(typeof l.start!="undefined"))?parseFloat(l.start):this.min(this._series[0][n]);if(this._series.length>1){for(var j=1;j<this._series.length;j++){var a=this.max(this._series[j][n]);var g=this.min(this._series[j][n]);if(a>o){o=a}if(g<m){m=g}}}}return{max:o,min:m}},_log10:function(c){var a="log";return Math.floor((Math[a](c)/Math.LN10))},_drawXAxisLabel:function(c,m,l,a,j){if(!this._settings.xAxis){return}var g=this.canvases.x.renderTextAt(j,a,c,m-(j?2:0),this._settings.xAxis.template(l));if(g){g.className+=" dhx_axis_item_x"}},_drawXAxisLine:function(c,a,j,g,l){if(!this._settings.xAxis||!this._settings.xAxis.lines){return}this._drawLine(c,a,j,a,g,this._settings.xAxis.lineColor.call(this,l),1)},_drawLine:function(a,j,n,g,l,c,m){a.strokeStyle=c;a.lineWidth=m;a.beginPath();a.moveTo(j,n);a.lineTo(g,l);a.stroke();a.lineWidth=1},_getRelativeValue:function(j,l){var g,a;var c=1;if(l!=j){g=l-j}else{g=j}return[g,c]},_rainbow:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}],addSeries:function(c){var a=this._settings;this._settings=dhtmlx.extend({},a);this._parseSettings(c,{});this._series.push(this._settings);this._settings=a},_switchSerie:function(j,a){var g;this._active_serie=a.getAttribute("userdata");if(!this._series[this._active_serie]){return}for(var c=0;c<this._series.length;c++){g=this._series[c].tooltip;if(g){g.disable()}}if(!a.getAttribute("disabled")){g=this._series[this._active_serie].tooltip;if(g){g.enable()}}},hideSeries:function(a){this.canvases[a].hideCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){this._settings.legend.values[a].$hidden=true}this._drawLegend()},showSeries:function(a){this.canvases[a].showCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){delete this._settings.legend.values[a].$hidden}this._drawLegend()},_setBorderStyles:function(a,c){var j,g;g=dhtmlx.math.toRgb(c);j=dhtmlx.math.rgbToHsv(g[0],g[1],g[2]);j[2]/=2;c="rgb("+dhtmlx.math.hsvToRgb(j[0],j[1],j[2])+")";a.strokeStyle=c;if(a.globalAlpha==1){a.globalAlpha=0.9}},_drawLegend:function(j,c){var l,r,A,s,m,u,a,o=0,n=0,w,q,g,v;j=j||[];c=c||this._obj.offsetWidth;w=this.canvases.legend.getCanvas();r=this._settings.legend;a=(this._settings.legend.layout!="x"?"width:"+r.width+"px":"");if(this.legendObj){this.legendObj.innerHTML="";this.legendObj.parentNode.removeChild(this.legendObj)}this.canvases.legend.clearCanvas(true);A=dhtmlx.html.create("DIV",{"class":"dhx_chart_legend",style:"left:"+o+"px; top:"+n+"px;"+a},"");if(r.padding){A.style.padding=r.padding+"px"}this.legendObj=A;this._obj.appendChild(A);m=[];if(!r.values){for(l=0;l<j.length;l++){m.push(this._drawLegendText(A,r.template(j[l])))}}else{for(l=0;l<r.values.length;l++){m.push(this._drawLegendText(A,r.values[l].text,(typeof r.values[l].id!="undefined"?typeof r.values[l].id:l),r.values[l].$hidden))}}u=A.offsetWidth;s=A.offsetHeight;if(u<this._obj.offsetWidth){if(r.layout=="x"&&r.align=="center"){o=(this._obj.offsetWidth-u)/2}if(r.align=="right"){o=this._obj.offsetWidth-u}if(r.margin&&r.align!="center"){o+=(r.align=="left"?1:-1)*r.margin}}if(s<this._obj.offsetHeight){if(r.valign=="middle"&&r.align!="center"&&r.layout!="x"){n=(this._obj.offsetHeight-s)/2}else{if(r.valign=="bottom"){n=this._obj.offsetHeight-s}}if(r.margin&&r.valign!="middle"){n+=(r.valign=="top"?1:-1)*r.margin}}A.style.left=o+"px";A.style.top=n+"px";w.save();for(l=0;l<m.length;l++){v=m[l];if(r.values&&r.values[l].$hidden){g=true;q=(r.values[l].disableColor?r.values[l].disableColor:"#d9d9d9")}else{g=false;q=(r.values?r.values[l].color:this._settings.color.call(this,j[l]))}this._drawLegendMarker(w,v.offsetLeft+o,v.offsetTop+n,q,v.offsetHeight,g,l)}w.restore();m=null},_drawLegendText:function(a,l,c,j){var g="";if(this._settings.legend.layout=="x"){g="float:left;"}var m=dhtmlx.html.create("DIV",{style:g+"padding-left:"+(10+this._settings.legend.marker.width)+"px","class":"dhx_chart_legend_item"+(j?" hidden":"")},l);if(arguments.length>2){m.setAttribute("series_id",c)}a.appendChild(m);return m},_drawLegendMarker:function(C,u,s,l,A,m,o){var c=[];var n=this._settings.legend.marker;var w=this._settings.legend.values;var r=(w&&w[o].markerType?w[o].markerType:n.type);if(l){C.fillStyle=l;C.strokeStyle=this._getDarkenColor(l,0.75)}C.beginPath();if(r=="round"||!n.radius){C.lineWidth=n.height;C.lineCap=r;u+=C.lineWidth/2+5;s+=A/2;C.moveTo(u,s);var a=u+n.width-n.height+1;C.lineTo(a,s)}else{if(r=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){C.beginPath();C.lineWidth=this._series[o].line.width;C.strokeStyle=m?l:this._series[o].line.color.call(this,{});var g=u+5;var v=s+A/2;C.moveTo(g,v);var a=g+n.width;C.lineTo(a,v);C.stroke()}var j=this._series[o].item;var q=parseInt(j.radius.call(this,{}),10)||0;if(q){C.beginPath();if(m){C.lineWidth=j.borderWidth;C.strokeStyle=l;C.fillStyle=l}else{C.lineWidth=j.borderWidth;C.fillStyle=j.color.call(this,{});C.strokeStyle=j.borderColor.call(this,{});C.globalAlpha=j.alpha.call(this,{})}C.beginPath();u+=n.width/2+5;s+=A/2;this._strokeChartItem(C,u,s,q+1,j.type);C.fill();C.stroke()}C.globalAlpha=1}else{C.lineWidth=1;u+=5;s+=parseInt(A/2-n.height/2,10);c=[[u+n.radius,s+n.radius,n.radius,Math.PI,3*Math.PI/2,false],[u+n.width-n.radius,s],[u+n.width-n.radius,s+n.radius,n.radius,-Math.PI/2,0,false],[u+n.width,s+n.height-n.radius],[u+n.width-n.radius,s+n.height-n.radius,n.radius,0,Math.PI/2,false],[u+n.radius,s+n.height],[u+n.radius,s+n.height-n.radius,n.radius,Math.PI/2,Math.PI,false],[u,s+n.radius]];this._path(C,c)}}C.stroke();C.fill()},_getDarkenColor:function(a,j){var g,c;c=dhtmlx.math.toRgb(a);g=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);g[2]=g[2]*j;return"rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")"},_getChartBounds:function(a,n){var q,g,o,c;q=this._settings.padding.left;g=this._settings.padding.top;o=a-this._settings.padding.right;c=n-this._settings.padding.bottom;if(this._settings.legend){var l=this._settings.legend;var m=this._settings.legend.width;var j=this._settings.legend.height;if(l.layout=="x"){if(l.valign=="center"){if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}else{if(l.valign=="bottom"){c-=j}else{g+=j}}}else{if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}}return{start:{x:q,y:g},end:{x:o,y:c}}},_getStackedLimits:function(m){var c,a,n,l,g;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){n=parseFloat(this._settings.yAxis.end);l=parseFloat(this._settings.yAxis.start)}else{for(c=0;c<m.length;c++){m[c].$sum=0;m[c].$min=Infinity;for(a=0;a<this._series.length;a++){g=parseFloat(this._series[a].value(m[c])||0);if(isNaN(g)){continue}if(this._series[a].view.toLowerCase().indexOf("stacked")!=-1){m[c].$sum+=g}if(g<m[c].$min){m[c].$min=g}}}n=-Infinity;l=Infinity;for(c=0;c<m.length;c++){if(m[c].$sum>n){n=m[c].$sum}if(m[c].$min<l){l=m[c].$min}}if(l>0){l=0}}return{max:n,min:l}},_setBarGradient:function(w,c,s,a,q,o,j,g){var r,l,n,m,v,u;if(o=="light"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}u=[[0,"#FFFFFF"],[0.9,j],[1,j]];l=2}else{if(o=="falling"||o=="rising"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}n=dhtmlx.math.toRgb(j);m=dhtmlx.math.rgbToHsv(n[0],n[1],n[2]);m[1]*=1/2;v="rgb("+dhtmlx.math.hsvToRgb(m[0],m[1],m[2])+")";if(o=="falling"){u=[[0,v],[0.7,j],[1,j]]}else{if(o=="rising"){u=[[0,j],[0.3,j],[1,v]]}}l=0}else{w.globalAlpha=0.37;l=0;if(g=="x"){r=w.createLinearGradient(c,q,c,s)}else{r=w.createLinearGradient(c,s,a,s)}u=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(r,u);return{gradient:r,offset:l}},_getPositionByAngle:function(g,c,l,j){g*=(-1);c=c+Math.cos(g)*j;l=l-Math.sin(g)*j;return{x:c,y:l}},_gradient:function(g,c){for(var a=0;a<c.length;a++){g.addColorStop(c[a][0],c[a][1])}},_path:function(a,g){var c,j;for(c=0;c<g.length;c++){j=(c?"lineTo":"moveTo");if(g[c].length>2){j="arc"}a[j].apply(a,g[c])}},_circle:function(c,a,j,g){c.arc(a,j,g,Math.PI*2,true)},_addMapRect:function(j,l,a,g,c){j.addRect(l,[a[0].x-g.x,a[0].y-g.y,a[1].x-g.x,a[1].y-g.y],c)}};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachChart=function(a){this.callEvent("_onBeforeContentAttach",["chart"]);var c=document.createElement("DIV");c.id="dhxChartObj_"+window.dhx4.newId();c.style.width="100%";c.style.height="100%";document.body.appendChild(c);this._attachObject(c);a.container=c.id;this.dataType="chart";this.dataObj=new dhtmlXChart(a);if(!this.dataObj.setSizes){this.dataObj.setSizes=function(){if(this.resize){this.resize()}else{this.render()}}}return this.dataObj}}dhtmlx.ui.pager=function(a){this.name="Pager";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this._parseSettings(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this._settings;this.refresh()};dhtmlx.ui.pager.prototype={_id:"dhx_p_id",on_click:{dhx_pager_item:function(a,c){this.select(c)}},select:function(a){switch(a){case"next":a=this._settings.page+1;break;case"prev":a=this._settings.page-1;break;case"first":a=0;break;case"last":a=this._settings.limit-1;break;default:break}if(a<0){a=0}if(a>=this.data.limit){a=this.data.limit-1}if(this.callEvent("onBeforePageChange",[this._settings.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),pages:function(g){var c="";if(g.page==-1){return""}g.min=g.page-Math.round((g.group-1)/2);g.max=g.min+g.group-1;if(g.min<0){g.max+=g.min*(-1);g.min=0}if(g.max>=g.limit){g.min-=Math.min(g.min,g.max-g.limit+1);g.max=g.limit-1}for(var a=(g.min||0);a<=g.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==g.page?"_selected":"")})}return c},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},refresh:function(){var a=this._settings;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit){a.page=Math.min(a.limit-1,a.page)}var c=a.page;if(c!=-1&&(c!=a.old_page)||(a.limit!=a.old_limit)){this.render();this.callEvent("onRefresh",[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.DataProcessor={_dp_init:function(c){var a="_methods";c[a]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(g){c.setUpdated(g,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(j,g){if(j.getUserData){j.getUserData(g,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(j){if(c._silent_mode){return true}var g=c.getState(j);if(g=="inserted"){c.setUpdated(j,false);return true}if(g=="deleted"){return false}if(g=="true_deleted"){return true}c.setUpdated(j,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(g){c.setUpdated(g,true,"updated")});this.attachEvent("onBindUpdate",function(g){window.setTimeout(function(){c.setUpdated(g.id,true,"updated")},1)});a="_getRowData";c[a]=function(n,g){var l=this.obj.data.get(n);var m={};for(var j in l){if(j.indexOf("_")===0){continue}m[j]=l[j]}return m};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(g,j){this.obj.setUserData(j,this.action_param,"true_deleted");this.obj.remove(j)});dhtmlx.compat("dataProcessor",c)},_dp_callback:function(a,c){this.obj.data.set(c,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(c)},setItemStyle:function(g,a){var c=this._locateHTML(g);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(g,a,c){if(g){this.data.get(g)[a]=c}else{this._userdata[a]=c}},getUserData:function(c,a){return c?this.data.get(c)[a]:this._userdata[a]}};(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor._dp_init})();dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var o="_dragged";var j=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(r,s,q){j.apply(this,arguments);if(!q){var u=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!u.from){u.from=this.dragStartObject}dhtmlx.DragControl._checkLand(r,s,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(s,q,r){if(!r){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=n.dragStartNode;dhtmlx.DragControl._stopDrag(s,true)}}c.apply(this,arguments)};var n=new dhtmlDragAndDropObject();var l=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){l.apply(this,arguments);var u=dhtmlx.DragControl._drag_context;if(!u){return}var s=[];var r=[];for(var q=0;q<u.source.length;q++){s[q]={idd:u.source[q]};r.push(u.source[q])}n.dragStartNode={parentNode:{},parentObject:{idd:s,id:(r.length==1?r[0]:r),treeNod:{object:u.from}}};n.dragStartNode.parentObject.treeNod[o]=s;n.dragStartObject=u.from};var m=dhtmlx.DragControl._checkLand;dhtmlx.DragControl._checkLand=function(r,s,q){m.apply(this,arguments);if(!this._last&&!q){r=n.checkLanding(r,s,true)}};var a=dhtmlx.DragControl._stopDrag;dhtmlx.DragControl._stopDrag=function(r,q){a.apply(this,arguments);if(n.lastLanding&&!q){n.stopDrag(r,false,true)}};var g=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(r){var s=null;if(r){s=g.apply(this,arguments)}if(!s){s=n.dragStartObject;var u=[];var v=s[o];for(var q=0;q<v.length;q++){u.push(v[q].idd||v[q].id)}dhtmlx.DragControl._drag_context.source=u}return s}}};dhtmlx.DataMove={_init:function(){dhtmlx.assert(this.data,"DataMove :: Component doesn't have DataStore")},copy:function(c,l,a,j){var g=this.get(c);if(!g){dhtmlx.log("Warning","Incorrect ID in DataMove::copy");return}if(a){dhtmlx.assert(a.externalData,"DataMove :: External object doesn't support operation");g=a.externalData(g)}a=a||this;return a.add(a.externalData(g,j),l)},move:function(g,n,c,m){if(g instanceof Array){for(var j=0;j<g.length;j++){var a=(c||this).indexById(this.move(g[j],n,c,g[j]));if(g[j+1]){n=a+(this.indexById(g[j+1])<a?0:1)}}return}nid=g;if(n<0){dhtmlx.log("Info","DataMove::move - moving outside of bounds is ignored");return}var l=this.get(g);if(!l){dhtmlx.log("Warning","Incorrect ID in DataMove::move");return}if(!c||c==this){this.data.move(this.indexById(g),n)}else{dhtmlx.assert(c.externalData,"DataMove :: External object doesn't support operation");nid=c.add(c.externalData(l,m),n);this.remove(g)}return nid},moveUp:function(c,a){return this.move(c,this.indexById(c)-(a||1))},moveDown:function(c,a){return this.moveUp(c,(a||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,g){var c=dhtmlx.extend({},a);c.id=g||dhtmlx.uid();c.$selected=c.$template=null;return c}};dhtmlx.DragControl={_drag_masters:dhtmlx.toArray(["dummy"]),addDrop:function(c,g,a){c=dhtmlx.toNode(c);c.dhx_drop=this._getCtrl(g);if(a){c.dhx_master=true}},_getCtrl:function(c){c=c||dhtmlx.DragControl;var a=this._drag_masters.find(c);if(a<0){a=this._drag_masters.length;this._drag_masters.push(c)}return a},addDrag:function(a,c){a=dhtmlx.toNode(a);a.dhx_drag=this._getCtrl(c);dhtmlx.event(a,"mousedown",this._preStart,a)},_preStart:function(a){if(dhtmlx.DragControl._active){dhtmlx.DragControl._preStartFalse();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl._active=this;dhtmlx.DragControl._start_pos={x:a.pageX,y:a.pageY};dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._startDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._preStartFalse);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.event(this,"scroll",dhtmlx.DragControl._preStartFalse);a.cancelBubble=true;return false},_preStartFalse:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_sc)},_startDrag:function(a){var c={x:a.pageX,y:a.pageY};if(Math.abs(c.x-dhtmlx.DragControl._start_pos.x)<5&&Math.abs(c.y-dhtmlx.DragControl._start_pos.y)<5){return}dhtmlx.DragControl._preStartFalse();if(!dhtmlx.DragControl.createDrag(a)){return}dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._moveDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._stopDrag);dhtmlx.DragControl._moveDrag(a)},_stopDrag:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);if(dhtmlx.DragControl._last){dhtmlx.DragControl.onDrop(dhtmlx.DragControl._active,dhtmlx.DragControl._last,this._landing,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl._active,dhtmlx.DragControl._last,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},_moveDrag:function(a){var c=dhtmlx.html.pos(a);dhtmlx.DragControl._html.style.top=c.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl._html.style.left=c.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl._skip){dhtmlx.DragControl._skip=false}else{dhtmlx.DragControl._checkLand((a.srcElement||a.target),a)}a.cancelBubble=true;return false},_checkLand:function(a,c){while(a&&a.tagName!="BODY"){if(a.dhx_drop){if(this._last&&(this._last!=a||a.dhx_master)){this.onDragOut(this._active,this._last,a,c)}if(!this._last||this._last!=a||a.dhx_master){this._last=null;this._landing=this.onDragIn(dhtmlx.DragControl._active,a,c);if(this._landing){this._last=a}return}return}a=a.parentNode}if(this._last){this._last=this._landing=this.onDragOut(this._active,this._last,null,c)}},sendSignal:function(a){dhtmlx.DragControl.active=(a=="start")},getMaster:function(a){return this._drag_masters[a.dhx_drag||a.dhx_drop]},getContext:function(a){return this._drag_context},createDrag:function(l){var g=dhtmlx.DragControl._active;var j=this._drag_masters[g.dhx_drag];var c;if(j.onDragCreate){c=j.onDragCreate(g,l);c.style.position="absolute";c.style.zIndex=dhtmlx.zIndex.drag;c.onmousemove=dhtmlx.DragControl._skip_mark}else{var m=dhtmlx.DragControl.onDrag(g,l);if(!m){return false}var c=document.createElement("DIV");c.innerHTML=m;c.className="dhx_drag_zone";c.onmousemove=dhtmlx.DragControl._skip_mark;document.body.appendChild(c)}dhtmlx.DragControl._html=c;return true},_skip_mark:function(){dhtmlx.DragControl._skip=true},destroyDrag:function(){var c=dhtmlx.DragControl._active;var g=this._drag_masters[c.dhx_drag];if(g&&g.onDragDestroy){g.onDragDestroy(c,dhtmlx.DragControl._html)}else{dhtmlx.html.remove(dhtmlx.DragControl._html)}dhtmlx.DragControl._landing=dhtmlx.DragControl._active=dhtmlx.DragControl._last=dhtmlx.DragControl._html=null},top:5,left:5,onDragIn:function(g,c,j){var a=this._drag_masters[c.dhx_drop];if(a.onDragIn&&a!=this){return a.onDragIn(g,c,j)}c.className=c.className+" dhx_drop_zone";return c},onDragOut:function(g,c,l,j){var a=this._drag_masters[c.dhx_drop];if(a.onDragOut&&a!=this){return a.onDragOut(g,c,l,j)}c.className=c.className.replace("dhx_drop_zone","");return null},onDrop:function(g,c,l,j){var a=this._drag_masters[c.dhx_drop];dhtmlx.DragControl._drag_context.from=dhtmlx.DragControl.getMaster(g);if(a.onDrop&&a!=this){return a.onDrop(g,c,l,j)}c.appendChild(g)},onDrag:function(c,g){var a=this._drag_masters[c.dhx_drag];if(a.onDrag&&a!=this){return a.onDrag(c,g)}dhtmlx.DragControl._drag_context={source:c,from:c};return"<div style='"+c.style.cssText+"'>"+c.innerHTML+"</div>"}};dhtmlx.DragItem={_init:function(){dhtmlx.assert(this.move,"DragItem :: Component doesn't have DataMove interface");dhtmlx.assert(this.locate,"DragItem :: Component doesn't have RenderStack interface");dhtmlx.assert(dhtmlx.DragControl,"DragItem :: DragControl is not included");if(!this._settings||this._settings.drag){dhtmlx.DragItem._initHandlers(this)}else{if(this._settings){this.drag_setter=function(a){if(a){this._initHandlers(this);delete this.drag_setter}return a}}}if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},_initHandlers:function(a){dhtmlx.DragControl.addDrop(a._obj,a,true);dhtmlx.DragControl.addDrag(a._obj,a)},onDragIn:function(j,g,l){var n=this.locate(l)||null;var c=dhtmlx.DragControl._drag_context;var m=dhtmlx.DragControl.getMaster(j);var a=(this._locateHTML(n)||this._obj);if(a==dhtmlx.DragControl._landing){return a}c.target=n;c.to=m;if(!this.callEvent("onBeforeDragIn",[c,l])){c.id=null;return null}dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(j,g,o,l){var m=this.locate(l)||null;if(o!=this._dataobj){m=null}var c=(this._locateHTML(m)||(o?dhtmlx.DragControl.getMaster(o)._obj:window.undefined));if(c==dhtmlx.DragControl._landing){return null}var a=dhtmlx.DragControl._drag_context;dhtmlx.html.removeCss(dhtmlx.DragControl._landing,"dhx_drag_over");a.target=a.to=null;this.callEvent("onDragOut",[a,l]);return null},onDrop:function(g,c,l,j){var a=dhtmlx.DragControl._drag_context;a.to=this;a.index=a.target?this.indexById(a.target):this.dataCount();a.new_id=dhtmlx.uid();if(!this.callEvent("onBeforeDrop",[a,j])){return}if(a.from==a.to){this.move(a.source,a.index)}else{if(a.from){a.from.move(a.source,a.index,a.to,a.new_id)}else{dhtmlx.error("Unsopported d-n-d combination")}}this.callEvent("onAfterDrop",[a,j])},onDrag:function(g,l){var m=this.locate(l);var j=[m];if(m){if(this.getSelected){var c=this.getSelected();if(dhtmlx.PowerArray.find.call(c,m)!=-1){j=c}}var a=dhtmlx.DragControl._drag_context={source:j,start:m};a.from=this;if(this.callEvent("onBeforeDrag",[a,l])){return a.html||this._toHTML(this.get(m))}}return null}};dhtmlx.EditAbility={_init:function(a){this._edit_id=null;this._edit_bind=null;dhtmlx.assert(this.data,"EditAbility :: Component doesn't have DataStore");dhtmlx.assert(this._locateHTML,"EditAbility :: Component doesn't have RenderStack");this.attachEvent("onEditKeyPress",function(g,j,c){if(g==13&&!c){this.stopEdit()}else{if(g==27){this.stopEdit(true)}}});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this._edit_id},edit:function(c){if(this.stopEdit(false,c)){if(!this.callEvent("onBeforeEditStart",[c])){return}var a=this.data.get(c);if(a.$template){return}a.$template="edit";this.data.refresh(c);this._edit_id=c;this._save_binding(c);this._edit_bind(true,a);this.callEvent("onAfterEditStart",[c])}},stopEdit:function(g,l){if(!this._edit_id){return true}if(this._edit_id==l){return false}var a={};if(!g){this._edit_bind(false,a)}else{a=null}if(!this.callEvent("onBeforeEditStop",[this._edit_id,a])){return false}var c=this.data.get(this._edit_id);c.$template=null;if(!g){this._edit_bind(false,c)}var j=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(j);this.callEvent("onAfterEditStop",[j,a]);return true},_save_binding:function(o){var a=this._locateHTML(o);var g="";var m="";var l=[];if(a){var j=a.getElementsByTagName("*");var n="";for(var c=0;c<j.length;c++){if(j[c].nodeType==1&&(n=j[c].getAttribute("bind"))){g+="els["+l.length+"].value="+n+";";m+=n+"=els["+l.length+"].value;";l.push(j[c]);j[c].className+=" dhx_allow_selection";j[c].onselectstart=this._block_native}}j=null}g=Function("obj","els",g);m=Function("obj","els",m);this._edit_bind=function(r,q){if(r){g(q,l);if(l.length&&l[0].select){l[0].select()}}else{m(q,l)}}},_block_native:function(a){(a||event).cancelBubble=true;return true}};dhtmlx.SelectionModel={_init:function(){this._selected=dhtmlx.toArray();dhtmlx.assert(this.data,"SelectionModel :: Component doesn't have DataStore");this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this._data_updated,this));this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._data_loaded,this));this.data.attachEvent("onAfterFilter",dhtmlx.bind(this._data_filtered,this));this.data.attachEvent("onIdChange",dhtmlx.bind(this._id_changed,this))},_id_changed:function(g,a){for(var c=this._selected.length-1;c>=0;c--){if(this._selected[c]==g){this._selected[c]=a}}},_data_filtered:function(){for(var a=this._selected.length-1;a>=0;a--){if(this.data.indexById(this._selected[a])<0){var g=this._selected[a]}var c=this.item(g);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[g])}},_data_updated:function(g,c,a){if(a=="delete"){this._selected.remove(g)}else{if(!this.data.dataCount()&&!this.data._filter_order){this._selected=dhtmlx.toArray()}}},_data_loaded:function(){if(this._settings.select){this.data.each(function(a){if(a.$selected){this.select(a.id)}},this)}},_select_mark:function(g,c,a){if(!a&&!this.callEvent("onBeforeSelect",[g,c])){return false}this.data.item(g).$selected=c;if(a){a.push(g)}else{if(c){this._selected.push(g)}else{this._selected.remove(g)}this._refresh_selection(g)}return true},select:function(j,g,a){if(!j){return this.selectAll()}if(j instanceof Array){for(var c=0;c<j.length;c++){this.select(j[c],g,a)}return}if(!this.data.exists(j)){dhtmlx.error("Incorrect id in select command: "+j);return}if(a&&this._selected.length){return this.selectAll(this._selected[this._selected.length-1],j)}if(!g&&(this._selected.length!=1||this._selected[0]!=j)){this._silent_selection=true;this.unselectAll();this._silent_selection=false}if(this.isSelected(j)){if(g){this.unselect(j)}return}if(this._select_mark(j,true)){this.callEvent("onAfterSelect",[j])}},unselect:function(a){if(!a){return this.unselectAll()}if(!this.isSelected(a)){return}this._select_mark(a,false)},selectAll:function(j,g){var a;var c=[];if(j||g){a=this.data.getRange(j||null,g||null)}else{a=this.data.getRange()}a.each(function(l){var m=this.data.item(l.id);if(!m.$selected){this._selected.push(l.id);this._select_mark(l.id,true,c)}return l.id},this);this._refresh_selection(c)},unselectAll:function(){var a=[];this._selected.each(function(c){this._select_mark(c,false,a)},this);this._selected=dhtmlx.toArray();this._refresh_selection(a)},isSelected:function(a){return this._selected.find(a)!=-1},getSelected:function(a){switch(this._selected.length){case 0:return a?[]:"";case 1:return a?[this._selected[0]]:this._selected[0];default:return([].concat(this._selected))}},_is_mass_selection:function(a){return a.length>100||a.length>this.data.dataCount/2},_refresh_selection:function(c){if(typeof c!="object"){c=[c]}if(!c.length){return}if(this._is_mass_selection(c)){this.data.refresh()}else{for(var a=0;a<c.length;a++){this.render(c[a],this.data.item(c[a]),"update")}}if(!this._silent_selection){this.callEvent("onSelectChange",[c])}}};dhtmlx.RenderStack={_init:function(){dhtmlx.assert(this.data,"RenderStack :: Component doesn't have DataStore");dhtmlx.assert(dhtmlx.Template,"dhtmlx.Template :: dhtmlx.Template is not accessible");this._html=document.createElement("DIV")},_toHTML:function(a){dhtmlx.assert((!a.$template||this.type["template_"+a.$template]),"RenderStack :: Unknown template: "+a.$template);this.callEvent("onItemRender",[a]);return this.type._item_start(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type._item_end},_toHTMLObject:function(a){this._html.innerHTML=this._toHTML(a);return this._html.firstChild},_locateHTML:function(a){if(this._htmlmap){return this._htmlmap[a]}this._htmlmap={};var g=this._dataobj.childNodes;for(var c=0;c<g.length;c++){var j=g[c].getAttribute(this._id);if(j){this._htmlmap[j]=g[c]}}return this._locateHTML(a)},locate:function(a){return dhtmlx.html.locate(a,this._id)},show:function(c){var a=this._locateHTML(c);if(a){this._dataobj.scrollTop=a.offsetTop-this._dataobj.offsetTop}},render:function(m,j,g,l){if(m){var a=this._locateHTML(m);switch(g){case"update":if(!a){return}var c=this._htmlmap[m]=this._toHTMLObject(j);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;case"delete":if(!a){return}dhtmlx.html.remove(a);delete this._htmlmap[m];break;case"add":var c=this._htmlmap[m]=this._toHTMLObject(j);dhtmlx.html.insertBefore(c,this._locateHTML(this.data.next(m)),this._dataobj);break;case"move":this.render(m,j,"delete");this.render(m,j,"add");break;default:dhtmlx.error("Unknown render command: "+g);break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._dataobj.innerHTML=this.data.getRange().map(this._toHTML,this).join("");this._htmlmap=null}}this.callEvent("onAfterRender",[])},pager_setter:function(c){this.attachEvent("onBeforeRender",function(){var j=this._settings.pager._settings;if(j.page==-1){return false}this.data.min=j.page*j.size;this.data.max=(j.page+1)*j.size-1;return true});var a=new dhtmlx.ui.pager(c);var g=dhtmlx.bind(function(){this.data.refresh()},this);a.attachEvent("onRefresh",g);this.data.attachEvent("onStoreUpdated",function(l){var j=this.dataCount();if(j!=a._settings.count){a._settings.count=j;if(a._settings.page==-1){a._settings.page=0}a.refresh()}});return a},height_setter:function(a){if(a=="auto"){this.attachEvent("onAfterRender",this._correct_height);dhtmlx.event(window,"resize",dhtmlx.bind(this._correct_height,this))}return a},_correct_height:function(){this._dataobj.style.overflow="hidden";this._dataobj.style.height="1px";var a=this._dataobj.scrollHeight;this._dataobj.style.height=a+"px";if(dhtmlx._isFF){var c=this._dataobj.scrollHeight;if(c!=a){this._dataobj.style.height=c+"px"}}this._obj.style.height=this._dataobj.style.height},_getDimension:function(){var a=this.type;var c=(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+c,y:a.height+c}},x_count_setter:function(c){var g=this._getDimension();var a=dhtmlx.$customScroll?0:18;this._dataobj.style.width=g.x*c+(this._settings.height!="auto"?a:0)+"px";return c},y_count_setter:function(a){var c=this._getDimension();this._dataobj.style.height=c.y*a+"px";return a}};dhtmlx.VirtualRenderStack={_init:function(){dhtmlx.assert(this.render,"VirtualRenderStack :: Object must use RenderStack first");this._htmlmap={};this._dataobj.style.overflowY="scroll";dhtmlx.event(this._dataobj,"scroll",dhtmlx.bind(this._render_visible_rows,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.data._unrendered_area=[];this.data.getIndexRange=this._getIndexRange},_locateHTML:function(a){return this._htmlmap[a]},show:function(g){range=this._getVisibleRange();var c=this.data.indexById(g);var a=Math.floor(c/range._dx)*range._y;this._dataobj.scrollTop=a},_getIndexRange:function(l,j){if(j!==0){j=Math.min((j||Infinity),this.dataCount()-1)}var a=dhtmlx.toArray();for(var c=(l||0);c<=j;c++){var g=this.item(this.order[c]);if(this.order.length>c){if(!g){this.order[c]=dhtmlx.uid();g={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(g.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(g)}}return a},render:function(m,j,g,l){if(m){var a=this._locateHTML(m);switch(g){case"update":if(!a){return}var c=this._htmlmap[m]=this._toHTMLObject(j);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;default:this._render_delayed();break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._htmlmap={};this._render_visible_rows(null,true);this._wait_for_render=false;this.callEvent("onAfterRender",[])}}},_render_delayed:function(){if(this._wait_for_render){return}this._wait_for_render=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)},_create_placeholder:function(a){var c=document.createElement("DIV");c.className="dhxdataview_placeholder";c.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";return c},_render_visible_rows:function(y,D){this.data._unrendered_area=[];var x=this._getVisibleRange();if(!this._dataobj.firstChild||D){this._dataobj.innerHTML="";this._dataobj.appendChild(this._create_placeholder(x._max));this._htmlrows=[this._dataobj.firstChild]}var j=Math.max(x._from,0);var w=(this.data.max||this.data.max===0)?this.data.max:Infinity;while(j<=x._height){while(this._htmlrows[j]&&this._htmlrows[j]._filled&&j<=x._height){j++}if(j>x._height){break}var n=j;while(!this._htmlrows[n]){n--}var a=this._htmlrows[n];var g=j*x._dx+(this.data.min||0);if(g>w){break}var l=Math.min(g+x._dx-1,w);var q=this._create_placeholder(x._y);var m=this.data.getIndexRange(g,l);if(!m.length){break}q.innerHTML=m.map(this._toHTML,this).join("");for(var u=0;u<m.length;u++){this._htmlmap[this.data.idByIndex(g+u)]=q.childNodes[u]}var v=parseInt(a.style.height,10);var C=(j-n)*x._y;var s=(v-C-x._y);dhtmlx.html.insertBefore(q,C?a.nextSibling:a,this._dataobj);this._htmlrows[j]=q;q._filled=true;if(C<=0&&s>0){a.style.height=s+"px";this._htmlrows[j+1]=a}else{if(C<0){dhtmlx.html.remove(a)}else{a.style.height=C+"px"}if(s>0){var o=this._htmlrows[j+1]=this._create_placeholder(s);dhtmlx.html.insertBefore(o,q.nextSibling,this._dataobj)}}j++}if(this.data._unrendered_area.length){var r=this.indexById(this.data._unrendered_area[0]);var c=this.indexById(this.data._unrendered_area.pop())+1;if(c>r){if(!this.callEvent("onDataRequest",[r,c-r])){return false}dhtmlx.assert(this.data.feed,"Data feed is missed");this.data.feed.call(this,r,c-r)}}if(dhtmlx._isIE){var A=this._getVisibleRange();if(A._from!=x._from){this._render_visible_rows()}}},_getVisibleRange:function(){var c=dhtmlx.$customScroll?0:18;var n=this._dataobj.scrollTop;var a=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-c;var o=this._dataobj.offsetHeight;var r=this.type;var j=this._getDimension();var s=Math.floor(a/j.x)||1;var g=Math.floor(n/j.y);var q=Math.ceil((o+n)/j.y)-1;var l=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var m=Math.ceil(l/s)*j.y;return{_from:g,_height:q,_top:n,_max:m,_y:j.y,_dx:s}}};dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this._parseSettings(a,{drag:false,edit:false,select:"multiselect",type:"default"});if(this._settings.height!="auto"&&!this._settings.renderAll){dhtmlx.extend(this,dhtmlx.VirtualRenderStack)}this.data.provideApi(this,true);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXDataView.prototype={bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(g,l){var j=this._locateHTML(g.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(j){j.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";j.style.backgroundRepeat="no-repeat";this._drag_marker=j}}if(j&&this._settings.auto_scroll){var a=j.offsetTop;var m=j.offsetHeight;var c=this._obj.scrollTop;var n=this._obj.offsetHeight;if(a-m>=0&&a-m*0.75<c){c=Math.max(a-m,0)}else{if(a+m/0.75>c+n){c=c+m}}this._obj.scrollTop=c}return true},_id:"dhx_f_id",on_click:{dhx_dataview_item:function(a,c){if(this.stopEdit(false,c)){if(this._settings.select){if(this._settings.select=="multiselect"){this.select(c,a.ctrlKey,a.shiftKey)}else{this.select(c)}}}}},on_dblclick:{dhx_dataview_item:function(a,c){if(this._settings.edit){this.edit(c)}}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachDataView=function(a){this.callEvent("_onBeforeContentAttach",["dataview"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(a)=="undefined"){a={}}c.id="DataViewObject_"+new Date().getTime();a.container=c.id;a.skin=this.conf.skin;this.dataType="dataview";this.dataObj=new dhtmlXDataView(a);this.dataObj.setSizes=function(){this.render()};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}function xmlPointer(a){this.d=a}xmlPointer.prototype={text:function(){if(!_isFF){return this.d.xml}var a=new XMLSerializer();return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return !!this.d},content:function(){return this.d.firstChild?(this.d.firstChild.wholeText||this.d.firstChild.data):""},each:function(j,n,m,l){var g=this.d.childNodes;var o=new xmlPointer();if(g.length){for(l=l||0;l<g.length;l++){if(g[l].tagName==j){o.d=g[l];if(n.apply(m,[o,l])==-1){return}}}}},get_all:function(){var g={};var c=this.d.attributes;for(var j=0;j<c.length;j++){g[c[j].name]=c[j].value}return g},sub:function(j){var g=this.d.childNodes;var m=new xmlPointer();if(g.length){for(var l=0;l<g.length;l++){if(g[l].tagName==j){m.d=g[l];return m}}}},up:function(a){return new xmlPointer(this.d.parentNode)},set:function(a,c){this.d.setAttribute(a,c)},clone:function(a){return new xmlPointer(this.d)},sub_exists:function(g){var c=this.d.childNodes;if(c.length){for(var j=0;j<c.length;j++){if(c[j].tagName==g){return true}}}return false},through:function(g,n,r,l,s){var o=this.d.childNodes;if(o.length){for(var j=0;j<o.length;j++){if(o[j].tagName==g&&o[j].getAttribute(n)!=null&&o[j].getAttribute(n)!=""&&(!r||o[j].getAttribute(n)==r)){var m=new xmlPointer(o[j]);l.apply(s,[m,j])}var q=this.d;this.d=o[j];this.through(g,n,r,l,s);this.d=q}}}};function dhtmlXTreeObject(m,j,c,a){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}}if(typeof(m)!="object"){this.parentObject=document.getElementById(m)}else{this.parentObject=m}this.parentObject.style.overflow="hidden";this._itim_dg=true;this.dlmtr=",";this.dropLower=false;this.enableIEImageFix(true);this.xmlstate=0;this.mytype="tree";this.smcheck=true;this.width=j;this.height=c;this.rootId=a;this.childCalc=null;this.def_img_x="18px";this.def_img_y="18px";this.def_line_img_x="18px";this.def_line_img_y="24px";this._dragged=new Array();this._selected=new Array();this.style_pointer="pointer";this._aimgs=true;this.htmlcA=" [";this.htmlcB="]";this.lWin=window;this.cMenu=0;this.mlitems=0;this.iconURL="";this.dadmode=0;this.slowParse=false;this.autoScroll=true;this.hfMode=0;this.nodeCut=new Array();this.XMLsource=0;this.XMLloadingWarning=0;this._idpull={};this._pullSize=0;this.treeLinesOn=true;this.tscheck=false;this.timgen=true;this.dpcpy=false;this._ld_id=null;this._oie_onXLE=[];this.imPath=window.dhx_globalImgPath||"";this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif");this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif");this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif");this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif");this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif");this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif");this.cutImg=new Array(0,0,0);this.cutImage="but_cut.gif";dhx4._eventable(this);this.dragger=new dhtmlDragAndDropObject();this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree=this._createSelf();this.allTree.appendChild(this.htmlNode.htmlNode);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}if(_isFF){this.allTree.childNodes[0].width="100%";this.allTree.childNodes[0].style.overflow="hidden"}var g=this;this.allTree.onselectstart=new Function("return false;");if(_isMacOS){this.allTree.oncontextmenu=function(n){return g._doContClick(n||window.event,true)}}this.allTree.onmousedown=function(n){return g._doContClick(n||window.event)};this.XMLLoader=this._parseXMLTree;if(_isIE){this.preventIECashing(true)}this.selectionBar=document.createElement("DIV");this.selectionBar.className="selectionBar";this.selectionBar.innerHTML="&nbsp;";this.selectionBar.style.display="none";this.allTree.appendChild(this.selectionBar);if(window.addEventListener){window.addEventListener("unload",function(){try{g.destructor()}catch(n){}},false)}if(window.attachEvent){window.attachEvent("onunload",function(){try{g.destructor()}catch(n){}})}this.setImagesPath=this.setImagePath;this.setIconsPath=this.setIconPath;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtree")||"dhx_skyblue");return this}dhtmlXTreeObject.prototype.setDataMode=function(a){this._datamode=a};dhtmlXTreeObject.prototype._doContClick=function(n,a){if(!a&&n.button!=2){if(this._acMenu){if(this._acMenu.hideContextMenu){this._acMenu.hideContextMenu()}else{this.cMenu._contextEnd()}}return true}var c=(_isIE?n.srcElement:n.target);while((c)&&(c.tagName!="BODY")){if(c.parentObject){break}c=c.parentNode}if((!c)||(!c.parentObject)){return true}var l=c.parentObject;if(!this.callEvent("onRightClick",[l.id,n])){(n.srcElement||n.target).oncontextmenu=function(r){(r||event).cancelBubble=true;return false}}this._acMenu=(l.cMenu||this.cMenu);if(this._acMenu){if(!(this.callEvent("onBeforeContextMenu",[l.id]))){return true}if(!_isMacOS){(n.srcElement||n.target).oncontextmenu=function(r){(r||event).cancelBubble=true;return false}}if(this._acMenu.showContextMenu){var j=window.document.documentElement;var g=window.document.body;var o=new Array((j.scrollLeft||g.scrollLeft),(j.scrollTop||g.scrollTop));if(_isIE){var q=n.clientX+o[0];var m=n.clientY+o[1]}else{var q=n.pageX;var m=n.pageY}this._acMenu.showContextMenu(q-1,m-1);this.contextID=l.id;n.cancelBubble=true;this._acMenu._skip_hide=true}else{c.contextMenuId=l.id;c.contextMenu=this._acMenu;c.a=this._acMenu._contextStart;c.a(c,n);c.a=null}return false}return true};dhtmlXTreeObject.prototype.enableIEImageFix=function(a){if(!a){this._getImg=function(c){return document.createElement((c==this.rootId)?"div":"img")};this._setSrc=function(g,c){g.src=c};this._getSrc=function(c){return c.src}}else{this._getImg=function(){var c=document.createElement("DIV");c.innerHTML="&nbsp;";c.className="dhx_bg_img_fix";return c};this._setSrc=function(g,c){g.style.backgroundImage="url("+c+")"};this._getSrc=function(c){var g=c.style.backgroundImage;return g.substr(4,g.length-5).replace(/(^")|("$)/g,"")}}};dhtmlXTreeObject.prototype.destructor=function(){for(var c in this._idpull){var g=this._idpull[c];if(!g){continue}g.parentObject=null;g.treeNod=null;g.childNodes=null;g.span=null;g.tr.nodem=null;g.tr=null;g.htmlNode.objBelong=null;g.htmlNode=null;this._idpull[c]=null}this.parentObject.innerHTML="";this.allTree.onselectstart=null;this.allTree.oncontextmenu=null;this.allTree.onmousedown=null;for(var c in this){this[c]=null}};function cObject(){return this}cObject.prototype=new Object;cObject.prototype.clone=function(){function a(){}a.prototype=this;return new a()};function dhtmlXTreeItemObject(m,c,g,a,j,l){this.htmlNode="";this.acolor="";this.scolor="";this.tr=0;this.childsCount=0;this.tempDOMM=0;this.tempDOMU=0;this.dragSpan=0;this.dragMove=0;this.span=0;this.closeble=1;this.childNodes=new Array();this.userData=new cObject();this.checkstate=0;this.treeNod=a;this.label=c;this.parentObject=g;this.actionHandler=j;this.images=new Array(a.imageArray[0],a.imageArray[1],a.imageArray[2]);this.id=a._globalIdStorageAdd(m,this);if(this.treeNod.checkBoxOff){this.htmlNode=this.treeNod._createItem(1,this,l)}else{this.htmlNode=this.treeNod._createItem(0,this,l)}this.htmlNode.objBelong=this;return this}dhtmlXTreeObject.prototype._globalIdStorageAdd=function(c,a){if(this._globalIdStorageFind(c,1,1)){c=c+"_"+(new Date()).valueOf();return this._globalIdStorageAdd(c,a)}this._idpull[c]=a;this._pullSize++;return c};dhtmlXTreeObject.prototype._globalIdStorageSub=function(a){if(this._idpull[a]){this._unselectItem(this._idpull[a]);this._idpull[a]=null;this._pullSize--}if((this._locker)&&(this._locker[a])){this._locker[a]=false}};dhtmlXTreeObject.prototype._globalIdStorageFind=function(n,a,g,l){var m=this._idpull[n];if(m){if((m.unParsed)&&(!g)){this.reParse(m,0)}if(this._srnd&&!m.htmlNode){this._buildSRND(m,g)}if((l)&&(this._edsbpsA)){for(var c=0;c<this._edsbpsA.length;c++){if(this._edsbpsA[c][2]==n){dhx4.callEvent("ongetItemError",["Requested item still in parsing process.",n]);return null}}}return m}if((this.slowParse)&&(n!=0)&&(!a)){return this.preParse(n)}else{return null}};dhtmlXTreeObject.prototype._getSubItemsXML=function(a){var c=[];a.each("item",function(g){c.push(g.get("id"))},this);return c.join(this.dlmtr)};dhtmlXTreeObject.prototype.enableSmartXMLParsing=function(a){this.slowParse=dhx4.s2b(a)};dhtmlXTreeObject.prototype.findXML=function(c,a,g){};dhtmlXTreeObject.prototype._getAllCheckedXML=function(c,a,j){var g=[];if(j==2){c.through("item","checked",-1,function(l){g.push(l.get("id"))},this)}if(j==1){c.through("item","id",null,function(l){if(l.get("checked")&&(l.get("checked")!=-1)){g.push(l.get("id"))}},this)}if(j==0){c.through("item","id",null,function(l){if(!l.get("checked")||l.get("checked")==0){g.push(l.get("id"))}},this)}if(g.length){return a+(a?this.dlmtr:"")+g.join(this.dlmtr)}if(a){return a}else{return""}};dhtmlXTreeObject.prototype._setSubCheckedXML=function(a,c){var g=a?"1":"";c.through("item","id",null,function(j){if(!j.get("disabled")||j.get("disabled")==0){j.set("checked",g)}},this)};dhtmlXTreeObject.prototype._getAllScraggyItemsXML=function(g,a){var j=[];var c=function(l){if(!l.sub_exists("item")){j.push(l.get("id"))}else{l.each("item",c,this)}};c(g);return j.join(",")};dhtmlXTreeObject.prototype._getAllFatItemsXML=function(g,a){var j=[];var c=function(l){if(!l.sub_exists("item")){return}j.push(l.get("id"));l.each("item",c,this)};c(g);return j.join(",")};dhtmlXTreeObject.prototype._getAllSubItemsXML=function(g,c,a){var c=[];a.through("item","id",null,function(j){c.push(j.get("id"))},this);return c.join(",")};dhtmlXTreeObject.prototype.reParse=function(g){var m=this;if(!this.parsCount){m.callEvent("onXLS",[m,g.id])}this.xmlstate=1;var j=g.unParsed;g.unParsed=0;this.XMLloadingWarning=1;var a=this.parsingOn;var o=this.waitUpdateXML;var q=this.parsedArray;this.parsedArray=new Array();this.waitUpdateXML=false;this.parsingOn=g.id;this.parsedArray=new Array();this.setCheckList="";this._parse(j,g.id,2);var r=this.setCheckList.split(this.dlmtr);for(var l=0;l<this.parsedArray.length;l++){g.htmlNode.childNodes[0].appendChild(this.parsedArray[l])}if(j.get("order")&&j.get("order")!="none"){this._reorderBranch(g,j.get("order"),true)}this.oldsmcheck=this.smcheck;this.smcheck=false;for(var c=0;c<r.length;c++){if(r[c]){this.setCheck(r[c],1)}}this.smcheck=this.oldsmcheck;this.parsingOn=a;this.waitUpdateXML=o;this.parsedArray=q;this.XMLloadingWarning=0;this._redrawFrom(this,g);if(this._srnd&&!g._sready){this.prepareSR(g.id)}this.xmlstate=0;return true};dhtmlXTreeObject.prototype.preParse=function(c){if(!c||!this._p){return null}var a=false;this._p.clone().through("item","id",c,function(j){this._globalIdStorageFind(j.up().get("id"));return a=true},this);if(a){var g=this._globalIdStorageFind(c,true,false);if(!g){dhx4.callEvent("ongetItemError",["The item "+c+" not operable. Seems you have non-unique|incorrect IDs in tree's XML.",c])}}return g};dhtmlXTreeObject.prototype._escape=function(a){switch(this.utfesc){case"none":return a;break;case"utf8":return encodeURIComponent(a);break;default:return escape(a);break}};dhtmlXTreeObject.prototype._drawNewTr=function(l,g){var j=document.createElement("tr");var c=document.createElement("td");var a=document.createElement("td");c.appendChild(document.createTextNode(" "));a.colSpan=3;a.appendChild(l);j.appendChild(c);j.appendChild(a);return j};dhtmlXTreeObject.prototype.loadXMLString=function(g,c){var a=this;if(!this.parsCount){this.callEvent("onXLS",[a,null])}this.xmlstate=1;this.XMLLoader({responseXML:dhx4.ajax.parse(g)},c)};dhtmlXTreeObject.prototype.loadXML=function(c,j){if(this._datamode&&this._datamode!="xml"){return this["load"+this._datamode.toUpperCase()](c,j)}var g=this;if(!this.parsCount){this.callEvent("onXLS",[g,this._ld_id])}this._ld_id=null;this.xmlstate=1;this.XMLLoader=this._parseXMLTree;var a=this;dhx4.ajax.get(c,function(l){a.XMLLoader(l.xmlDoc,j);a=null})};dhtmlXTreeObject.prototype._attachChildNode=function(o,m,j,q,E,D,C,r,g,v,w){if(v&&v.parentObject){o=v.parentObject}if(((o.XMLload==0)&&(this.XMLsource))&&(!this.XMLloadingWarning)){o.XMLload=1;this._loadDynXML(o.id)}var s=o.childsCount;var F=o.childNodes;if(w&&w.tr.previousSibling){if(w.tr.previousSibling.previousSibling){v=w.tr.previousSibling.nodem}else{r=r.replace("TOP","")+",TOP"}}if(v){var l,A;for(l=0;l<s;l++){if(F[l]==v){for(A=s;A!=l;A--){F[1+A]=F[A]}break}}l++;s=l}if(r){var x=r.split(",");for(var y=0;y<x.length;y++){switch(x[y]){case"TOP":if(o.childsCount>0){v=new Object;v.tr=o.childNodes[0].tr.previousSibling}o._has_top=true;for(l=s;l>0;l--){F[l]=F[l-1]}s=0;break}}}var u;if(!(u=this._idpull[m])||u.span!=-1){u=F[s]=new dhtmlXTreeItemObject(m,j,o,this,q,1);m=F[s].id;o.childsCount++}if(!u.htmlNode){u.label=j;u.htmlNode=this._createItem((this.checkBoxOff?1:0),u);u.htmlNode.objBelong=u}if(E){u.images[0]=E}if(D){u.images[1]=D}if(C){u.images[2]=C}var c=this._drawNewTr(u.htmlNode);if((this.XMLloadingWarning)||(this._hAdI)){u.htmlNode.parentNode.parentNode.style.display="none"}if((v)&&v.tr&&(v.tr.nextSibling)){o.htmlNode.childNodes[0].insertBefore(c,v.tr.nextSibling)}else{if(this.parsingOn==o.id){this.parsedArray[this.parsedArray.length]=c}else{o.htmlNode.childNodes[0].appendChild(c)}}if((v)&&(!v.span)){v=null}if(this.XMLsource){if((g)&&(g!=0)){u.XMLload=0}else{u.XMLload=1}}u.tr=c;c.nodem=u;if(o.itemId==0){c.childNodes[0].className="hiddenRow"}if((o._r_logic)||(this._frbtr)){this._setSrc(u.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0])}if(r){var x=r.split(",");for(var y=0;y<x.length;y++){switch(x[y]){case"SELECT":this.selectItem(m,false);break;case"CALL":this.selectItem(m,true);break;case"CHILD":u.XMLload=0;break;case"CHECKED":if(this.XMLloadingWarning){this.setCheckList+=this.dlmtr+m}else{this.setCheck(m,1)}break;case"HCHECKED":this._setCheck(u,"unsure");break;case"OPEN":u.openMe=1;break}}}if(!this.XMLloadingWarning){if((this._getOpenState(o)<0)&&(!this._hAdI)){this.openItem(o.id)}if(v){this._correctPlus(v);this._correctLine(v)}this._correctPlus(o);this._correctLine(o);this._correctPlus(u);if(o.childsCount>=2){this._correctPlus(F[o.childsCount-2]);this._correctLine(F[o.childsCount-2])}if(o.childsCount!=2){this._correctPlus(F[0])}if(this.tscheck){this._correctCheckStates(o)}if(this._onradh){if(this.xmlstate==1){var a=this.onXLE;this.onXLE=function(n){this._onradh(m);if(a){a(n)}}}else{this._onradh(m)}}}return u};dhtmlXTreeObject.prototype.enableContextMenu=function(a){if(a){this.cMenu=a}};dhtmlXTreeObject.prototype.setItemContextMenu=function(m,j){var a=m.toString().split(this.dlmtr);for(var g=0;g<a.length;g++){var c=this._globalIdStorageFind(a[g]);if(!c){continue}c.cMenu=j}};dhtmlXTreeObject.prototype.insertNewItem=function(j,o,r,g,n,m,l,c,a){var s=this._globalIdStorageFind(j);if(!s){return(-1)}var q=this._attachChildNode(s,o,r,g,n,m,l,c,a);if(!this._idpull[this.rootId].XMLload){this._idpull[this.rootId].XMLload=1}if((!this.XMLloadingWarning)&&(this.childCalc)){this._fixChildCountLabel(s)}return q};dhtmlXTreeObject.prototype.insertNewChild=function(j,o,q,g,n,m,l,c,a){return this.insertNewItem(j,o,q,g,n,m,l,c,a)};dhtmlXTreeObject.prototype._parseXMLTree=function(a,g){var c=new xmlPointer(dhx4.ajax.xmltop("tree",a));this._parse(c);this._p=c;if(g){g.call(this,a)}};dhtmlXTreeObject.prototype._parseItem=function(m,r,l,o){var g;if(this._srnd&&(!this._idpull[g=m.get("id")]||!this._idpull[g].span)){this._addItemSRND(r.id,g,m);return}var n=m.get_all();if((typeof(this.waitUpdateXML)=="object")&&(!this.waitUpdateXML[n.id])){this._parse(m,n.id,1);return}if((n.text===null)||(typeof(n.text)=="undefined")){n.text=m.sub("itemtext");if(n.text){n.text=n.text.content()}}var u=[];if(n.select){u.push("SELECT")}if(n.top){u.push("TOP")}if(n.call){this.nodeAskingCall=n.id}if(n.checked==-1){u.push("HCHECKED")}else{if(n.checked){u.push("CHECKED")}}if(n.open){u.push("OPEN")}if(this.waitUpdateXML){if(this._globalIdStorageFind(n.id)){var q=this.updateItem(n.id,n.text,n.im0,n.im1,n.im2,n.checked,n.child)}else{if(this.npl==0){u.push("TOP")}else{l=r.childNodes[this.npl]}var q=this._attachChildNode(r,n.id,n.text,0,n.im0,n.im1,n.im2,u.join(","),n.child,0,l);n.id=q.id;l=null}}else{var q=this._attachChildNode(r,n.id,n.text,0,n.im0,n.im1,n.im2,u.join(","),n.child,(o||0),l)}if(n.tooltip){q.span.parentNode.parentNode.title=n.tooltip}if(n.style){if(q.span.style.cssText){q.span.style.cssText+=(";"+n.style)}else{q.span.setAttribute("style",q.span.getAttribute("style")+"; "+n.style)}}if(n.radio){q._r_logic=true}if(n.nocheckbox){var s=q.span.parentNode.previousSibling.previousSibling;s.style.display="none";q.nocheckbox=true}if(n.disabled){if(n.checked!=null){this._setCheck(q,n.checked)}this.disableCheckbox(q,1)}q._acc=n.child||0;if(this.parserExtension){this.parserExtension._parseExtension.call(this,m,n,(r?r.id:0))}this.setItemColor(q,n.aCol,n.sCol);if(n.locked=="1"){this.lockItem(q.id,true,true)}if((n.imwidth)||(n.imheight)){this.setIconSize(n.imwidth,n.imheight,q)}if((n.closeable=="0")||(n.closeable=="1")){this.setItemCloseable(q,n.closeable)}var j="";if(n.topoffset){this.setItemTopOffset(q,n.topoffset)}if((!this.slowParse)||(typeof(this.waitUpdateXML)=="object")){if(m.sub_exists("item")){j=this._parse(m,n.id,1)}}else{if((!q.childsCount)&&m.sub_exists("item")){q.unParsed=m.clone()}m.each("userdata",function(a){this.setUserData(n.id,a.get("name"),a.content())},this)}if(j!=""){this.nodeAskingCall=j}m.each("userdata",function(a){this.setUserData(m.get("id"),a.get("name"),a.content())},this)};dhtmlXTreeObject.prototype._parse=function(g,m,a,c){if(this._srnd&&!this.parentObject.offsetHeight){var w=this;return window.setTimeout(function(){w._parse(g,m,a,c)},100)}if(!g.exists()){return}this.skipLock=true;if(!m){m=g.get("id");var u=g.get("dhx_security");if(u){dhtmlx.security_key=u}if(g.get("radio")){this.htmlNode._r_logic=true}this.parsingOn=m;this.parsedArray=new Array();this.setCheckList="";this.nodeAskingCall=""}var v=this._globalIdStorageFind(m);if(!v){return dhx4.callEvent("onDataStructureError",["XML refers to not existing parent"])}this.parsCount=this.parsCount?(this.parsCount+1):1;this.XMLloadingWarning=1;if((v.childsCount)&&(!c)&&(!this._edsbps)&&(!v._has_top)){var o=0}else{var o=0}this.npl=0;g.each("item",function(x,n){v.XMLload=1;this._parseItem(x,v,0,o);if((this._edsbps)&&(this.npl==this._edsbpsC)){this._distributedStart(g,n+1,m,a,v.childsCount);return -1}this.npl++},this,c);if(!a){g.each("userdata",function(n){this.setUserData(g.get("id"),n.get("name"),n.content())},this);v.XMLload=1;if(this.waitUpdateXML){this.waitUpdateXML=false;for(var l=v.childsCount-1;l>=0;l--){if(v.childNodes[l]._dmark){this.deleteItem(v.childNodes[l].id)}}}var r=this._globalIdStorageFind(this.parsingOn);for(var l=0;l<this.parsedArray.length;l++){v.htmlNode.childNodes[0].appendChild(this.parsedArray[l])}this.parsedArray=[];this.lastLoadedXMLId=m;this.XMLloadingWarning=0;var s=this.setCheckList.split(this.dlmtr);for(var j=0;j<s.length;j++){if(s[j]){this.setCheck(s[j],1)}}if((this.XMLsource)&&(this.tscheck)&&(this.smcheck)&&(v.id!=this.rootId)){if(v.checkstate===0){this._setSubChecked(0,v)}else{if(v.checkstate===1){this._setSubChecked(1,v)}}}this._redrawFrom(this,null,c);if(g.get("order")&&g.get("order")!="none"){this._reorderBranch(v,g.get("order"),true)}if(this.nodeAskingCall!=""){this.callEvent("onClick",[this.nodeAskingCall,this.getSelectedItemId()])}if(this._branchUpdate){this._branchUpdateNext(g)}}if(this.parsCount==1){this.parsingOn=null;if(this._srnd&&v.id!=this.rootId){this.prepareSR(v.id);if(this.XMLsource){this.openItem(v.id)}}g.through("item","open",null,function(n){this.openItem(n.get("id"))},this);if((!this._edsbps)||(!this._edsbpsA.length)){var q=this;window.setTimeout(function(){q.callEvent("onXLE",[q,m])},1);this.xmlstate=0}this.skipLock=false}this.parsCount--;var q=this;if(this._edsbps){window.setTimeout(function(){q._distributedStep(m)},this._edsbpsD)}if(!a&&this.onXLE){this.onXLE(this,m)}return this.nodeAskingCall};dhtmlXTreeObject.prototype._branchUpdateNext=function(a){a.each("item",function(j){var g=j.get("id");if(this._idpull[g]&&(!this._idpull[g].XMLload)){return}this._branchUpdate++;this.smartRefreshItem(j.get("id"),j)},this);this._branchUpdate--};dhtmlXTreeObject.prototype.checkUserData=function(c,g){if((c.nodeType==1)&&(c.tagName=="userdata")){var a=c.getAttribute("name");if((a)&&(c.childNodes[0])){this.setUserData(g,a,c.childNodes[0].data)}}};dhtmlXTreeObject.prototype._redrawFrom=function(o,c,n,g){if(!c){var l=o._globalIdStorageFind(o.lastLoadedXMLId);o.lastLoadedXMLId=-1;if(!l){return 0}}else{l=c}var m=0;for(var j=(n?n-1:0);j<l.childsCount;j++){if((!this._branchUpdate)||(this._getOpenState(l)==1)){if((!c)||(g==1)){l.childNodes[j].htmlNode.parentNode.parentNode.style.display=""}}if(l.childNodes[j].openMe==1){this._openItem(l.childNodes[j]);l.childNodes[j].openMe=0}o._redrawFrom(o,l.childNodes[j]);if(this.childCalc!=null){if((l.childNodes[j].unParsed)||((!l.childNodes[j].XMLload)&&(this.XMLsource))){if(l.childNodes[j]._acc){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+l.childNodes[j]._acc+this.htmlcB}else{l.childNodes[j].span.innerHTML=l.childNodes[j].label}}if((l.childNodes[j].childNodes.length)&&(this.childCalc)){if(this.childCalc==1){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+l.childNodes[j].childsCount+this.htmlcB}if(this.childCalc==2){var a=l.childNodes[j].childsCount-(l.childNodes[j].pureChilds||0);if(a){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+a+this.htmlcB}if(l.pureChilds){l.pureChilds++}else{l.pureChilds=1}}if(this.childCalc==3){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+l.childNodes[j]._acc+this.htmlcB}if(this.childCalc==4){var a=l.childNodes[j]._acc;if(a){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+a+this.htmlcB}}}else{if(this.childCalc==4){m++}}m+=l.childNodes[j]._acc;if(this.childCalc==3){m++}}}if((!l.unParsed)&&((l.XMLload)||(!this.XMLsource))){l._acc=m}o._correctLine(l);o._correctPlus(l);if((this.childCalc)&&(!c)){o._fixChildCountLabel(l)}};dhtmlXTreeObject.prototype._createSelf=function(){var a=document.createElement("div");a.className="containerTableStyle";a.style.width=this.width;a.style.height=this.height;this.parentObject.appendChild(a);return a};dhtmlXTreeObject.prototype._xcloseAll=function(c){if(c.unParsed){return}if(this.rootId!=c.id){if(!c.htmlNode){return}var j=c.htmlNode.childNodes[0].childNodes;var a=j.length;for(var g=1;g<a;g++){j[g].style.display="none"}this._correctPlus(c)}for(var g=0;g<c.childsCount;g++){if(c.childNodes[g].childsCount){this._xcloseAll(c.childNodes[g])}}};dhtmlXTreeObject.prototype._xopenAll=function(a){this._HideShow(a,2);for(var c=0;c<a.childsCount;c++){this._xopenAll(a.childNodes[c])}};dhtmlXTreeObject.prototype._correctPlus=function(c){if(!c.htmlNode){return}var g=c.htmlNode.childNodes[0].childNodes[0].childNodes[0].lastChild;var l=c.htmlNode.childNodes[0].childNodes[0].childNodes[2].childNodes[0];var a=this.lineArray;if((this.XMLsource)&&(!c.XMLload)){var a=this.plusArray;this._setSrc(l,this.iconURL+c.images[2]);if(this._txtimg){return(g.innerHTML="[+]")}}else{if((c.childsCount)||(c.unParsed)){if((c.htmlNode.childNodes[0].childNodes[1])&&(c.htmlNode.childNodes[0].childNodes[1].style.display!="none")){if(!c.wsign){var a=this.minusArray}this._setSrc(l,this.iconURL+c.images[1]);if(this._txtimg){return(g.innerHTML="[-]")}}else{if(!c.wsign){var a=this.plusArray}this._setSrc(l,this.iconURL+c.images[2]);if(this._txtimg){return(g.innerHTML="[+]")}}}else{this._setSrc(l,this.iconURL+c.images[0])}}var j=2;if(!c.treeNod.treeLinesOn){this._setSrc(g,this.imPath+a[3])}else{if(c.parentObject){j=this._getCountStatus(c.id,c.parentObject)}this._setSrc(g,this.imPath+a[j])}};dhtmlXTreeObject.prototype._correctLine=function(c){if(!c.htmlNode){return}var a=c.parentObject;if(a){if((this._getLineStatus(c.id,a)==0)||(!this.treeLinesOn)){for(var g=1;g<=c.childsCount;g++){if(!c.htmlNode.childNodes[0].childNodes[g]){break}c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundImage="";c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundRepeat=""}}else{for(var g=1;g<=c.childsCount;g++){if(!c.htmlNode.childNodes[0].childNodes[g]){break}c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundImage="url("+this.imPath+this.lineArray[5]+")";c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundRepeat="repeat-y"}}}};dhtmlXTreeObject.prototype._getCountStatus=function(c,a){if(a.childsCount<=1){if(a.id==this.rootId){return 4}else{return 0}}if(a.childNodes[0].id==c){if(a.id==this.rootId){return 2}else{return 1}}if(a.childNodes[a.childsCount-1].id==c){return 0}return 1};dhtmlXTreeObject.prototype._getLineStatus=function(c,a){if(a.childNodes[a.childsCount-1].id==c){return 0}return 1};dhtmlXTreeObject.prototype._HideShow=function(c,l){if((this.XMLsource)&&(!c.XMLload)){if(l==1){return}c.XMLload=1;this._loadDynXML(c.id);return}if(c.unParsed){this.reParse(c)}var j=c.htmlNode.childNodes[0].childNodes;var a=j.length;if(a>1){if(((j[1].style.display!="none")||(l==1))&&(l!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";nodestyle="none"}else{nodestyle=""}for(var g=1;g<a;g++){j[g].style.display=nodestyle}}this._correctPlus(c)};dhtmlXTreeObject.prototype._getOpenState=function(a){if(!a.htmlNode){return 0}var c=a.htmlNode.childNodes[0].childNodes;if(c.length<=1){return 0}if(c[1].style.display!="none"){return 1}else{return -1}};dhtmlXTreeObject.prototype.onRowClick2=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onDblClick",[this.parentObject.id,a])){return false}if((this.parentObject.closeble)&&(this.parentObject.closeble!="0")){a._HideShow(this.parentObject)}else{a._HideShow(this.parentObject,2)}if(a.checkEvent("onOpenEnd")){if(!a.xmlstate){a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])}else{a._oie_onXLE.push(a.onXLE);a.onXLE=a._epnFHe}}return false};dhtmlXTreeObject.prototype.onRowClick=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onOpenStart",[this.parentObject.id,a._getOpenState(this.parentObject)])){return 0}if((this.parentObject.closeble)&&(this.parentObject.closeble!="0")){a._HideShow(this.parentObject)}else{a._HideShow(this.parentObject,2)}if(a.checkEvent("onOpenEnd")){if(!a.xmlstate){a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])}else{a._oie_onXLE.push(a.onXLE);a.onXLE=a._epnFHe}}};dhtmlXTreeObject.prototype._epnFHe=function(c,g,a){if(g!=this.rootId){this.callEvent("onOpenEnd",[g,c.getOpenState(g)])}c.onXLE=c._oie_onXLE.pop();if(!a&&!c._oie_onXLE.length){if(c.onXLE){c.onXLE(c,g)}}};dhtmlXTreeObject.prototype.onRowClickDown=function(c){c=c||window.event;var a=this.parentObject.treeNod;a._selectItem(this.parentObject,c)};dhtmlXTreeObject.prototype.getSelectedItemId=function(){var c=new Array();for(var a=0;a<this._selected.length;a++){c[a]=this._selected[a].id}return(c.join(this.dlmtr))};dhtmlXTreeObject.prototype._selectItem=function(m,n){if(this.checkEvent("onSelect")){this._onSSCFold=this.getSelectedItemId()}if((!this._amsel)||(!n)||((!n.ctrlKey)&&(!n.metaKey)&&(!n.shiftKey))){this._unselectItems()}if((m.i_sel)&&(this._amsel)&&(n)&&(n.ctrlKey||n.metaKey)){this._unselectItem(m)}else{if((!m.i_sel)&&((!this._amselS)||(this._selected.length==0)||(this._selected[0].parentObject==m.parentObject))){if((this._amsel)&&(n)&&(n.shiftKey)&&(this._selected.length!=0)&&(this._selected[this._selected.length-1].parentObject==m.parentObject)){var j=this._getIndex(this._selected[this._selected.length-1]);var g=this._getIndex(m);if(g<j){var q=j;j=g;g=q}for(var l=j;l<=g;l++){if(!m.parentObject.childNodes[l].i_sel){this._markItem(m.parentObject.childNodes[l])}}}else{this._markItem(m)}}}if(this.checkEvent("onSelect")){var o=this.getSelectedItemId();if(o!=this._onSSCFold){this.callEvent("onSelect",[o])}}};dhtmlXTreeObject.prototype._markItem=function(a){if(a.scolor){a.span.style.color=a.scolor}a.span.className="selectedTreeRow";a.i_sel=true;this._selected[this._selected.length]=a};dhtmlXTreeObject.prototype.getIndexById=function(c){var a=this._globalIdStorageFind(c);if(!a){return null}return this._getIndex(a)};dhtmlXTreeObject.prototype._getIndex=function(a){var g=a.parentObject;for(var c=0;c<g.childsCount;c++){if(g.childNodes[c]==a){return c}}};dhtmlXTreeObject.prototype._unselectItem=function(c){if((c)&&(c.i_sel)){c.span.className="standartTreeRow";if(c.acolor){c.span.style.color=c.acolor}c.i_sel=false;for(var a=0;a<this._selected.length;a++){if(!this._selected[a].i_sel){this._selected.splice(a,1);break}}}};dhtmlXTreeObject.prototype._unselectItems=function(){for(var a=0;a<this._selected.length;a++){var c=this._selected[a];c.span.className="standartTreeRow";if(c.acolor){c.span.style.color=c.acolor}c.i_sel=false}this._selected=new Array()};dhtmlXTreeObject.prototype.onRowSelect=function(j,g,m){j=j||window.event;var c=this.parentObject;if(g){c=g.parentObject}var a=c.treeNod;var l=a.getSelectedItemId();if((!j)||(!j.skipUnSel)){a._selectItem(c,j)}if(!m){if(c.actionHandler){c.actionHandler(c.id,l)}else{a.callEvent("onClick",[c.id,l])}}};dhtmlXTreeObject.prototype._correctCheckStates=function(l){if(!this.tscheck){return}if(!l){return}if(l.id==this.rootId){return}var g=l.childNodes;var c=0;var a=0;if(l.childsCount==0){return}for(var j=0;j<l.childsCount;j++){if(g[j].dscheck){continue}if(g[j].checkstate==0){c=1}else{if(g[j].checkstate==1){a=1}else{c=1;a=1;break}}}if((c)&&(a)){this._setCheck(l,"unsure")}else{if(c){this._setCheck(l,false)}else{this._setCheck(l,true)}}this._correctCheckStates(l.parentObject)};dhtmlXTreeObject.prototype.onCheckBoxClick=function(a){if(!this.treeNod.callEvent("onBeforeCheck",[this.parentObject.id,this.parentObject.checkstate])){return}if(this.parentObject.dscheck){return true}if(this.treeNod.tscheck){if(this.parentObject.checkstate==1){this.treeNod._setSubChecked(false,this.parentObject)}else{this.treeNod._setSubChecked(true,this.parentObject)}}else{if(this.parentObject.checkstate==1){this.treeNod._setCheck(this.parentObject,false)}else{this.treeNod._setCheck(this.parentObject,true)}}this.treeNod._correctCheckStates(this.parentObject.parentObject);return this.treeNod.callEvent("onCheck",[this.parentObject.id,this.parentObject.checkstate])};dhtmlXTreeObject.prototype._createItem=function(u,s,o){var v=document.createElement("table");v.cellSpacing=0;v.cellPadding=0;v.border=0;if(this.hfMode){v.style.tableLayout="fixed"}v.style.margin=0;v.style.padding=0;var n=document.createElement("tbody");var r=document.createElement("tr");var j=document.createElement("td");j.className="standartTreeImage";if(this._txtimg){var l=document.createElement("div");j.appendChild(l);l.className="dhx_tree_textSign"}else{var l=this._getImg(s.id);l.border="0";if(l.tagName=="IMG"){l.align="absmiddle"}j.appendChild(l);l.style.padding=0;l.style.margin=0;l.style.width=this.def_line_img_x}var g=document.createElement("td");var q=this._getImg(this.cBROf?this.rootId:s.id);q.checked=0;this._setSrc(q,this.imPath+this.checkArray[0]);q.style.width="18px";q.style.height="18px";if(!u){g.style.display="none"}g.appendChild(q);if((!this.cBROf)&&(q.tagName=="IMG")){q.align="absmiddle"}q.onclick=this.onCheckBoxClick;q.treeNod=this;q.parentObject=s;if(!window._KHTMLrv){g.width="20px"}else{g.width="16px"}var c=document.createElement("td");c.className="standartTreeImage";var m=this._getImg(this.timgen?s.id:this.rootId);m.onmousedown=this._preventNsDrag;m.ondragstart=this._preventNsDrag;m.border="0";if(this._aimgs){m.parentObject=s;if(m.tagName=="IMG"){m.align="absmiddle"}m.onclick=this.onRowSelect}if(!o){this._setSrc(m,this.iconURL+this.imageArray[0])}c.appendChild(m);m.style.padding=0;m.style.margin=0;if(this.timgen){c.style.width=m.style.width=this.def_img_x;m.style.height=this.def_img_y}else{m.style.width="0px";m.style.height="0px";if(_isOpera||window._KHTMLrv){c.style.display="none"}}var a=document.createElement("td");a.className="standartTreeRow";s.span=document.createElement("span");s.span.className="standartTreeRow";if(this.mlitems){s.span.style.width=this.mlitems;s.span.style.display="block"}else{a.noWrap=true}if(dhx4.isIE8){a.style.width="99999px"}else{if(!window._KHTMLrv){a.style.width="100%"}}s.span.innerHTML=s.label;a.appendChild(s.span);a.parentObject=s;j.parentObject=s;a.onclick=this.onRowSelect;j.onclick=this.onRowClick;a.ondblclick=this.onRowClick2;if(this.ettip){r.title=s.label}if(this.dragAndDropOff){if(this._aimgs){this.dragger.addDraggableItem(c,this);c.parentObject=s}this.dragger.addDraggableItem(a,this)}s.span.style.paddingLeft="5px";s.span.style.paddingRight="5px";a.style.verticalAlign="";a.style.fontSize="10pt";a.style.cursor=this.style_pointer;r.appendChild(j);r.appendChild(g);r.appendChild(c);r.appendChild(a);n.appendChild(r);v.appendChild(n);if(this.ehlt||this.checkEvent("onMouseIn")||this.checkEvent("onMouseOut")){r.onmousemove=this._itemMouseIn;r[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut}return v};dhtmlXTreeObject.prototype.setImagePath=function(a){this.imPath=a;this.iconURL=a};dhtmlXTreeObject.prototype.setIconPath=function(a){this.iconURL=a};dhtmlXTreeObject.prototype._getLeafCount=function(j){var g=0;for(var c=0;c<j.childsCount;c++){if(j.childNodes[c].childsCount==0){g++}}return g};dhtmlXTreeObject.prototype._getChildCounterValue=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}if((a.unParsed)||((!a.XMLload)&&(this.XMLsource))){return a._acc}switch(this.childCalc){case 1:return a.childsCount;break;case 2:return this._getLeafCount(a);break;case 3:return a._acc;break;case 4:return a._acc;break}};dhtmlXTreeObject.prototype._fixChildCountLabel=function(m,j){if(this.childCalc==null){return}if((m.unParsed)||((!m.XMLload)&&(this.XMLsource))){if(m._acc){m.span.innerHTML=m.label+this.htmlcA+m._acc+this.htmlcB}else{m.span.innerHTML=m.label}return}switch(this.childCalc){case 1:if(m.childsCount!=0){m.span.innerHTML=m.label+this.htmlcA+m.childsCount+this.htmlcB}else{m.span.innerHTML=m.label}break;case 2:var l=this._getLeafCount(m);if(l!=0){m.span.innerHTML=m.label+this.htmlcA+l+this.htmlcB}else{m.span.innerHTML=m.label}break;case 3:if(m.childsCount!=0){var g=0;for(var c=0;c<m.childsCount;c++){if(!m.childNodes[c]._acc){m.childNodes[c]._acc=0}g+=m.childNodes[c]._acc*1}g+=m.childsCount*1;m.span.innerHTML=m.label+this.htmlcA+g+this.htmlcB;m._acc=g}else{m.span.innerHTML=m.label;m._acc=0}if((m.parentObject)&&(m.parentObject!=this.htmlNode)){this._fixChildCountLabel(m.parentObject)}break;case 4:if(m.childsCount!=0){var g=0;for(var c=0;c<m.childsCount;c++){if(!m.childNodes[c]._acc){m.childNodes[c]._acc=1}g+=m.childNodes[c]._acc*1}m.span.innerHTML=m.label+this.htmlcA+g+this.htmlcB;m._acc=g}else{m.span.innerHTML=m.label;m._acc=1}if((m.parentObject)&&(m.parentObject!=this.htmlNode)){this._fixChildCountLabel(m.parentObject)}break}};dhtmlXTreeObject.prototype.setChildCalcMode=function(a){switch(a){case"child":this.childCalc=1;break;case"leafs":this.childCalc=2;break;case"childrec":this.childCalc=3;break;case"leafsrec":this.childCalc=4;break;case"disabled":this.childCalc=null;break;default:this.childCalc=4}};dhtmlXTreeObject.prototype.setChildCalcHTML=function(c,a){this.htmlcA=c;this.htmlcB=a};dhtmlXTreeObject.prototype.setOnRightClickHandler=function(a){this.attachEvent("onRightClick",a)};dhtmlXTreeObject.prototype.setOnClickHandler=function(a){this.attachEvent("onClick",a)};dhtmlXTreeObject.prototype.setOnSelectStateChange=function(a){this.attachEvent("onSelect",a)};dhtmlXTreeObject.prototype.setXMLAutoLoading=function(a){this.XMLsource=a};dhtmlXTreeObject.prototype.setOnCheckHandler=function(a){this.attachEvent("onCheck",a)};dhtmlXTreeObject.prototype.setOnOpenHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(a){this.attachEvent("onOpenEnd",a)};dhtmlXTreeObject.prototype.setOnDblClickHandler=function(a){this.attachEvent("onDblClick",a)};dhtmlXTreeObject.prototype.openAllItems=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}this._xopenAll(a)};dhtmlXTreeObject.prototype.getOpenState=function(c){var a=this._globalIdStorageFind(c);if(!a){return""}return this._getOpenState(a)};dhtmlXTreeObject.prototype.closeAllItems=function(c){if(c===window.undefined){c=this.rootId}var a=this._globalIdStorageFind(c);if(!a){return 0}this._xcloseAll(a);this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};dhtmlXTreeObject.prototype.setUserData=function(j,c,g){var a=this._globalIdStorageFind(j,0,true);if(!a){return}if(c=="hint"){a.htmlNode.childNodes[0].childNodes[0].title=g}if(typeof(a.userData["t_"+c])=="undefined"){if(!a._userdatalist){a._userdatalist=c}else{a._userdatalist+=","+c}}a.userData["t_"+c]=g};dhtmlXTreeObject.prototype.getUserData=function(g,c){var a=this._globalIdStorageFind(g,0,true);if(!a){return}return a.userData["t_"+c]};dhtmlXTreeObject.prototype.getItemColor=function(g){var a=this._globalIdStorageFind(g);if(!a){return 0}var c=new Object();if(a.acolor){c.acolor=a.acolor}if(a.scolor){c.scolor=a.scolor}return c};dhtmlXTreeObject.prototype.setItemColor=function(g,c,j){if((g)&&(g.span)){var a=g}else{var a=this._globalIdStorageFind(g)}if(!a){return 0}else{if(a.i_sel){if(j){a.span.style.color=j}}else{if(c){a.span.style.color=c}}if(j){a.scolor=j}if(c){a.acolor=c}}};dhtmlXTreeObject.prototype.getItemText=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}return(a.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML)};dhtmlXTreeObject.prototype.getParentId=function(c){var a=this._globalIdStorageFind(c);if((!a)||(!a.parentObject)){return""}return a.parentObject.id};dhtmlXTreeObject.prototype.changeItemId=function(c,g){if(c==g){return}var a=this._globalIdStorageFind(c);if(!a){return 0}a.id=g;a.span.contextMenuId=g;this._idpull[g]=this._idpull[c];delete this._idpull[c]};dhtmlXTreeObject.prototype.doCut=function(){if(this.nodeCut){this.clearCut()}this.nodeCut=(new Array()).concat(this._selected);for(var a=0;a<this.nodeCut.length;a++){var c=this.nodeCut[a];c._cimgs=new Array();c._cimgs[0]=c.images[0];c._cimgs[1]=c.images[1];c._cimgs[2]=c.images[2];c.images[0]=c.images[1]=c.images[2]=this.cutImage;this._correctPlus(c)}};dhtmlXTreeObject.prototype.doPaste=function(g){var a=this._globalIdStorageFind(g);if(!a){return 0}for(var c=0;c<this.nodeCut.length;c++){if(this._checkPNodes(a,this.nodeCut[c])){continue}this._moveNode(this.nodeCut[c],a)}this.clearCut()};dhtmlXTreeObject.prototype.clearCut=function(){for(var a=0;a<this.nodeCut.length;a++){var c=this.nodeCut[a];c.images[0]=c._cimgs[0];c.images[1]=c._cimgs[1];c.images[2]=c._cimgs[2];this._correctPlus(c)}this.nodeCut=new Array()};dhtmlXTreeObject.prototype._moveNode=function(a,c){var m=this.dadmodec;if(m==1){var l=c;if(this.dadmodefix<0){while(true){l=this._getPrevNode(l);if((l==-1)){l=this.htmlNode;break}if((l.tr==0)||(l.tr.style.display=="")||(!l.parentObject)){break}}var j=l;var g=c}else{if((l.tr)&&(l.tr.nextSibling)&&(l.tr.nextSibling.nodem)&&(this._getOpenState(l)<1)){l=l.tr.nextSibling.nodem}else{l=this._getNextNode(l);if((l==-1)){l=this.htmlNode}}var g=l;var j=c}if(this._getNodeLevel(j,0)>this._getNodeLevel(g,0)){if(!this.dropLower){return this._moveNodeTo(a,j.parentObject)}else{if(g.id!=this.rootId){return this._moveNodeTo(a,g.parentObject,g)}else{return this._moveNodeTo(a,this.htmlNode,null)}}}else{return this._moveNodeTo(a,g.parentObject,g)}}else{return this._moveNodeTo(a,c)}};dhtmlXTreeObject.prototype._fixNodesCollection=function(o,m){var c=0;var j=0;var n=o.childNodes;var a=o.childsCount-1;if(m==n[a]){return}for(var l=0;l<a;l++){if(n[l]==n[a]){n[l]=n[l+1];n[l+1]=n[a]}}for(var l=0;l<a+1;l++){if(c){var g=n[l];n[l]=c;c=g}else{if(n[l]==m){c=n[l];n[l]=n[a]}}}};dhtmlXTreeObject.prototype._recreateBranch=function(m,o,l,a){var c;var q="";if(l){for(c=0;c<o.childsCount;c++){if(o.childNodes[c]==l){break}}if(c!=0){l=o.childNodes[c-1]}else{q="TOP";l=""}}var g=this._onradh;this._onradh=null;var n=this._attachChildNode(o,m.id,m.label,0,m.images[0],m.images[1],m.images[2],q,0,l);n._userdatalist=m._userdatalist;n.userData=m.userData.clone();if(m._attrs){n._attrs={};for(var j in m._attrs){n._attrs[j]=m._attrs[j]}}n.XMLload=m.XMLload;if(g){this._onradh=g;this._onradh(n.id)}if(m.treeNod.dpcpy){m.treeNod._globalIdStorageFind(m.id)}else{n.unParsed=m.unParsed}this._correctPlus(n);for(var c=0;c<m.childsCount;c++){this._recreateBranch(m.childNodes[c],n,0,1)}if((!a)&&(this.childCalc)){this._redrawFrom(this,o)}return n};dhtmlXTreeObject.prototype._moveNodeTo=function(u,w,s){if(u.treeNod._nonTrivialNode){return u.treeNod._nonTrivialNode(this,w,s,u)}if(this._checkPNodes(w,u)){return false}if(w.mytype){var n=(u.treeNod.lWin!=w.lWin)}else{var n=(u.treeNod.lWin!=w.treeNod.lWin)}if(!this.callEvent("onDrag",[u.id,w.id,(s?s.id:null),u.treeNod,w.treeNod])){return false}if((w.XMLload==0)&&(this.XMLsource)){w.XMLload=1;this._loadDynXML(w.id)}this.openItem(w.id);var g=u.treeNod;var q=u.parentObject.childsCount;var r=u.parentObject;if((n)||(g.dpcpy)){var j=u.id;u=this._recreateBranch(u,w,s);if(!g.dpcpy){g.deleteItem(j)}}else{var l=w.childsCount;var v=w.childNodes;if(l==0){w._open=true}g._unselectItem(u);v[l]=u;u.treeNod=w.treeNod;w.childsCount++;var o=this._drawNewTr(v[l].htmlNode);if(!s){w.htmlNode.childNodes[0].appendChild(o);if(this.dadmode==1){this._fixNodesCollection(w,s)}}else{w.htmlNode.childNodes[0].insertBefore(o,s.tr);this._fixNodesCollection(w,s);v=w.childNodes}}if((!g.dpcpy)&&(!n)){var a=u.tr;if((document.all)&&(navigator.appVersion.search(/MSIE\ 5\.0/gi)!=-1)){window.setTimeout(function(){a.parentNode.removeChild(a)},250)}else{u.parentObject.htmlNode.childNodes[0].removeChild(u.tr)}if((!s)||(w!=u.parentObject)){for(var m=0;m<r.childsCount;m++){if(r.childNodes[m].id==u.id){r.childNodes[m]=0;break}}}else{r.childNodes[r.childsCount-1]=0}g._compressChildList(r.childsCount,r.childNodes);r.childsCount--}if((!n)&&(!g.dpcpy)){u.tr=o;o.nodem=u;u.parentObject=w;if(g!=w.treeNod){if(u.treeNod._registerBranch(u,g)){return}this._clearStyles(u);this._redrawFrom(this,u.parentObject);if(this._onradh){this._onradh(u.id)}}this._correctPlus(w);this._correctLine(w);this._correctLine(u);this._correctPlus(u);if(s){this._correctPlus(s)}else{if(w.childsCount>=2){this._correctPlus(v[w.childsCount-2]);this._correctLine(v[w.childsCount-2])}}this._correctPlus(v[w.childsCount-1]);if(this.tscheck){this._correctCheckStates(w)}if(g.tscheck){g._correctCheckStates(r)}}if(q>1){g._correctPlus(r.childNodes[q-2]);g._correctLine(r.childNodes[q-2])}g._correctPlus(r);g._correctLine(r);this._fixChildCountLabel(w);g._fixChildCountLabel(r);this.callEvent("onDrop",[u.id,w.id,(s?s.id:null),g,w.treeNod]);return u.id};dhtmlXTreeObject.prototype._clearStyles=function(a){if(!a.htmlNode){return}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1];var c=j.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=false;if(a._aimgs){this.dragger.removeDraggableItem(j.nextSibling)}if(this.checkBoxOff){j.childNodes[0].style.display="";j.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(j.childNodes[0],this.imPath+this.checkArray[a.checkstate])}else{j.style.display="none"}j.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);if(this.dragAndDropOff){this.dragger.addDraggableItem(c,this)}if(this._aimgs){this.dragger.addDraggableItem(j.nextSibling,this)}c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;j.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var g=0;g<a.childsCount;g++){this._clearStyles(a.childNodes[g])}};dhtmlXTreeObject.prototype._registerBranch=function(c,a){if(a){a._globalIdStorageSub(c.id)}c.id=this._globalIdStorageAdd(c.id,c);c.treeNod=this;for(var g=0;g<c.childsCount;g++){this._registerBranch(c.childNodes[g],a)}return 0};dhtmlXTreeObject.prototype.enableThreeStateCheckboxes=function(a){this.tscheck=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setOnMouseInHandler=function(a){this.ehlt=true;this.attachEvent("onMouseIn",a)};dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(a){this.ehlt=true;this.attachEvent("onMouseOut",a)};dhtmlXTreeObject.prototype.enableMercyDrag=function(a){this.dpcpy=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableTreeImages=function(a){this.timgen=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableFixedMode=function(a){this.hfMode=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableCheckBoxes=function(c,a){this.checkBoxOff=dhx4.s2b(c);this.cBROf=(!(this.checkBoxOff||dhx4.s2b(a)))};dhtmlXTreeObject.prototype.setStdImages=function(a,g,c){this.imageArray[0]=a;this.imageArray[1]=g;this.imageArray[2]=c};dhtmlXTreeObject.prototype.enableTreeLines=function(a){this.treeLinesOn=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setImageArrays=function(j,a,m,l,g,c){switch(j){case"plus":this.plusArray[0]=a;this.plusArray[1]=m;this.plusArray[2]=l;this.plusArray[3]=g;this.plusArray[4]=c;break;case"minus":this.minusArray[0]=a;this.minusArray[1]=m;this.minusArray[2]=l;this.minusArray[3]=g;this.minusArray[4]=c;break}};dhtmlXTreeObject.prototype.openItem=function(c){this.skipLock=true;var a=this._globalIdStorageFind(c);if(!a){return 0}else{return this._openItem(a)}this.skipLock=false};dhtmlXTreeObject.prototype._openItem=function(a){var c=this._getOpenState(a);if((c<0)||(((this.XMLsource)&&(!a.XMLload)))){if(!this.callEvent("onOpenStart",[a.id,c])){return 0}this._HideShow(a,2);if(this.checkEvent("onOpenEnd")){if(this.onXLE==this._epnFHe){this._epnFHe(this,a.id,true)}if(!this.xmlstate||!this.XMLsource){this.callEvent("onOpenEnd",[a.id,this._getOpenState(a)])}else{this._oie_onXLE.push(this.onXLE);this.onXLE=this._epnFHe}}}else{if(this._srnd){this._HideShow(a,2)}}if(a.parentObject&&!this._skip_open_parent){this._openItem(a.parentObject)}};dhtmlXTreeObject.prototype.closeItem=function(c){if(this.rootId==c){return 0}this.skipLock=true;var a=this._globalIdStorageFind(c);if(!a){return 0}if(a.closeble){this._HideShow(a,1)}this.skipLock=false};dhtmlXTreeObject.prototype.getLevel=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}return this._getNodeLevel(a,0)};dhtmlXTreeObject.prototype.setItemCloseable=function(g,a){a=dhx4.s2b(a);if((g)&&(g.span)){var c=g}else{var c=this._globalIdStorageFind(g)}if(!c){return 0}c.closeble=a};dhtmlXTreeObject.prototype._getNodeLevel=function(a,c){if(a.parentObject){return this._getNodeLevel(a.parentObject,c+1)}return(c)};dhtmlXTreeObject.prototype.hasChildren=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}else{if((this.XMLsource)&&(!a.XMLload)){return true}else{return a.childsCount}}};dhtmlXTreeObject.prototype._getLeafCount=function(j){var g=0;for(var c=0;c<j.childsCount;c++){if(j.childNodes[c].childsCount==0){g++}}return g};dhtmlXTreeObject.prototype.setItemText=function(j,g,c){var a=this._globalIdStorageFind(j);if(!a){return 0}a.label=g;a.span.innerHTML=g;if(this.childCalc){this._fixChildCountLabel(a)}a.span.parentNode.parentNode.title=c||""};dhtmlXTreeObject.prototype.getItemTooltip=function(c){var a=this._globalIdStorageFind(c);if(!a){return""}return(a.span.parentNode.parentNode._dhx_title||a.span.parentNode.parentNode.title||"")};dhtmlXTreeObject.prototype.refreshItem=function(c){if(!c){c=this.rootId}var a=this._globalIdStorageFind(c);this.deleteChildItems(c);this._loadDynXML(c)};dhtmlXTreeObject.prototype.setItemImage2=function(j,a,l,g){var c=this._globalIdStorageFind(j);if(!c){return 0}c.images[1]=l;c.images[2]=g;c.images[0]=a;this._correctPlus(c)};dhtmlXTreeObject.prototype.setItemImage=function(g,a,j){var c=this._globalIdStorageFind(g);if(!c){return 0}if(j){c.images[1]=a;c.images[2]=j}else{c.images[0]=a}this._correctPlus(c)};dhtmlXTreeObject.prototype.getSubItems=function(g){var a=this._globalIdStorageFind(g,0,1);if(!a){return 0}if(a.unParsed){return(this._getSubItemsXML(a.unParsed))}var c="";for(i=0;i<a.childsCount;i++){if(!c){c=""+a.childNodes[i].id}else{c+=this.dlmtr+a.childNodes[i].id}}return c};dhtmlXTreeObject.prototype._getAllScraggyItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(j){j+=this.dlmtr+a}else{j=a}}}else{if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}}}return j};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){j+=this.dlmtr+a}}}return j};dhtmlXTreeObject.prototype._getAllSubItems=function(m,l,j){if(j){c=j}else{var c=this._globalIdStorageFind(m)}if(!c){return 0}l="";for(var g=0;g<c.childsCount;g++){if(!l){l=""+c.childNodes[g].id}else{l+=this.dlmtr+c.childNodes[g].id}var a=this._getAllSubItems(0,l,c.childNodes[g]);if(a){l+=this.dlmtr+a}}if(c.unParsed){l=this._getAllSubItemsXML(m,l,c.unParsed)}return l};dhtmlXTreeObject.prototype.selectItem=function(j,g,c){g=dhx4.s2b(g);var a=this._globalIdStorageFind(j);if((!a)||(!a.parentObject)){return 0}if(this.XMLloadingWarning){a.parentObject.openMe=1}else{this._openItem(a.parentObject)}var l=null;if(c){l=new Object;l.ctrlKey=true;if(a.i_sel){l.skipUnSel=true}}if(g){this.onRowSelect(l,a.htmlNode.childNodes[0].childNodes[0].childNodes[3],false)}else{this.onRowSelect(l,a.htmlNode.childNodes[0].childNodes[0].childNodes[3],true)}};dhtmlXTreeObject.prototype.getSelectedItemText=function(){var c=new Array();for(var a=0;a<this._selected.length;a++){c[a]=this._selected[a].span.innerHTML}return(c.join(this.dlmtr))};dhtmlXTreeObject.prototype._compressChildList=function(a,g){a--;for(var c=0;c<a;c++){if(g[c]==0){g[c]=g[c+1];g[c+1]=0}}};dhtmlXTreeObject.prototype._deleteNode=function(n,l,q){if((!l)||(!l.parentObject)){return 0}var a=0;var c=0;if(l.tr.nextSibling){a=l.tr.nextSibling.nodem}if(l.tr.previousSibling){c=l.tr.previousSibling.nodem}var m=l.parentObject;var g=m.childsCount;var o=m.childNodes;for(var j=0;j<g;j++){if(o[j].id==n){if(!q){m.htmlNode.childNodes[0].removeChild(o[j].tr)}o[j]=0;break}}this._compressChildList(g,o);if(!q){m.childsCount--}if(a){this._correctPlus(a);this._correctLine(a)}if(c){this._correctPlus(c);this._correctLine(c)}if(this.tscheck){this._correctCheckStates(m)}if(!q){this._globalIdStorageRecSub(l)}};dhtmlXTreeObject.prototype.setCheck=function(g,c){var a=this._globalIdStorageFind(g,0,1);if(!a){return}if(c==="unsure"){this._setCheck(a,c)}else{c=dhx4.s2b(c);if((this.tscheck)&&(this.smcheck)){this._setSubChecked(c,a)}else{this._setCheck(a,c)}}if(this.smcheck){this._correctCheckStates(a.parentObject)}};dhtmlXTreeObject.prototype._setCheck=function(a,g){if(!a){return}if(((a.parentObject._r_logic)||(this._frbtr))&&(g)){if(this._frbtrs){if(this._frbtrL){this.setCheck(this._frbtrL.id,0)}this._frbtrL=a}else{for(var c=0;c<a.parentObject.childsCount;c++){this._setCheck(a.parentObject.childNodes[c],0)}}}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if(g=="unsure"){a.checkstate=2}else{if(g){a.checkstate=1}else{a.checkstate=0}}if(a.dscheck){a.checkstate=a.dscheck}this._setSrc(j,this.imPath+((a.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[a.checkstate])};dhtmlXTreeObject.prototype.setSubChecked=function(g,c){var a=this._globalIdStorageFind(g);this._setSubChecked(c,a);this._correctCheckStates(a.parentObject)};dhtmlXTreeObject.prototype._setSubChecked=function(g,a){g=dhx4.s2b(g);if(!a){return}if(((a.parentObject._r_logic)||(this._frbtr))&&(g)){for(var c=0;c<a.parentObject.childsCount;c++){this._setSubChecked(0,a.parentObject.childNodes[c])}}if(a.unParsed){this._setSubCheckedXML(g,a.unParsed)}if(a._r_logic||this._frbtr){this._setSubChecked(g,a.childNodes[0])}else{for(var c=0;c<a.childsCount;c++){this._setSubChecked(g,a.childNodes[c])}}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if(g){a.checkstate=1}else{a.checkstate=0}if(a.dscheck){a.checkstate=a.dscheck}this._setSrc(j,this.imPath+((a.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[a.checkstate])};dhtmlXTreeObject.prototype.isItemChecked=function(c){var a=this._globalIdStorageFind(c);if(!a){return}return a.checkstate};dhtmlXTreeObject.prototype.deleteChildItems=function(l){var a=this._globalIdStorageFind(l);if(!a){return}var c=a.childsCount;for(var g=0;g<c;g++){this._deleteNode(a.childNodes[0].id,a.childNodes[0])}};dhtmlXTreeObject.prototype.deleteItem=function(g,a){if((!this._onrdlh)||(this._onrdlh(g))){var c=this._deleteItem(g,a);if(c){this._fixChildCountLabel(c)}}this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};dhtmlXTreeObject.prototype._deleteItem=function(m,c,l){c=dhx4.s2b(c);var a=this._globalIdStorageFind(m);if(!a){return}var g=this.getParentId(m);var j=a.parentObject;this._deleteNode(m,a,l);if(this._editCell&&this._editCell.id==m){this._editCell=null}this._correctPlus(j);this._correctLine(j);if((c)&&(g!=this.rootId)){this.selectItem(g,1)}return j};dhtmlXTreeObject.prototype._globalIdStorageRecSub=function(a){for(var c=0;c<a.childsCount;c++){this._globalIdStorageRecSub(a.childNodes[c]);this._globalIdStorageSub(a.childNodes[c].id)}this._globalIdStorageSub(a.id);var g=a;g.span=null;g.tr.nodem=null;g.tr=null;g.htmlNode=null};dhtmlXTreeObject.prototype.insertNewNext=function(o,s,r,g,m,l,j,c,a){var n=this._globalIdStorageFind(o);if((!n)||(!n.parentObject)){return(0)}var q=this._attachChildNode(0,s,r,g,m,l,j,c,a,n);if((!this.XMLloadingWarning)&&(this.childCalc)){this._fixChildCountLabel(n.parentObject)}return q};dhtmlXTreeObject.prototype.getItemIdByIndex=function(g,a){var c=this._globalIdStorageFind(g);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(g,a){var c=this._globalIdStorageFind(g);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.setDragHandler=function(a){this.attachEvent("onDrag",a)};dhtmlXTreeObject.prototype._clearMove=function(){if(this._lastMark){this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,"");this._lastMark=null}this.selectionBar.style.display="none";this.allTree.className=this.allTree.className.replace(" selectionBox","")};dhtmlXTreeObject.prototype.enableDragAndDrop=function(c,a){if(c=="temporary_disabled"){this.dADTempOff=false;c=true}else{this.dADTempOff=true}this.dragAndDropOff=dhx4.s2b(c);if(this.dragAndDropOff){this.dragger.addDragLanding(this.allTree,this)}if(arguments.length>1){this._ddronr=(!dhx4.s2b(a))}};dhtmlXTreeObject.prototype._setMove=function(l,g,n){if(l.parentObject.span){var j=dhx4.absTop(l);var c=dhx4.absTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if(this.dadmode==2){var m=n-j+(document.body.scrollTop||document.documentElement.scrollTop)-2-l.offsetHeight/2;if((Math.abs(m)-l.offsetHeight/6)>0){this.dadmodec=1;if(m<0){this.dadmodefix=0-l.offsetHeight}}else{this.dadmodec=0}}if(this.dadmodec==0){var a=l.parentObject.span;a.className+=" dragAndDropRow";this._lastMark=a}else{this._clearMove();this.selectionBar.style.top=(j-c+((parseInt(l.parentObject.span.parentNode.previousSibling.childNodes[0].style.height)||18)-1)+this.dadmodefix)+"px";this.selectionBar.style.left="5px";if(this.allTree.offsetWidth>20){this.selectionBar.style.width=(this.allTree.offsetWidth-(_isFF?30:25))+"px"}this.selectionBar.style.display=""}this._autoScroll(null,j,c)}};dhtmlXTreeObject.prototype._autoScroll=function(g,c,a){if(this.autoScroll){if(g){c=dhx4.absTop(g);a=dhx4.absTop(this.allTree)-this.allTree.scrollTop}if((c-a-parseInt(this.allTree.scrollTop))>(parseInt(this.allTree.offsetHeight)-50)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20}if((c-a)<(parseInt(this.allTree.scrollTop)+30)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20}}};dhtmlXTreeObject.prototype._createDragNode=function(l,j){if(!this.dADTempOff){return null}var g=l.parentObject;if(!this.callEvent("onBeforeDrag",[g.id,j])){return null}if(!g.i_sel){this._selectItem(g,j)}this._checkMSelectionLogic();var c=document.createElement("div");var m=new Array();if(this._itim_dg){for(var a=0;a<this._selected.length;a++){m[a]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[a].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[a].span.innerHTML+"</td></tr></table>"}}else{m=this.getSelectedItemText().split(this.dlmtr)}c.innerHTML=m.join("");c.style.position="absolute";c.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return c};dhtmlXTreeObject.prototype._focusNode=function(a){var c=dhx4.absTop(a.htmlNode)-dhx4.absTop(this.allTree);if((c>(this.allTree.offsetHeight-30))||(c<0)){this.allTree.scrollTop=c+this.allTree.scrollTop}};dhtmlXTreeObject.prototype._preventNsDrag=function(a){if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlXTreeObject.prototype._drag=function(n,o,a){if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}if(!a.parentObject){a=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];this.dadmodec=0}this._clearMove();var m=n.parentObject.treeNod;if((m)&&(m._clearMove)){m._clearMove("")}if((!this.dragMove)||(this.dragMove())){if((!m)||(!m._clearMove)||(!m._dragged)){var j=new Array(n.parentObject)}else{var j=m._dragged}var c=a.parentObject;for(var l=0;l<j.length;l++){var g=this._moveNode(j[l],c);if((this.dadmodec)&&(g!==false)){c=this._globalIdStorageFind(g,true,true)}if((g)&&(!this._sADnD)){this.selectItem(g,0,1)}}}if(m){m._dragged=new Array()}};dhtmlXTreeObject.prototype._dragIn=function(j,c,m,l){if(!this.dADTempOff){return 0}var n=c.parentObject;var a=j.parentObject;if((!a)&&(this._ddronr)){return}if(!this.callEvent("onDragIn",[n.id,a?a.id:null,n.treeNod,this])){if(a){this._autoScroll(j)}return 0}if(!a){this.allTree.className+=" selectionBox"}else{if(n.childNodes==null){this._setMove(j,m,l);return j}var q=n.treeNod;for(var g=0;g<q._dragged.length;g++){if(this._checkPNodes(a,q._dragged[g])){this._autoScroll(j);return 0}}this.selectionBar.parentNode.removeChild(this.selectionBar);a.span.parentNode.appendChild(this.selectionBar);this._setMove(j,m,l);if(this._getOpenState(a)<=0){var o=this;this._autoOpenId=a.id;this._autoOpenTimer=window.setTimeout(function(){o._autoOpenItem(null,o);o=null},1000)}}return j};dhtmlXTreeObject.prototype._autoOpenItem=function(c,a){a.openItem(a._autoOpenId)};dhtmlXTreeObject.prototype._dragOut=function(a){this._clearMove();if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}};dhtmlXTreeObject.prototype._getNextNode=function(a,c){if((!c)&&(a.childsCount)){return a.childNodes[0]}if(a==this.htmlNode){return -1}if((a.tr)&&(a.tr.nextSibling)&&(a.tr.nextSibling.nodem)){return a.tr.nextSibling.nodem}return this._getNextNode(a.parentObject,true)};dhtmlXTreeObject.prototype._lastChild=function(a){if(a.childsCount){return this._lastChild(a.childNodes[a.childsCount-1])}else{return a}};dhtmlXTreeObject.prototype._getPrevNode=function(a,c){if((a.tr)&&(a.tr.previousSibling)&&(a.tr.previousSibling.nodem)){return this._lastChild(a.tr.previousSibling.nodem)}if(a.parentObject){return a.parentObject}else{return -1}};dhtmlXTreeObject.prototype.findItem=function(a,g,c){var j=this._findNodeByLabel(a,g,(c?this.htmlNode:null));if(j){this.selectItem(j.id,true);this._focusNode(j);return j.id}else{return null}};dhtmlXTreeObject.prototype.findItemIdByLabel=function(a,g,c){var j=this._findNodeByLabel(a,g,(c?this.htmlNode:null));if(j){return j.id}else{return null}};dhtmlXTreeObject.prototype.findStrInXML=function(c,g,l){if(!c.childNodes&&c.item){return this.findStrInJSON(c,g,l)}if(!c.childNodes){return false}for(var a=0;a<c.childNodes.length;a++){if(c.childNodes[a].nodeType==1){var j=c.childNodes[a].getAttribute(g);if(!j&&c.childNodes[a].tagName=="itemtext"){j=c.childNodes[a].firstChild.data}if((j)&&(j.toLowerCase().search(l)!=-1)){return true}if(this.findStrInXML(c.childNodes[a],g,l)){return true}}}return false};dhtmlXTreeObject.prototype.findStrInJSON=function(c,g,l){for(var a=0;a<c.item.length;a++){var j=c.item[a].text;if((j)&&(j.toLowerCase().search(l)!=-1)){return true}if(c.item[a].item&&this.findStrInJSON(c.item[a],g,l)){return true}}return false};dhtmlXTreeObject.prototype._findNodeByLabel=function(a,l,j){var a=a.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");a=new RegExp(a.replace(/([\^\.\?\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if(!j){j=this._selected[0];if(!j){j=this.htmlNode}}var c=j;if(!l){if((j.unParsed)&&(this.findStrInXML(j.unParsed.d,"text",a))){this.reParse(j)}j=this._getNextNode(c);if(j==-1){j=this.htmlNode.childNodes[0]}}else{var g=this._getPrevNode(c);if(g==-1){g=this._lastChild(this.htmlNode)}if((g.unParsed)&&(this.findStrInXML(g.unParsed.d,"text",a))){this.reParse(g);j=this._getPrevNode(c)}else{j=g}if(j==-1){j=this._lastChild(this.htmlNode)}}while((j)&&(j!=c)){if((j.label)&&(j.label.search(a)!=-1)){return(j)}if(!l){if(j==-1){if(c==this.htmlNode){break}j=this.htmlNode.childNodes[0]}if((j.unParsed)&&(this.findStrInXML(j.unParsed.d,"text",a))){this.reParse(j)}j=this._getNextNode(j);if(j==-1){j=this.htmlNode}}else{var g=this._getPrevNode(j);if(g==-1){g=this._lastChild(this.htmlNode)}if((g.unParsed)&&(this.findStrInXML(g.unParsed.d,"text",a))){this.reParse(g);j=this._getPrevNode(j)}else{j=g}if(j==-1){j=this._lastChild(this.htmlNode)}}}return null};dhtmlXTreeObject.prototype.moveItem=function(o,c,q,a){var l=this._globalIdStorageFind(o);if(!l){return(0)}var m=null;switch(c){case"right":alert("Not supported yet");break;case"item_child":var g=(a||this)._globalIdStorageFind(q);if(!g){return(0)}m=(a||this)._moveNodeTo(l,g,0);break;case"item_sibling":var g=(a||this)._globalIdStorageFind(q);if(!g){return(0)}m=(a||this)._moveNodeTo(l,g.parentObject,g);break;case"item_sibling_next":var g=(a||this)._globalIdStorageFind(q);if(!g){return(0)}if((g.tr)&&(g.tr.nextSibling)&&(g.tr.nextSibling.nodem)){m=(a||this)._moveNodeTo(l,g.parentObject,g.tr.nextSibling.nodem)}else{m=(a||this)._moveNodeTo(l,g.parentObject)}break;case"left":if(l.parentObject.parentObject){m=this._moveNodeTo(l,l.parentObject.parentObject,l.parentObject)}break;case"up":var n=this._getPrevNode(l);if((n==-1)||(!n.parentObject)){return null}m=this._moveNodeTo(l,n.parentObject,n);break;case"up_strict":var n=this._getIndex(l);if(n!=0){m=this._moveNodeTo(l,l.parentObject,l.parentObject.childNodes[n-1])}break;case"down_strict":var n=this._getIndex(l);var j=l.parentObject.childsCount-2;if(n==j){m=this._moveNodeTo(l,l.parentObject)}else{if(n<j){m=this._moveNodeTo(l,l.parentObject,l.parentObject.childNodes[n+2])}}break;case"down":var n=this._getNextNode(this._lastChild(l));if((n==-1)||(!n.parentObject)){return}if(n.parentObject==l.parentObject){var n=this._getNextNode(n)}if(n==-1){m=this._moveNodeTo(l,l.parentObject)}else{if((n==-1)||(!n.parentObject)){return}m=this._moveNodeTo(l,n.parentObject,n)}break}if(_isIE&&_isIE<8){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}return m};dhtmlXTreeObject.prototype.setDragBehavior=function(c,a){this._sADnD=(!dhx4.s2b(a));switch(c){case"child":this.dadmode=0;break;case"sibling":this.dadmode=1;break;case"complex":this.dadmode=2;break}};dhtmlXTreeObject.prototype._loadDynXML=function(g,c){c=c||this.XMLsource;var a=(new Date()).valueOf();this._ld_id=g;if(this.xmlalb=="function"){if(c){c(this._escape(g))}}else{if(this.xmlalb=="name"){this.loadXML(c+this._escape(g))}else{if(this.xmlalb=="xmlname"){this.loadXML(c+this._escape(g)+".xml?uid="+a)}else{this.loadXML(c+dhtmlx.url(c)+"uid="+a+"&id="+this._escape(g))}}}};dhtmlXTreeObject.prototype.enableMultiselection=function(c,a){this._amsel=dhx4.s2b(c);this._amselS=dhx4.s2b(a)};dhtmlXTreeObject.prototype._checkMSelectionLogic=function(){var g=new Array();for(var c=0;c<this._selected.length;c++){for(var a=0;a<this._selected.length;a++){if((c!=a)&&(this._checkPNodes(this._selected[a],this._selected[c]))){g[g.length]=this._selected[a]}}}for(var c=0;c<g.length;c++){this._unselectItem(g[c])}};dhtmlXTreeObject.prototype._checkPNodes=function(c,a){if(this._dcheckf){return false}if(a==c){return 1}if(c.parentObject){return this._checkPNodes(c.parentObject,a)}else{return 0}};dhtmlXTreeObject.prototype.disableDropCheck=function(a){this._dcheckf=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableDistributedParsing=function(g,c,a){this._edsbps=dhx4.s2b(g);this._edsbpsA=new Array();this._edsbpsC=c||10;this._edsbpsD=a||250};dhtmlXTreeObject.prototype.getDistributedParsingState=function(){return(!((!this._edsbpsA)||(!this._edsbpsA.length)))};dhtmlXTreeObject.prototype.getItemParsingState=function(g){var c=this._globalIdStorageFind(g,true,true);if(!c){return 0}if(this._edsbpsA){for(var a=0;a<this._edsbpsA.length;a++){if(this._edsbpsA[a][2]==g){return -1}}}return 1};dhtmlXTreeObject.prototype._distributedStart=function(c,l,j,g,a){if(!this._edsbpsA){this._edsbpsA=new Array()}this._edsbpsA[this._edsbpsA.length]=[c,l,j,g,a]};dhtmlXTreeObject.prototype._distributedStep=function(j){var c=this;if((!this._edsbpsA)||(!this._edsbpsA.length)){c.XMLloadingWarning=0;return}var l=this._edsbpsA[0];this.parsedArray=new Array();this._parse(l[0],l[2],l[3],l[1]);var a=this._globalIdStorageFind(l[2]);this._redrawFrom(this,a,l[4],this._getOpenState(a));var g=this.setCheckList.split(this.dlmtr);for(var m=0;m<g.length;m++){if(g[m]){this.setCheck(g[m],1)}}this._edsbpsA=(new Array()).concat(this._edsbpsA.slice(1));if((!this._edsbpsA.length)){window.setTimeout(function(){if(c.onXLE){c.onXLE(c,j)}c.callEvent("onXLE",[c,j])},1);c.xmlstate=0}};dhtmlXTreeObject.prototype.enableTextSigns=function(a){this._txtimg=dhx4.s2b(a)};dhtmlXTreeObject.prototype.preventIECaching=function(a){dhx4.ajax.cache=!a};dhtmlXTreeObject.prototype.preventIECashing=dhtmlXTreeObject.prototype.preventIECaching;dhtmlXTreeObject.prototype.disableCheckbox=function(g,c){if(typeof(g)!="object"){var a=this._globalIdStorageFind(g,0,1)}else{var a=g}if(!a){return}a.dscheck=dhx4.s2b(c)?(((a.checkstate||0)%3)+3):((a.checkstate>2)?(a.checkstate-3):a.checkstate);this._setCheck(a);if(a.dscheck<3){a.dscheck=false}};dhtmlXTreeObject.prototype.smartRefreshBranch=function(c,a){this._branchUpdate=1;this.smartRefreshItem(c,a)};dhtmlXTreeObject.prototype.smartRefreshItem=function(j,g){var a=this._globalIdStorageFind(j);for(var c=0;c<a.childsCount;c++){a.childNodes[c]._dmark=true}this.waitUpdateXML=true;if(g&&g.exists){this._parse(g,j)}else{this._loadDynXML(j,g)}};dhtmlXTreeObject.prototype.refreshItems=function(c,g){var j=c.toString().split(this.dlmtr);this.waitUpdateXML=new Array();for(var a=0;a<j.length;a++){this.waitUpdateXML[j[a]]=true}this.loadXML((g||this.XMLsource)+dhtmlx.url(g||this.XMLsource)+"ids="+this._escape(c))};dhtmlXTreeObject.prototype.updateItem=function(n,m,j,g,c,l,o){var a=this._globalIdStorageFind(n);a.userData=new cObject();if(m){a.label=m}a.images=new Array(j||this.imageArray[0],g||this.imageArray[1],c||this.imageArray[2]);this.setItemText(n,m);if(l){this._setCheck(a,true)}if(o=="1"&&!this.hasChildren(n)){a.XMLload=0}this._correctPlus(a);a._dmark=false;return a};dhtmlXTreeObject.prototype.setDropHandler=function(a){this.attachEvent("onDrop",a)};dhtmlXTreeObject.prototype.setOnLoadingStart=function(a){this.attachEvent("onXLS",a)};dhtmlXTreeObject.prototype.setOnLoadingEnd=function(a){this.attachEvent("onXLE",a)};dhtmlXTreeObject.prototype.setXMLAutoLoadingBehaviour=function(a){this.xmlalb=a};dhtmlXTreeObject.prototype.enableSmartCheckboxes=function(a){this.smcheck=dhx4.s2b(a)};dhtmlXTreeObject.prototype.getXMLState=function(){return(this.xmlstate==1)};dhtmlXTreeObject.prototype.setItemTopOffset=function(m,j){var g;if(typeof(m)!="object"){g=this._globalIdStorageFind(m)}else{g=m}var l=g.span.parentNode.parentNode;g.span.style.paddingBottom="1px";for(var c=0;c<l.childNodes.length;c++){if(c!=0){if(_isIE){l.childNodes[c].style.height="18px";l.childNodes[c].style.paddingTop=parseInt(j)+"px"}else{l.childNodes[c].style.height=18+parseInt(j)+"px"}}else{var a=l.childNodes[c].firstChild;if(l.childNodes[c].firstChild.tagName!="DIV"){a=document.createElement("DIV");l.childNodes[c].insertBefore(a,l.childNodes[c].firstChild)}a.style.height=parseInt(j)+"px";if((g.parentObject.id!=this.rootId||g.parentObject.childNodes[0]!=g)&&this.treeLinesOn){a.style.backgroundImage="url("+this.imPath+this.lineArray[5]+")"}a.innerHTML="&nbsp;";a.style.overflow="hidden";if(parseInt(j)==0){l.childNodes[c].removeChild(a)}}if(!_isIE){l.childNodes[c].style.verticalAlign="bottom"}if(_isIE){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}}};dhtmlXTreeObject.prototype.setIconSize=function(j,c,l){if(l){if((l)&&(l.span)){var a=l}else{var a=this._globalIdStorageFind(l)}if(!a){return(0)}var g=a.span.parentNode.previousSibling.childNodes[0];if(j){g.style.width=j+"px";if(window._KHTMLrv){g.parentNode.style.width=j+"px"}}if(c){g.style.height=c+"px";if(window._KHTMLrv){g.parentNode.style.height=c+"px"}}}else{this.def_img_x=j;this.def_img_y=c}};dhtmlXTreeObject.prototype.getItemImage=function(l,j,c){var g=this._globalIdStorageFind(l);if(!g){return""}var a=g.images[j||0];if(c){a=this.iconURL+a}return a};dhtmlXTreeObject.prototype.enableRadioButtons=function(j,g){if(arguments.length==1){this._frbtr=dhx4.s2b(j);this.checkBoxOff=this.checkBoxOff||this._frbtr;return}var c=this._globalIdStorageFind(j);if(!c){return""}g=dhx4.s2b(g);if((g)&&(!c._r_logic)){c._r_logic=true;for(var a=0;a<c.childsCount;a++){this._setCheck(c.childNodes[a],c.childNodes[a].checkstate)}}if((!g)&&(c._r_logic)){c._r_logic=false;for(var a=0;a<c.childsCount;a++){this._setCheck(c.childNodes[a],c.childNodes[a].checkstate)}}};dhtmlXTreeObject.prototype.enableSingleRadioMode=function(a){this._frbtrs=dhx4.s2b(a)};dhtmlXTreeObject.prototype.openOnItemAdded=function(a){this._hAdI=!dhx4.s2b(a)};dhtmlXTreeObject.prototype.openOnItemAdding=function(a){this._hAdI=!dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableMultiLineItems=function(a){if(a===true){this.mlitems="100%"}else{this.mlitems=a}};dhtmlXTreeObject.prototype.enableAutoTooltips=function(a){this.ettip=dhx4.s2b(a)};dhtmlXTreeObject.prototype.clearSelection=function(a){if(a){this._unselectItem(this._globalIdStorageFind(a))}else{this._unselectItems()}};dhtmlXTreeObject.prototype.showItemSign=function(j,c){var a=this._globalIdStorageFind(j);if(!a){return 0}var g=a.span.parentNode.previousSibling.previousSibling.previousSibling;if(!dhx4.s2b(c)){this._openItem(a);a.closeble=false;a.wsign=true}else{a.closeble=true;a.wsign=false}this._correctPlus(a)};dhtmlXTreeObject.prototype.showItemCheckbox=function(l,j){if(!l){for(var c in this._idpull){this.showItemCheckbox(this._idpull[c],j)}}if(typeof(l)!="object"){l=this._globalIdStorageFind(l,0,0)}if(!l){return 0}l.nocheckbox=!dhx4.s2b(j);var g=l.span.parentNode.previousSibling.previousSibling.childNodes[0];g.parentNode.style.display=(!l.nocheckbox)?"":"none"};dhtmlXTreeObject.prototype.setListDelimeter=function(a){this.dlmtr=a};dhtmlXTreeObject.prototype.setEscapingMode=function(a){this.utfesc=a};dhtmlXTreeObject.prototype.enableHighlighting=function(a){this.ehlt=true;this.ehlta=dhx4.s2b(a)};dhtmlXTreeObject.prototype._itemMouseOut=function(){var c=this.childNodes[3].parentObject;var a=c.treeNod;a.callEvent("onMouseOut",[c.id]);if(c.id==a._l_onMSI){a._l_onMSI=null}if(!a.ehlta){return}c.span.className=c.span.className.replace("_lor","")};dhtmlXTreeObject.prototype._itemMouseIn=function(){var c=this.childNodes[3].parentObject;var a=c.treeNod;if(a._l_onMSI!=c.id){a.callEvent("onMouseIn",[c.id])}a._l_onMSI=c.id;if(!a.ehlta){return}c.span.className=c.span.className.replace("_lor","");c.span.className=c.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor")};dhtmlXTreeObject.prototype.enableActiveImages=function(a){this._aimgs=dhx4.s2b(a)};dhtmlXTreeObject.prototype.focusItem=function(c){var a=this._globalIdStorageFind(c);if(!a){return(0)}this._focusNode(a)};dhtmlXTreeObject.prototype.getAllSubItems=function(a){return this._getAllSubItems(a)};dhtmlXTreeObject.prototype.getAllChildless=function(){return this._getAllScraggyItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless;dhtmlXTreeObject.prototype._getAllScraggyItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(j){j+=this.dlmtr+a}else{j=a}}}else{if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}}}return j};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){j+=this.dlmtr+a}}}return j};dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)};dhtmlXTreeObject.prototype.getAllUnchecked=function(a){if(a){a=this._globalIdStorageFind(a)}return this._getAllChecked(a,"",0)};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)};dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var a=[this._getAllChecked("","",1)];var c=this._getAllChecked("","",2);if(c){a.push(c)}return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._getAllChecked=function(l,g,m){if(!l){l=this.htmlNode}if(l.checkstate==m){if(!l.nocheckbox){if(g){g+=this.dlmtr+l.id}else{g=""+l.id}}}var a=l.childsCount;for(var c=0;c<a;c++){g=this._getAllChecked(l.childNodes[c],g,m)}if(l.unParsed){g=this._getAllCheckedXML(l.unParsed,g,m)}if(g){return g}else{return""}};dhtmlXTreeObject.prototype.setItemStyle=function(j,g,c){var c=c||false;var a=this._globalIdStorageFind(j);if(!a){return 0}if(!a.span.style.cssText){a.span.setAttribute("style",a.span.getAttribute("style")+"; "+g)}else{a.span.style.cssText=c?g:a.span.style.cssText+";"+g}};dhtmlXTreeObject.prototype.enableImageDrag=function(a){this._itim_dg=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setOnDragIn=function(a){this.attachEvent("onDragIn",a)};dhtmlXTreeObject.prototype.enableDragAndDropScrolling=function(a){this.autoScroll=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setSkin=function(a){var c=this.parentObject.className.replace(/dhxtree_[^ ]*/gi,"");this.parentObject.className=c+" dhxtree_"+a;if(a=="dhx_terrace"||a=="dhx_web"){this.enableTreeLines(false)}};(function(){dhtmlx.extend_api("dhtmlXTreeObject",{_init:function(a){return[a.parent,(a.width||"100%"),(a.height||"100%"),(a.root_id||0)]},auto_save_selection:"enableAutoSavingSelected",auto_tooltip:"enableAutoTooltips",checkbox:"enableCheckBoxes",checkbox_3_state:"enableThreeStateCheckboxes",checkbox_smart:"enableSmartCheckboxes",context_menu:"enableContextMenu",distributed_parsing:"enableDistributedParsing",drag:"enableDragAndDrop",drag_copy:"enableMercyDrag",drag_image:"enableImageDrag",drag_scroll:"enableDragAndDropScrolling",editor:"enableItemEditor",hover:"enableHighlighting",images:"enableTreeImages",image_fix:"enableIEImageFix",image_path:"setImagePath",lines:"enableTreeLines",loading_item:"enableLoadingItem",multiline:"enableMultiLineItems",multiselect:"enableMultiselection",navigation:"enableKeyboardNavigation",radio:"enableRadioButtons",radio_single:"enableSingleRadioMode",rtl:"enableRTL",search:"enableKeySearch",smart_parsing:"enableSmartXMLParsing",smart_rendering:"enableSmartRendering",text_icons:"enableTextSigns",xml:"loadXML",skin:"setSkin"},{})})();dhtmlXTreeObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(j,m,c){var g=dhx4.ajax.xpath(".//item",j);var l=g[0].getAttribute("text");this.obj.insertNewItem(c,m,l,0,0,0,0,"CHILD")});a.attachEvent("updateCallback",function(j,m,c){var g=dhx4.ajax.xpath(".//item",j);var l=g[0].getAttribute("text");this.obj.setItemText(m,l);if(this.obj.getParentId(m)!=c){this.obj.moveItem(m,"item_child",c)}this.setUpdated(m,true,"updated")});a.attachEvent("deleteCallback",function(g,j,c){this.obj.setUserData(j,this.action_param,"true_deleted");this.obj.deleteItem(j,false)});a._methods=["setItemStyle","","changeItemId","deleteItem"];this.attachEvent("onEdit",function(c,g){if(c==3){a.setUpdated(g,true)}return true});this.attachEvent("onDrop",function(m,l,j,g,c){if(g==c){a.setUpdated(m,true)}});this._onrdlh=function(c){var g=a.getState(c);if(g=="inserted"){a.set_invalid(c,false);a.setUpdated(c,false);return true}if(g=="true_deleted"){a.setUpdated(c,false);return true}a.setUpdated(c,true,"deleted");return false};this._onradh=function(c){a.setUpdated(c,true,"inserted")};a._getRowData=function(l){var j={};var m=this.obj._globalIdStorageFind(l);var g=m.parentObject;var c=0;for(c=0;c<g.childsCount;c++){if(g.childNodes[c]==m){break}}j.tr_id=m.id;j.tr_pid=g.id;j.tr_order=c;j.tr_text=m.span.innerHTML;g=(m._userdatalist||"").split(",");for(c=0;c<g.length;c++){j[g[c]]=m.userData["t_"+g[c]]}return j}};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachTree=function(a){this.callEvent("_onBeforeContentAttach",["tree"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);this.dataType="tree";this.dataObj=new dhtmlXTreeObject(c,"100%","100%",(a||0));this.dataObj.setSkin(this.conf.skin);this.dataObj.allTree.childNodes[0].style.marginTop="2px";this.dataObj.allTree.childNodes[0].style.marginBottom="2px";c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXTreeObject.prototype.makeDraggable=function(c,a){if(typeof(c)!="object"){c=document.getElementById(c)}dragger=new dhtmlDragAndDropObject();dropper=new dhx_dragSomethingInTree();dragger.addDraggableItem(c,dropper);c.dragLanding=null;c.ondragstart=dropper._preventNsDrag;c.onselectstart=new Function("return false;");c.parentObject=new Object;c.parentObject.img=c;c.parentObject.treeNod=dropper;dropper._customDrop=a};dhtmlXTreeObject.prototype.makeDragable=dhtmlXTreeObject.prototype.makeDraggable;dhtmlXTreeObject.prototype.makeAllDraggable=function(c){var g=document.getElementsByTagName("div");for(var a=0;a<g.length;a++){if(g[a].getAttribute("dragInDhtmlXTree")){this.makeDragable(g[a],c)}}};function dhx_dragSomethingInTree(){this.lWin=window;this._createDragNode=function(c){var a=document.createElement("div");a.style.position="absolute";a.innerHTML=(c.innerHTML||c.value);a.className="dragSpanDiv";return a};this._preventNsDrag=function(a){(a||window.event).cancelBubble=true;if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};this._nonTrivialNode=function(c,g,a,j){if(this._customDrop){return this._customDrop(c,j.img.id,g.id,a?a.id:null)}var l=(j.img.getAttribute("image")||"");var n=j.img.id||"new";var m=(j.img.getAttribute("text")||(_isIE?j.img.innerText:j.img.textContent));c[a?"insertNewNext":"insertNewItem"](a?a.id:g.id,n,m,"",l,l,l)}}dhtmlXTreeObject.prototype.enableItemEditor=function(a){this._eItEd=dhx4.s2b(a);if(!this._eItEdFlag){this._edn_click_IE=true;this._edn_dblclick=true;this._ie_aFunc=this.aFunc;this._ie_dblclickFuncHandler=this.dblclickFuncHandler;this.setOnDblClickHandler(function(g,c){if(this._edn_dblclick){this._editItem(g,c)}return true});this.setOnClickHandler(function(g,c){this._stopEditItem(g,c);if((this.ed_hist_clcik==g)&&(this._edn_click_IE)){this._editItem(g,c)}this.ed_hist_clcik=g;return true});this._eItEdFlag=true}};dhtmlXTreeObject.prototype.setOnEditHandler=function(a){this.attachEvent("onEdit",a)};dhtmlXTreeObject.prototype.setEditStartAction=function(a,c){this._edn_click_IE=dhx4.s2b(a);this._edn_dblclick=dhx4.s2b(c)};dhtmlXTreeObject.prototype._stopEdit=function(c,m){if(this._editCell){this.dADTempOff=this.dADTempOffEd;if(this._editCell.id!=c){var j=true;if(!m){j=this.callEvent("onEdit",[2,this._editCell.id,this,this._editCell.span.childNodes[0].value])}else{j=false;this.callEvent("onEditCancel",[this._editCell.id,this._editCell._oldValue])}if(j===true){j=this._editCell.span.childNodes[0].value}else{if(j===false){j=this._editCell._oldValue}}var l=(j!=this._editCell._oldValue);this._editCell.span.innerHTML=j;this._editCell.label=this._editCell.span.innerHTML;var g=this._editCell.i_sel?"selectedTreeRow":"standartTreeRow";this._editCell.span.className=g;this._editCell.span.parentNode.className="standartTreeRow";this._editCell.span.style.paddingRight=this._editCell.span.style.paddingLeft="5px";this._editCell.span.onclick=this._editCell.span.ondblclick=function(){};var n=this._editCell.id;if(this.childCalc){this._fixChildCountLabel(this._editCell)}this._editCell=null;if(!m){this.callEvent("onEdit",[3,n,this,l])}if(this._enblkbrd){this.parentObject.lastChild.focus();this.parentObject.lastChild.focus()}}}};dhtmlXTreeObject.prototype._stopEditItem=function(c,a){this._stopEdit(c)};dhtmlXTreeObject.prototype.stopEdit=function(a){if(this._editCell){this._stopEdit(this._editCell.id+"_non",a)}};dhtmlXTreeObject.prototype.editItem=function(a){this._editItem(a,this)};dhtmlXTreeObject.prototype._editItem=function(l,a){if(this._eItEd){this._stopEdit();var g=this._globalIdStorageFind(l);if(!g){return}var j=this.callEvent("onEdit",[0,l,this,g.span.innerHTML]);if(j===true){j=(typeof g.span.innerText!="undefined"?g.span.innerText:g.span.textContent)}else{if(j===false){return}}this.dADTempOffEd=this.dADTempOff;this.dADTempOff=false;this._editCell=g;g._oldValue=j;g.span.innerHTML="<input type='text' class='intreeeditRow' />";g.span.style.paddingRight=g.span.style.paddingLeft="0px";g.span.onclick=g.span.ondblclick=function(m){(m||event).cancelBubble=true};g.span.childNodes[0].value=j;g.span.childNodes[0].onselectstart=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].onmousedown=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].focus();g.span.childNodes[0].focus();g.span.onclick=function(m){(m||event).cancelBubble=true;return false};g.span.className="";g.span.parentNode.className="";var c=this;g.span.childNodes[0].onkeydown=function(m){if(!m){m=window.event}if(m.keyCode==13){m.cancelBubble=true;c._stopEdit(window.undefined)}else{if(m.keyCode==27){c._stopEdit(window.undefined,true)}}(m||event).cancelBubble=true};this.callEvent("onEdit",[1,l,this])}};function jsonPointer(c,a){this.d=c;this.dp=a}jsonPointer.prototype={text:function(){var a=function(l){var j=[];for(var g=0;g<l.length;g++){j.push("{"+c(l[g])+"}")}return j.join(",")};var c=function(l){var j=[];for(var g in l){if(typeof(l[g])=="object"){if(g.length){j.push('"'+g+'":['+a(l[g])+"]")}else{j.push('"'+g+'":{'+c(l[g])+"}")}}else{j.push('"'+g+'":"'+l[g]+'"')}}return j.join(",")};return"{"+c(this.d)+"}"},get:function(a){return this.d[a]},exists:function(){return !!this.d},content:function(){return this.d.content},each:function(j,n,m){var g=this.d[j];var o=new jsonPointer();if(g){for(var l=0;l<g.length;l++){o.d=g[l];n.apply(m,[o,l])}}},get_all:function(){return this.d},sub:function(a){return new jsonPointer(this.d[a],this.d)},sub_exists:function(a){return !!this.d[a]},each_x:function(j,o,n,m,l){var g=this.d[j];var q=new jsonPointer(0,this.d);if(g){for(l=l||0;l<g.length;l++){if(g[l][o]){q.d=g[l];if(n.apply(m,[q,l])==-1){return}}}}},up:function(a){return new jsonPointer(this.dp,this.d)},set:function(a,c){this.d[a]=c},clone:function(a){return new jsonPointer(this.d,this.dp)},through:function(g,n,r,l,s){var o=this.d[g];if(o.length){for(var j=0;j<o.length;j++){if(o[j][n]!=null&&o[j][n]!=""&&(!r||o[j][n]==r)){var m=new jsonPointer(o[j],this.d);l.apply(s,[m,j])}var q=this.d;this.d=o[j];if(this.sub_exists(g)){this.through(g,n,r,l,s)}this.d=q}}}};dhtmlXTreeObject.prototype.loadJSArrayFile=function(file,callback){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=function(xml,callback){eval("var z="+xml.responseText);this.loadJSArray(z);if(callback){callback.call(this,xml)}};dhx4.ajax.get(file,function(obj){that.XMLLoader(obj.xmlDoc,callback)})};dhtmlXTreeObject.prototype.loadCSV=function(a,g){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var c=this;this.XMLLoader=function(j,l){this.loadCSVString(j.responseText);if(l){l.call(this,j)}};dhx4.ajax.get(a,function(j){c.XMLLoader(j.xmlDoc,g)})};dhtmlXTreeObject.prototype.loadJSArray=function(a,j){var m=[];for(var c=0;c<a.length;c++){if(!m[a[c][1]]){m[a[c][1]]=[]}m[a[c][1]].push({id:a[c][0],text:a[c][2]})}var l={id:this.rootId};var g=function(q,o){if(m[q.id]){q.item=m[q.id];for(var n=0;n<q.item.length;n++){o(q.item[n],o)}}};g(l,g);this.loadJSONObject(l,j)};dhtmlXTreeObject.prototype.loadCSVString=function(a,m){var o=[];var c=a.split("\n");for(var j=0;j<c.length;j++){var g=c[j].split(",");if(!o[g[1]]){o[g[1]]=[]}o[g[1]].push({id:g[0],text:g[2]})}var n={id:this.rootId};var l=function(s,r){if(o[s.id]){s.item=o[s.id];for(var q=0;q<s.item.length;q++){r(s.item[q],r)}}};l(n,l);this.loadJSONObject(n,m)};dhtmlXTreeObject.prototype.loadJSONObject=function(a,c){if(!this.parsCount){this.callEvent("onXLS",[this,null])}this.xmlstate=1;var g=new jsonPointer(a);this._parse(g);this._p=g;if(c){c()}};dhtmlXTreeObject.prototype.loadJSON=function(file,callback){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=function(xml,callback){try{eval("var t="+xml.responseText)}catch(e){dhx4.callEvent("onLoadXMLerror",["Incorrect JSON",(xml),this]);return}var p=new jsonPointer(t);this._parse(p);this._p=p;if(callback){callback.call(this,xml)}};dhx4.ajax.get(file,function(obj){that.XMLLoader(obj.xmlDoc,callback)})};dhtmlXTreeObject.prototype.serializeTreeToJSON=function(){var a=['{"id":"'+this.rootId+'", "item":['];var g=[];for(var c=0;c<this.htmlNode.childsCount;c++){g.push(this._serializeItemJSON(this.htmlNode.childNodes[c]))}a.push(g.join(","));a.push("]}");return a.join("")};dhtmlXTreeObject.prototype._serializeItemJSON=function(n){var a=[];if(n.unParsed){return(n.unParsed.text())}if(this._selected.length){var g=this._selected[0].id}else{g=""}var m=n.span.innerHTML;m=m.replace(/\"/g,'\\"',m);if(!this._xfullXML){a.push('{ "id":"'+n.id+'", '+(this._getOpenState(n)==1?' "open":"1", ':"")+(g==n.id?' "select":"1",':"")+' "text":"'+m+'"'+(((this.XMLsource)&&(n.XMLload==0))?', "child":"1" ':""))}else{a.push('{ "id":"'+n.id+'", '+(this._getOpenState(n)==1?' "open":"1", ':"")+(g==n.id?' "select":"1",':"")+' "text":"'+m+'", "im0":"'+n.images[0]+'", "im1":"'+n.images[1]+'", "im2":"'+n.images[2]+'" '+(n.acolor?(', "aCol":"'+n.acolor+'" '):"")+(n.scolor?(', "sCol":"'+n.scolor+'" '):"")+(n.checkstate==1?', "checked":"1" ':(n.checkstate==2?', "checked":"-1"':""))+(n.closeable?', "closeable":"1" ':"")+(((this.XMLsource)&&(n.XMLload==0))?', "child":"1" ':""))}if((this._xuserData)&&(n._userdatalist)){a.push(', "userdata":[');var l=n._userdatalist.split(",");var j=[];for(var c=0;c<l.length;c++){j.push('{ "name":"'+l[c]+'" , "content":"'+n.userData["t_"+l[c]]+'" }')}a.push(j.join(","));a.push("]")}if(n.childsCount){a.push(', "item":[');var j=[];for(var c=0;c<n.childsCount;c++){j.push(this._serializeItemJSON(n.childNodes[c]))}a.push(j.join(","));a.push("]\n")}a.push("}\n");return a.join("")};function dhtmlXTreeFromHTML(obj){if(typeof(obj)!="object"){obj=document.getElementById(obj)}var n=obj;var id=n.id;var cont="";for(var j=0;j<obj.childNodes.length;j++){if(obj.childNodes[j].nodeType=="1"){if(obj.childNodes[j].tagName=="XMP"){var cHead=obj.childNodes[j];for(var m=0;m<cHead.childNodes.length;m++){cont+=cHead.childNodes[m].data}}else{if(obj.childNodes[j].tagName.toLowerCase()=="ul"){cont=dhx_li2trees(obj.childNodes[j],new Array(),0)}}break}}obj.innerHTML="";var t=new dhtmlXTreeObject(obj,"100%","100%",0);var z_all=new Array();for(b in t){z_all[b.toLowerCase()]=b}var atr=obj.attributes;for(var a=0;a<atr.length;a++){if((atr[a].name.indexOf("set")==0)||(atr[a].name.indexOf("enable")==0)){var an=atr[a].name;if(!t[an]){an=z_all[atr[a].name]}t[an].apply(t,atr[a].value.split(","))}}if(typeof(cont)=="object"){t.XMLloadingWarning=1;for(var i=0;i<cont.length;i++){var n=t.insertNewItem(cont[i][0],cont[i][3],cont[i][1]);if(cont[i][2]){t._setCheck(n,cont[i][2])}}t.XMLloadingWarning=0;t.lastLoadedXMLId=0;t._redrawFrom(t)}else{t.loadXMLString("<tree id='0'>"+cont+"</tree>")}window[id]=t;var oninit=obj.getAttribute("oninit");if(oninit){eval(oninit)}return t}function dhx_init_trees(){var c=document.getElementsByTagName("div");for(var a=0;a<c.length;a++){if(c[a].className=="dhtmlxTree"){dhtmlXTreeFromHTML(c[a])}}}function dhx_li2trees(u,n,g){for(var o=0;o<u.childNodes.length;o++){var s=u.childNodes[o];if((s.nodeType==1)&&(s.tagName.toLowerCase()=="li")){var r="";var q=null;var a=s.getAttribute("checked");for(var m=0;m<s.childNodes.length;m++){var l=s.childNodes[m];if(l.nodeType==3){r+=l.data}else{if(l.tagName.toLowerCase()!="ul"){r+=dhx_outer_html(l)}else{q=l}}}n[n.length]=[g,r,a,(s.id||(n.length+1))];if(q){n=dhx_li2trees(q,n,(s.id||n.length))}}}return n}function dhx_outer_html(c){if(c.outerHTML){return c.outerHTML}var a=document.createElement("DIV");a.appendChild(c.cloneNode(true));a=a.innerHTML;return a}if(window.addEventListener){window.addEventListener("load",dhx_init_trees,false)}else{if(window.attachEvent){window.attachEvent("onload",dhx_init_trees)}}var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlx.extend((a||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(c){for(var a=0;a<this.length;a++){if(c==this[a]){return a}}return -1},_dhx_insertAt:function(g,c){this[this.length]=null;for(var a=this.length-1;a>=g;a--){this[a]=this[a-1]}this[g]=c},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,g){var c=this[a];this[a]=this[g];this[g]=c}};function dhtmlXGridObject(id){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(id){if(typeof(id)=="object"){this.entBox=id;if(!this.entBox.id){this.entBox.id="cgrid2_"+this.uid()}}else{this.entBox=document.getElementById(id)}}else{this.entBox=document.createElement("DIV");this.entBox.id="cgrid2_"+this.uid()}this.entBox.innerHTML="";dhx4._eventable(this);var self=this;this._wcorr=0;this.fontWidth=7;this.cell=null;this.row=null;this.iconURL="";this.editor=null;this._f2kE=true;this._dclE=true;this.combos=new Array(0);this.defVal=new Array(0);this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=true;this.xmlLoader=this.doLoadDetails;this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?(this.entBox.style.width||window.getComputedStyle(this.entBox,null)["width"]):(this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0))||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?(this.entBox.style.height||window.getComputedStyle(this.entBox,null)["height"]):(this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0))||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return false};var t_creator=function(name){var t=document.createElement("TABLE");t.cellSpacing=t.cellPadding=0;t.style.cssText="width:100%;table-layout:fixed;";t.className=name.substr(2);return t};this.obj=t_creator("c_obj");this.hdr=t_creator("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow="hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=new Array(0);this.sortImg=document.createElement("DIV");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=(_isIE&&(document.compatMode!="BackCompat")?22:20);this.imgURL=window.dhx_globalImgPath||"";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{if(self.destructor){self.destructor()}}catch(e){}});this.setSkin=function(name){this._srdh=window.dhx4.readFromCss("dhxgrid_rh_"+name)+4;this.skin_name=name;if(this._imgURL){this.setImagePath(this._imgURL)}var classname=this.entBox.className.split(" gridbox")[0];this.entBox.className=classname+" gridbox gridbox_"+name+(_isIE?" isIE":" isModern");this.skin_h_correction=0;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid());this._fixAlterCss();switch(name){case"dhx_terrace":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_skyblue":case"dhx_web":this.forceDivInHeader=true;break}if(_isIE&&this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)}this.setSizes()};if(_isIE){this.preventIECaching(true)}if(window.dhtmlDragAndDropObject){this.dragger=new dhtmlDragAndDropObject()}this._doOnScroll=function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll=function(e,mode){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr){this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft}if(mode){return}if(this._srnd){if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}this._dLoadTimer=window.setTimeout(function(){if(self._update_srnd_view){self._update_srnd_view()}},100)}};this.attachToObject=function(obj){obj.appendChild(this.globalBox?this.globalBox:this.entBox);this.setSizes()};this.init=function(fl){if((this.isTreeGrid())&&(!this._h2)){this._h2=this._createHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}if(!this.skin_name){this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxgrid")||"dhx_skyblue")}this.editStop();this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.cellWidthPX=[];this.cellWidthPC=[];if(this.hdr.rows.length>0){var temp=this.xmlFileUrl;this.clearAll(true);this.xmlFileUrl=temp}var hdrRow=this.hdr.insertRow(0);for(var i=0;i<this.hdrLabels.length;i++){hdrRow.appendChild(document.createElement("TH"));hdrRow.childNodes[i]._cellIndex=i;hdrRow.childNodes[i].style.height="0px"}if(_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined){hdrRow.style.position="absolute"}else{hdrRow.style.height="auto"}var hdrRow=this.hdr.insertRow(_isKHTML?2:1);hdrRow._childIndexes=new Array();var col_ex=0;for(var i=0;i<this.hdrLabels.length;i++){hdrRow._childIndexes[i]=i-col_ex;if((this.hdrLabels[i]==this.splitSign)&&(i!=0)){if(_isKHTML){hdrRow.insertCell(i-col_ex)}hdrRow.cells[i-col_ex-1].colSpan=(hdrRow.cells[i-col_ex-1].colSpan||1)+1;hdrRow.childNodes[i-col_ex-1]._cellIndex++;col_ex++;hdrRow._childIndexes[i]=i-col_ex;continue}hdrRow.insertCell(i-col_ex);hdrRow.childNodes[i-col_ex]._cellIndex=i;hdrRow.childNodes[i-col_ex]._cellIndexS=i;this.setColumnLabel(i,this.hdrLabels[i])}if(col_ex==0){hdrRow._childIndexes=null}this._cCount=this.hdrLabels.length;if(_isIE){window.setTimeout(function(){if(self.setSizes){self.setSizes()}},1)}if(!this.obj.firstChild){this.obj.appendChild(document.createElement("TBODY"))}var tar=this.obj.firstChild;if(!tar.firstChild){tar.appendChild(document.createElement("TR"));tar=tar.firstChild;if(_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined){tar.style.position="absolute"}else{tar.style.height="auto"}for(var i=0;i<this.hdrLabels.length;i++){tar.appendChild(document.createElement("TH"));tar.childNodes[i].style.height="0px"}}this._c_order=null;if(this.multiLine!=true){this.obj.className+=" row20px"}this.sortImg.style.position="absolute";this.sortImg.style.display="none";this.sortImg.className="dhxgrid_sort_desc";this.sortImg.defLeft=0;if(this.noHeader){this.hdrBox.style.display="none"}else{this.noHeader=false}if(this._ivizcol){this.setColHidden()}this.attachHeader();this.attachHeader(0,0,"_aFoot");this.setSizes();if(fl){this.parseXML()}this.obj.scrollTop=0;if(this.dragAndDropOff){this.dragger.addDragLanding(this.entBox,this)}if(this._initDrF){this._initD()}dhx4.callEvent("onGridCreated",[this])};this.setColumnSizes=function(gridWidth){var summ=0;var fcols=[];var fix=0;for(var i=0;i<this._cCount;i++){if((this.initCellWidth[i]=="*")&&!this._hrrar[i]){this._awdth=false;fcols.push(i);continue}if(this.cellWidthType=="%"){if(typeof this.cellWidthPC[i]=="undefined"){this.cellWidthPC[i]=this.initCellWidth[i]}var cwidth=(gridWidth*this.cellWidthPC[i]/100)||0;if(fix>0.5){cwidth++;fix--}var rwidth=this.cellWidthPX[i]=Math.floor(cwidth);var fix=fix+cwidth-rwidth}else{if(typeof this.cellWidthPX[i]=="undefined"){this.cellWidthPX[i]=this.initCellWidth[i]}}if(!this._hrrar[i]){summ+=this.cellWidthPX[i]*1}}if(fcols.length){var ms=Math.floor((gridWidth-summ)/fcols.length);if(ms<0){ms=1}for(var i=0;i<fcols.length;i++){var next=Math.max((this._drsclmW?(this._drsclmW[fcols[i]]||0):0),ms);this.cellWidthPX[fcols[i]]=next;summ+=next}if(gridWidth>summ){var last=fcols[fcols.length-1];this.cellWidthPX[last]=this.cellWidthPX[last]+(gridWidth-summ);summ=gridWidth}this._setAutoResize()}this.obj.style.width=summ+"px";this.hdr.style.width=summ+"px";if(this.ftr){this.ftr.style.width=summ+"px"}this.chngCellWidth();return summ};this.setSizes=function(){if((!this.hdr.rows[0])){return}var quirks=this.quirks=(_isIE&&document.compatMode=="BackCompat");var outerBorder=(this.entBox.offsetWidth-this.entBox.clientWidth)/2;if(!this.dontSetSizes){if(this.globalBox){var splitOuterBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var ow=this.globalBox.clientWidth;this.globalBox.style.width=this._delta_x;this.entBox.style.width=Math.max(0,(this.globalBox.clientWidth+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(ow!=this.globalBox.clientWidth){this._fake._correctSplit(this._fake.entBox.clientWidth)}}if(this._delta_y&&!this._realfake){this.globalBox.style.height=this._delta_y;this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden";this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(quirks?splitOuterBorder*2:0)+"px"}}else{if(this._delta_x){if(this.entBox.parentNode&&this.entBox.parentNode.tagName=="TD"){this.entBox.style.width="1px";this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-outerBorder*2+"px"}else{this.entBox.style.width=this._delta_x}}if(this._delta_y){this.entBox.style.height=this._delta_y}}}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth)){this._sizeTime=window.setTimeout(function(){if(self.setSizes){self.setSizes()}},250);return}var border_x=((!this._wthB)&&((this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);var border_y=((!this._wthB)&&((this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);if(this._sizeFix){border_x-=this._sizeFix;border_y-=this._sizeFix}var isVScroll=this.parentGrid?false:(this.objBox.scrollHeight>this.objBox.offsetHeight);var scrfix=dhtmlx.$customScroll?0:18;var gridWidth=this.entBox.clientWidth-(this.skin_h_correction||0)*(quirks?0:1)-border_x;var gridWidthActive=this.entBox.clientWidth-(this.skin_h_correction||0)-border_x;var gridHeight=this.entBox.clientHeight-border_y;var summ=this.setColumnSizes(gridWidthActive-(isVScroll?scrfix:0)-(this._correction_x||0));var isHScroll=this.parentGrid?false:((this.objBox.scrollWidth>this.objBox.offsetWidth)||(this.objBox.style.overflowX=="scroll"));var headerHeight=this.hdr.clientHeight;var footerHeight=this.ftr?this.ftr.clientHeight:0;var newWidth=gridWidth;var newHeight=gridHeight-headerHeight-footerHeight;if(this._awdth&&this._awdth[0]&&this._awdth[1]==99999){isHScroll=0}if(this._ahgr){if(this._ahgrMA){newHeight=this.entBox.parentNode.clientHeight-headerHeight-footerHeight}else{newHeight=this.obj.offsetHeight+(isHScroll?scrfix:0)+(this._correction_y||0)}if(this._ahgrM){if(this._ahgrF){newHeight=Math.min(this._ahgrM,newHeight+headerHeight+footerHeight)-headerHeight-footerHeight}else{newHeight=Math.min(this._ahgrM,newHeight)}}if(isVScroll&&newHeight>=this.obj.scrollHeight+(isHScroll?scrfix:0)){isVScroll=false;this.setColumnSizes(gridWidthActive-(this._correction_x||0))}}if((this._awdth)&&(this._awdth[0])){if(this.cellWidthType=="%"){this.cellWidthType="px"}if(this._fake){summ+=this._fake.entBox.clientWidth}var newWidth=Math.min(Math.max(summ+(isVScroll?scrfix:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this.objBox.style.overflowX=(!isVScroll&&this.objBox.scrollWidth<=newWidth)?"hidden":"auto";if(this._fake){newWidth-=this._fake.entBox.clientWidth}}newHeight=Math.max(0,newHeight);this._ff_size_delta=(this._ff_size_delta==0.1)?0.2:0.1;if(!_isFF){this._ff_size_delta=0}if(!this.dontSetSizes){this.entBox.style.width=Math.max(0,newWidth+(quirks?2:0)*outerBorder+this._ff_size_delta)+"px";this.entBox.style.height=newHeight+(quirks?2:0)*outerBorder+headerHeight+footerHeight+"px"}this.objBox.style.height=newHeight+((quirks&&!isVScroll)?2:0)*outerBorder+"px";this.hdrBox.style.height=headerHeight+"px";if(newHeight!=gridHeight){this.doOnScroll(0,!this._srnd)}var ext=this["setSizes_"+this.skin_name];if(ext){ext.call(this)}this.setSortImgPos();if(headerHeight!=this.hdr.clientHeight&&this._ahgr){this.setSizes()}this.callEvent("onSetSizes",[])};this.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;i<l;i++){this.hdr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px";this.obj.rows[0].childNodes[i].style.width=this.cellWidthPX[i]+"px";if(this.ftr){this.ftr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px"}}};this.setDelimiter=function(delim){this.delim=delim};this.setInitWidthsP=function(wp){this.cellWidthType="%";this.initCellWidth=wp.split(this.delim.replace(/px/gi,""));if(!arguments[1]){this._setAutoResize()}};this._setAutoResize=function(){if(this._realfake){return}var el=window;var self=this;dhtmlxEvent(window,"resize",function(){window.clearTimeout(self._resize_timer);if(self._setAutoResize){self._resize_timer=window.setTimeout(function(){if(self.setSizes){self.setSizes()}if(self._fake){self._fake._correctSplit()}},100)}})};this.setInitWidths=function(wp){this.cellWidthType="px";this.initCellWidth=wp.split(this.delim);if(_isFF){for(var i=0;i<this.initCellWidth.length;i++){if(this.initCellWidth[i]!="*"){this.initCellWidth[i]=parseInt(this.initCellWidth[i])}}}};this.enableMultiline=function(state){this.multiLine=dhx4.s2b(state)};this.enableMultiselect=function(state){this.selMultiRows=dhx4.s2b(state)};this.setImagePath=function(path){path=path.replace(/imgs\/dhxgrid_[a-z]*\/$/,"imgs/");this._imgURL=path;this.imgURL=path+"dhxgrid_"+(this.skin_name||"dhx_skyblue").replace("dhx_","")+"/";this.iconTree=this.imgURL+"tree/"};this.setImagesPath=this.setImagePath;this.setIconPath=function(path){this.iconURL=path};this.setIconsPath=this.setIconPath;this.changeCursorState=function(ev){var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}if(!el){return}if((el.tagName=="TD")&&(this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return el.style.cursor="default"}var check=(ev.layerX||0)+(((!_isIE)&&(ev.target.tagName=="DIV"))?el.offsetLeft:0);if((el.offsetWidth-(ev.offsetX||(parseInt(this.getPosition(el,this.hdrBox))-check)*-1))<(_isOpera?20:10)){el.style.cursor="E-resize"}else{el.style.cursor="default"}if(_isOpera){this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this.startColResize=function(ev){if(this.resized){this.stopColResize()}this.resized=null;var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}var x=ev.clientX;var tabW=this.hdr.offsetWidth;var startW=parseInt(el.offsetWidth);if(el.tagName=="TD"&&el.style.cursor!="default"){if((this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return}self._old_d_mm=document.body.onmousemove;self._old_d_mu=document.body.onmouseup;document.body.onmousemove=function(e){if(self){self.doColResize(e||window.event,el,startW,x,tabW)}};document.body.onmouseup=function(){if(self){self.stopColResize()}}}};this.stopColResize=function(){document.body.onmousemove=self._old_d_mm||"";document.body.onmouseup=self._old_d_mu||"";this.setSizes();this.doOnScroll(0,1);this.callEvent("onResizeEnd",[this])};this.doColResize=function(ev,el,startW,x,tabW){el.style.cursor="E-resize";this.resized=el;var fcolW=startW+(ev.clientX-x);var wtabW=tabW+(ev.clientX-x);if(!(this.callEvent("onResize",[el._cellIndex,fcolW,this]))){return}if(_isIE){this.objBox.scrollLeft=this.hdrBox.scrollLeft}var result=false;if(el.colSpan>1){var a_sizes=new Array();for(var i=0;i<el.colSpan;i++){a_sizes[i]=Math.round(fcolW*this.hdr.rows[0].childNodes[el._cellIndexS+i].offsetWidth/el.offsetWidth)}for(var i=0;i<el.colSpan;i++){result=this._setColumnSizeR(el._cellIndexS+i*1,a_sizes[i])}}else{result=this._setColumnSizeR(el._cellIndex,fcolW)}this.doOnScroll(0,1);this.setSizes();if(this._fake&&this._awdth){this._fake._correctSplit()}return result};this._setColumnSizeR=function(ind,fcolW){if(fcolW>((this._drsclmW&&!this._notresize)?(this._drsclmW[ind]||10):10)){this.obj.rows[0].childNodes[ind].style.width=fcolW+"px";this.hdr.rows[0].childNodes[ind].style.width=fcolW+"px";if(this.ftr){this.ftr.rows[0].childNodes[ind].style.width=fcolW+"px"}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=fcolW}else{var gridWidth=parseInt(this.entBox.offsetWidth);if(this.objBox.scrollHeight>this.objBox.offsetHeight){gridWidth-=17}var pcWidth=Math.round(fcolW/gridWidth*100);this.cellWidthPC[ind]=pcWidth}if(this.sortImg.style.display!="none"){this.setSortImgPos()}}else{return false}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!dhx4.s2b(state)){this.sortImg.style.display="none";this.fldSorted=this.r_fldSorted=null;return}if(order=="asc"){this.sortImg.className="dhxgrid_sort_asc"}else{this.sortImg.className="dhxgrid_sort_desc"}this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[ind];var r=this.hdr.rows[row||1];if(!r){return}for(var i=0;i<r.childNodes.length;i++){if(r.childNodes[i]._cellIndexS==ind){this.r_fldSorted=r.childNodes[i];return this.setSortImgPos()}}return this.setSortImgState(state,ind,order,(row||1)+1)};this.setSortImgPos=function(ind,mode,hRowInd,el){if(this._hrrar&&this._hrrar[this.r_fldSorted?this.r_fldSorted._cellIndex:ind]){return}if(!el){if(!ind){var el=this.r_fldSorted}else{var el=this.hdr.rows[hRowInd||0].cells[ind]}}if(el!=null){var pos=this.getPosition(el,this.hdrBox);var wdth=el.offsetWidth;this.sortImg.style.left=Number(pos[0]+wdth-13)+"px";this.sortImg.defLeft=parseInt(this.sortImg.style.left);this.sortImg.style.top=Number(pos[1]+5)+"px";if((!this.useImagesInHeader)&&(!mode)){this.sortImg.style.display="inline"}this.sortImg.style.left=this.sortImg.defLeft+"px"}};this.setActive=function(fl){if(arguments.length==0){var fl=true}if(fl==true){if(globalActiveDHTMLGridObject&&(globalActiveDHTMLGridObject!=this)){globalActiveDHTMLGridObject.editStop();globalActiveDHTMLGridObject.callEvent("onBlur",[globalActiveDHTMLGridObject])}globalActiveDHTMLGridObject=this;this.isActive=true}else{this.isActive=false;this.callEvent("onBlur",[this])}};this._doClick=function(ev){var selMethod=0;var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(!el||!el.parentNode||!el.parentNode.idd){return}var fl=true;if(this.markedCells){var markMethod=0;if(ev.shiftKey||ev.metaKey){markMethod=1}if(ev.ctrlKey){markMethod=2}this.doMark(el,markMethod);return true}if(this.selMultiRows!=false){if(ev.shiftKey&&this.row!=null&&this.selectedRows.length){selMethod=1}if(ev.ctrlKey||ev.metaKey){selMethod=2}}return this.doClick(el,fl,selMethod,false)};this._doContClick=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if((!el)||(typeof(el.parentNode.idd)=="undefined")){this.callEvent("onEmptyClick",[ev]);return true}if(ev.button==2||(_isMacOS&&ev.ctrlKey)){if(!this.callEvent("onRightClick",[el.parentNode.idd,el._cellIndex,ev])){var z=function(e){(e||event).cancelBubble=true;return false};(ev.srcElement||ev.target).oncontextmenu=z;return z(ev)}if(this._ctmndx){if(!(this.callEvent("onBeforeContextMenu",[el.parentNode.idd,el._cellIndex,this]))){return true}if(_isIE){ev.srcElement.oncontextmenu=function(){event.cancelBubble=true;return false}}if(this._ctmndx.showContextMenu){var dEl0=window.document.documentElement;var dEl1=window.document.body;var corrector=new Array((dEl0.scrollLeft||dEl1.scrollLeft),(dEl0.scrollTop||dEl1.scrollTop));if(_isIE){var x=ev.clientX+corrector[0];var y=ev.clientY+corrector[1]}else{var x=ev.pageX;var y=ev.pageY}this._ctmndx.showContextMenu(x-1,y-1);this.contextID=this._ctmndx.contextMenuZoneId=el.parentNode.idd+"_"+el._cellIndex;this._ctmndx._skip_hide=true}else{el.contextMenuId=el.parentNode.idd+"_"+el._cellIndex;el.contextMenu=this._ctmndx;el.a=this._ctmndx._contextStart;el.a(el,ev);el.a=null}ev.cancelBubble=true;return false}}else{if(this._ctmndx){if(this._ctmndx.hideContextMenu){this._ctmndx.hideContextMenu()}else{this._ctmndx._contextEnd()}}}return true};this.doClick=function(el,fl,selMethod,show){if(!this.selMultiRows){selMethod=0}var psid=this.row?this.row.idd:0;this.setActive(true);if(!selMethod){selMethod=0}if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"")}if(el.tagName=="TD"){if(this.checkEvent("onSelectStateChanged")){var initial=this.getSelectedId()}var prow=this.row;if(selMethod==1){var elRowIndex=this.rowsCol._dhx_find(el.parentNode);var lcRowIndex=this.rowsCol._dhx_find(this.lastClicked);if(elRowIndex>lcRowIndex){var strt=lcRowIndex;var end=elRowIndex}else{var strt=elRowIndex;var end=lcRowIndex}for(var i=0;i<this.rowsCol.length;i++){if((i>=strt&&i<=end)){if(this.rowsCol[i]&&(!this.rowsCol[i]._sRow)){if(this.rowsCol[i].className.indexOf("rowselected")==-1&&(this.callEvent("onBeforeSelect",[this.rowsCol[i].idd,psid,el._cellIndex]))){this.rowsCol[i].className+=" rowselected";this.selectedRows[this.selectedRows.length]=this.rowsCol[i]}}else{this.clearSelection();return this.doClick(el,fl,0,show)}}}}else{if(selMethod==2){if(el.parentNode.className.indexOf("rowselected")!=-1){el.parentNode.className=el.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode));var skipRowSelection=true;show=false}}}this.editStop();if(typeof(el.parentNode.idd)=="undefined"){return true}if((!skipRowSelection)&&(!el.parentNode._sRow)){if(this.callEvent("onBeforeSelect",[el.parentNode.idd,psid,el._cellIndex])){if(this.getSelectedRowId()!=el.parentNode.idd){if(selMethod==0){this.clearSelection()}this.cell=el;if((prow==el.parentNode)&&(this._chRRS)){fl=false}this.row=el.parentNode;this.row.className+=" rowselected";if(this.selectedRows._dhx_find(this.row)==-1){this.selectedRows[this.selectedRows.length]=this.row}}else{this.cell=el;this.row=el.parentNode}}else{fl=false}}if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1){this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"}if(selMethod!=1){if(!this.row){return}}this.lastClicked=el.parentNode;var rid=this.row.idd;var cid=this.cell;if(fl&&typeof(rid)!="undefined"&&cid&&!skipRowSelection){self.onRowSelectTime=setTimeout(function(){if(self.callEvent){self.callEvent("onRowSelect",[rid,cid._cellIndex])}},100)}else{this.callEvent("onRowSelectRSOnly",[rid])}if(this.checkEvent("onSelectStateChanged")){var afinal=this.getSelectedId();if(initial!=afinal){this.callEvent("onSelectStateChanged",[afinal,initial])}}if(skipRowSelection){return false}}this.isActive=true;if(show!==false&&this.cell&&this.cell.parentNode.idd){this.moveToVisible(this.cell)}};this.selectAll=function(){this.clearSelection();var coll=this.rowsBuffer;if(this.pagingOn){coll=this.rowsCol}for(var i=0;i<coll.length;i++){this.render_row(i).className+=" rowselected"}this.selectedRows=dhtmlxArray([].concat(coll));if(this.selectedRows.length){this.row=this.selectedRows[0];this.cell=this.row.cells[0]}if((this._fake)&&(!this._realfake)){this._fake.selectAll()}};this.selectCell=function(r,cInd,fl,preserve,edit,show){if(!fl){fl=false}if(typeof(r)!="object"){r=this.render_row(r)}if(!r||r==-1){return null}if(r._childIndexes){var c=r.childNodes[r._childIndexes[cInd]]}else{var c=r.childNodes[cInd]}if(!c){c=r.childNodes[0]}if(!this.markedCells){if(preserve){this.doClick(c,fl,3,show)}else{this.doClick(c,fl,0,show)}}else{this.doMark(c,preserve?2:0)}if(edit){this.editCell()}};this.moveToVisible=function(cell_obj,onlyVScroll){if(this.pagingOn){var newPage=Math.floor(this.getRowIndex(cell_obj.parentNode.idd)/this.rowsBufferOutSize)+1;if(newPage!=this.currentPage){this.changePage(newPage)}}try{if(cell_obj.offsetHeight){var distance=cell_obj.offsetLeft+cell_obj.offsetWidth+20;var scrollLeft=0;if(distance>(this.objBox.offsetWidth+this.objBox.scrollLeft)){if(cell_obj.offsetLeft>this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-(this.objBox.offsetWidth-cell_obj.offsetWidth)+5}}else{if(cell_obj.offsetLeft<this.objBox.scrollLeft){distance-=cell_obj.offsetWidth*2/3;if(distance<this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-5}}}if((scrollLeft)&&(!onlyVScroll)){this.objBox.scrollLeft=scrollLeft}}if(!cell_obj.offsetHeight){var mask=this._realfake?this._fake.rowsAr[cell_obj.parentNode.idd]:cell_obj.parentNode;distance=this.rowsBuffer._dhx_find(mask)*this._srdh}else{distance=cell_obj.offsetTop}var distancemax=distance+cell_obj.offsetHeight+38;if(distancemax>(this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop=distance}else{if(distance<this.objBox.scrollTop){var scrollTop=distance-5}}if(scrollTop){this.objBox.scrollTop=scrollTop}}catch(er){}};this.editCell=function(){if(this.editor&&this.cell==this.editor.cell){return}this.editStop();if((this.isEditable!=true)||(!this.cell)){return false}var c=this.cell;if(c.parentNode._locked){return false}this.editor=this.cells4(c);if(this.editor!=null){if(this.editor.isDisabled()){this.editor=null;return false}if(this.callEvent("onEditCell",[0,this.row.idd,this.cell._cellIndex])!=false&&this.editor.edit){this._Opera_stop=(new Date).valueOf();c.className+=" editable";this.editor.edit();this.callEvent("onEditCell",[1,this.row.idd,this.cell._cellIndex])}else{this.editor=null}}};this.editStop=function(mode){if(_isOpera){if(this._Opera_stop){if((this._Opera_stop*1+50)>(new Date).valueOf()){return}this._Opera_stop=null}}if(this.editor&&this.editor!=null){this.editor.cell.className=this.editor.cell.className.replace("editable","");if(mode){var t=this.editor.val;this.editor.detach();this.editor.setValue(t);this.editor=null;this.callEvent("onEditCancel",[this.row.idd,this.cell._cellIndex,t]);return}if(this.editor.detach()){this.cell.wasChanged=true}var g=this.editor;if(g==null){return}this.editor=null;var z=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,g.getValue(),g.val]);if((typeof(z)=="string")||(typeof(z)=="number")){g[g.setImage?"setLabel":"setValue"](z)}else{if(!z){g[g.setImage?"setLabel":"setValue"](g.val)}}if(this._ahgr&&this.multiLine){this.setSizes()}}};this._nextRowCell=function(row,dir,pos){row=this._nextRow((this._groups?this.rowsCol:this.rowsBuffer)._dhx_find(row),dir);if(!row){return null}return row.childNodes[row._childIndexes?row._childIndexes[pos]:pos]};this._getNextCell=function(acell,dir,i){acell=acell||this.cell;var arow=acell.parentNode;if(this._tabOrder){i=this._tabOrder[acell._cellIndex];if(typeof i!="undefined"){if(i<0){acell=this._nextRowCell(arow,dir,Math.abs(i)-1)}else{acell=arow.childNodes[i]}}}else{var i=acell._cellIndex+dir;if(i>=0&&i<this._cCount){if(arow._childIndexes){i=arow._childIndexes[acell._cellIndex]+dir}acell=arow.childNodes[i]}else{acell=this._nextRowCell(arow,dir,(dir==1?0:(this._cCount-1)))}}if(!acell){if((dir==1)&&this.tabEnd){this.tabEnd.focus();this.tabEnd.focus();this.setActive(false)}if((dir==-1)&&this.tabStart){this.tabStart.focus();this.tabStart.focus();this.setActive(false)}return null}if(acell.style.display!="none"&&(!this.smartTabOrder||!this.cells(acell.parentNode.idd,acell._cellIndex).isDisabled())){return acell}return this._getNextCell(acell,dir)};this._nextRow=function(ind,dir){var r=this.render_row(ind+dir);if(!r||r==-1){return null}if(r&&r.style.display=="none"){return this._nextRow(ind+dir,dir)}return r};this.scrollPage=function(dir){if(!this.rowsBuffer.length){return}var master=this._realfake?this._fake:this;var new_ind=Math.floor((master._r_select||this.getRowIndex(this.row.idd)||0)+(dir)*this.objBox.offsetHeight/(this._srdh||20));if(new_ind<0){new_ind=0}if(new_ind>=this.rowsBuffer.length){new_ind=this.rowsBuffer.length-1}if(this._srnd&&!this.rowsBuffer[new_ind]){this.objBox.scrollTop+=Math.floor((dir)*this.objBox.offsetHeight/(this._srdh||20))*(this._srdh||20);if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}master._r_select=new_ind}else{this.selectCell(new_ind,this.cell._cellIndex,true,false,false,(this.multiLine||this._srnd));if(!this.multiLine&&!this._srnd&&!this._realfake){this.objBox.scrollTop=this.getRowById(this.getRowId(new_ind)).offsetTop;if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}}master._r_select=null}};this.doKey=function(ev){if(!ev){return true}if((ev.target||ev.srcElement).value!==window.undefined){var zx=(ev.target||ev.srcElement);if(zx.className!="dhxcombo_input"&&((!zx.parentNode)||(zx.parentNode.className.indexOf("editable")==-1))){return true}}if((globalActiveDHTMLGridObject)&&(this!=globalActiveDHTMLGridObject)){return globalActiveDHTMLGridObject.doKey(ev)}if(this.isActive==false){return true}if(this._htkebl){return true}if(!this.callEvent("onKeyPress",[ev.keyCode,ev.ctrlKey,ev.shiftKey,ev])){return false}var code="k"+ev.keyCode+"_"+(ev.ctrlKey?1:0)+"_"+(ev.shiftKey?1:0);if(this.cell){if(this._key_events[code]){if(false===this._key_events[code].call(this)){return true}if(ev.preventDefault){ev.preventDefault()}ev.cancelBubble=true;return false}if(this._key_events.k_other){this._key_events.k_other.call(this,ev)}}return true};this.selectRow=function(r,fl,preserve,show){if(typeof(r)!="object"){r=this.render_row(r)}this.selectCell(r,0,fl,preserve,false,show)};this.wasDblClicked=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(el){var rowId=el.parentNode.idd;return this.callEvent("onRowDblClicked",[rowId,el._cellIndex,ev])}};this._onHeaderClick=function(e,el){var that=this.grid;el=el||that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");if(this.grid.resized==null){if(!(this.grid.callEvent("onHeaderClick",[el._cellIndexS,(e||window.event)]))){return false}that.sortField(el._cellIndexS,false,el)}this.grid.resized=null};this.deleteSelectedRows=function(){var num=this.selectedRows.length;if(num==0){return}var tmpAr=this.selectedRows;this.selectedRows=dhtmlxArray();for(var i=num-1;i>=0;i--){var node=tmpAr[i];if(!this.deleteRow(node.idd,node)){this.selectedRows[this.selectedRows.length]=node}else{if(node==this.row){var ind=i}}}if(ind){try{if(ind+1>this.rowsCol.length){ind--}this.selectCell(ind,0,true)}catch(er){this.row=null;this.cell=null}}};this.getSelectedRowId=function(){var selAr=new Array(0);var uni={};for(var i=0;i<this.selectedRows.length;i++){var id=this.selectedRows[i].idd;if(uni[id]){continue}selAr[selAr.length]=id;uni[id]=true}if(selAr.length==0){return null}else{return selAr.join(this.delim)}};this.getSelectedCellIndex=function(){if(this.cell!=null){return this.cell._cellIndex}else{return -1}};this.getColWidth=function(ind){return parseInt(this.cellWidthPX[ind])};this.setColWidth=function(ind,value){if(value=="*"){this.initCellWidth[ind]="*"}else{if(this._hrrar[ind]){return}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=parseInt(value)}else{this.cellWidthPC[ind]=parseInt(value)}}this.setSizes()};this.getRowIndex=function(row_id){for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]&&this.rowsBuffer[i].idd==row_id){return i}}return -1};this.getRowId=function(ind){return this.rowsBuffer[ind]?this.rowsBuffer[ind].idd:this.undefined};this.setRowId=function(ind,row_id){this.changeRowId(this.getRowId(ind),row_id)};this.changeRowId=function(oldRowId,newRowId){if(oldRowId==newRowId){return}var row=this.rowsAr[oldRowId];row.idd=newRowId;if(this.UserData[oldRowId]){this.UserData[newRowId]=this.UserData[oldRowId];this.UserData[oldRowId]=null}if(this._h2&&this._h2.get[oldRowId]){this._h2.get[newRowId]=this._h2.get[oldRowId];this._h2.get[newRowId].id=newRowId;delete this._h2.get[oldRowId]}this.rowsAr[oldRowId]=null;this.rowsAr[newRowId]=row;for(var i=0;i<row.childNodes.length;i++){if(row.childNodes[i]._code){row.childNodes[i]._code=this._compileSCL(row.childNodes[i]._val,row.childNodes[i])}}if(this._mat_links&&this._mat_links[oldRowId]){var a=this._mat_links[oldRowId];delete this._mat_links[oldRowId];for(var c in a){for(var i=0;i<a[c].length;i++){this._compileSCL(a[c][i].original,a[c][i])}}}this.callEvent("onRowIdChange",[oldRowId,newRowId])};this.setColumnIds=function(ids){this.columnIds=ids.split(this.delim)};this.setColumnId=function(ind,id){this.columnIds[ind]=id};this.getColIndexById=function(id){for(var i=0;i<this.columnIds.length;i++){if(this.columnIds[i]==id){return i}}};this.getColumnId=function(cin){return this.columnIds[cin]};this.getColumnLabel=function(cin,ind,hdr){var z=(hdr||this.hdr).rows[(ind||0)+1];for(var i=0;i<z.cells.length;i++){if(z.cells[i]._cellIndexS==cin){return(_isIE?z.cells[i].innerText:z.cells[i].textContent)}}return""};this.getColLabel=this.getColumnLabel;this.getFooterLabel=function(cin,ind){return this.getColumnLabel(cin,ind,this.ftr)};this.setRowTextBold=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="bold"}};this.setRowTextStyle=function(row_id,styleString){var r=this.getRowById(row_id);if(!r){return}for(var i=0;i<r.childNodes.length;i++){var pfix=r.childNodes[i]._attrs.style||"";if((this._hrrar)&&(this._hrrar[i])){pfix="display:none;"}if(_isIE){r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}else{r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}}};this.setRowColor=function(row_id,color){var r=this.getRowById(row_id);for(var i=0;i<r.childNodes.length;i++){r.childNodes[i].bgColor=color}};this.setCellTextStyle=function(row_id,ind,styleString){var r=this.getRowById(row_id);if(!r){return}var cell=r.childNodes[r._childIndexes?r._childIndexes[ind]:ind];if(!cell){return}var pfix="";if((this._hrrar)&&(this._hrrar[ind])){pfix="display:none;"}if(_isIE){cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}else{cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}};this.setRowTextNormal=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="normal"}};this.doesRowExist=function(row_id){if(this.getRowById(row_id)!=null){return true}else{return false}};this.getColumnsNum=function(){return this._cCount};this.moveRowUp=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,-1)}var rInd=this.rowsCol._dhx_find(r);if((r.previousSibling)&&(rInd!=0)){r.parentNode.insertBefore(r,r.previousSibling);this.rowsCol._dhx_swapItems(rInd,rInd-1);this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd-1);if(this._cssEven){this._fixAlterCss(rInd-1)}}};this.moveRowDown=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,1)}var rInd=this.rowsCol._dhx_find(r);if(r.nextSibling){this.rowsCol._dhx_swapItems(rInd,rInd+1);if(r.nextSibling.nextSibling){r.parentNode.insertBefore(r,r.nextSibling.nextSibling)}else{r.parentNode.appendChild(r)}this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd+1);if(this._cssEven){this._fixAlterCss(rInd)}}};this.getCombo=function(col_ind){if(!this.combos[col_ind]){this.combos[col_ind]=new dhtmlXGridComboObject()}return this.combos[col_ind]};this.setUserData=function(row_id,name,value){if(!row_id){row_id="gridglobaluserdata"}if(!this.UserData[row_id]){this.UserData[row_id]=new Hashtable()}this.UserData[row_id].put(name,value)};this.getUserData=function(row_id,name){if(!row_id){row_id="gridglobaluserdata"}this.getRowById(row_id);var z=this.UserData[row_id];return(z?z.get(name):"")};this.setEditable=function(fl){this.isEditable=dhx4.s2b(fl)};this.selectRowById=function(row_id,multiFL,show,call){if(!call){call=false}this.selectCell(this.getRowById(row_id),0,call,multiFL,false,show)};this.clearSelection=function(){this.editStop();for(var i=0;i<this.selectedRows.length;i++){var r=this.rowsAr[this.selectedRows[i].idd];if(r){r.className=r.className.replace(/rowselected/g,"")}}this.selectedRows=dhtmlxArray();this.row=null;if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"");this.cell=null}this.callEvent("onSelectionCleared",[])};this.copyRowContent=function(from_row_id,to_row_id){var frRow=this.getRowById(from_row_id);if(!this.isTreeGrid()){for(var i=0;i<frRow.cells.length;i++){this.cells(to_row_id,i).setValue(this.cells(from_row_id,i).getValue())}}else{this._copyTreeGridRowContent(frRow,from_row_id,to_row_id)}if(!_isIE){this.getRowById(from_row_id).cells[0].height=frRow.cells[0].offsetHeight}};this.setFooterLabel=function(c,label,ind){return this.setColumnLabel(c,label,ind,this.ftr)};this.setColumnLabel=function(c,label,ind,hdr){var z=(hdr||this.hdr).rows[ind||1];var col=(z._childIndexes?z._childIndexes[c]:c);if(!z.cells[col]){return}if(!this.useImagesInHeader){var hdrHTML="<div class='hdrcell'>";if(label.indexOf("img:[")!=-1){var imUrl=label.replace(/.*\[([^>]+)\].*/,"$1");label=label.substr(label.indexOf("]")+1,label.length);hdrHTML+="<img width='18px' height='18px' align='absmiddle' src='"+imUrl+"' hspace='2'>"}hdrHTML+=label;hdrHTML+="</div>";z.cells[col].innerHTML=hdrHTML;if(this._hstyles[col]){z.cells[col].style.cssText=this._hstyles[col]}}else{z.cells[col].style.textAlign="left";z.cells[col].innerHTML="<img src='"+label+"'>";var a=new Image();a.src=""+label.replace(/(\.[a-z]+)/,".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=a;var b=new Image();b.src=""+label.replace(/(\.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]=b}if((label||"").indexOf("#")!=-1){var t=label.match(/(^|{)#([^}]+)(}|$)/);if(t){var tn="_in_header_"+t[2];if(this[tn]){this[tn]((this.forceDivInHeader?z.cells[col].firstChild:z.cells[col]),col,label.split(t[0]))}}}};this.setColLabel=function(a,b,ind,c){return this.setColumnLabel(a,b,(ind||0)+1,c)};this.clearAll=function(header){if(!this.obj.rows[0]){return}if(this._h2){this._h2=this._createHierarchy();if(this._fake){if(this._realfake){this._h2=this._fake._h2}else{this._fake._h2=this._h2}}}this.limit=this._limitC=0;this.editStop(true);if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}if(this._dload){this.objBox.scrollTop=0;this.limit=this._limitC||0;this._initDrF=true}var len=this.rowsCol.length;len=this.obj.rows.length;for(var i=len-1;i>0;i--){var t_r=this.obj.rows[i];t_r.parentNode.removeChild(t_r)}if(header){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(var i=this.hdr.rows.length-1;i>=0;i--){var t_r=this.hdr.rows[i];t_r.parentNode.removeChild(t_r)}if(this.ftr){this.ftr.parentNode.removeChild(this.ftr);this.ftr=null}this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.row=null;this.cell=null;this.rowsCol=dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd){this.xmlFileUrl=""}if(this.pagingOn){this.changePage(1)}if(this._contextCallTimer){window.clearTimeout(this._contextCallTimer)}if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;this.setSortImgState(false);this.setSizes();this.callEvent("onClearAll",[])};this.sortField=function(ind,repeatFl,r_el){if(this.getRowsNum()==0){return false}var el=this.hdr.rows[0].cells[ind];if(!el){return}if(el.tagName=="TH"&&(this.fldSort.length-1)>=el._cellIndex&&this.fldSort[el._cellIndex]!="na"){var data=this.getSortingState();var sortType=(data[0]==ind&&data[1]=="asc")?"des":"asc";if(!this.callEvent("onBeforeSorting",[ind,this.fldSort[ind],sortType])){return}this.sortImg.className="dhxgrid_sort_"+(sortType=="asc"?"asc":"desc");if(this.useImagesInHeader){var cel=this.hdr.rows[1].cells[el._cellIndex].firstChild;if(this.fldSorted!=null){var celT=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;celT.src=celT.src.replace(/(\.asc\.)|(\.des\.)/,".")}cel.src=cel.src.replace(/(\.[a-z]+)$/,"."+sortType+"$1")}this.sortRows(el._cellIndex,this.fldSort[el._cellIndex],sortType);this.fldSorted=el;this.r_fldSorted=r_el;var c=this.hdr.rows[1];var c=r_el.parentNode;var real_el=c._childIndexes?c._childIndexes[el._cellIndex]:el._cellIndex;this.setSortImgPos(false,false,false,r_el)}};this.setCustomSorting=function(func,col){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[col]=(typeof(func)=="string")?eval(func):func;this.fldSort[col]="cus"};this.enableHeaderImages=function(fl){this.useImagesInHeader=fl};this.setHeader=function(hdrStr,splitSign,styles){if(typeof(hdrStr)!="object"){var arLab=this._eSplit(hdrStr)}else{arLab=[].concat(hdrStr)}var arWdth=new Array(0);var arTyp=new dhtmlxArray(0);var arAlg=new Array(0);var arVAlg=new Array(0);var arSrt=new Array(0);for(var i=0;i<arLab.length;i++){arWdth[arWdth.length]=Math.round(100/arLab.length);arTyp[arTyp.length]="ed";arAlg[arAlg.length]="left";arVAlg[arVAlg.length]="middle";arSrt[arSrt.length]="na"}this.splitSign=splitSign||"#cspan";this.hdrLabels=arLab;this.cellWidth=arWdth;if(!this.initCellWidth.length){this.setInitWidthsP(arWdth.join(this.delim),true)}this.cellType=arTyp;this.cellAlign=arAlg;this.cellVAlign=arVAlg;this.fldSort=arSrt;this._hstyles=styles||[]};this._eSplit=function(str){if(![].push){return str.split(this.delim)}var a="r"+(new Date()).valueOf();var z=this.delim.replace(/([\|\+\*\^])/g,"\\$1");return(str||"").replace(RegExp(z,"g"),a).replace(RegExp("\\\\"+a,"g"),this.delim).split(a)};this.getColType=function(cInd){return this.cellType[cInd]};this.getColTypeById=function(cID){return this.cellType[this.getColIndexById(cID)]};this.setColTypes=function(typeStr){this.cellType=dhtmlxArray(typeStr.split(this.delim));this._strangeParams=new Array();for(var i=0;i<this.cellType.length;i++){if((this.cellType[i].indexOf("[")!=-1)){var z=this.cellType[i].split(/[\[\]]+/g);this.cellType[i]=z[0];this.defVal[i]=z[1];if(z[1].indexOf("=")==0){this.cellType[i]="math";this._strangeParams[i]=z[0]}}if(!window["eXcell_"+this.cellType[i]]){dhx4.callEvent("onConfigurationError",["Incorrect cell type: "+this.cellType[i],this,this.cellType[i]])}}};this.setColSorting=function(sortStr){this.fldSort=sortStr.split(this.delim);var check={str:1,"int":1,date:1};for(var i=0;i<this.fldSort.length;i++){if((!check[this.fldSort[i]])&&(typeof(window[this.fldSort[i]])=="function")){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[i]=window[this.fldSort[i]];this.fldSort[i]="cus"}}};this.setColAlign=function(alStr){this.cellAlign=alStr.split(this.delim);for(var i=0;i<this.cellAlign.length;i++){this.cellAlign[i]=this.cellAlign[i]._dhx_trim()}};this.setColVAlign=function(valStr){this.cellVAlign=valStr.split(this.delim)};this.setNoHeader=function(fl){this.noHeader=dhx4.s2b(fl)};this.showRow=function(rowID){this.getRowById(rowID);if(this._h2){this.openItem(this._h2.get[rowID].parent.id)}var c=this.getRowById(rowID).childNodes[0];while(c&&c.style.display=="none"){c=c.nextSibling}if(c){this.moveToVisible(c,true)}};this.setStyle=function(ss_header,ss_grid,ss_selCell,ss_selRow){this.ssModifier=[ss_header,ss_grid,ss_selCell,ss_selCell,ss_selRow];var prefs=["#"+this.entBox.id+" table.hdr td","#"+this.entBox.id+" table.obj td","#"+this.entBox.id+" table.obj tr.rowselected td.cellselected","#"+this.entBox.id+" table.obj td.cellselected","#"+this.entBox.id+" table.obj tr.rowselected td"];var index=0;while(!_isIE){try{var temp=document.styleSheets[index].cssRules.length}catch(e){index++;continue}break}for(var i=0;i<prefs.length;i++){if(this.ssModifier[i]){if(_isIE){document.styleSheets[0].addRule(prefs[i],this.ssModifier[i])}else{document.styleSheets[index].insertRule(prefs[i]+(" { "+this.ssModifier[i]+" }"),document.styleSheets[index].cssRules.length)}}}};this.setColumnColor=function(clr){this.columnColor=clr.split(this.delim)};this.enableAlterCss=function(cssE,cssU,perLevel,levelUnique){if(cssE||cssU){this.attachEvent("onGridReconstructed",function(){this._fixAlterCss();if(this._fake){this._fake._fixAlterCss()}})}this._cssSP=perLevel;this._cssSU=levelUnique;this._cssEven=cssE;this._cssUnEven=cssU};this._fixAlterCss=function(ind){if(this._h2&&(this._cssSP||this._cssSU)){return this._fixAlterCssTGR(ind)}if(!this._cssEven&&!this._cssUnEven){return}ind=ind||0;var j=ind;for(var i=ind;i<this.rowsCol.length;i++){if(!this.rowsCol[i]){continue}if(this.rowsCol[i].style.display!="none"){if(this.rowsCol[i]._cntr){j=1;continue}if(this.rowsCol[i].className.indexOf("rowselected")!=-1){if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" rowselected "+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" rowselected "+(this.rowsCol[i]._css||"")}}else{if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" "+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" "+(this.rowsCol[i]._css||"")}}j++}}};this.clearChangedState=function(){for(var i=0;i<this.rowsCol.length;i++){var row=this.rowsCol[i];if(row&&row.childNodes){var cols=row.childNodes.length;for(var j=0;j<cols;j++){row.childNodes[j].wasChanged=false}}}};this.getChangedRows=function(and_added){var res=new Array();this.forEachRow(function(id){var row=this.rowsAr[id];if(row.tagName!="TR"){return}var cols=row.childNodes.length;if(and_added&&row._added){res[res.length]=row.idd}else{for(var j=0;j<cols;j++){if(row.childNodes[j].wasChanged){res[res.length]=row.idd;break}}}});return res.join(this.delim)};this._sUDa=false;this._sAll=false;this.setSerializationLevel=function(userData,fullXML,config,changedAttr,onlyChanged,asCDATA){this._sUDa=userData;this._sAll=fullXML;this._sConfig=config;this._chAttr=changedAttr;this._onlChAttr=onlyChanged;this._asCDATA=asCDATA};this.setSerializableColumns=function(list){if(!list){this._srClmn=null;return}this._srClmn=(list||"").split(",");for(var i=0;i<this._srClmn.length;i++){this._srClmn[i]=dhx4.s2b(this._srClmn[i])}};this._serialise=function(rCol,inner,closed){this.editStop();var out=[];var close="</"+this.xml.s_row+">";if(this.isTreeGrid()){this._h2.forEachChildF(0,function(el){var temp=this._serializeRow(this.render_row_tree(-1,el.id));out.push(temp);if(temp){return true}else{return false}},this,function(){out.push(close)})}else{for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]){if(this._chAttr&&this.rowsBuffer[i]._locator){continue}var temp=this._serializeRow(this.render_row(i));out.push(temp);if(temp){out.push(close)}}}}return[out.join("")]};this._serializeRow=function(r,i){var out=[];var ra=this.xml.row_attrs;var ca=this.xml.cell_attrs;out.push("<"+this.xml.s_row);out.push(" id='"+r.idd+"'");if((this._sAll)&&this.selectedRows._dhx_find(r)!=-1){out.push(" selected='1'")}if(this._h2&&this._h2.get[r.idd].state=="minus"){out.push(" open='1'")}if(ra.length){for(var i=0;i<ra.length;i++){out.push(" "+ra[i]+"='"+r._attrs[ra[i]]+"'")}}out.push(">");if(this._sUDa&&this.UserData[r.idd]){keysAr=this.UserData[r.idd].getKeys();for(var ii=0;ii<keysAr.length;ii++){out.push("<userdata name='"+keysAr[ii]+"'>"+(this._asCDATA?"<![CDATA[":"")+this.UserData[r.idd].get(keysAr[ii])+(this._asCDATA?"]]>":"")+"</userdata>")}}var changeFl=false;for(var jj=0;jj<this._cCount;jj++){if((!this._srClmn)||(this._srClmn[jj])){var zx=this.cells3(r,jj);out.push("<cell");if(ca.length){for(var i=0;i<ca.length;i++){out.push(" "+ca[i]+"='"+zx.cell._attrs[ca[i]]+"'")}}zxVal=zx[this._agetm]();if(this._asCDATA){zxVal="<![CDATA["+zxVal+"]]>"}if((this._ecspn)&&(zx.cell.colSpan)&&zx.cell.colSpan>1){out.push(' colspan="'+zx.cell.colSpan+'" ')}if(this._chAttr){if(zx.wasChanged()){out.push(' changed="1"');changeFl=true}}else{if((this._onlChAttr)&&(zx.wasChanged())){changeFl=true}}if(this._sAll&&this.cellType[jj]=="tree"){out.push((this._h2?(" image='"+this._h2.get[r.idd].image+"'"):"")+">"+zxVal+"</cell>")}else{out.push(">"+zxVal+"</cell>")}if((this._ecspn)&&(zx.cell.colSpan)){for(var u=0;u<zx.cell.colSpan-1;u++){out.push("<cell/>");jj++}}}}if((this._onlChAttr)&&(!changeFl)&&(!r._added)){return""}return out.join("")};this._serialiseConfig=function(){var out="<head>";for(var i=0;i<this.hdr.rows[0].cells.length;i++){if(this._srClmn&&!this._srClmn[i]){continue}var sort=this.fldSort[i];if(sort=="cus"){sort=this._customSorts[i].toString();sort=sort.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}out+="<column width='"+this.getColWidth(i)+"' align='"+this.cellAlign[i]+"' type='"+this.cellType[i]+"' sort='"+(sort||"na")+"' color='"+this.columnColor[i]+"'"+(this.columnIds[i]?(" id='"+this.columnIds[i]+"'"):"")+">";if(this._asCDATA){out+="<![CDATA["+this.getColumnLabel(i)+"]]>"}else{out+=this.getColumnLabel(i)}var z=this.getCombo(i);if(z){for(var j=0;j<z.keys.length;j++){out+="<option value='"+z.keys[j]+"'>"+z.values[j]+"</option>"}}out+="</column>"}return out+="</head>"};this.serialize=function(){var out='<?xml version="1.0"?><rows>';if(this._mathSerialization){this._agetm="getMathValue"}else{this._agetm="getValue"}if(this._sUDa&&this.UserData.gridglobaluserdata){var keysAr=this.UserData.gridglobaluserdata.getKeys();for(var i=0;i<keysAr.length;i++){out+="<userdata name='"+keysAr[i]+"'>"+this.UserData.gridglobaluserdata.get(keysAr[i])+"</userdata>"}}if(this._sConfig){out+=this._serialiseConfig()}out+=this._serialise();out+="</rows>";return out};this.getPosition=function(oNode,pNode){if(!pNode){var pos=dhx4.getOffset(oNode);return[pos.left,pos.top]}pNode=pNode||document.body;var oCurrentNode=oNode;var iLeft=0;var iTop=0;while((oCurrentNode)&&(oCurrentNode!=pNode)){iLeft+=oCurrentNode.offsetLeft-oCurrentNode.scrollLeft;iTop+=oCurrentNode.offsetTop-oCurrentNode.scrollTop;oCurrentNode=oCurrentNode.offsetParent}if(pNode==document.body){if(_isIE){iTop+=document.body.offsetTop||document.documentElement.offsetTop;iLeft+=document.body.offsetLeft||document.documentElement.offsetLeft}else{if(!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop}}}return[iLeft,iTop]};this.getFirstParentOfType=function(obj,tag){while(obj&&obj.tagName!=tag&&obj.tagName!="BODY"){obj=obj.parentNode}return obj};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.hdrBox.onscroll=function(){if(this._try_header_sync){return}this._try_header_sync=true;if(Math.abs(this.grid.objBox.scrollLeft-this.scrollLeft)>1){this.grid.objBox.scrollLeft=this.scrollLeft}this._try_header_sync=false};if((!_isOpera)||(_OperaRv>8.5)){this.hdr.onmousemove=function(e){this.grid.changeCursorState(e||window.event)};this.hdr.onmousedown=function(e){return this.grid.startColResize(e||window.event)}}this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(e){(e||event).cancelBubble=true};this.obj.onclick=function(e){if(this.grid._doClick(e||window.event)!==false){if(this.grid._sclE){this.grid.editCell(e||window.event)}else{this.grid.editStop()}}(e||event).cancelBubble=true};if(_isMacOS){this.entBox.oncontextmenu=function(e){e.cancelBubble=true;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}var that=this.grid;if(that._realfake){that=that._fake}return that._doContClick(e||window.event)}}else{this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.entBox.oncontextmenu=function(e){if(this.grid._ctmndx){(e||event).cancelBubble=true}return !this.grid._ctmndx}}this.obj.ondblclick=function(e){if(!this.grid.wasDblClicked(e||window.event)){return false}if(this.grid._dclE){var row=this.grid.getFirstParentOfType((_isIE?event.srcElement:e.target),"TR");if(row==this.grid.row){this.grid.editCell(e||window.event)}}(e||event).cancelBubble=true;if(_isOpera){return false}};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){self._onHeaderClick.apply({grid:self},[null,self.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown){dhtmlxEvent(document,"keydown",function(e){if(globalActiveDHTMLGridObject){return globalActiveDHTMLGridObject.doKey(e||window.event)}});document.body._dhtmlxgrid_onkeydown=true}dhtmlxEvent(document.body,"click",function(){if(self.editStop){self.editStop()}if(self.isActive){self.setActive(false)}});if(this.entBox.style.height.toString().indexOf("%")!=-1){this._delta_y=this.entBox.style.height}if(this.entBox.style.width.toString().indexOf("%")!=-1){this._delta_x=this.entBox.style.width}if(this._delta_x||this._delta_y){this._setAutoResize()}this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}if(dhtmlx.skin){this.setSkin(dhtmlx.skin)}return this}dhtmlXGridObject.prototype={getRowAttribute:function(c,a){return this.getRowById(c)._attrs[a]},setRowAttribute:function(g,a,c){this.getRowById(g)._attrs[a]=c},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(m,g){var c=dhx4.s2b(g);var l=this.getRowById(m);if(!l){return}if(l.expand===""){this.collapseKids(l)}if((g)&&(l.style.display!="none")){l.style.display="none";var j=this.selectedRows._dhx_find(l);if(j!=-1){l.className=l.className.replace("rowselected","");for(var a=0;a<l.childNodes.length;a++){l.childNodes[a].className=l.childNodes[a].className.replace(/cellselected/g,"")}this.selectedRows._dhx_removeAt(j)}this.callEvent("onGridReconstructed",[])}if((!g)&&(l.style.display=="none")){l.style.display="";this.callEvent("onGridReconstructed",[])}this.callEvent("onRowHide",[m,g]);this.setSizes()},setColumnHidden:function(g,c){if(!this.hdr.rows.length){if(!this._ivizcol){this._ivizcol=[]}return this._ivizcol[g]=c}if((this.fldSorted)&&(this.fldSorted.cellIndex==g)&&(c)){this.sortImg.style.display="none"}var a=dhx4.s2b(c);if(a){if(!this._hrrar){this._hrrar=new Array()}else{if(this._hrrar[g]){return}}this._hrrar[g]="display:none;";this._hideShowColumn(g,"none")}else{if((!this._hrrar)||(!this._hrrar[g])){return}this._hrrar[g]="";this._hideShowColumn(g,"")}if((this.fldSorted)&&(this.fldSorted.cellIndex==g)&&(!c)){this.sortImg.style.display="inline"}this.setSortImgPos();this.callEvent("onColumnHidden",[g,c])},isColumnHidden:function(a){if((this._hrrar)&&(this._hrrar[a])){return true}return false},setColumnsVisibility:function(c){if(c){this._ivizcol=c.split(this.delim)}if(this.hdr.rows.length&&this._ivizcol){for(var a=0;a<this._ivizcol.length;a++){this.setColumnHidden(a,this._ivizcol[a])}}},_fixHiddenRowsAll:function(q,g,a,c,n){n=n||"_cellIndex";var o=q.rows.length;for(var m=0;m<o;m++){var r=q.rows[m].childNodes;if(r.length!=this._cCount){for(var l=0;l<r.length;l++){if(r[l][n]==g){r[l].style[a]=c;break}}}else{r[g].style[a]=c}}},_hideShowColumn:function(l,j){var a=l;if(this.hdr.rows[1]&&(this.hdr.rows[1]._childIndexes)&&(this.hdr.rows[1]._childIndexes[l]!=l)){a=this.hdr.rows[1]._childIndexes[l]}if(j=="none"){this.hdr.rows[0].cells[l]._oldWidth=this.hdr.rows[0].cells[l].style.width||(this.initCellWidth[l]+"px");this.hdr.rows[0].cells[l]._oldWidthP=this.cellWidthPC[l];this.obj.rows[0].cells[l].style.width="0px";var c={rows:[this.obj.rows[0]]};this.forEachRow(function(m){if(this.rowsAr[m].tagName=="TR"){c.rows.push(this.rowsAr[m])}});this._fixHiddenRowsAll(c,l,"display","none");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(l,"none")}if((_isOpera&&_OperaRv<9)||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,l,"display","none","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],l,"display","none")}this._fixHiddenRowsAll(this.hdr,l,"whiteSpace","nowrap","_cellIndexS");if(!this.cellWidthPX.length&&!this.cellWidthPC.length){this.cellWidthPX=[].concat(this.initCellWidth)}if(this.cellWidthPX[l]){this.cellWidthPX[l]=0}if(this.cellWidthPC[l]){this.cellWidthPC[l]=0}}else{if(this.hdr.rows[0].cells[l]._oldWidth){var g=this.hdr.rows[0].cells[l];if(_isOpera||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,l,"display","","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],l,"display","")}var c={rows:[this.obj.rows[0]]};this.forEachRow(function(m){if(this.rowsAr[m].tagName=="TR"){c.rows.push(this.rowsAr[m])}});this._fixHiddenRowsAll(c,l,"display","");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(l,"")}this._fixHiddenRowsAll(this.hdr,l,"whiteSpace","normal","_cellIndexS");if(g._oldWidthP){this.cellWidthPC[l]=g._oldWidthP}if(g._oldWidth){this.cellWidthPX[l]=parseInt(g._oldWidth)}}}this.setSizes();if((!_isIE)&&(!_isFF)){this.obj.border=1;this.obj.border=0}},enableColSpan:function(a){this._ecspn=dhx4.s2b(a)},enableRowsHover:function(c,a){this._unsetRowHover(false,true);this._hvrCss=a;if(dhx4.s2b(c)){if(!this._elmnh){this.obj._honmousemove=this.obj.onmousemove;this.obj.onmousemove=this._setRowHover;if(_isIE){this.obj.onmouseleave=this._unsetRowHover}else{this.obj.onmouseout=this._unsetRowHover}this._elmnh=true}}else{if(this._elmnh){this.obj.onmousemove=this.obj._honmousemove;if(_isIE){this.obj.onmouseleave=null}else{this.obj.onmouseout=null}this._elmnh=false}}},enableEditEvents:function(c,g,a){this._sclE=dhx4.s2b(c);this._dclE=dhx4.s2b(g);this._f2kE=dhx4.s2b(a)},enableLightMouseNavigation:function(a){if(dhx4.s2b(a)){if(!this._elmn){this.entBox._onclick=this.entBox.onclick;this.entBox.onclick=function(){return true};this.obj._onclick=this.obj.onclick;this.obj.onclick=function(g){var j=this.grid.getFirstParentOfType(g?g.target:event.srcElement,"TD");if(!j){return}this.grid.editStop();this.grid.doClick(j);this.grid.editCell();(g||event).cancelBubble=true};this.obj._onmousemove=this.obj.onmousemove;this.obj.onmousemove=this._autoMoveSelect;this._elmn=true}}else{if(this._elmn){this.entBox.onclick=this.entBox._onclick;this.obj.onclick=this.obj._onclick;this.obj.onmousemove=this.obj._onmousemove;this._elmn=false}}},_unsetRowHover:function(g,j){if(j){that=this}else{that=this.grid}if((that._lahRw)&&(that._lahRw!=j)){for(var a=0;a<that._lahRw.childNodes.length;a++){that._lahRw.childNodes[a].className=that._lahRw.childNodes[a].className.replace(that._hvrCss,"")}that._lahRw=null}},_setRowHover:function(g){var j=this.grid.getFirstParentOfType(g?g.target:event.srcElement,"TD");if(j&&j.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0,j);j=j.parentNode;if(!j.idd||j.idd=="__filler__"){return}for(var a=0;a<j.childNodes.length;a++){j.childNodes[a].className+=" "+this.grid._hvrCss}this.grid._lahRw=j}this._honmousemove(g)},_autoMoveSelect:function(a){if(!this.grid.editor){var g=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(g.parentNode.idd){this.grid.doClick(g,true,0)}}this._onmousemove(a)},enableDistributedParsing:function(g,a,c){if(dhx4.s2b(g)){this._ads_count=a||10;this._ads_time=c||250}else{this._ads_count=0}},destructor:function(){this.editStop(true);if(this._sizeTime){this._sizeTime=window.clearTimeout(this._sizeTime)}this.entBox.className=(this.entBox.className||"").replace(/gridbox.*/,"");if(this.formInputs){for(var g=0;g<this.formInputs.length;g++){this.parentForm.removeChild(this.formInputs[g])}}var c;for(var g=0;g<this.rowsCol.length;g++){if(this.rowsCol[g]){this.rowsCol[g].grid=null}}for(g in this.rowsAr){if(this.rowsAr[g]){this.rowsAr[g]=null}}this.rowsCol=new dhtmlxArray();this.rowsAr={};this.entBox.innerHTML="";var j=function(){};this.entBox.onclick=this.entBox.onmousedown=this.entBox.onbeforeactivate=this.entBox.onbeforedeactivate=this.entBox.onbeforedeactivate=this.entBox.onselectstart=j;this.setSizes=this._update_srnd_view=this.callEvent=j;this.entBox.grid=this.objBox.grid=this.hdrBox.grid=this.obj.grid=this.hdr.grid=null;if(this._fake){this.globalBox.innerHTML="";this._fake.setSizes=this._fake._update_srnd_view=this._fake.callEvent=j;this.globalBox.onclick=this.globalBox.onmousedown=this.globalBox.onbeforeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onselectstart=j}for(c in this){if((this[c])&&(this[c].m_obj)){this[c].m_obj=null}this[c]=null}if(this==globalActiveDHTMLGridObject){globalActiveDHTMLGridObject=null}return null},getSortingState:function(){var a=new Array();if(this.fldSorted){a[0]=this.fldSorted._cellIndex;a[1]=(this.sortImg.className=="dhxgrid_sort_desc"?"des":"asc")}return a},enableAutoHeight:function(g,c,a){this._ahgr=dhx4.s2b(g);this._ahgrF=dhx4.s2b(a);this._ahgrM=c||null;if(arguments.length==1){this.objBox.style.overflowY=g?"hidden":"auto"}if(c=="auto"){this._ahgrM=null;this._ahgrMA=true;this._setAutoResize()}},enableStableSorting:function(a){this._sst=dhx4.s2b(a);this.rowsCol.stablesort=function(n){var m=this.length-1;for(var l=0;l<this.length-1;l++){for(var g=0;g<m;g++){if(n(this[g],this[g+1])>0){var c=this[g];this[g]=this[g+1];this[g+1]=c}}m--}}},enableKeyboardSupport:function(a){this._htkebl=!dhx4.s2b(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(a){},enableTooltips:function(c){this._enbTts=c.split(",");for(var a=0;a<this._enbTts.length;a++){this._enbTts[a]=dhx4.s2b(this._enbTts[a])}},enableResizing:function(c){this._drsclmn=c.split(",");for(var a=0;a<this._drsclmn.length;a++){this._drsclmn[a]=dhx4.s2b(this._drsclmn[a])}},setColumnMinWidth:function(a,c){if(arguments.length==2){if(!this._drsclmW){this._drsclmW=new Array()}this._drsclmW[c]=a}else{this._drsclmW=a.split(",")}},enableCellIds:function(a){this._enbCid=dhx4.s2b(a)},lockRow:function(a,g){var c=this.getRowById(a);if(c){c._locked=dhx4.s2b(g);if((this.cell)&&(this.cell.parentNode.idd==a)){this.editStop()}}},_getRowArray:function(l){var j=new Array();for(var g=0;g<l.childNodes.length;g++){var c=this.cells3(l,g);j[g]=c.getValue()}return j},setDateFormat:function(c,a){this._dtmask=c;this._dtmask_inc=a},setNumberFormat:function(o,g,l,n){var j=o.replace(/[^0\,\.]*/g,"");var a=j.indexOf(".");if(a>-1){a=j.length-a-1}var c=j.indexOf(",");if(c>-1){c=j.length-a-2-c}if(typeof l!="string"){l=this.i18n.decimal_separator}if(typeof n!="string"){n=this.i18n.group_separator}var q=o.split(j)[0];var m=o.split(j)[1];this._maskArr[g]=[a,c,q,m,l,n]},_aplNFb:function(l,j){var c=this._maskArr[j];if(!c){return l}var g=parseFloat(l.toString().replace(/[^0-9]*/g,""));if(l.toString().substr(0,1)=="-"){g=g*-1}if(c[0]>0){g=g/Math.pow(10,c[0])}return g},_aplNF:function(n,m){var g=this._maskArr[m];if(!g){return n}var o=(parseFloat(n)<0?"-":"")+g[2];n=Math.abs(Math.round(parseFloat(n)*Math.pow(10,g[0]>0?g[0]:0))).toString();n=(n.length<g[0]?Math.pow(10,g[0]+1-n.length).toString().substr(1,g[0]+1)+n.toString():n).split("").reverse();n[g[0]]=(n[g[0]]||"0")+g[4];if(g[1]>0){for(var l=(g[0]>0?0:1)+g[0]+g[1];l<n.length;l+=g[1]){n[l]+=g[5]}}return o+n.reverse().join("")+g[3]},_launchCommands:function(a){for(var l=0;l<a.length;l++){var g=new Array();for(var c=0;c<a[l].childNodes.length;c++){if(a[l].childNodes[c].nodeType==1){g[g.length]=a[l].childNodes[c].firstChild.data}}this[a[l].getAttribute("command")].apply(this,g)}},_parseHead:function(m){var l=dhx4.ajax.xpath("./head",m);if(l.length){var n=dhx4.ajax.xpath("./column",l[0]);var o=dhx4.ajax.xpath("./settings",l[0]);var D="setInitWidths";var x=false;if(o[0]){for(var q=0;q<o[0].childNodes.length;q++){switch(o[0].childNodes[q].tagName){case"colwidth":if(o[0].childNodes[q].firstChild&&o[0].childNodes[q].firstChild.data=="%"){D="setInitWidthsP"}break;case"splitat":x=(o[0].childNodes[q].firstChild?o[0].childNodes[q].firstChild.data:false);break}}}this._launchCommands(dhx4.ajax.xpath("./beforeInit/call",l[0]));if(n.length>0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var w=["","width","type","align","sort","color","format","hidden","id"];var v=["",D,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var C=0;C<n.length;C++){for(var A=1;A<w.length;A++){a[A].push(n[C].getAttribute(w[A]))}a[0].push((n[C].firstChild?n[C].firstChild.data:"").replace(/^\s*((\s\S)*.+)\s*$/gi,"$1"))}this.setHeader(a[0]);for(var C=0;C<v.length;C++){if(v[C]){this[v[C]](a[C].join(this.delim))}}for(var C=0;C<n.length;C++){if((this.cellType[C].indexOf("co")==0)||(this.cellType[C]=="clist")){var r=dhx4.ajax.xpath("./option",n[C]);if(r.length){var y=new Array();if(this.cellType[C]=="clist"){for(var A=0;A<r.length;A++){y[y.length]=r[A].firstChild?r[A].firstChild.data:""}this.registerCList(C,y)}else{var E=this.getCombo(C);for(var A=0;A<r.length;A++){E.put(r[A].getAttribute("value"),r[A].firstChild?r[A].firstChild.data:"")}}}}else{if(a[6][C]){if((this.cellType[C].toLowerCase().indexOf("calendar")!=-1)||(this.fldSort[C]=="date")){this.setDateFormat(a[6][C])}else{this.setNumberFormat(a[6][C],C)}}}}this.init();var g=a[7].join(this.delim);if(this.setColHidden&&g.replace(/,/g,"")!=""){this.setColHidden(g)}if((x)&&(this.splitAt)){this.splitAt(x)}}this._launchCommands(dhx4.ajax.xpath("./afterInit/call",l[0]))}var c=dhx4.ajax.xpath("//rows/userdata",m);if(c.length>0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var A=0;A<c.length;A++){var F="";for(var u=0;u<c[A].childNodes.length;u++){F+=c[A].childNodes[u].nodeValue}this.UserData.gridglobaluserdata.put(c[A].getAttribute("name"),F)}}},getCheckedRows:function(a){var c=new Array();this.forEachRowA(function(j){var g=this.cells(j,a);if(g.changeState&&g.getValue()!=0){c.push(j)}},true);return c.join(",")},checkAll:function(){var c=arguments.length?arguments[0]:1;for(var a=0;a<this.getColumnsNum();a++){if(this.getColType(a)=="ch"){this.setCheckedRows(a,c)}}},uncheckAll:function(){this.checkAll(0)},setCheckedRows:function(c,a){this.forEachRowA(function(g){if(this.cells(g,c).isCheckbox()){this.cells(g,c).setValue(a)}})},_drawTooltip:function(l){var m=this.grid.getFirstParentOfType(l?l.target:event.srcElement,"TD");if(!m||((this.grid.editor)&&(this.grid.editor.cell==m))){return true}var j=m.parentNode;if(!j.idd||j.idd=="__filler__"){return}var g=(l?l.target:event.srcElement);if(j.idd==window.unknown){return true}if(!this.grid.callEvent("onMouseOver",[j.idd,m._cellIndex,(l||window.event)])){return true}if((this.grid._enbTts)&&(!this.grid._enbTts[m._cellIndex])){if(g.title){g.title=""}return true}if(m._cellIndex>=this.grid._cCount){return}var a=this.grid.cells3(j,m._cellIndex);if(!a||!a.cell||!a.cell._attrs){return}if(g._title){a.cell.title=""}if(!a.cell._attrs.title){g._title=true}if(a){g.title=a.cell._attrs.title||(a.getTitle?a.getTitle():(a.getValue()||"").toString().replace(/<[^>]*>/gi,""))}return true},enableCellWidthCorrection:function(a){if(_isFF){this._wcorr=parseInt(a)}},getAllRowIds:function(g){var a=[];for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]){a.push(this.rowsBuffer[c].idd)}}return a.join(g||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},setColspan:function(g,y,l){if(!this._ecspn){return}var a=this.getRowById(g);if((a._childIndexes)&&(a.childNodes[a._childIndexes[y]])){var s=a._childIndexes[y];var o=a.childNodes[s];var q=o.colSpan;o.colSpan=1;if((q)&&(q!=1)){for(var v=1;v<q;v++){var x=document.createElement("TD");if(o.nextSibling){a.insertBefore(x,o.nextSibling)}else{a.appendChild(x)}a._childIndexes[y+v]=s+v;x._cellIndex=y+v;x.style.textAlign=this.cellAlign[v];x.style.verticalAlign=this.cellVAlign[v];o=x;this.cells3(a,y+v).setValue("")}}for(var w=y*1+1*q;w<a._childIndexes.length;w++){a._childIndexes[w]+=(q-1)*1}}if((l)&&(l>1)){if(a._childIndexes){var s=a._childIndexes[y]}else{var s=y;a._childIndexes=new Array();for(var w=0;w<a.childNodes.length;w++){a._childIndexes[w]=w}}a.childNodes[s].colSpan=l;for(var w=1;w<l;w++){a._childIndexes[a.childNodes[s+1]._cellIndex]=s;a.removeChild(a.childNodes[s+1])}var u=a.childNodes[a._childIndexes[y]]._cellIndex;for(var w=u*1+1*l;w<a._childIndexes.length;w++){a._childIndexes[w]-=(l-1)}}},preventIECaching:function(a){dhx4.ajax.cache=!a},enableColumnAutoSize:function(a){this._eCAS=dhx4.s2b(a)},_onHeaderDblClick:function(g){var c=this.grid;var a=c.getFirstParentOfType(_isIE?event.srcElement:g.target,"TD");if(!c._eCAS){return false}c.adjustColumnSize(a._cellIndexS)},adjustColumnSize:function(r,c){if(this._hrrar&&this._hrrar[r]){return}this._notresize=true;var g=0;this._setColumnSizeR(r,20);for(var o=1;o<this.hdr.rows.length;o++){var u=this.hdr.rows[o];u=u.childNodes[(u._childIndexes)?u._childIndexes[r]:r];if((u)&&((!u.colSpan)||(u.colSpan<2))&&u._cellIndex==r){if((u.childNodes[0])&&(u.childNodes[0].className=="hdrcell")){u=u.childNodes[0]}g=Math.max(g,u.scrollWidth)}}var n=this.obj.rows.length;var s=0;var w=this.cellType._dhx_find("tree");for(var q=1;q<n;q++){var v=this.obj.rows[q];if(!this.rowsAr[v.idd]){continue}if(v._childIndexes&&v._childIndexes[r]!=r||!v.childNodes[r]){continue}s=(v.childNodes[r].innerText||v.childNodes[r].textContent||"").length*this.fontWidth;if(this._h2&&r==w){s+=this._h2.get[v.idd].level*22}if(s>g){g=s}}g+=20+(c||0);this._setColumnSizeR(r,g);this._notresize=false;this.setSizes()},detachHeader:function(a,g){g=g||this.hdr;var c=g.rows[a+1];if(c){c.parentNode.removeChild(c)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,j,c){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(j)=="string"){j=j.split(this.delim)}c=c||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,j],this[(c=="_aHead")?"hdr":"ftr"])}else{if(this[c]){for(var g=0;g<this[c].length;g++){this.attachHeader.apply(this,this[c][g])}}}}else{if(!this[c]){this[c]=new Array()}this[c][this[c].length]=[a,j,c]}},_createHRow:function(g,s){if(!s){if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}var o=document.createElement("DIV");o.className="c_ftr".substr(2);this.entBox.appendChild(o);var x=document.createElement("TABLE");x.cellPadding=x.cellSpacing=0;if(!_isIE||_isIE==8){x.width="100%";x.style.paddingRight="20px"}x.style.marginRight="20px";x.style.tableLayout="fixed";o.appendChild(x);x.appendChild(document.createElement("TBODY"));this.ftr=s=x;var n=x.insertRow(0);var a=((this.hdrLabels.length<=1)?g[0].length:this.hdrLabels.length);for(var l=0;l<a;l++){n.appendChild(document.createElement("TH"));n.childNodes[l]._cellIndex=l}if(_isIE&&_isIE<8){n.style.position="absolute"}else{n.style.height="auto"}}var m=g[1];var o=document.createElement("TR");s.rows[0].parentNode.appendChild(o);for(var l=0;l<g[0].length;l++){if(g[0][l]=="#cspan"){var q=o.cells[o.cells.length-1];q.colSpan=(q.colSpan||1)+1;continue}if((g[0][l]=="#rspan")&&(s.rows.length>1)){var A=s.rows.length-2;var y=false;var q=null;while(!y){var q=s.rows[A];for(var c=0;c<q.cells.length;c++){if(q.cells[c]._cellIndex==l){y=c+1;break}}A--}q=q.cells[y-1];q.rowSpan=(q.rowSpan||1)+1;continue}var r=document.createElement("TD");r._cellIndex=r._cellIndexS=l;if(this._hrrar&&this._hrrar[l]&&!_isIE){r.style.display="none"}if(typeof g[0][l]=="object"){r.appendChild(g[0][l])}else{if(this.forceDivInHeader){r.innerHTML="<div class='hdrcell'>"+(g[0][l]||"&nbsp;")+"</div>"}else{r.innerHTML=(g[0][l]||"&nbsp;")}if((g[0][l]||"").indexOf("#")!=-1){var x=g[0][l].match(/(^|{)#([^}]+)(}|$)/);if(x){var u="_in_header_"+x[2];if(this[u]){this[u]((this.forceDivInHeader?r.firstChild:r),l,g[0][l].split(x[0]))}}}}if(m){r.style.cssText=m[l]}o.appendChild(r)}var v=s;if(_isKHTML){if(s._kTimer){window.clearTimeout(s._kTimer)}s._kTimer=window.setTimeout(function(){s.rows[1].style.display="none";window.setTimeout(function(){s.rows[1].style.display=""},1)},500)}},attachFooter:function(a,c){this.attachHeader(a,c,"_aFoot")},setCellExcellType:function(g,a,c){this.changeCellType(this.getRowById(g),a,c)},changeCellType:function(g,j,c){c=c||this.cellType[j];var l=this.cells3(g,j);var a=l.getValue();l.cell._cellType=c;var l=this.cells3(g,j);l.setValue(a)},setRowExcellType:function(g,c){var j=this.rowsAr[g];for(var a=0;a<j.childNodes.length;a++){this.changeCellType(j,a,c)}},setColumnExcellType:function(a,g){for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]&&this.rowsBuffer[c].tagName=="TR"){this.changeCellType(this.rowsBuffer[c],a,g)}}if(this.cellType[a]=="math"){this._strangeParams[c]=g}else{this.cellType[a]=g}},forEachRow:function(g){for(var c in this.rowsAr){if(this.rowsAr[c]&&this.rowsAr[c].idd){g.apply(this,[this.rowsAr[c].idd])}}},forEachRowA:function(g){for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]){g.call(this,this.render_row(c).idd)}}},forEachCell:function(g,c){var j=this.getRowById(g);if(!j){return}for(var a=0;a<this._cCount;a++){c(this.cells3(j,a),a)}},enableAutoWidth:function(g,a,c){this._awdth=[dhx4.s2b(g),parseInt(a||99999),parseInt(c||0)];if(arguments.length==1){this.objBox.style.overflowX=g?"hidden":"auto"}},updateFromXML:function(a,j,c,g){if(typeof j=="undefined"){j=true}this._refresh_mode=[true,j,c];this.load(a,g)},_refreshFromXML:function(j){if(this._f_rowsBuffer){this.filterBy(0,"")}reset=false;if(window.eXcell_tree){eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue;eXcell_tree.prototype.setValue=function(v){var u=this.grid._h2.get[this.cell.parentNode.idd];if(u&&this.cell.parentNode.valTag){this.setLabel(v)}else{this.setValueX(v)}}}var s=this.cellType._dhx_find("tree");var m=dhx4.ajax.xmltop("rows",j);var l=m.getAttribute("parent")||0;var o={};if(this._refresh_mode[2]){if(s!=-1){this._h2.forEachChild(l,function(u){o[u.id]=true},this)}else{this.forEachRow(function(u){o[u]=true})}}var r=dhx4.ajax.xpath("//row",m);for(var g=0;g<r.length;g++){var q=r[g];var a=q.getAttribute("id");o[a]=false;var l=q.parentNode.getAttribute("id")||l;if(this.rowsAr[a]&&this.rowsAr[a].tagName!="TR"){if(this._h2){this._h2.get[a].buff.data=q}else{this.rowsBuffer[this.getRowIndex(a)].data=q}this.rowsAr[a]=q}else{if(this.rowsAr[a]){this._process_xml_row(this.rowsAr[a],q,-1);this._postRowProcessing(this.rowsAr[a],true);if(this._fake&&this._fake.rowsAr[a]){this._fake._process_xml_row(this._fake.rowsAr[a],q,-1)}}else{if(this._refresh_mode[1]){var n={idd:a,data:q,_parser:this._process_xml_row,_locator:this._get_xml_data};var c=this.rowsBuffer.length;if(this._refresh_mode[1]=="top"){this.rowsBuffer.unshift(n);c=0}else{this.rowsBuffer.push(n)}if(this._h2){reset=true;(this._h2.add(a,(q.parentNode.getAttribute("id")||q.parentNode.getAttribute("parent")))).buff=this.rowsBuffer[this.rowsBuffer.length-1]}else{if(this._srnd){reset=true}}this.rowsAr[a]=q;q=this.render_row(c);this._insertRowAt(q,c?-1:0)}}}}if(this._refresh_mode[2]){for(a in o){if(o[a]&&this.rowsAr[a]){this.deleteRow(a)}}}this._refresh_mode=null;if(window.eXcell_tree){eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX}if(reset){if(this._h2){this._renderSort()}else{this.render_dataset()}}if(this._f_rowsBuffer){this._f_rowsBuffer=null;this.filterByAll()}},getCustomCombo:function(g,c){var a=this.cells(g,c).cell;if(!a._combo){a._combo=new dhtmlXGridComboObject()}return a._combo},setTabOrder:function(c){var j=c.split(this.delim);this._tabOrder=[];var a=this._cCount||c.length;for(var g=0;g<a;g++){j[g]={c:parseInt(j[g]),ind:g}}j.sort(function(m,l){return(m.c>l.c?1:-1)});for(var g=0;g<a;g++){if(!j[g+1]||(typeof j[g].c=="undefined")){this._tabOrder[j[g].ind]=(j[0].ind+1)*-1}else{this._tabOrder[j[g].ind]=j[g+1].ind}}},i18n:{loading:"Loading",decimal_separator:".",group_separator:","},_key_events:{k13_1_0:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a+1],this.cell._cellIndex,true)},k13_0_1:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a-1],this.cell._cellIndex,true)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[(this.row?this.row.idd:null),(this.cell?this.cell._cellIndex:null)]);this._still_active=true},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",[true])){return true}var a=this._getNextCell(null,1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab",[false])){return false}var a=this._getNextCell(null,-1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}},k113_0_0:function(){if(this._f2kE){this.editCell()}},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||(a.changeState()===false)){return false}},k27_0_0:function(){this.editStop(true)},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k37_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.collapseKids(this.row)}else{return false}},k39_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.expandKids(this.row)}else{return false}},k40_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{if(!this.row.idd){return}var a=Math.max((c._r_select||0),this.getRowIndex(this.row.idd));var g=this._nextRow(a,1);if(g){c._r_select=null;this.selectCell(g,this.cell._cellIndex,true);if(c.pagingOn){c.showRow(g.idd)}}else{if(!this.callEvent("onLastRow",[])){return false}this._key_events.k34_0_0.apply(this,[]);if(this.pagingOn&&this.rowsCol[a+1]){this.selectCell(a+1,0,true)}}}this._still_active=true},k38_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{if(!this.row.idd){return}var a=this.getRowIndex(this.row.idd)+1;if(a!=-1&&(!this.pagingOn||(a!=1))){var g=this._nextRow(a-1,-1);this.selectCell(g,this.cell._cellIndex,true);if(c.pagingOn&&g){c.showRow(g.idd)}}else{this._key_events.k33_0_0.apply(this,[])}}this._still_active=true}},_build_master_row:function(){var g=document.createElement("DIV");var c=["<table><tr>"];for(var a=0;a<this._cCount;a++){c.push("<td></td>")}c.push("</tr></table>");g.innerHTML=c.join("");this._master_row=g.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var g=this._master_row.cloneNode(true);for(var c=0;c<g.childNodes.length;c++){g.childNodes[c]._cellIndex=c;if(this._enbCid){g.childNodes[c].id="c_"+a+"_"+c}if(this.dragAndDropOff){this.dragger.addDraggableItem(g.childNodes[c],this)}}g.idd=a;g.grid=this;return g},_process_jsarray_row:function(c,g){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,(this._c_order?this._swapColumns(g):g));return c},_get_jsarray_data:function(c,a){return c[a]},_process_json_row:function(a,c){c=this._c_order?this._swapColumns(c.data):c.data;return this._process_some_row(a,c)},_process_some_row:function(c,g){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,g);return c},_get_json_data:function(c,a){return c.data[a]},_process_js_row:function(g,j){var a=[];for(var c=0;c<this.columnIds.length;c++){a[c]=j[this.columnIds[c]];if(!a[c]&&a[c]!==0){a[c]=""}}this._process_some_row(g,a);g._attrs=j;return g},_get_js_data:function(c,a){return c[this.columnIds[a]]},_process_csv_row:function(c,g){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,(this._c_order?this._swapColumns(g.split(this.csv.cell)):g.split(this.csv.cell)));return c},_get_csv_data:function(c,a){return c.split(this.csv.cell)[a]},_process_store_row:function(m,l){var a=[];for(var g=0;g<this.columnIds.length;g++){a[g]=l[this.columnIds[g]]}for(var c=0;c<m.childNodes.length;c++){m.childNodes[c]._attrs={}}m._attrs=l;this._fillRow(m,a)},_process_xml_row:function(a,n){var v=dhx4.ajax.xpath(this.xml.cell,n);var s=[];a._attrs=this._xml_attrs(n);if(this._ud_enabled){var u=dhx4.ajax.xpath("./userdata",n);for(var m=u.length-1;m>=0;m--){var q="";for(var g=0;g<u[m].childNodes.length;g++){q+=u[m].childNodes[g].nodeValue}this.setUserData(a.idd,u[m].getAttribute("name"),q)}}for(var g=0;g<v.length;g++){var l=v[this._c_order?this._c_order[g]:g];if(!l){continue}var c=a._childIndexes?a._childIndexes[g]:g;var o=l.getAttribute("type");if(a.childNodes[c]){if(o){a.childNodes[c]._cellType=o}a.childNodes[c]._attrs=this._xml_attrs(l)}if(!l.getAttribute("xmlcontent")){if(l.firstChild){l=l.firstChild.data}else{l=""}}s.push(l)}for(g<v.length;g<a.childNodes.length;g++){a.childNodes[g]._attrs={}}if(a.parentNode&&a.parentNode.tagName=="row"){a._attrs.parent=a.parentNode.getAttribute("idd")}this._fillRow(a,s);return a},_get_xml_data:function(c,a){c=c.firstChild;while(true){if(!c){return""}if(c.tagName=="cell"){a--}if(a<0){break}c=c.nextSibling}return(c.firstChild?c.firstChild.data:"")},_fillRow:function(j,m){if(this.editor&&this.editor.parentNode&&this.editor.parentNode.idd==j.idd){this.editStop()}for(var c=0;c<j.childNodes.length;c++){if((c<m.length)||(this.defVal[c])){var g=j.childNodes[c]._cellIndex;var l=m[g];var a=this.cells4(j.childNodes[c]);if((this.defVal[g])&&((l=="")||(typeof(l)=="undefined"))){l=this.defVal[g]}if(a){a.setValue(l)}}else{j.childNodes[c].innerHTML="&nbsp;";j.childNodes[c]._clearCell=true}}return j},_postRowProcessing:function(m,o){if(m._attrs["class"]){m._css=m.className=m._attrs["class"]}if(m._attrs.locked){m._locked=true}if(m._attrs.bgColor){m.bgColor=m._attrs.bgColor}var n=0;for(var g=0;g<m.childNodes.length;g++){var q=m.childNodes[g];var l=q._cellIndex;var j=q._attrs.style||m._attrs.style;if(j){q.style.cssText+=";"+j}if(q._attrs["class"]){q.className=q._attrs["class"]}j=q._attrs.align||this.cellAlign[l];if(j){q.align=j}q.vAlign=q._attrs.valign||this.cellVAlign[l];var a=q._attrs.bgColor||this.columnColor[l];if(a){q.bgColor=a}if(q._attrs.colspan&&!o){this.setColspan(m.idd,g+n,q._attrs.colspan);n+=(q._attrs.colspan-1)}if(this._hrrar&&this._hrrar[l]&&!o){q.style.display="none"}}this.callEvent("onRowCreated",[m.idd,m,null])},load:function(a,g,c){this.callEvent("onXLS",[this]);if(arguments.length==2&&typeof g!="function"){c=g;g=null}c=c||"xml";if(!this.xmlFileUrl){this.xmlFileUrl=a}this._data_type=c;this.xmlLoader=this.doLoadDetails;var j=this;this.xmlLoader=function(l){if(!j.callEvent){return}j["_process_"+c](l.xmlDoc);if(!j._contextCallTimer){j.callEvent("onXLE",[j,0,0,l.xmlDoc])}if(g){g();g=null}};return dhx4.ajax.get(a,this.xmlLoader)},loadXMLString:function(c,a){this.parse({responseXML:dhx4.ajax.parse(c)},a,"xml")},loadXML:function(a,c){this.load(a,c,"xml")},parse:function(g,c,a){if(arguments.length==2&&typeof c!="function"){a=c;c=null}a=a||"xml";this._data_type=a;if(a=="xml"&&typeof g=="string"){g={responseXML:dhx4.ajax.parse(g)}}this["_process_"+a](g);if(!this._contextCallTimer){this.callEvent("onXLE",[this,0,0,g])}if(c){c()}},xml:{top:"rows",row:"./row",cell:"./cell",s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"\n",cell:","},_xml_attrs:function(c){var g={};if(c.attributes.length){for(var a=0;a<c.attributes.length;a++){g[c.attributes[a].name]=c.attributes[a].value}}return g},_process_xml:function(q){if(this._refresh_mode){return this._refreshFromXML(q)}this._parsing=true;var m=dhx4.ajax.xmltop(this.xml.top,q);if(m.tagName!=this.xml.top){return}var o=m.getAttribute("dhx_security");if(o){dhtmlx.security_key=o}this._parseHead(m);var r=dhx4.ajax.xpath(this.xml.row,m);var l=parseInt(m.getAttribute("pos")||0);var n=parseInt(m.getAttribute("total_count")||0);if(!this.pagingOn){var n=Math.min(n,32000000/this._srdh)}var j=false;if(n&&n!=this.rowsBuffer.length){if(!this.rowsBuffer[n-1]){if(this.rowsBuffer.length){j=true}this.rowsBuffer[n-1]=null}if(n<this.rowsBuffer.length){this.rowsBuffer.splice(n,this.rowsBuffer.length-n);j=true}}if(this.isTreeGrid()){return this._process_tree_xml(m)}for(var c=0;c<r.length;c++){if(this.rowsBuffer[c+l]){continue}var a=r[c].getAttribute("id")||(c+l+1);this.rowsBuffer[c+l]={idd:a,data:r[c],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[a]=r[c]}this.callEvent("onDataReady",[]);if(j&&this._srnd){var g=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=g}else{this.render_dataset()}this._parsing=false},_process_jsarray:function(data){this._parsing=true;data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}for(var i=0;i<data.length;i++){var id=i+1;this.rowsBuffer.push({idd:id,data:data[i],_parser:this._process_jsarray_row,_locator:this._get_jsarray_data});this.rowsAr[id]=data[i]}this.render_dataset();this._parsing=false},_process_csv:function(j){this._parsing=true;j=j.responseText||j;j=j.replace(/\r/g,"");j=j.split(this.csv.row);if(this._csvHdr){this.clearAll();var g=j.splice(0,1)[0].split(this.csv.cell);if(!this._csvAID){g.splice(0,1)}this.setHeader(g.join(this.delim));this.init()}for(var c=0;c<j.length;c++){if(!j[c]&&c==j.length-1){continue}if(this._csvAID){var l=c+1;this.rowsBuffer.push({idd:l,data:j[c],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var a=j[c].split(this.csv.cell);var l=a.splice(0,1)[0];this.rowsBuffer.push({idd:l,data:a,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[l]=j[c]}this.render_dataset();this._parsing=false},_process_js:function(a){return this._process_json(a,"js")},_process_json:function(data,mode){this._parsing=true;var data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}if(mode=="js"){if(data.data){data=data.data}for(var i=0;i<data.length;i++){var row=data[i];var id=row.id||(i+1);this.rowsBuffer.push({idd:id,data:row,_parser:this._process_js_row,_locator:this._get_js_data});this.rowsAr[id]=data[i]}}else{for(var i=0;i<data.rows.length;i++){var id=data.rows[i].id;this.rowsBuffer.push({idd:id,data:data.rows[i],_parser:this._process_json_row,_locator:this._get_json_data});this.rowsAr[id]=data.rows[i]}}if(data.dhx_security){dhtmlx.security_key=data.dhx_security}this.callEvent("onDataReady",[]);this.render_dataset();this._parsing=false},render_dataset:function(j,a){if(this._srnd){if(this._fillers){return this._update_srnd_view()}a=Math.min((this._get_view_size()+(this._srnd_pr||0)),this.rowsBuffer.length)}if(this.pagingOn){j=Math.max((j||0),(this.currentPage-1)*this.rowsBufferOutSize);a=Math.min(this.currentPage*this.rowsBufferOutSize,this.rowsBuffer.length)}else{j=j||0;a=a||this.rowsBuffer.length}for(var g=j;g<a;g++){var m=this.render_row(g);if(m==-1){if(this.xmlFileUrl){if(this.callEvent("onDynXLS",[g,(this._dpref?this._dpref:(a-g))])){this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+g+"&count="+(this._dpref?this._dpref:(a-g)),this._data_type)}}a=g;break}if(!m.parentNode||!m.parentNode.tagName){this._insertRowAt(m,g);if(m._attrs.selected||m._attrs.select){this.selectRow(m,m._attrs.call?true:false,true);m._attrs.selected=m._attrs.select=null}}if(this._ads_count&&g-j==this._ads_count){var l=this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){l._contextCallTimer=null;l.render_dataset(g,a);if(!l._contextCallTimer){if(l._context_parsing){l.callEvent("onXLE",[])}else{l._fixAlterCss()}l.callEvent("onDistributedEnd",[]);l._context_parsing=false}},this._ads_time)}}if(this._ads_count&&g==a){this.callEvent("onDistributedEnd",[])}if(this._srnd&&!this._fillers){var c=this.rowsBuffer.length-a;this._fillers=[];if(this._fake&&!this._realfake){this._fake._fillers=[]}while(c>0){var o=(_isIE||window._FFrv)?Math.min(c,50000):c;var n=this._add_filler(a,o);if(n){this._fillers.push(n)}c-=o;a+=o}}this.setSizes()},render_row:function(c){if(!this.rowsBuffer[c]){return -1}if(this.rowsBuffer[c]._parser){var a=this.rowsBuffer[c];if(this.rowsAr[a.idd]&&this.rowsAr[a.idd].tagName=="TR"){return this.rowsBuffer[c]=this.rowsAr[a.idd]}var g=this._prepareRow(a.idd);this.rowsBuffer[c]=g;this.rowsAr[a.idd]=g;a._parser.call(this,g,a.data);this._postRowProcessing(g);return g}return this.rowsBuffer[c]},_get_cell_value:function(c,a,g){if(c._locator){if(this._c_order){a=this._c_order[a]}return c._locator.call(this,c.data,a)}return this.cells3(c,a)[g?g:"getValue"]()},sortRows:function(g,m,c){this.editStop();c=(c||"asc").toLowerCase();m=(m||this.fldSort[g]);g=g||0;if(this.isTreeGrid()){this.sortTreeRows(g,m,c)}else{var a={};var l=this.cellType[g];var n="getValue";if(l=="link"){n="getContent"}if(l=="dhxCalendar"||l=="dhxCalendarA"){n="getDate"}for(var j=0;j<this.rowsBuffer.length;j++){a[this.rowsBuffer[j].idd]=this._get_cell_value(this.rowsBuffer[j],g,n)}this._sortRows(g,m,c,a)}this.callEvent("onAfterSorting",[g,m,c])},_sortCore:function(g,m,c,a,l){var j="sort";if(this._sst){l.stablesort=this.rowsCol.stablesort;j="stablesort"}if(m.length>4){m=window[m]}if(m=="cus"){var n=this._customSorts[g];l[j](function(q,o){return n(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(typeof(m)=="function"){l[j](function(q,o){return m(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(m=="str"){l[j](function(q,o){if(c=="asc"){return a[q.idd]>a[o.idd]?1:(a[q.idd]<a[o.idd]?-1:0)}else{return a[q.idd]<a[o.idd]?1:(a[q.idd]>a[o.idd]?-1:0)}})}else{if(m=="int"){l[j](function(r,q){var o=parseFloat(a[r.idd]);o=isNaN(o)?-99999999999999:o;var s=parseFloat(a[q.idd]);s=isNaN(s)?-99999999999999:s;if(c=="asc"){return o-s}else{return s-o}})}else{if(m=="date"){l[j](function(r,q){var o=Date.parse(a[r.idd])||(Date.parse("01/01/1900"));var s=Date.parse(a[q.idd])||(Date.parse("01/01/1900"));if(c=="asc"){return o-s}else{return s-o}})}}}}}},_sortRows:function(g,j,c,a){this._sortCore(g,j,c,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(g){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var j=a.removeChild(a.childNodes[0],true);if(_isKHTML){for(var c=a.parentNode.childNodes.length-1;c>=0;c--){if(a.parentNode.childNodes[c].tagName=="TR"){a.parentNode.removeChild(a.parentNode.childNodes[c],true)}}}else{if(_isIE){for(var c=a.childNodes.length-1;c>=0;c--){a.childNodes[c].removeNode(true)}}else{a.innerHTML=""}}a.appendChild(j);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!g){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(c,j){if(!j){j=this.getRowById(c)}if(!j){return}this.editStop();if(!this._realfake){if(this.callEvent("onBeforeRowDeleted",[c])==false){return false}}var a=0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake){a=this._h2.get[c].parent.id;this._removeTrGrRow(j)}else{if(j.parentNode){j.parentNode.removeChild(j)}var m=this.rowsCol._dhx_find(j);if(m!=-1){this.rowsCol._dhx_removeAt(m)}for(var g=0;g<this.rowsBuffer.length;g++){if(this.rowsBuffer[g]&&this.rowsBuffer[g].idd==c){this.rowsBuffer._dhx_removeAt(g);m=g;break}}}this.rowsAr[c]=null;for(var g=0;g<this.selectedRows.length;g++){if(this.selectedRows[g].idd==c){this.selectedRows._dhx_removeAt(g)}}if(this._srnd){for(var g=0;g<this._fillers.length;g++){var l=this._fillers[g];if(!l){continue}if(l[0]>=m){this._update_fillers(g,0,-1)}else{if(l[0]+l[1]>m){this._update_fillers(g,-1,0)}}}this._update_srnd_view()}if(this.pagingOn){this.changePage()}if(!this._realfake){this.callEvent("onAfterRowDeleted",[c,a])}this.callEvent("onGridReconstructed",[]);if(this._ahgr){this.setSizes()}return true},_addRow:function(n,o,c){if(c==-1||typeof c=="undefined"){c=this.rowsBuffer.length}if(typeof o=="string"){o=o.split(this.delim)}var q=this._prepareRow(n);q._attrs={};for(var g=0;g<q.childNodes.length;g++){q.childNodes[g]._attrs={}}this.rowsAr[q.idd]=q;if(this._h2){this._h2.get[q.idd].buff=q}this._fillRow(q,o);this._postRowProcessing(q);if(this._skipInsert){this._skipInsert=false;return this.rowsAr[q.idd]=q}if(this.pagingOn){this.rowsBuffer._dhx_insertAt(c,q);this.rowsAr[q.idd]=q;return q}if(this._fillers){this.rowsCol._dhx_insertAt(c,null);this.rowsBuffer._dhx_insertAt(c,q);if(this._fake){this._fake.rowsCol._dhx_insertAt(c,null)}this.rowsAr[q.idd]=q;var r=false;for(var l=0;l<this._fillers.length;l++){var m=this._fillers[l];if(m&&m[0]<=c&&(m[0]+m[1])>=c){m[1]=m[1]+1;var a=m[2].firstChild.style.height=parseInt(m[2].firstChild.style.height)+this._srdh+"px";r=true;if(this._fake){this._fake._fillers[l][1]++;this._fake._fillers[l][2].firstChild.style.height=a}}if(m&&m[0]>c){m[0]=m[0]+1;if(this._fake){this._fake._fillers[l][0]++}}}if(!r){this._fillers.push(this._add_filler(c,1,(c==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:(this.rowsCol[1])}:this.rowsCol[c-1])))}return q}this.rowsBuffer._dhx_insertAt(c,q);return this._insertRowAt(q,c)},addRow:function(a,j,g){var c=this._addRow(a,j,g);if(!this.dragContext){this.callEvent("onRowAdded",[a])}if(this.pagingOn){this.changePage(this.currentPage)}if(this._srnd){this._update_srnd_view()}c._added=true;if(this._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return c},_insertRowAt:function(g,j,c){this.rowsAr[g.idd]=g;if(this._skipInsert){this._skipInsert=false;return g}if((j<0)||((!j)&&(parseInt(j)!==0))){j=this.rowsCol.length}else{if(j>this.rowsCol.length){j=this.rowsCol.length}}if(this._cssEven){var a=g.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(g.idd):j)%2==1){g.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(g.idd)):"")}else{g.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(g.idd)):"")}}if(!c){if((j==(this.obj.rows.length-1))||(!this.rowsCol[j])){if(_isKHTML){this.obj.appendChild(g)}else{this.obj.firstChild.appendChild(g)}}else{this.rowsCol[j].parentNode.insertBefore(g,this.rowsCol[j])}}this.rowsCol._dhx_insertAt(j,g);this.callEvent("onRowInserted",[g,j]);return g},getRowById:function(g){var c=this.rowsAr[g];if(c){if(c.tagName!="TR"){for(var a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].idd==g){return this.render_row(a)}}if(this._h2){return this.render_row(null,c.idd)}}return c}return null},cellById:function(c,a){return this.cells(c,a)},cells:function(j,g){if(arguments.length==0){return this.cells4(this.cell)}else{var l=this.getRowById(j)}var a=(l._childIndexes?l.childNodes[l._childIndexes[g]]:l.childNodes[g]);if(!a&&l._childIndexes){a=l.firstChild||{}}return this.cells4(a)},cellByIndex:function(c,a){return this.cells2(c,a)},cells2:function(j,g){var l=this.render_row(j);var a=(l._childIndexes?l.childNodes[l._childIndexes[g]]:l.childNodes[g]);if(!a&&l._childIndexes){a=l.firstChild||{}}return this.cells4(a)},cells3:function(g,c){var a=(g._childIndexes?g.childNodes[g._childIndexes[c]]:g.childNodes[c]);return this.cells4(a)},cells4:function(a){var c=window["eXcell_"+(a._cellType||this.cellType[a._cellIndex])];if(c){return new c(a)}},cells5:function(a,g){var g=g||(a._cellType||this.cellType[a._cellIndex]);if(!this._ecache[g]){if(!window["eXcell_"+g]){var c=eXcell_ro}else{var c=window["eXcell_"+g]}this._ecache[g]=new c(a)}this._ecache[g].cell=a;return this._ecache[g]},dma:function(a){if(!this._ecache){this._ecache={}}if(a&&!this._dma){this._dma=this.cells4;this.cells4=this.cells5}else{if(!a&&this._dma){this.cells4=this._dma;this._dma=null}}},getRowsNum:function(){return this.rowsBuffer.length},enableEditTabOnly:function(a){if(arguments.length>0){this.smartTabOrder=dhx4.s2b(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(l,a){var c=this;this.tabStart=(typeof(l)=="object")?l:document.getElementById(l);var g=this.tabStart.onkeydown;this.tabStart.onkeydown=function(n){if(g){g.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&!m.shiftKey){m.cancelBubble=true;c.selectCell(0,0,0,0,1);if(c.smartTabOrder&&c.cells2(0,0).isDisabled()){c._key_events.k9_0_0.call(c)}this.blur();return false}};if(_isOpera){this.tabStart.onkeypress=this.tabStart.onkeydown}this.tabEnd=(typeof(a)=="object")?a:document.getElementById(a);var j=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(n){if(j){j.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&m.shiftKey){m.cancelBubble=true;c.selectCell((c.getRowsNum()-1),(c.getColumnCount()-1),0,0,1);if(c.smartTabOrder&&c.cells2((c.getRowsNum()-1),(c.getColumnCount()-1)).isDisabled()){c._key_events.k9_0_1.call(c)}this.blur();return false}};if(_isOpera){this.tabEnd.onkeypress=this.tabEnd.onkeydown}},uid:function(){if(!this._ui_seed){this._ui_seed=(new Date()).valueOf()}return this._ui_seed++},clearAndLoad:function(){var a=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=a;this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){var a=(this.currentPage-1)*this.rowsBufferOutSize;return[this.currentPage,a,Math.min(a+this.rowsBufferOutSize,this.rowsBuffer.length),this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.rowsBuffer.length]}};(function(){function j(n,o){this[n]=o}function m(n,o){this[n].call(this,o)}function g(n,o){this[n].call(this,o.join(this.delim))}function a(n,r){for(var q=0;q<r.length;q++){if(typeof r[q]=="object"){var s=this.getCombo(q);for(var o in r[q]){s.put(o,r[q][o])}}}}function l(n,w,r){var y=1;var v=[];function x(C,A,D){if(!v[A]){v[A]=[]}if(typeof D=="object"){D.toString=function(){return this.text}}v[A][C]=D}for(var s=0;s<w.length;s++){if(typeof(w[s])=="object"&&w[s].length){for(var q=0;q<w[s].length;q++){x(s,q,w[s][q])}}else{x(s,0,w[s])}}for(var s=0;s<v.length;s++){for(var q=0;q<v[0].length;q++){var u=v[s][q];v[s][q]=(u||"").toString()||"&nbsp;";if(u&&u.colspan){for(var o=1;o<u.colspan;o++){x(q+o,s,"#cspan")}}if(u&&u.rowspan){for(var o=1;o<u.rowspan;o++){x(q,s+o,"#rspan")}}}}this.setHeader(v[0]);for(var s=1;s<v.length;s++){this.attachHeader(v[s])}}var c=[{name:"label",def:"&nbsp;",operation:"setHeader",type:l},{name:"id",def:"",operation:"columnIds",type:j},{name:"width",def:"*",operation:"setInitWidths",type:g},{name:"align",def:"left",operation:"cellAlign",type:j},{name:"valign",def:"middle",operation:"cellVAlign",type:j},{name:"sort",def:"na",operation:"fldSort",type:j},{name:"type",def:"ro",operation:"setColTypes",type:g},{name:"options",def:"",operation:"",type:a}];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(n){return[n.parent]},image_path:"setImagePath",columns:"columns",rows:"rows",headers:"headers",skin:"setSkin",smart_rendering:"enableSmartRendering",css:"enableAlterCss",auto_height:"enableAutoHeight",save_hidden:"enableAutoHiddenColumnsSaving",save_cookie:"enableAutoSaving",save_size:"enableAutoSizeSaving",auto_width:"enableAutoWidth",block_selection:"enableBlockSelection",csv_id:"enableCSVAutoID",csv_header:"enableCSVHeader",cell_ids:"enableCellIds",colspan:"enableColSpan",column_move:"enableColumnMove",context_menu:"enableContextMenu",distributed:"enableDistributedParsing",drag:"enableDragAndDrop",drag_order:"enableDragOrder",tabulation:"enableEditTabOnly",header_images:"enableHeaderImages",header_menu:"enableHeaderMenu",keymap:"enableKeyboardSupport",mouse_navigation:"enableLightMouseNavigation",markers:"enableMarkedCells",math_editing:"enableMathEditing",math_serialization:"enableMathSerialization",drag_copy:"enableMercyDrag",multiline:"enableMultiline",multiselect:"enableMultiselect",save_column_order:"enableOrderSaving",hover:"enableRowsHover",rowspan:"enableRowspan",smart:"enableSmartRendering",save_sorting:"enableSortingSaving",stable_sorting:"enableStableSorting",undo:"enableUndoRedo",csv_cell:"setCSVDelimiter",date_format:"setDateFormat",drag_behavior:"setDragBehavior",editable:"setEditable",without_header:"setNoHeader",submit_changed:"submitOnlyChanged",submit_serialization:"submitSerialization",submit_selected:"submitOnlySelected",submit_id:"submitOnlyRowID",xml:"load"},{columns:function(s){for(var n=0;n<c.length;n++){var r=[];for(var o=0;o<s.length;o++){r[o]=s[o][c[n].name]||c[n].def}var q=c[n].type||m;q.call(this,c[n].operation,r,s)}this.init()},rows:function(n){},headers:function(o){for(var n=0;n<o.length;n++){this.attachHeader(o[n])}}})})();dhtmlXGridObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(c,j){if(this.obj._h2){this.obj.addRow(j,g,null,parent)}else{this.obj.addRow(j,[],0)}var g=this.obj.getRowById(j);if(g){this.obj._process_xml_row(g,c.firstChild);this.obj._postRowProcessing(g)}});a.attachEvent("updateCallback",function(c,j){var g=this.obj.getRowById(j);if(g){this.obj._process_xml_row(g,c.firstChild);this.obj._postRowProcessing(g)}});a.attachEvent("deleteCallback",function(c,g){this.obj.setUserData(g,this.action_param,"true_deleted");this.obj.deleteRow(g)});a._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(j,l,g){if(a._columns&&!a._columns[g]){return true}var c=this.cells(l,g);if(j==1){if(c.isCheckbox()){a.setUpdated(l,true)}}else{if(j==2){if(c.wasChanged()){a.setUpdated(l,true)}}}return true});this.attachEvent("onRowPaste",function(c){a.setUpdated(c,true)});this.attachEvent("onUndo",function(c){a.setUpdated(c,true)});this.attachEvent("onRowIdChange",function(j,c){var g=a.findRow(j);if(g<a.updatedRows.length){a.updatedRows[g]=c}});this.attachEvent("onSelectStateChanged",function(c){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onEnter",function(g,c){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onBeforeRowDeleted",function(c){if(!this.rowsAr[c]){return true}if(this.dragContext&&a.dnd){window.setTimeout(function(){a.setUpdated(c,true)},1);return true}var g=a.getState(c);if(this._h2){this._h2.forEachChild(c,function(j){a.setUpdated(j.id,false);a.markRow(j.id,true,"deleted")},this)}if(g=="inserted"){a.set_invalid(c,false);a.setUpdated(c,false);return true}if(g=="deleted"){return false}if(g=="true_deleted"){a.setUpdated(c,false);return true}a.setUpdated(c,true,"deleted");return false});this.attachEvent("onBindUpdate",function(c){if(typeof c=="object"){c=c.id}a.setUpdated(c,true)});this.attachEvent("onRowAdded",function(c){if(this.dragContext&&a.dnd){return true}a.setUpdated(c,true,"inserted");return true});a._getRowData=function(l,v){var o=[];o.gr_id=l;if(this.obj.isTreeGrid()){o.gr_pid=this.obj.getParentId(l)}var g=this.obj.getRowById(l);for(var q=0;q<this.obj._cCount;q++){if(this.obj._c_order){var s=this.obj._c_order[q]}else{var s=q}var u=this.obj.cells(g.idd,q);if(this._changed&&!u.wasChanged()){continue}if(this._endnm){o[this.obj.getColumnId(q)]=u.getValue()}else{o["c"+s]=u.getValue()}}var m=this.obj.UserData[l];if(m){for(var n=0;n<m.keys.length;n++){if(m.keys[n]&&m.keys[n].indexOf("__")!=0){o[m.keys[n]]=m.values[n]}}}var m=this.obj.UserData.gridglobaluserdata;if(m){for(var n=0;n<m.keys.length;n++){o[m.keys[n]]=m.values[n]}}return o};a._clearUpdateFlag=function(g){var l=this.obj.getRowById(g);if(l){for(var c=0;c<this.obj._cCount;c++){this.obj.cells(g,c).cell.wasChanged=false}}};a.checkBeforeUpdate=function(m){var l=true;var c=[];for(var j=0;j<this.obj._cCount;j++){if(this.mandatoryFields[j]){var g=this.mandatoryFields[j].call(this.obj,this.obj.cells(m,j).getValue(),m,j);if(typeof g=="string"){this.messages.push(g);l=false}else{l&=g;c[j]=!g}}}if(!l){this.set_invalid(m,"invalid",c);this.setUpdated(m,false)}return l}};dhx4.attachEvent("onGridCreated",function(c){c._con_f_used=[].concat(c._con_f_used);dhtmlXGridObject.prototype._con_f_used=[];var a=function(m){m=m.replace(/(\?|\&)connector[^\f]*/g,"");return m+(m.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")};var l=function(m){return a.call(this,m)+(this._connector_sorting||"")+(this._connector_filter||"")};var j=function(n,o,m){this._connector_sorting="&dhx_sort["+o+"]="+m;return l.call(this,n)};var g=function(n,m,q){var r=[];for(var o=0;o<m.length;o++){r[o]="dhx_filter["+m[o]+"]="+encodeURIComponent(q[o])}this._connector_filter="&"+r.join("&");return l.call(this,n)};c.attachEvent("onCollectValues",function(m){if(this._con_f_used[m]){if(typeof(this._con_f_used[m])=="object"){return this._con_f_used[m]}else{return false}}return true});c.attachEvent("onDynXLS",function(){this.xmlFileUrl=l.call(this,this.xmlFileUrl);return true});c.attachEvent("onBeforeSorting",function(q,o,n){if(o=="connector"){var m=this;this.clearAndLoad(j.call(this,this.xmlFileUrl,q,n),function(){m.setSortImgState(true,q,n)});return false}return true});c.attachEvent("onFilterStart",function(n,m){var q=this.getSortingState();if(this._con_f_used.length){var o=this;this.clearAndLoad(g.call(this,this.xmlFileUrl,n,m));if(q.length){o.setSortImgState(true,q[0],q[1])}return false}return true})});dhtmlXGridObject.prototype._con_f_used=[];dhtmlXGridObject.prototype._in_header_connector_text_filter=function(c,a){if(!this._con_f_used[a]){this._con_f_used[a]=1}return this._in_header_text_filter(c,a)};dhtmlXGridObject.prototype._in_header_connector_select_filter=function(c,a){if(!this._con_f_used[a]){this._con_f_used[a]=2}return this._in_header_select_filter(c,a)};dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;dhtmlXGridObject.prototype.load=function(c,l,j){if(!this._colls_loaded&&this.cellType){var a=[];for(var g=0;g<this.cellType.length;g++){if(this.cellType[g].indexOf("co")==0||this.cellType[g].indexOf("clist")==0||this._con_f_used[g]==2){a.push(g)}}if(a.length){arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+a.join(",")}}return this.load_connector.apply(this,arguments)};dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;dhtmlXGridObject.prototype._parseHead=function(c,x,s){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){var u=dhx4.ajax.xpath("./coll_options",arguments[0]);for(var o=0;o<u.length;o++){var r=u[o].getAttribute("for");var w=[];var l=null;if(this.cellType[r]=="combo"){l=this.getColumnCombo(r)}else{if(this.cellType[r].indexOf("co")==0){l=this.getCombo(r)}}var n=dhx4.ajax.xpath("./item",u[o]);var a=[];for(var m=0;m<n.length;m++){var g=n[m].getAttribute("value");if(l){var q=n[m].getAttribute("label")||g;if(l.addOption){a.push([g,q])}else{l.put(g,q)}w[w.length]=q}else{w[w.length]=g}}if(a.length){if(l){l.addOption(a)}}else{if(w.length&&!l){if(this.registerCList){this.registerCList(r*1,w)}}}if(this._con_f_used[r*1]){this._con_f_used[r*1]=w}}this._colls_loaded=true}};function dhtmlXGridCellObject(a){this.destructor=function(){this.cell.obj=null;this.cell=null;this.grid=null;this.base=null;return null};this.cell=a;this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}else{return this.cell.innerHTML._dhx_trim()}};this.getMathValue=function(){if(this.cell.original){return this.cell.original}else{return this.getValue()}};this.getFont=function(){arOut=new Array(3);if(this.cell.style.fontFamily){arOut[0]=this.cell.style.fontFamily}if(this.cell.style.fontWeight=="bold"||this.cell.parentNode.style.fontWeight=="bold"){arOut[1]="bold"}if(this.cell.style.fontStyle=="italic"||this.cell.parentNode.style.fontWeight=="italic"){arOut[1]+="italic"}if(this.cell.style.fontSize){arOut[2]=this.cell.style.fontSize}else{arOut[2]=""}return arOut.join("-")};this.getTextColor=function(){if(this.cell.style.color){return this.cell.style.color}else{return"#000000"}};this.getBgColor=function(){if(this.cell.bgColor){return this.cell.bgColor}else{return"#FFFFFF"}};this.getHorAlign=function(){if(this.cell.style.textAlign){return this.cell.style.textAlign}else{if(this.cell.style.textAlign){return this.cell.style.textAlign}else{return"left"}}};this.getWidth=function(){return this.cell.scrollWidth};this.setFont=function(c){fntAr=c.split("-");this.cell.style.fontFamily=fntAr[0];this.cell.style.fontSize=fntAr[fntAr.length-1];if(fntAr.length==3){if(/bold/.test(fntAr[1])){this.cell.style.fontWeight="bold"}if(/italic/.test(fntAr[1])){this.cell.style.fontStyle="italic"}if(/underline/.test(fntAr[1])){this.cell.style.textDecoration="underline"}}};this.setTextColor=function(c){this.cell.style.color=c};this.setBgColor=function(c){if(c==""){c=null}this.cell.style.background=c};this.setHorAlign=function(c){if(c.length==1){if(c=="c"){this.cell.style.textAlign="center"}else{if(c=="l"){this.cell.style.textAlign="left"}else{this.cell.style.textAlign="right"}}}else{this.cell.style.textAlign=c}};this.wasChanged=function(){if(this.cell.wasChanged){return true}else{return false}};this.isCheckbox=function(){var c=this.cell.firstChild;if(c&&c.tagName=="INPUT"){type=c.type;if(type=="radio"||type=="checkbox"){return true}else{return false}}else{return false}};this.isChecked=function(){if(this.isCheckbox()){return this.cell.firstChild.checked}};this.isDisabled=function(){return this.cell._disabled};this.setChecked=function(c){if(this.isCheckbox()){if(c!="true"&&c!=1){c=false}this.cell.firstChild.checked=c}};this.setDisabled=function(c){if(c!="true"&&c!=1){c=false}if(this.isCheckbox()){this.cell.firstChild.disabled=c;if(this.disabledF){this.disabledF(c)}}this.cell._disabled=c}}dhtmlXGridCellObject.prototype={getAttribute:function(a){return this.cell._attrs[a]},setAttribute:function(a,c){this.cell._attrs[a]=c},getInput:function(){if(this.obj&&(this.obj.tagName=="INPUT"||this.obj.tagName=="TEXTAREA")){return this.obj}var a=(this.obj||this.cell).getElementsByTagName("TEXTAREA");if(!a.length){a=(this.obj||this.cell).getElementsByTagName("INPUT")}return a[0]}};dhtmlXGridCellObject.prototype.setValue=function(a){if((typeof(a)!="number")&&(!a||a.toString()._dhx_trim()=="")){a="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCValue(a)};dhtmlXGridCellObject.prototype.getTitle=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};dhtmlXGridCellObject.prototype.setCValue=function(c,a){this.cell.innerHTML=c;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,(arguments.length>1?a:c)])};dhtmlXGridCellObject.prototype.setCTxtValue=function(a){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(a));this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,a])};dhtmlXGridCellObject.prototype.setLabel=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.getMath=function(){if(this._val){return this.val}else{return this.getValue()}};function eXcell(){this.obj=null;this.val=null;this.changeState=function(){return false};this.edit=function(){this.val=this.getValue()};this.detach=function(){return false};this.getPosition=function(j){var a=j;var g=0;var c=0;while(a.tagName!="BODY"){g+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return new Array(g,c)}}eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=(!this.grid.multiLine)?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(c){(c||event).cancelBubble=true};this.obj.onmousedown=function(c){(c||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(c){if(!c){c=event}c.cancelBubble=true;return true};if(_isIE){this.obj.focus();this.obj.blur()}this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell._orig_value||this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){var c=this.obj.value;this.setValue(c);return this.val!=this.getValue()}}eXcell_edn.prototype=new eXcell_ed;eXcell_edn.prototype.setValue=function(a){if(!a||a.toString()._dhx_trim()==""){this.cell._clearCell=true;return this.setCValue("&nbsp;",0)}else{this.cell._clearCell=false;this.cell._orig_value=a}this.setCValue(this.grid._aplNF(a,this.cell._cellIndex),a)};function eXcell_ch(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")}};this.changeState=function(c){if(c===true&&!this.grid.isActive){if(window.globalActiveDHTMLGridObject!=null&&window.globalActiveDHTMLGridObject!=this.grid&&window.globalActiveDHTMLGridObject.isActive){window.globalActiveDHTMLGridObject.setActive(false)}this.grid.setActive(true)}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(c){this.setValue(c.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+c+".gif' onclick='new eXcell_ch(this.parentNode).changeState(true); (arguments[0]||event).cancelBubble=true; '>",this.cell.chstate)};function eXcell_ra(a){this.base=eXcell_ch;this.base(a);this.grid=a.parentNode.grid;this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")}};this.changeState=function(c){if(c===false&&this.getValue()==1){return}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.edit=null}eXcell_ra.prototype=new eXcell_ch;eXcell_ra.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){if(!this.grid._RaSeCol){this.grid._RaSeCol=[]}if(this.grid._RaSeCol[this.cell._cellIndex]){var a=this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);a.setValue("0");if(this.grid.rowsAr[a.cell.parentNode.idd]){this.grid.callEvent("onEditCell",[1,a.cell.parentNode.idd,a.cell._cellIndex])}}this.grid._RaSeCol[this.cell._cellIndex]=this.cell;c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+c+".gif' onclick='new eXcell_ra(this.parentNode).changeState(false);'>",this.cell.chstate)};function eXcell_txt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(j){(j||event).cancelBubble=true};var c=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;document.body.appendChild(this.obj);if(_isOpera){this.obj.onkeypress=function(j){if(j.keyCode==9){return false}}}this.obj.onkeydown=function(l){var j=(l||event);if(j.keyCode==9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:j.keyCode,shiftKey:j.shiftKey,srcElement:"0"});return false}};this.obj.style.left=c[0]+"px";this.obj.style.top=c[1]+this.cell.offsetHeight+"px";if(this.cell.offsetWidth<200){var g=200}else{var g=this.cell.offsetWidth}this.obj.style.width=g+16+"px";if(_isIE){this.obj.select();this.obj.value=this.obj.value}this.obj.focus()};this.detach=function(){var c="";c=this.obj.value;if(c==""){this.cell._clearCell=true}else{this.cell._clearCell=false}this.setValue(c);document.body.removeChild(this.obj);this.obj=null;return this.val!=this.getValue()};this.getValue=function(){if(this.obj){return this.obj.value}if(this.cell._clearCell){return""}if(typeof this.cell._brval!="undefined"){return this.cell._brval}if((!this.grid.multiLine)){return this.cell._brval||this.cell.innerHTML}else{return this.cell._brval||this.cell.innerHTML.replace(/<br[^>]*>/gi,"\n")._dhx_trim()}}}eXcell_txt.prototype=new eXcell;function eXcell_txttxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}if((!this.grid.multiLine)&&this.cell._brval){return this.cell._brval}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){this.cell._brval=c;if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(a){this.cell._brval=a;if(!a||a.toString()._dhx_trim()==""){a="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}if((!this.grid.multiLine)||this.cell._clearCell){this.setCValue(a,this.cell._brval)}else{this.setCValue(a.replace(/\n/g,"<br/>"),a)}};function eXcell_co(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));this.editable=true}this.shiftNext=function(){var c=this.list.options[this.list.selectedIndex+1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text;return true};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var c=this.list.options[this.list.selectedIndex-1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text}return true};this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var j=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(q){(q||event).cancelBubble=true};this.obj.onmousedown=function(q){(q||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(q){if(!q){q=event}q.cancelBubble=true;return true};var m=this;this.obj.onkeyup=function(s){var r=(s||event).keyCode;if(r==38||r==40||r==9){return}var u=this.readonly?String.fromCharCode(r):this.value;var v=m.list.options;for(var q=0;q<v.length;q++){if(v[q].text.indexOf(u)==0){return v[q].selected=true}}};this.list=document.createElement("SELECT");this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=j[0]+"px";this.list.style.top=j[1]+this.cell.offsetHeight+"px";this.list.onclick=function(s){var r=s||window.event;var q=r.target||r.srcElement;if(q.tagName=="OPTION"){q=q.parentNode}m.editable=false;m.grid.editStop();r.cancelBubble=true};var c=this.combo.getKeys();var l=false;var o=0;for(var g=0;g<c.length;g++){var n=this.combo.get(c[g]);this.list.options[this.list.options.length]=new Option(n,c[g]);if(c[g]==this.val){o=this.list.options.length-1;l=true}}if(l==false){this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val);o=this.list.options.length-1}document.body.appendChild(this.list);this.list.size="6";this.cstate=1;if(this.editable){this.cell.innerHTML=""}else{this.obj.style.width="1px";this.obj.style.height="1px"}this.cell.appendChild(this.obj);this.list.options[o].selected=true;if(this.editable){this.obj.focus();this.obj.focus()}if(!this.editable){this.obj.style.visibility="hidden";this.list.focus();this.list.onkeydown=function(q){q=q||window.event;m.grid.setActive(true);if(q.keyCode<30){return m.grid.doKey({target:m.cell,keyCode:q.keyCode,shiftKey:q.shiftKey,ctrlKey:q.ctrlKey})}}}};this.getValue=function(){return((this.cell.combo_value==window.undefined)?"":this.cell.combo_value)};this.detach=function(){if(this.val!=this.getValue()){this.cell.wasChanged=true}if(this.list.parentNode!=null){if(this.editable){var c=this.list.options[this.list.selectedIndex];if(c&&c.text==this.obj.value){this.setValue(this.list.value)}else{var g=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));var j=g.values._dhx_find(this.obj.value);if(j!=-1){this.setValue(g.keys[j])}else{this.setValue(this.cell.combo_value=this.obj.value)}}}else{this.setValue(this.list.value)}}if(this.list.parentNode){this.list.parentNode.removeChild(this.list)}if(this.obj.parentNode){this.obj.parentNode.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_co.prototype=new eXcell;eXcell_co.prototype.getText=function(){return this.cell.innerHTML};eXcell_co.prototype.setValue=function(l){if(typeof(l)=="object"){var g=dhx4.ajax.xpath("./option",l);if(g.length){this.cell._combo=new dhtmlXGridComboObject()}for(var c=0;c<g.length;c++){this.cell._combo.put(g[c].getAttribute("value"),g[c].firstChild?g[c].firstChild.data:"")}l=l.firstChild.data}if((l||"").toString()._dhx_trim()==""){l=null}this.cell.combo_value=l;if(l!==null){var a=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(l);this.setCValue(a===null?l:a,l)}else{this.setCValue("&nbsp;",l)}};function eXcell_coro(a){this.base=eXcell_co;this.base(a);this.editable=false}eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(a){this.base=eXcell_co;this.base(a)}eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};eXcell_cotxt.prototype.setValue=function(g){if(typeof(g)=="object"){var c=dhx4.ajax.xpath("./option",g);if(c.length){this.cell._combo=new dhtmlXGridComboObject()}for(var a=0;a<c.length;a++){this.cell._combo.put(c[a].getAttribute("value"),c[a].firstChild?c[a].firstChild.data:"")}g=g.firstChild.data}if((g||"").toString()._dhx_trim()==""){g=null}if(g!==null){this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(g)||g,g)}else{this.setCTxtValue(" ",g)}this.cell.combo_value=g};function eXcell_corotxt(a){this.base=eXcell_co;this.base(a);this.editable=false}eXcell_corotxt.prototype=new eXcell_cotxt;function eXcell_cp(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("SPAN");this.obj.style.border="1px solid black";this.obj.style.position="absolute";var g=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=g[0]+"px";this.obj.style.zIndex=1000;this.obj.style.top=g[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(g){if(g.length==1){g="0"+g}return g};this.colorPanel=function(u,x){var q=document.createElement("TABLE");x.appendChild(q);q.cellSpacing=0;q.editor_obj=this;q.style.cursor="default";q.onclick=function(y){var r=y||window.event;var j=r.target||r.srcElement;var n=j.parentNode.parentNode.parentNode.editor_obj;n.setValue(j._bg);n.grid.editStop()};var m=256/u;for(var o=0;o<=(256/m);o++){var g=q.insertRow(o);for(var s=0;s<=(256/m);s++){for(var l=0;l<=(256/m);l++){R=new Number(m*o)-(o==0?0:1);G=new Number(m*s)-(s==0?0:1);B=new Number(m*l)-(l==0?0:1);var w=this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16));var v=g.insertCell(s);v.width="10px";v.innerHTML="&nbsp;";v.title=w.toUpperCase();v.style.backgroundColor="#"+w;v._bg="#"+w;if(this.val!=null&&"#"+w.toUpperCase()==this.val.toUpperCase()){v.style.border="2px solid white"}}}}};this.getValue=function(){return this.cell.firstChild._bg||""};this.getRed=function(){return Number(parseInt(this.getValue().substr(1,2),16))};this.getGreen=function(){return Number(parseInt(this.getValue().substr(3,2),16))};this.getBlue=function(){return Number(parseInt(this.getValue().substr(5,2),16))};this.detach=function(){if(this.obj.offsetParent!=null){document.body.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_cp.prototype=new eXcell;eXcell_cp.prototype.setValue=function(a){this.setCValue("<div style='width:100%;height:"+((this.grid.multiLine?"100%":23))+";background-color:"+(a||"")+";border:0px;'>&nbsp;</div>",a);this.cell.firstChild._bg=a};function eXcell_img(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG"){return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"")}else{if(this.cell.firstChild.tagName=="A"){var g=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");g+="^"+this.cell.lnk;if(this.cell.trg){g+="^"+this.cell.trg}return g}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(g){var c=g;if((g||"").indexOf("^")!=-1){var a=g.split("^");g=a[0];c=this.cell._attrs.title||a[1];if(a.length>2){this.cell.lnk=a[2];if(a[3]){this.cell.trg=a[3]}}this.cell.titFl="1"}this.setCValue("<img src='"+this.grid.iconURL+(g||"")._dhx_trim()+"' border='0'>",g);if(this.cell.lnk){this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>"}this.cell._brval=c};function eXcell_price(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){if(this.cell.childNodes.length>1){return this.cell.childNodes[1].innerHTML.toString()._dhx_trim()}else{return"0"}}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(c){if(isNaN(parseFloat(c))){c=this.val||0}var a="green";if(c<0){a="red"}this.setCValue("<span>$</span><span style='padding-right:2px;color:"+a+";'>"+c+"</span>",c)};function eXcell_dyn(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed;eXcell_dyn.prototype.setValue=function(g){if(!g||isNaN(Number(g))){if(g!==""){g=0}}if(g>0){var c="green";var a="dyn_up.gif"}else{if(g==0){var c="black";var a="dyn_.gif"}else{var c="red";var a="dyn_down.gif"}}this.setCValue("<div style='position:relative;padding-right:2px; width:100%;overflow:hidden; white-space:nowrap;'><img src='"+this.grid.imgURL+""+a+"' height='15' style='position:absolute;top:0px;left:0px;'><span style=' padding-left:20px; width:100%;color:"+c+";'>"+g+"</span></div>",g)};function eXcell_ro(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()}}eXcell_ro.prototype=new eXcell;window.eXcell_hidden=function(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell.val}};eXcell_hidden.prototype=new eXcell;eXcell_hidden.prototype.setValue=function(a){this.cell.val=a};function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex).toString()}}eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(a){if(a===0){}else{if(!a||a.toString()._dhx_trim()==""){this.setCValue("&nbsp;");return this.cell._clearCell=true}}this.cell._clearCell=false;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")};function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.setValue=function(c){if(!c){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)};this.getValue=function(){if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)}}eXcell_rotxt.prototype=new eXcell;function dhtmlXGridComboObject(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();this.put=function(c,g){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){this.values[a]=g;return true}}this.values[this.values.length]=g;this.keys[this.keys.length]=c};this.get=function(c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){return this.values[a]}}return null};this.clear=function(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray()};this.remove=function(c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){this.keys._dhx_removeAt(a);this.values._dhx_removeAt(a);return true}}};this.size=function(){var a=0;for(var c=0;c<this.keys.length;c++){if(this.keys[c]!=null){a++}}return a};this.getKeys=function(){var a=new Array(0);for(var c=0;c<this.keys.length;c++){if(this.keys[c]!=null){a[a.length]=this.keys[c]}}return a};this.save=function(){this._save=new Array();for(var a=0;a<this.keys.length;a++){this._save[a]=[this.keys[a],this.values[a]]}};this.restore=function(){if(this._save){this.keys[a]=new Array();this.values[a]=new Array();for(var a=0;a<this._save.length;a++){this.keys[a]=this._save[a][0];this.values[a]=this._save[a][1]}}};return this}function Hashtable(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();return this}Hashtable.prototype=new dhtmlXGridComboObject;if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachGrid=function(){this.callEvent("_onBeforeContentAttach",["grid"]);var a=document.createElement("DIV");a.style.width="100%";a.style.height="100%";a.style.position="relative";a.style.overflow="hidden";this._attachObject(a);this.dataType="grid";this.dataObj=new dhtmlXGridObject(a);this.dataObj.setSkin(this.conf.skin);if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}a=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXGridObject.prototype.enableDragAndDrop=function(a){if(a=="temporary_disabled"){this.dADTempOff=false;a=true}else{this.dADTempOff=true}this.dragAndDropOff=dhx4.s2b(a);this._drag_validate=true;if(a){this.objBox.ondragstart=function(c){(c||event).cancelBubble=true;return false}}};dhtmlXGridObject.prototype.setDragBehavior=function(a){this.dadmodec=this.dadmodefix=0;switch(a){case"child":this.dadmode=0;this._sbmod=false;break;case"sibling":this.dadmode=1;this._sbmod=false;break;case"sibling-next":this.dadmode=1;this._sbmod=true;break;case"complex":this.dadmode=2;this._sbmod=false;break;case"complex-next":this.dadmode=2;this._sbmod=true;break}};dhtmlXGridObject.prototype.enableDragOrder=function(a){this._dndorder=dhx4.s2b(a)};dhtmlXGridObject.prototype._checkParent=function(j,c){var g=this._h2.get[j.idd].parent;if(!g.parent){return}for(var a=0;a<c.length;a++){if(c[a]==g.id){return true}}return this._checkParent(this.rowsAr[g.id],c)};dhtmlXGridObject.prototype._createDragNode=function(g,j){this.editStop();if(window.dhtmlDragAndDrop.dragNode){return null}if(!this.dADTempOff){return null}g.parentObject=new Object();g.parentObject.treeNod=this;var o=this.callEvent("onBeforeDrag",[g.parentNode.idd,g._cellIndex,j]);if(!o){return null}var l=new Array();l=this.getSelectedId();l=(((l)&&(l!=""))?l.split(this.delim):[]);var m=false;for(var c=0;c<l.length;c++){if(l[c]==g.parentNode.idd){m=true}}if(!m){this.selectRow(this.rowsAr[g.parentNode.idd],false,j.ctrlKey,false);if(!j.ctrlKey){l=[]}l[this.selMultiRows?l.length:0]=g.parentNode.idd}if(this.isTreeGrid()){for(var c=l.length-1;c>=0;c--){if(this._checkParent(this.rowsAr[l[c]],l)){l.splice(c,1)}}}var q=this;if(l.length&&this._dndorder){l.sort(function(s,r){return(q.rowsAr[s].rowIndex>q.rowsAr[r].rowIndex?1:-1)})}var a=this.getFirstParentOfType(_isIE?j.srcElement:j.target,"TD");if(a){this._dndExtra=a._cellIndex}this._dragged=new Array();for(var c=0;c<l.length;c++){if(this.rowsAr[l[c]]){this._dragged[this._dragged.length]=this.rowsAr[l[c]];this.rowsAr[l[c]].treeNod=this}}g.parentObject.parentNode=g.parentNode;var n=document.createElement("div");n.innerHTML=(o!==true?o:this.rowToDragElement(g.parentNode.idd));n.style.position="absolute";n.className="dragSpanDiv";return n};dhtmlXGridObject.prototype._createSdrgc=function(){this._sdrgc=document.createElement("DIV");this._sdrgc.innerHTML="&nbsp;";this._sdrgc.className="gridDragLine";this.objBox.appendChild(this._sdrgc)};function dragContext(w,v,u,s,r,q,n,o,m,g){this.source=w||"grid";this.target=v||"grid";this.mode=u||"move";this.dropmode=s||"child";this.sid=r||0;this.tid=q;this.sobj=n||null;this.tobj=o||null;this.sExtra=m||null;this.tExtra=g||null;return this}dragContext.prototype.valid=function(){if(this.sobj!=this.tobj){return true}if(this.sid==this.tid){return false}if(this.target=="treeGrid"){var a=this.tid;while(a=this.tobj.getParentId(a)){if(this.sid==a){return false}}}return true};dragContext.prototype.close=function(){this.sobj=null;this.tobj=null};dragContext.prototype.copy=function(){return new dragContext(this.source,this.target,this.mode,this.dropmode,this.sid,this.tid,this.sobj,this.tobj,this.sExtra,this.tExtra)};dragContext.prototype.set=function(g,c){this[g]=c;return this};dragContext.prototype.uid=function(g,c){this.nid=this.sid;while(this.tobj.rowsAr[this.nid]){this.nid=this.nid+((new Date()).valueOf())}return this};dragContext.prototype.data=function(){if(this.sobj==this.tobj){return this.sobj._getRowArray(this.sobj.rowsAr[this.sid])}if(this.source=="tree"){return this.tobj.treeToGridElement(this.sobj,this.sid,this.tid)}else{return this.tobj.gridToGrid(this.sid,this.sobj,this.tobj)}};dragContext.prototype.attrs=function(){if(this.source=="tree"){return{}}else{return this.sobj.rowsAr[this.sid]._attrs}};dragContext.prototype.childs=function(){if(this.source=="treeGrid"){return this.sobj._h2.get[this.sid]._xml_await?this.sobj._h2.get[this.sid].has_kids:null}return null};dragContext.prototype.pid=function(){if(!this.tid){return 0}if(!this.tobj._h2){return 0}if(this.target=="treeGrid"){if(this.dropmode=="child"){return this.tid}else{var c=this.tobj.rowsAr[this.tid];var a=this.tobj._h2.get[c.idd].parent.id;if((this.alfa)&&(this.tobj._sbmod)&&(c.nextSibling)){var g=this.tobj._h2.get[c.nextSibling.idd].parent.id;if(g==this.tid){return this.tid}if(g!=a){return g}}return a}}};dragContext.prototype.ind=function(){if(this.tid==window.unknown){return this.tobj.rowsBuffer.length}if(this.target=="treeGrid"){if(this.dropmode=="child"){this.tobj.openItem(this.tid)}else{this.tobj.openItem(this.tobj.getParentId(this.tid))}}var a=this.tobj.rowsBuffer._dhx_find(this.tobj.rowsAr[this.tid]);if((this.alfa)&&(this.tobj._sbmod)&&(this.dropmode=="sibling")){var c=this.tobj.rowsAr[this.tid];if((c.nextSibling)&&(this._h2.get[c.nextSibling.idd].parent.id==this.tid)){return a+1}}return(a+1+((this.target=="treeGrid"&&a>=0&&this.tobj._h2.get[this.tobj.rowsBuffer[a].idd].state=="minus")?this.tobj._getOpenLenght(this.tobj.rowsBuffer[a].idd,0):0))};dragContext.prototype.img=function(){if((this.target!="grid")&&(this.sobj._h2)){return this.sobj.getItemImage(this.sid)}else{return null}};dragContext.prototype.slist=function(){var c=new Array();for(var a=0;a<this.sid.length;a++){c[c.length]=this.sid[a][(this.source=="tree")?"id":"idd"]}return c.join(",")};dhtmlXGridObject.prototype._drag=function(s,l,r,u){if(this._realfake){return this._fake._drag()}var q=(this.lastLanding);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}var j=r.parentNode;var g=s.parentObject;if(!j.idd){j.grid=this;this.dadmodefix=0}var o=new dragContext(0,0,0,((j.grid.dadmode==1||j.grid.dadmodec)?"sibling":"child"));if(g&&g.childNodes){o.set("source","tree").set("sobj",g.treeNod).set("sid",o.sobj._dragged)}else{if(!g){return true}if(g.treeNod.isTreeGrid&&g.treeNod.isTreeGrid()){o.set("source","treeGrid")}o.set("sobj",g.treeNod).set("sid",o.sobj._dragged)}if(j.grid.isTreeGrid()){o.set("target","treeGrid")}else{o.set("dropmode","sibling")}o.set("tobj",j.grid).set("tid",j.idd);if(((o.tobj.dadmode==2)&&(o.tobj.dadmodec==1))&&(o.tobj.dadmodefix<0)){if(o.tobj.obj.rows[1].idd!=o.tid){o.tid=j.previousSibling.idd}else{o.tid=0}}var a=this.getFirstParentOfType(u,"TD");if(a){o.set("tExtra",a._cellIndex)}if(a){o.set("sExtra",o.sobj._dndExtra)}if(o.sobj.dpcpy){o.set("mode","copy")}if(o.tobj._realfake){o.tobj=o.tobj._fake}if(o.sobj._realfake){o.sobj=o.sobj._fake}o.tobj._clearMove();if(g&&g.treeNod&&g.treeNod._nonTrivialRow){g.treeNod._nonTrivialRow(this,o.tid,o.dropmode,g)}else{o.tobj.dragContext=o;if(!o.tobj.callEvent("onDrag",[o.slist(),o.tid,o.sobj,o.tobj,o.sExtra,o.tExtra])){return o.tobj.dragContext=null}var v=new Array();if(typeof(o.sid)=="object"){var n=o.copy();for(var m=0;m<o.sid.length;m++){if(!n.set("alfa",(!m)).set("sid",o.sid[m][(o.source=="tree"?"id":"idd")]).valid()){continue}n.tobj._dragRoutine(n);if(n.target=="treeGrid"&&n.dropmode=="child"){n.tobj.openItem(n.tid)}v[v.length]=n.nid;n.set("dropmode","sibling").set("tid",n.nid)}n.close()}else{o.tobj._dragRoutine(o)}if(o.tobj.laterLink){o.tobj.laterLink()}o.tobj.callEvent("onDrop",[o.slist(),o.tid,v.join(","),o.sobj,o.tobj,o.sExtra,o.tExtra])}o.tobj.dragContext=null;o.close()};dhtmlXGridObject.prototype._dragRoutine=function(u){if((u.sobj==u.tobj)&&(u.source=="grid")&&(u.mode=="move")&&!this._fake){if(u.sobj._dndProblematic){return}var r=u.sobj.rowsAr[u.sid];var s=u.sobj.rowsCol._dhx_find(r);u.sobj.rowsCol._dhx_removeAt(u.sobj.rowsCol._dhx_find(r));u.sobj.rowsBuffer._dhx_removeAt(u.sobj.rowsBuffer._dhx_find(r));u.sobj.rowsBuffer._dhx_insertAt(u.ind(),r);if(u.tobj._fake){u.tobj._fake.rowsCol._dhx_removeAt(s);var v=u.tobj._fake.rowsAr[u.sid];v.parentNode.removeChild(v)}u.sobj._insertRowAt(r,u.ind());u.nid=u.sid;u.sobj.callEvent("onGridReconstructed",[]);return}var q;if(this._h2&&typeof u.tid!="undefined"&&u.dropmode=="sibling"&&(this._sbmod||u.tid)){if(u.alfa&&this._sbmod&&this._h2.get[u.tid].childs.length){this.openItem(u.tid);q=u.uid().tobj.addRowBefore(u.nid,u.data(),this._h2.get[u.tid].childs[0].id,u.img(),u.childs())}else{q=u.uid().tobj.addRowAfter(u.nid,u.data(),u.tid,u.img(),u.childs())}}else{q=u.uid().tobj.addRow(u.nid,u.data(),u.ind(),u.pid(),u.img(),u.childs())}q._attrs=u.attrs();if(u.source=="tree"){this.callEvent("onRowAdded",[u.nid]);var a=u.sobj._globalIdStorageFind(u.sid);if(a.childsCount){var o=u.copy().set("tid",u.nid).set("dropmode",u.target=="grid"?"sibling":"child");for(var m=0;m<a.childsCount;m++){u.tobj._dragRoutine(o.set("sid",a.childNodes[m].id));if(u.mode=="move"){m--}}o.close()}}else{u.tobj._copyUserData(u);this.callEvent("onRowAdded",[u.nid]);if((u.source=="treeGrid")){if(u.sobj==u.tobj){q._xml=u.sobj.rowsAr[u.sid]._xml}var n=u.sobj._h2.get[u.sid];if((n)&&(n.childs.length)){var o=u.copy().set("tid",u.nid);if(u.target=="grid"){o.set("dropmode","sibling")}else{if(!o.tobj.kidsXmlFile){o.tobj.openItem(u.tid)}o.set("dropmode","child")}var g=n.childs.length;if(!o.tobj.kidsXmlFile){for(var m=0;m<g;m++){u.sobj.render_row_tree(null,n.childs[m].id);u.tobj._dragRoutine(o.set("sid",n.childs[m].id));if(g!=n.childs.length){m--;g=n.childs.length}}}o.close()}}}if(u.mode=="move"){u.sobj[(u.source=="tree")?"deleteItem":"deleteRow"](u.sid);if((u.sobj==u.tobj)&&(!u.tobj.rowsAr[u.sid])){u.tobj.changeRowId(u.nid,u.sid);u.nid=u.sid}}};dhtmlXGridObject.prototype.gridToGrid=function(j,a,g){var l=new Array();for(var c=0;c<a.hdr.rows[0].cells.length;c++){l[c]=a.cells(j,c).getValue()}return l};dhtmlXGridObject.prototype.checkParentLine=function(a,c){if((!this._h2)||(!c)||(!a)){return false}if(a.id==c){return true}else{return this.checkParentLine(a.parent,c)}};dhtmlXGridObject.prototype._dragIn=function(m,j,c,n){if(!this.dADTempOff){return 0}var a=this.isTreeGrid();var l=j.parentNode.idd?j.parentNode:j.parentObject;if(this._drag_validate){if(m.parentNode==j.parentNode){return 0}if((a)&&(this==l.grid)&&((this.checkParentLine(this._h2.get[m.parentNode.idd],j.parentNode.idd)))){return 0}}if(!this.callEvent("onDragIn",[l.idd||l.id,m.parentNode.idd,l.grid||l.treeNod,(m.grid||m.parentNode.grid)])){return this._setMove(m,c,n,true)}this._setMove(m,c,n);if((a)&&(m.parentNode.expand!="")){var g=this;this._autoOpenTimer=window.setTimeout(function(){g._autoOpenItem(null,g);g=null},1000);this._autoOpenId=m.parentNode.idd}else{if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}}return m};dhtmlXGridObject.prototype._autoOpenItem=function(a,c){c.openItem(c._autoOpenId)};dhtmlXGridObject.prototype._dragOut=function(c){this._clearMove();var a=c.parentNode.parentObject?c.parentObject.id:c.parentNode.idd;this.callEvent("onDragOut",[a]);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}};dhtmlXGridObject.prototype._setMove=function(m,c,o,l){if(!m.parentNode.idd){return}var g=dhx4.absTop(m);var a=dhx4.absTop(this.objBox);if((g-a)>(parseInt(this.objBox.offsetHeight)-50)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20}if((g-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(l){return 0}if(this.dadmode==2){var n=o-g+(document.body.scrollTop||document.documentElement.scrollTop)-2-m.offsetHeight/2;if((Math.abs(n)-m.offsetHeight/6)>0){this.dadmodec=1;if(n<0){this.dadmodefix=-1}else{this.dadmodefix=1}}else{this.dadmodec=0}}else{this.dadmodec=this.dadmode}if(this.dadmodec){if(!this._sdrgc){this._createSdrgc()}this._sdrgc.style.display="block";this._sdrgc.style.top=g-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?m.offsetHeight:0)+"px"}else{this._llSelD=m;if(m.parentNode.tagName=="TR"){for(var j=0;j<m.parentNode.childNodes.length;j++){var n=m.parentNode.childNodes[j];n._bgCol=n.style.backgroundColor;n.style.backgroundColor="#FFCCCC"}}}};dhtmlXGridObject.prototype._clearMove=function(){if(this._sdrgc){this._sdrgc.style.display="none"}if((this._llSelD)&&(this._llSelD.parentNode.tagName=="TR")){var c=this._llSelD.parentNode.childNodes;for(var a=0;a<c.length;a++){c[a].style.backgroundColor=c[a]._bgCol}}this._llSelD=null};dhtmlXGridObject.prototype.rowToDragElement=function(a){var c=this.cells(a,0).getValue();return c};dhtmlXGridObject.prototype._copyUserData=function(j){if(!j.tobj.UserData[j.nid]||j.tobj!=j.sobj){j.tobj.UserData[j.nid]=new Hashtable()}else{return}var g=j.sobj.UserData[j.sid];var a=j.tobj.UserData[j.nid];if(g){a.keys=a.keys.concat(g.keys);a.values=a.values.concat(g.values)}};dhtmlXGridObject.prototype.moveRow=function(g,j,a,c){switch(j){case"row_sibling":this.moveRowTo(g,a,"move","sibling",this,c);break;case"up":this.moveRowUp(g);break;case"down":this.moveRowDown(g);break}};dhtmlXGridObject.prototype._nonTrivialNode=function(s,r,n,o,g){if((s.callEvent)&&(!g)){if(!s.callEvent("onDrag",[o.idd,r.id,(n?n.id:null),this,s])){return false}}var q=o.idd;var a=q;while(s._idpull[a]){a+=(new Date()).getMilliseconds().toString()}var l=(this.isTreeGrid()?this.getItemImage(q):"");if(n){for(j=0;j<r.childsCount;j++){if(r.childNodes[j]==n){break}}if(j!=0){n=r.childNodes[j-1]}else{st="TOP";n=""}}var c=s._attachChildNode(r,a,this.gridToTreeElement(s,a,q),"",l,l,l,"","",n);if(this._h2){var m=this._h2.get[q];if(m.childs.length){for(var j=0;j<m.childs.length;j++){this._nonTrivialNode(s,c,0,this.rowsAr[m.childs[j].id],1);if(!this.dpcpy){j--}}}}if(!this.dpcpy){this.deleteRow(q)}if((s.callEvent)&&(!g)){s.callEvent("onDrop",[a,r.id,(n?n.id:null),this,s])}};dhtmlXGridObject.prototype.gridToTreeElement=function(c,g,a){return this.cells(a,0).getValue()};dhtmlXGridObject.prototype.treeToGridElement=function(j,l,a){var c=new Array();var m=this.cellType._dhx_find("tree");if(m==-1){m=0}for(var g=0;g<this.getColumnCount();g++){c[c.length]=(g!=m)?(j.getUserData(l,this.getColumnId(g))||""):j.getItemText(l)}return c};dhtmlXGridObject.prototype.moveRowTo=function(j,g,n,m,a,l){var o=new dragContext((a||this).isTreeGrid()?"treeGrid":"grid",(l||this).isTreeGrid()?"treeGrid":"grid",n,m||"sibling",j,g,a||this,l||this);o.tobj._dragRoutine(o);o.close();return o.nid};dhtmlXGridObject.prototype.enableMercyDrag=function(a){this.dpcpy=dhx4.s2b(a)};dhtmlXGridObject.prototype.toPDF=function(j,r,w,u,o,C){var l={row:this.getSelectedRowId(),col:this.getSelectedCellIndex()};if(l.row===null||l.col===-1){l=false}else{if(l.row&&l.row.indexOf(this.delim)!==-1){var c=this.cells(l.row,l.col).cell;c.parentNode.className=c.parentNode.className.replace(" rowselected","");c.className=c.className.replace(" cellselected","");l.el=c}else{l=false}}r=r||"color";var x=r=="full_color";var a=this;a._asCDATA=true;if(typeof(C)==="undefined"){this.target=' target="_blank"'}else{this.target=C}eXcell_ch.prototype.getContent=function(){return this.getValue()};eXcell_ra.prototype.getContent=function(){return this.getValue()};function A(F){var M=[];for(var K=1;K<a.hdr.rows.length;K++){M[K]=[];for(var J=0;J<a._cCount;J++){var O=a.hdr.rows[K].childNodes[J];if(!M[K][J]){M[K][J]=[0,0]}if(O){M[K][O._cellIndexS]=[O.colSpan,O.rowSpan]}}}var L="<rows profile='"+F+"'";if(w){L+=" header='"+w+"'"}if(u){L+=" footer='"+u+"'"}L+="><head>"+a._serialiseExportConfig(M).replace(/^<head/,"<columns").replace(/head>$/,"columns>");for(var K=2;K<a.hdr.rows.length;K++){var D=0;var S=a.hdr.rows[K];var N="";for(var J=0;J<a._cCount;J++){if((a._srClmn&&!a._srClmn[J])||(a._hrrar[J]&&(!a._fake||J>=a._fake.hdrLabels.length))){D++;continue}var Q=M[K][J];var P=((Q[0]&&Q[0]>1)?' colspan="'+Q[0]+'" ':"");if(Q[1]&&Q[1]>1){P+=' rowspan="'+Q[1]+'" ';D=-1}var E="";var I=S;if(a._fake&&J<a._fake._cCount){I=a._fake.hdr.rows[K]}for(var H=0;H<I.cells.length;H++){if(I.cells[H]._cellIndexS==J){if(I.cells[H].getElementsByTagName("SELECT").length){E=""}else{E=_isIE?I.cells[H].innerText:I.cells[H].textContent}E=E.replace(/[ \n\r\t\xA0]+/," ");break}}if(!E||E==" "){D++}N+="<column"+P+"><![CDATA["+E+"]]></column>"}if(D!=a._cCount){L+="\n<columns>"+N+"</columns>"}}L+="</head>\n";L+=q();return L}function g(){var D=[];if(o){for(var E=0;E<o.length;E++){D.push(v(a.getRowIndex(o[E])))}}else{for(var E=0;E<a.getRowsNum();E++){D.push(v(E))}}return D.join("\n")}function q(){var F=["<foot>"];if(!a.ftr){return""}for(var H=1;H<a.ftr.rows.length;H++){F.push("<columns>");var K=a.ftr.rows[H];for(var E=0;E<a._cCount;E++){if(a._srClmn&&!a._srClmn[E]){continue}if(a._hrrar[E]&&(!a._fake||E>=a._fake.hdrLabels.length)){continue}for(var D=0;D<K.cells.length;D++){var J="";var I="";if(K.cells[D]._cellIndexS==E){J=_isIE?K.cells[D].innerText:K.cells[D].textContent;J=J.replace(/[ \n\r\t\xA0]+/," ");if(K.cells[D].colSpan&&K.cells[D].colSpan!=1){I=" colspan='"+K.cells[D].colSpan+"' "}if(K.cells[D].rowSpan&&K.cells[D].rowSpan!=1){I=" rowspan='"+K.cells[D].rowSpan+"' "}break}}F.push("<column"+I+"><![CDATA["+J+"]]></column>")}F.push("</columns>")}F.push("</foot>");return F.join("\n")}function n(E,D){return(window.getComputedStyle?(window.getComputedStyle(E,null)[D]):(E.currentStyle?E.currentStyle[D]:null))||""}function v(H){if(!a.rowsBuffer[H]){return""}var D=a.render_row(H);if(D.style.display=="none"){return""}var E=a.isTreeGrid()?' level="'+a.getLevel(D.idd)+'"':"";var L="<row"+E+">";for(var J=0;J<a._cCount;J++){if(((!a._srClmn)||(a._srClmn[J]))&&(!a._hrrar[J]||(a._fake&&J<a._fake.hdrLabels.length))){var P=a.cells(D.idd,J);if(x){var I=n(P.cell,"color");var O=n(P.cell,"backgroundColor");var N=n(P.cell,"font-weight")||n(P.cell,"fontWeight");var K=n(P.cell,"font-style")||n(P.cell,"fontStyle");var M=n(P.cell,"text-align")||n(P.cell,"textAlign");var F=n(P.cell,"font-family")||n(P.cell,"fontFamily");if(O=="transparent"||O=="rgba(0, 0, 0, 0)"){O="rgb(255,255,255)"}L+="<cell bgColor='"+O+"' textColor='"+I+"' bold='"+N+"' italic='"+K+"' align='"+M+"' font='"+F+"'>"}else{L+="<cell>"}L+="<![CDATA["+(P.getContent?P.getContent():P.getTitle())+"]]></cell>"}}return L+"</row>"}function s(){var D="</rows>";return D}var y=document.createElement("div");y.style.display="none";document.body.appendChild(y);var m="form_"+a.uid();y.innerHTML='<form id="'+m+'" method="post" action="'+j+'" accept-charset="utf-8"  enctype="application/x-www-form-urlencoded"'+this.target+'><input type="hidden" name="grid_xml" id="grid_xml"/> </form>';document.getElementById(m).firstChild.value=encodeURIComponent(A(r).replace("\u2013","-")+g()+s());document.getElementById(m).submit();y.parentNode.removeChild(y);a=null;if(l){l.el.parentNode.className+=" rowselected";l.el.className+=" cellselected"}l=null};dhtmlXGridObject.prototype._serialiseExportConfig=function(n){function m(j){if(typeof(j)!=="string"){return j}j=j.replace(/&/g,"&amp;");j=j.replace(/"/g,"&quot;");j=j.replace(/'/g,"&apos;");j=j.replace(/</g,"&lt;");j=j.replace(/>/g,"&gt;");return j}var c="<head>";for(var g=0;g<this.hdr.rows[0].cells.length;g++){if(this._srClmn&&!this._srClmn[g]){continue}if(this._hrrar[g]&&(!this._fake||g>=this._fake.hdrLabels.length)){continue}var l=this.fldSort[g];if(l=="cus"){l=this._customSorts[g].toString();l=l.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var r=n[1][g];var o=((r[1]&&r[1]>1)?' rowspan="'+r[1]+'" ':"")+((r[0]&&r[0]>1)?' colspan="'+r[0]+'" ':"");c+="<column "+o+" width='"+this.getColWidth(g)+"' align='"+this.cellAlign[g]+"' type='"+this.cellType[g]+"' hidden='"+((this.isColumnHidden&&this.isColumnHidden(g))?"true":"false")+"' sort='"+(l||"na")+"' color='"+(this.columnColor[g]||"")+"'"+(this.columnIds[g]?(" id='"+this.columnIds[g]+"'"):"")+">";if(this._asCDATA){c+="<![CDATA["+this.getColumnLabel(g)+"]]>"}else{c+=this.getColumnLabel(g)}var q=this.combos[g]?this.getCombo(g):null;if(q){for(var a=0;a<q.keys.length;a++){c+="<option value='"+m(q.keys[a])+"'><![CDATA["+q.values[a]+"]]></option>"}}c+="</column>"}return c+="</head>"};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,j,n,m,c){if(!document.getElementById("ifr")){var l=document.createElement("iframe");l.style.display="none";l.setAttribute("name","dhx_export_iframe");l.setAttribute("src","");l.setAttribute("id","dhx_export_iframe");document.body.appendChild(l)}var g=' target="dhx_export_iframe"';this.toPDF(a,j,n,m,c,g)};dhtmlXGridObject.prototype.filterBy=function(g,l,c){if(this.isTreeGrid()){return this.filterTreeBy(g,l,c)}if(this._f_rowsBuffer){if(!c){this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer));if(this._fake){this._fake.rowsBuffer=this.rowsBuffer}}}else{this._f_rowsBuffer=[].concat(this.rowsBuffer)}if(!this.rowsBuffer.length){return}var m=true;this.dma(true);if(typeof(g)=="object"){for(var a=0;a<l.length;a++){this._filterA(g[a],l[a])}}else{this._filterA(g,l)}this.dma(false);if(this.pagingOn&&this.rowsBuffer.length/this.rowsBufferOutSize<(this.currentPage-1)){this.changePage(0)}this._reset_view();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._filterA=function(c,g){if(g==""){return}var j=true;if(typeof(g)=="function"){j=false}else{g=(g||"").toString().toLowerCase()}if(!this.rowsBuffer.length){return}for(var a=this.rowsBuffer.length-1;a>=0;a--){if(j?(this._get_cell_value(this.rowsBuffer[a],c).toString().toLowerCase().indexOf(g)==-1):(!g.call(this,this._get_cell_value(this.rowsBuffer[a],c),this.rowsBuffer[a].idd))){this.rowsBuffer.splice(a,1)}}};dhtmlXGridObject.prototype.getFilterElement=function(a){if(!this.filters){return}for(var c=0;c<this.filters.length;c++){if(this.filters[c][1]==a){return(this.filters[c][0].combo||this.filters[c][0])}}return null};dhtmlXGridObject.prototype.collectValues=function(j){var u=this.dhxevs.data.oncollectvalues;if(u){var r=true;for(var s in u){var v=u[s].call(this,j);if(v!==true){r=v||r}}if(r!==true){return r}}if(this.isTreeGrid()){return this.collectTreeValues(j)}this.dma(true);this._build_m_order();j=this._m_order?this._m_order[j]:j;var o={};var m=[];var g=this._f_rowsBuffer||this.rowsBuffer;for(var l=0;l<g.length;l++){var a=this._get_cell_value(g[l],j);if(a&&(!g[l]._childIndexes||g[l]._childIndexes[j]!=g[l]._childIndexes[j-1])){o[a]=true}}this.dma(false);var q=(this.combos[j]||(this._col_combos?this._col_combos[j]:false));for(var n in o){if(o[n]===true){if(q){if(q.get&&q.get(n)){n=q.get(n)}else{if(q.getOption&&q.getOption(n)){n=q.getOption(n).text}}}m.push(n)}}return m.sort()};dhtmlXGridObject.prototype._build_m_order=function(){if(this._c_order){this._m_order=[];for(var a=0;a<this._c_order.length;a++){this._m_order[this._c_order[a]]=a}}};dhtmlXGridObject.prototype.filterByAll=function(){var g=[];var c=[];this._build_m_order();for(var j=0;j<this.filters.length;j++){var m=this._m_order?this._m_order[this.filters[j][1]]:this.filters[j][1];if(m>=this._cCount){continue}c.push(m);var n=this.filters[j][0].old_value=this.filters[j][0].value;if(this.filters[j][0]._filter){n=this.filters[j][0]._filter()}var l;if(typeof n!="function"&&(l=(this.combos[m]||(this._col_combos?this._col_combos[m]:false)))){if(l.values){m=l.values._dhx_find(n);n=(m==-1)?n:l.keys[m]}else{if(l.getOptionByLabel){n=(l.getOptionByLabel(n)?l.getOptionByLabel(n).value:n)}}}g.push(n)}if(!this.callEvent("onFilterStart",[c,g])){return}this.filterBy(c,g);if(this._cssEven){this._fixAlterCss()}this.callEvent("onFilterEnd",[this.filters]);if(this._f_rowsBuffer&&this.rowsBuffer.length==this._f_rowsBuffer.length){this._f_rowsBuffer=null}};dhtmlXGridObject.prototype.makeFilter=function(l,g,c){if(!this.filters){this.filters=[]}if(typeof(l)!="object"){l=document.getElementById(l)}if(!l){return}var a=this;if(!l.style.width){l.style.width="90%"}if(l.tagName=="SELECT"){this.filters.push([l,g]);this._loadSelectOptins(l,g);l.onchange=function(){a.filterByAll()};if(_isIE){l.style.marginTop="1px"}this.attachEvent("onEditCell",function(n,m,o){this._build_m_order();if(n==2&&this.filters&&(this._m_order?(o==this._m_order[g]):(o==g))){this._loadSelectOptins(l,g)}return true})}else{if(l.tagName=="INPUT"){this.filters.push([l,g]);l.old_value=l.value="";l.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(l.value!=l.old_value){a.filterByAll();l.old_value=l.value}},500)}}else{if(l.tagName=="DIV"&&l.className=="combo"){this.filters.push([l,g]);l.style.padding="0px";l.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var j=new dhtmlXCombo(l,"_filter","90%");j.filterSelfA=j.filterSelf;j.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};j.enableFilteringMode(true);l.combo=j;l.value="";this._loadComboOptins(l,g);j.attachEvent("onChange",function(){l.value=j.getSelectedValue();if(l.value===null){l.value=""}a.filterByAll()})}}}if(l.parentNode){l.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(n,o,l,m){var m=m||(function(q,j){return j.toString().toLowerCase().indexOf(q)!=-1});if(m===true){m=function(q,j){return j.toString().toLowerCase()==q}}var g=new Array();n=n.toString().toLowerCase();if(typeof l!="number"){l=l?1:0}if(!this.rowsBuffer.length){return g}for(var c=(o||0);c<this._cCount;c++){if(this._h2){this._h2.forEachChild(0,function(j){if(l&&g.length==l){return g}if(m(n,this._get_cell_value(j.buff,c))){g.push([j.id,c])}},this)}else{for(var a=0;a<this.rowsBuffer.length;a++){if(m(n,this._get_cell_value(this.rowsBuffer[a],c))){g.push([this.rowsBuffer[a].idd,c]);if(l&&g.length==l){return g}}}}if(typeof(o)!="undefined"){return g}}return g};dhtmlXGridObject.prototype.makeSearch=function(j,g,a){if(typeof(j)!="object"){j=document.getElementById(j)}if(!j){return}var c=this;if(j.tagName=="INPUT"){j.onkeypress=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(j.value==""){return}var l=c.findCell(j.value,g,true,a);if(l.length){if(c._h2){c.openItem(l[0][0])}c.selectCell(c.getRowIndex(l[0][0]),(g||0))}},500)}}if(j.parentNode){j.parentNode.className+=" filter"}};dhtmlXGridObject.prototype._loadSelectOptins=function(m,o){var a=this.collectValues(o);var g=m.value;m.innerHTML="";m.options[0]=new Option("","");var n=this._filter_tr?this._filter_tr[o]:null;for(var j=0;j<a.length;j++){m.options[m.options.length]=new Option(n?n(a[j]):a[j],a[j])}m.value=g};dhtmlXGridObject.prototype.setSelectFilterLabel=function(c,a){if(!this._filter_tr){this._filter_tr=[]}this._filter_tr[c]=a};dhtmlXGridObject.prototype._loadComboOptins=function(j,n){if(!j.combo){return}var a=this.collectValues(n);j.combo.clearAll();var m=[["",""]];for(var g=0;g<a.length;g++){m.push([a[g],a[g]])}j.combo.addOption(m)};dhtmlXGridObject.prototype.refreshFilters=function(){if(!this.filters){return}for(var a=0;a<this.filters.length;a++){switch(this.filters[a][0].tagName.toLowerCase()){case"input":break;case"select":this._loadSelectOptins.apply(this,this.filters[a]);break;case"div":this._loadComboOptins.apply(this,this.filters[a]);break}}};dhtmlXGridObject.prototype._filters_ready=function(c,a){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onRowCreated",function(l,j){if(this._f_rowsBuffer){for(var g=0;g<this._f_rowsBuffer.length;g++){if(this._f_rowsBuffer[g].idd==l){return this._f_rowsBuffer[g]=j}}}});this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if(!this.hdr.rows.length){this.filters=[]}});this.attachEvent("onSetSizes",this._filters_resize_combo);this.attachEvent("onResize",this._filters_resize_combo);this._filters_ready=function(){}};dhtmlXGridObject.prototype._filters_resize_combo=function(){if(!this.filters){return}for(var a=0;a<this.filters.length;a++){if(this.filters[a][0].combo!=null){this.filters[a][0].combo.setSize(Math.round(this.filters[a][0].offsetWidth*90/100))}}return true};dhtmlXGridObject.prototype._in_header_text_filter=function(c,a){c.innerHTML="<input type='text'>";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_text_filter_inc=function(c,a){c.innerHTML="<input type='text'>";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a);c.firstChild._filter=function(){if(c.firstChild.value==""){return""}return function(g){return(g.toString().toLowerCase().indexOf(c.firstChild.value.toLowerCase())==0)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(c,a){c.innerHTML="<select></select>";c.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(g,c){g.innerHTML="<select style='width:90%; font-size:8pt; font-family:Tahoma;'></select>";g.onclick=function(j){(j||event).cancelBubble=true;return false};this.makeFilter(g.firstChild,c);var a=this.combos;g.firstChild._filter=function(){var j=g.firstChild.value;if(!j){return""}if(a[c]){j=a[c].keys[a[c].values._dhx_find(j)]}j=j.toLowerCase();return function(l){return(l.toString().toLowerCase()==j)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(c,a){c.innerHTML="<div style='width:100%; padding-left:2px; overflow:hidden; ' class='combo'></div>";c.onselectstart=function(){return(event.cancelBubble=true)};c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._search_common=function(c,a){c.innerHTML="<input type='text' style='width:90%; '>";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)}};dhtmlXGridObject.prototype._in_header_text_search=function(g,c,a){this._search_common(g,c);this.makeSearch(g.firstChild,c)};dhtmlXGridObject.prototype._in_header_text_search_strict=function(c,a){this._search_common(c,a);this.makeSearch(c.firstChild,a,true)};dhtmlXGridObject.prototype._in_header_numeric_filter=function(c,a){this._in_header_text_filter.call(this,c,a);c.firstChild._filter=function(){var g=this.value;var l;var n="==";var j=parseFloat(g.replace("=",""));var m=null;if(g){if(g.indexOf("..")!=-1){g=g.split("..");j=parseFloat(g[0]);m=parseFloat(g[1]);return function(o){if(o>=j&&o<=m){return true}return false}}l=g.match(/>=|<=|>|</);if(l){n=l[0];j=parseFloat(g.replace(n,""))}return Function("v"," if (v "+n+" "+j+" ) return true; return false;")}return""}};dhtmlXGridObject.prototype._in_header_master_checkbox=function(j,g,l){j.innerHTML=l[0]+"<input type='checkbox' />"+l[1];var a=this;j.getElementsByTagName("input")[0].onclick=function(m){a._build_m_order();var c=a._m_order?a._m_order[g]:g;var n=this.checked?1:0;a.forEachRowA(function(q){var o=this.cells(q,c);if(o.isCheckbox()){o.setValue(n);o.cell.wasChanged=true}this.callEvent("onEditCell",[1,q,c,n]);this.callEvent("onCheckbox",[q,c,n])});(m||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(g,a,l){var j=function(){var o=0;this._build_m_order();var n=this._m_order?this._m_order[a]:a;for(var m=0;m<this.rowsBuffer.length;m++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[m],n));o+=isNaN(c)?0:c}return this._maskArr[n]?this._aplNF(o,n):(Math.round(o*100)/100)};this._stat_in_header(g,j,a,l,l)};dhtmlXGridObject.prototype._in_header_stat_multi_total=function(l,j,q){var o=q[1].split(":");q[1]="";for(var g=0;g<o.length;g++){o[g]=parseInt(o[g])}var m=function(){var u=0;for(var s=0;s<this.rowsBuffer.length;s++){var r=1;for(var c=0;c<o.length;c++){r*=parseFloat(this._get_cell_value(this.rowsBuffer[s],o[c]))}u+=isNaN(r)?0:r}return this._maskArr[j]?this._aplNF(u,j):(Math.round(u*100)/100)};var a=[];for(var n=0;n<o.length;n++){a[o[n]]=true}this._stat_in_header(l,m,a,q,q)};dhtmlXGridObject.prototype._in_header_stat_max=function(g,a,l){var j=function(){this._build_m_order();var m=this._m_order?this._m_order[a]:a;var n=-999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){n=Math.max(n,parseFloat(this._get_cell_value(this.rowsBuffer[c],m)))}return this._maskArr[a]?this._aplNF(n,a):n};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._in_header_stat_min=function(g,a,l){var j=function(){this._build_m_order();var m=this._m_order?this._m_order[a]:a;var n=999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){n=Math.min(n,parseFloat(this._get_cell_value(this.rowsBuffer[c],m)))}return this._maskArr[a]?this._aplNF(n,a):n};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._in_header_stat_average=function(g,a,l){var j=function(){this._build_m_order();var n=this._m_order?this._m_order[a]:a;var q=0;var o=0;if(this.getRowsNum()==0){return"&nbsp;"}for(var m=0;m<this.rowsBuffer.length;m++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[m],n));if(!isNaN(c)){q+=c;o++}}return this._maskArr[a]?this._aplNF(q/o,a):(Math.round(q/o*100)/100)};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._in_header_stat_count=function(g,a,l){var j=function(){return this.getRowsNum()};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._stat_in_header=function(g,j,a,n){var l=this;var m=function(){this.dma(true);g.innerHTML=(n[0]?n[0]:"")+j.call(this)+(n[1]?n[1]:"");this.dma(false);this.callEvent("onStatReady",[])};if(!this._stat_events){this._stat_events=[];this.attachEvent("onClearAll",function(){if(!this.hdr.rows[1]){for(var o=0;o<this._stat_events.length;o++){for(var c=0;c<4;c++){this.detachEvent(this._stat_events[o][c])}}this._stat_events=[]}})}this._stat_events.push([this.attachEvent("onGridReconstructed",m),this.attachEvent("onXLE",m),this.attachEvent("onFilterEnd",m),this.attachEvent("onEditCell",function(c,q,o){if(c==2&&(o==a||(a&&a[o]))){m.call(this)}return true})]);g.innerHTML=""};dhtmlXGridObject.prototype.loadCSVFile=function(c,a){this.load(c,a,"csv")};dhtmlXGridObject.prototype.enableCSVAutoID=function(a){this._csvAID=dhx4.s2b(a)};dhtmlXGridObject.prototype.enableCSVHeader=function(a){this._csvHdr=dhx4.s2b(a)};dhtmlXGridObject.prototype.setCSVDelimiter=function(a){this.csv.cell=a};dhtmlXGridObject.prototype._csvAID=true;dhtmlXGridObject.prototype.loadCSVString=function(a){this.parse(a,"csv")};dhtmlXGridObject.prototype.serializeToCSV=function(q){this.editStop();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText||q){this._agetm="getTitle"}else{this._agetm="getValue"}}var n=[];if(this._csvHdr){for(var m=1;m<this.hdr.rows.length;m++){var c=[];for(var o=0;o<this._cCount;o++){if((!this._srClmn)||(this._srClmn[o])){c.push(this.getColumnLabel(o,m-1))}}n.push(this.csvParser.str(c,this.csv.cell,this.csv.row))}}var o=0;var l=this.rowsBuffer.length;for(o;o<l;o++){var g=this._serializeRowToCVS(null,o);if(g!=""){n.push(g)}}return this.csvParser.block(n,this.csv.row)};dhtmlXGridObject.prototype._serializeRowToCVS=function(a,q,g,n){var o=new Array();if(!a){a=this.render_row(q);if(this._fake&&!this._fake.rowsAr[a.idd]){this._fake.render_row(q)}}if(!this._csvAID){o[o.length]=a.idd}g=g||0;n=n||this._cCount;var v=false;var j=g;while(a.childNodes[g]._cellIndex>j&&g){g--}for(var s=g;j<n;s++){if(!a.childNodes[s]){break}var c=a.childNodes[s]._cellIndex;if(((!this._srClmn)||(this._srClmn[c]))&&(!this._serialize_visible||!this._hrrar[c])){var l=a.childNodes[s];var m=this.cells(a.idd,c);while(j!=c){j++;o.push("");if(j>=n){break}}if(j>=n){break}j++;if(m.cell){zxVal=m[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(m.wasChanged())){v=true}o[o.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&l.colSpan&&l.colSpan>1){l=l.colSpan-1;for(var w=0;w<l;w++){o[o.length]="";j++}}}else{j++}}if((this._onlChAttr)&&(!v)){return""}return this.csvParser.str(o,this.csv.cell,this.csv.row)};dhtmlXGridObject.prototype.toClipBoard=function(a){if(window.clipboardData){window.clipboardData.setData("Text",a)}else{(new Clipboard()).copy(a)}};dhtmlXGridObject.prototype.fromClipBoard=function(){if(window.clipboardData){return window.clipboardData.getData("Text")}else{return(new Clipboard()).paste()}};dhtmlXGridObject.prototype.cellToClipboard=function(g,c){if((!g)||(!c&&c!==0)){if(!this.selectedRows[0]){return}g=this.selectedRows[0].idd;c=this.cell._cellIndex}var a=this.cells(g,c);this.toClipBoard(((a.getLabel?a.getLabel():a.getValue())||"").toString())};dhtmlXGridObject.prototype.updateCellFromClipboard=function(g,c){if((!g)||(!c)){if(!this.selectedRows[0]){return}g=this.selectedRows[0].idd;c=this.cell._cellIndex}var a=this.cells(g,c);a[a.setImage?"setLabel":"setValue"](this.fromClipBoard())};dhtmlXGridObject.prototype.rowToClipboard=function(j){var a="";if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=!this._fake;if(j){a=this._serializeRowToCVS(this.getRowById(j))}else{var g=[];for(var c=0;c<this.selectedRows.length;c++){g[g.length]=this._serializeRowToCVS(this.selectedRows[c]);a=this.csvParser.block(g,this.csv.row)}}this._serialize_visible=false;this.toClipBoard(a)};dhtmlXGridObject.prototype.updateRowFromClipboard=function(l){var a=this.fromClipBoard();if(!a){return}if(l){var j=this.getRowById(l)}else{var j=this.selectedRows[0]}if(!j){return}var m=this.csvParser;a=m.unblock(a,this.csv.cell,this.csv.row)[0];if(!this._csvAID){a.splice(0,1)}for(var g=0;g<a.length;g++){var c=this.cells3(j,g);c[c.setImage?"setLabel":"setValue"](a[g])}};dhtmlXGridObject.prototype.csvParser={block:function(a,c){return a.join(c)},unblock:function(m,a,l){var j=(m||"").split(l);for(var c=0;c<j.length;c++){j[c]=(j[c]||"").split(a)}var g=j.length-1;if(j[g].length==1&&j[g][0]==""){j.splice(g,1)}return j},str:function(c,a,g){return c.join(a)}};dhtmlXGridObject.prototype.csvExtParser={_quote:RegExp('"',"g"),_quote_esc:RegExp('\\\\"',"g"),block:function(a,c){return a.join(c)},unblock:function(o,s,v){var g=[[]];var c=0;if(!o){return g}var q=/^[ ]*"/;var n=/"[ ]*$/;var a=new RegExp(".*"+v+".*$");var l=o.split(s);for(var j=0;j<l.length;j++){if(l[j].match(q)){var u=l[j].replace(q,"");while(!l[j].match(n)){j++;u+=l[j]}g[c].push(u.replace(n,"").replace(this._quote_esc,'"'))}else{if(l[j].match(a)){var m=l[j].indexOf(v);g[c].push(l[j].substr(0,m));c++;g[c]=[];l[j]=l[j].substr(m+1);j--}else{if(l[j]||j!=l.length-1){g[c].push(l[j])}}}}var r=g.length-1;if(r>0&&!g[r].length){g.splice(r,1)}return g},str:function(g,a,j){for(var c=0;c<g.length;c++){g[c]='"'+g[c].replace(this._quote,'\\"')+'"'}return g.join(a)}};dhtmlXGridObject.prototype.addRowFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}var g=this.csvParser.unblock(a,this.csv.cell,this.csv.row);for(var c=0;c<g.length;c++){if(g[c]){a=g[c];if(!a.length){continue}if(this._csvAID){this.addRow(this.getRowsNum()+2,a)}else{if(this.rowsAr[a[0]]){a[0]=this.uid()}this.addRow(a[0],a.slice(1))}}}};dhtmlXGridObject.prototype.gridToClipboard=function(){this.toClipBoard(this.serializeToCSV())};dhtmlXGridObject.prototype.gridFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}this.loadCSVString(a)};dhtmlXGridObject.prototype.getXLS=function(n){if(!this.xslform){this.xslform=document.createElement("FORM");this.xslform.action=(n||"")+"xls.php";this.xslform.method="post";this.xslform.target=(_isIE?"_blank":"");document.body.appendChild(this.xslform);var m=document.createElement("INPUT");m.type="hidden";m.name="csv";this.xslform.appendChild(m);var j=document.createElement("INPUT");j.type="hidden";j.name="csv_header";this.xslform.appendChild(j)}var o=this.serializeToCSV();this.xslform.childNodes[0].value=o;var g=[];var a=this._cCount;for(var c=0;c<a;c++){g.push(this.getHeaderCol(c))}g=g.join(",");this.xslform.childNodes[1].value=g;this.xslform.submit()};dhtmlXGridObject.prototype.printView=function(u,g){var r="<style>TD { font-family:Arial; text-align:center; padding-left:2px;padding-right:2px; } \n td.filter input, td.filter select { display:none; }  \n  </style>";var D=null;if(this._fake){D=[].concat(this._hrrar);for(var C=0;C<this._fake._cCount;C++){this._hrrar[C]=null}}r+="<base  href='"+document.location.href+"'></base>";if(!this.parentGrid){r+=(u||"")}r+='<table width="100%" border="2px" cellpadding="0" cellspacing="0">';var s=Math.max(this.rowsBuffer.length,this.rowsCol.length);var q=this._cCount;var v=this._printWidth();r+='<tr class="header_row_1">';for(var C=0;C<q;C++){if(this._hrrar&&this._hrrar[C]){continue}var m=this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes?this.hdr.rows[1]._childIndexes[parseInt(C)]:C];var a=(m.colSpan||1);var I=(m.rowSpan||1);for(var A=1;A<a;A++){v[C]+=v[A]}r+='<td rowspan="'+I+'" width="'+v[C]+'%" style="background-color:lightgrey;" colspan="'+a+'">'+this.getHeaderCol(C)+"</td>";C+=a-1}r+="</tr>";for(var C=2;C<this.hdr.rows.length;C++){if(_isIE){r+="<tr style='background-color:lightgrey' class='header_row_"+C+"'>";var l=this.hdr.rows[C].childNodes;for(var A=0;A<l.length;A++){if(!this._hrrar||!this._hrrar[l[A]._cellIndex]){r+=l[A].outerHTML}}r+="</tr>"}else{r+="<tr class='header_row_"+C+"' style='background-color:lightgrey'>"+(this._fake?this._fake.hdr.rows[C].innerHTML:"")+this.hdr.rows[C].innerHTML+"</tr>"}}for(var C=0;C<s;C++){r+="<tr>";if(this.rowsCol[C]&&this.rowsCol[C]._cntr){r+=this.rowsCol[C].innerHTML.replace(/<img[^>]*>/gi,"")+"</tr>";continue}if(this.rowsCol[C]&&this.rowsCol[C].style.display=="none"){continue}var o;if(this.rowsCol[C]){o=this.rowsCol[C].idd}else{if(this.rowsBuffer[C]){o=this.rowsBuffer[C].idd}else{continue}}for(var A=0;A<q;A++){if(this._hrrar&&this._hrrar[A]){continue}if(this.rowsAr[o]&&this.rowsAr[o].tagName=="TR"){var H=this.cells(o,A);if(H._setState){var w=""}else{if(H.getContent){w=H.getContent()}else{if(H.getImage||H.combo){var w=H.cell.innerHTML}else{var w=H.getValue()}}}}else{var w=this._get_cell_value(this.rowsBuffer[C],A)}var x=this.columnColor[A]?"background-color:"+this.columnColor[A]+";":"";var y=this.cellAlign[A]?"text-align:"+this.cellAlign[A]+";":"";var E=H.getAttribute("colspan");r+='<td style="'+x+y+'" '+(E?'colSpan="'+E+'"':"")+">"+(w===""?"&nbsp;":w)+"</td>";if(E){A+=E-1}}r+="</tr>";if(this.rowsCol[C]&&this.rowsCol[C]._expanded){var n=this.cells4(this.rowsCol[C]._expanded.ctrl);if(n.getSubGrid){r+='<tr><td colspan="'+q+'">'+n.getSubGrid().printView()+"</td></tr>"}else{r+='<tr><td colspan="'+q+'">'+this.rowsCol[C]._expanded.innerHTML+"</td></tr>"}}}if(this.ftr){for(var C=1;C<this.ftr.childNodes[0].rows.length;C++){r+="<tr style='background-color:lightgrey'>"+((this._fake)?this._fake.ftr.childNodes[0].rows[C].innerHTML:"")+this.ftr.childNodes[0].rows[C].innerHTML+"</tr>"}}r+="</table>";if(this.parentGrid){return r}r+=(g||"");var F=window.open("","_blank");F.document.write(r);F.document.write("<script>window.onerror=function(){return true;}<\/script>");F.document.close();if(this._fake){this._hrrar=D}};dhtmlXGridObject.prototype._printWidth=function(){var l=[];var j=0;for(var g=0;g<this._cCount;g++){var a=this.getColWidth(g);l.push(a);j+=a}var n=[];var c=0;for(var g=0;g<l.length;g++){var m=Math.floor((l[g]/j)*100);c+=m;n.push(m)}n[n.length-1]+=100-c;return n};if(!window.clipboardData){window.clipboardData={_make:function(){var c=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!c){return null}var a=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!a){return null}a.addDataFlavor("text/unicode");var g=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);this._p=[c,a,g];return true},setData:function(a,j){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(g){dhx4.callEvent("onClipboardError",["Access to clipboard denied",a,j]);return""}if(!this._make()){return false}this._p[2].data=j;this._p[1].setTransferData("text/unicode",this._p[2],j.length*2);var c=Components.interfaces.nsIClipboard;this._p[0].setData(this._p[1],null,c.kGlobalClipboard)},getData:function(a){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(g){dhx4.callEvent("onClipboardError",["Access to clipboard denied",a]);return""}if(!this._make()){return false}this._p[0].getData(this._p[1],this._p[0].kGlobalClipboard);var c=new Object();var j=new Object();try{this._p[1].getTransferData("text/unicode",j,c)}catch(g){return""}if(j){j=j.value.QueryInterface(Components.interfaces.nsISupportsString)}if(j){return j.data.substring(0,c.value/2)}return""}}}dhtmlXGridObject.prototype.enableBlockSelection=function(g){if(typeof this._bs_mode=="undefined"){var a=this;this.obj.onmousedown=function(j){if(a._bs_mode){a._OnSelectionStart((j||event),this)}return true};this._CSVRowDelimiter=this.csv.row;this.attachEvent("onResize",function(){a._HideSelection();return true});this.attachEvent("onGridReconstructed",function(){a._HideSelection();return true});this.attachEvent("onFilterEnd",this._HideSelection)}if(g===false){this._bs_mode=false;return this._HideSelection()}else{this._bs_mode=true}if(!window.dhx4.isIPad){var c=this._clip_area=document.createElement("textarea");c.style.cssText="position:absolute; width:1px; height:1px; overflow:hidden; color:transparent; background-color:transparent; bottom:1px; right:1px; border:none;";c.onkeydown=function(j){j=j||event;if(j.keyCode==86&&(j.ctrlKey||j.metaKey)){a.pasteBlockFromClipboard()}};document.body.insertBefore(this._clip_area,document.body.firstChild);dhtmlxEvent(this.entBox,"click",function(){if(!a.editor){a._clip_area.select()}})}};dhtmlXGridObject.prototype.forceLabelSelection=function(a){this._strictText=dhx4.s2b(a)};dhtmlXGridObject.prototype._OnSelectionStart=function(g,j){var c=this;if(g.button==2){return}var l=g.srcElement||g.target;if(this.editor){if(l.tagName&&(l.tagName=="INPUT"||l.tagName=="TEXTAREA")){return}this.editStop()}c.setActive(true);var n=this.getPosition(this.obj);var a=g.clientX-n[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var m=g.clientY-n[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));this._CreateSelection(a-4,m-4);if(l==this._selectionObj){this._HideSelection();this._startSelectionCell=null}else{while(l&&(!l.tagName||l.tagName.toLowerCase()!="td")){l=l.parentNode}this._startSelectionCell=l}if(this._startSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._startSelectionCell.parentNode.idd,this._startSelectionCell._cellIndex])){return this._startSelectionCell=null}}this.obj.onmousedown=null;this.obj[_isIE?"onmouseleave":"onmouseout"]=function(o){if(c._blsTimer){window.clearTimeout(c._blsTimer)}};this.obj.onmmold=this.obj.onmousemove;this._init_pos=[a,m];this._selectionObj.onmousemove=this.obj.onmousemove=function(o){o=o||g;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}c._OnSelectionMove(o)};this._oldDMP=document.body.onmouseup;document.body.onmouseup=function(o){o=o||g;c._OnSelectionStop(o,this);return true};this.callEvent("onBeforeBlockSelection",[]);document.body.onselectstart=function(){return false}};dhtmlXGridObject.prototype._getCellByPos=function(a,j){a=a;if(this._fake){a+=this._fake.objBox.scrollWidth}j=j;var c=0;for(var g=0;g<this.obj.rows.length;g++){j-=this.obj.rows[g].offsetHeight;if(j<=0){c=this.obj.rows[g];break}}if(!c||!c.idd){return null}for(var g=0;g<this._cCount;g++){a-=this.getColWidth(g);if(a<=0){while(true){if(c._childIndexes&&c._childIndexes[g+1]==c._childIndexes[g]){c=c.previousSibling}else{return this.cells(c.idd,g).cell}}}}return null};dhtmlXGridObject.prototype._OnSelectionMove=function(j){var x=this;this._ShowSelection();var s=this.getPosition(this.obj);var n=j.clientX-s[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var m=j.clientY-s[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));if((Math.abs(this._init_pos[0]-n)<5)&&(Math.abs(this._init_pos[1]-m)<5)){return this._HideSelection()}var v=this._endSelectionCell;if(this._startSelectionCell==null){this._endSelectionCell=this._startSelectionCell=this.getFirstParentOfType(j.srcElement||j.target,"TD")}else{if(j.srcElement||j.target){if((j.srcElement||j.target).className=="dhtmlxGrid_selection"){this._endSelectionCell=(this._getCellByPos(n,m)||this._endSelectionCell)}else{var w=this.getFirstParentOfType(j.srcElement||j.target,"TD");if(w.parentNode.idd){this._endSelectionCell=w}}}}if(this._endSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._endSelectionCell.parentNode.idd,this._endSelectionCell._cellIndex])){this._endSelectionCell=v}}var l=this.objBox.scrollLeft+this.objBox.clientWidth;var c=this.objBox.scrollTop+this.objBox.clientHeight;var q=this.objBox.scrollLeft;var o=this.objBox.scrollTop;var g=false;if(this._blsTimer){window.clearTimeout(this._blsTimer)}if(n+20>=l){this.objBox.scrollLeft=this.objBox.scrollLeft+20;g=true}else{if(n-20<q){this.objBox.scrollLeft=this.objBox.scrollLeft-20;g=true}}if(m+20>=c&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop+20;g=true}else{if(m-20<o&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop-20;g=true}}this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._endSelectionCell);if(g){var u=j.clientX;var r=j.clientY;this._blsTimer=window.setTimeout(function(){x._OnSelectionMove({clientX:u,clientY:r})},100)}};dhtmlXGridObject.prototype._OnSelectionStop=function(c){var a=this;if(this._blsTimer){window.clearTimeout(this._blsTimer)}this.obj.onmousedown=function(j){if(a._bs_mode){a._OnSelectionStart((j||c),this)}return true};this.obj.onmousemove=this.obj.onmmold||null;this._selectionObj.onmousemove=null;document.body.onmouseup=this._oldDMP||null;if(parseInt(this._selectionObj.style.width)<2&&parseInt(this._selectionObj.style.height)<2){this._HideSelection()}else{var g=this.getFirstParentOfType(c.srcElement||c.target,"TD");if((!g)||(!g.parentNode.idd)){g=this._endSelectionCell}while(g&&(!g.tagName||g.tagName.toLowerCase()!="td")){g=g.parentNode}if(!g){return this._HideSelection()}this._stopSelectionCell=g;this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._stopSelectionCell);this.callEvent("onBlockSelected",[])}document.body.onselectstart=function(){}};dhtmlXGridObject.prototype._RedrawSelectionPos=function(u,n){if(u.parentNode.grid!=n.parentNode.grid){return this._selectionArea}var r={};r.LeftTopCol=u._cellIndex;r.LeftTopRow=this.getRowIndex(u.parentNode.idd);r.RightBottomCol=n._cellIndex;r.RightBottomRow=this.getRowIndex(n.parentNode.idd);var j=u.offsetWidth;var g=u.offsetHeight;u=this.getPosition(u,this.obj);var v=n.offsetWidth;var o=n.offsetHeight;n=this.getPosition(n,this.obj);if(u[0]<n[0]){var l=u[0];var m=n[0]+v}else{var q=r.RightBottomCol;r.RightBottomCol=r.LeftTopCol;r.LeftTopCol=q;var l=n[0];var m=u[0]+j}if(u[1]<n[1]){var s=u[1];var a=n[1]+o}else{var q=r.RightBottomRow;r.RightBottomRow=r.LeftTopRow;r.LeftTopRow=q;var s=n[1];var a=u[1]+g}var w=m-l;var c=a-s;this._selectionObj.style.left=l+"px";this._selectionObj.style.top=s+"px";this._selectionObj.style.width=w+"px";this._selectionObj.style.height=c+"px";return r};dhtmlXGridObject.prototype._CreateSelection=function(a,g){if(this._selectionObj==null){var c=document.createElement("div");c.style.position="absolute";c.style.display="none";c.className="dhtmlxGrid_selection";this._selectionObj=c;this._selectionObj.onmousedown=function(j){j=j||event;if(j.button==2||(_isMacOS&&j.ctrlKey)){return this.parentNode.grid.callEvent("onBlockRightClick",["BLOCK",j])}};this._selectionObj.oncontextmenu=function(j){(j||event).cancelBubble=true;return false};this.objBox.appendChild(this._selectionObj)}this._selectionObj.style.width="0px";this._selectionObj.style.height="0px";this._selectionObj.style.left=a+"px";this._selectionObj.style.top=g+"px";this._selectionObj.startX=a;this._selectionObj.startY=g};dhtmlXGridObject.prototype._ShowSelection=function(){if(this._selectionObj){this._selectionObj.style.display=""}};dhtmlXGridObject.prototype._HideSelection=function(){if(this._selectionObj){this._selectionObj.style.display="none"}this._selectionArea=null;if(this._clip_area){this._clip_area.value="";this._clip_area.blur()}};dhtmlXGridObject.prototype.copyBlockToClipboard=function(){if(!this._clip_area){return}if(this._selectionArea!=null){var g=new Array();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=true;for(var a=this._selectionArea.LeftTopRow;a<=this._selectionArea.RightBottomRow;a++){var c=this._serializeRowToCVS(this.rowsBuffer[a],null,this._selectionArea.LeftTopCol,this._selectionArea.RightBottomCol+1);if(!this._csvAID){g[g.length]=c.substr(c.indexOf(this.csv.cell)+1)}else{g[g.length]=c}}g=g.join(this._CSVRowDelimiter);this._clip_area.value=g;this._clip_area.select();this._serialize_visible=false}};dhtmlXGridObject.prototype.pasteBlockFromClipboard=function(){if(!this._clip_area){return}this._clip_area.select();var a=this;window.setTimeout(function(){a._pasteBlockFromClipboard();a=null},1)};dhtmlXGridObject.prototype._pasteBlockFromClipboard=function(){var q=this._clip_area.value;if(!q){return}if(this._selectionArea!=null){var x=this._selectionArea.LeftTopRow;var a=this._selectionArea.LeftTopCol}else{if(this.cell!=null&&!this.editor){var x=this.getRowIndex(this.cell.parentNode.idd);var a=this.cell._cellIndex}else{return false}}q=this.csvParser.unblock(q,this.csv.cell,this.csv.row);var r=x+q.length;var v=a+q[0].length;if(v>this._cCount){v=this._cCount}var m=0;for(var s=x;s<r;s++){var y=this.render_row(s);if(y==-1){continue}var g=0;for(var o=a;o<v;o++){if(this._hrrar[o]&&!this._fake){v=Math.max(v+1,this._cCount);continue}var u=this.cells3(y,o);if(u.isDisabled()){g++;continue}if(this._onEditUndoRedo){this._onEditUndoRedo(2,y.idd,o,q[m][g],u.getValue())}if(u.combo){var w=u.combo.values;for(var c=0;c<w.length;c++){if(q[m][g]==w[c]){u.setValue(u.combo.keys[c]);w=null;break}}if(w!=null&&u.editable){u.setValue(q[m][g++])}else{g++}}else{u[u.setImage?"setLabel":"setValue"](q[m][g++])}u.cell.wasChanged=true}this.callEvent("onRowPaste",[y.idd]);m++}};dhtmlXGridObject.prototype.getSelectedBlock=function(){if(this._selectionArea){return this._selectionArea}else{if(this.getSelectedRowId()!==null){return{LeftTopRow:this.getSelectedRowId(),LeftTopCol:this.getSelectedCellIndex(),RightBottomRow:this.getSelectedRowId(),RightBottomCol:this.getSelectedCellIndex()}}else{return null}}};dhtmlXGridObject.prototype.enableSmartRendering=function(g,c,a){if(arguments.length>2){if(c&&!this.rowsBuffer[c-1]){this.rowsBuffer[c-1]=0}c=a}this._srnd=dhx4.s2b(g);this._srdh=this._srdh||20;this._dpref=c||0};dhtmlXGridObject.prototype.enablePreRendering=function(a){this._srnd_pr=parseInt(a||50)};dhtmlXGridObject.prototype.forceFullLoading=function(a,l){for(var g=0;g<this.rowsBuffer.length;g++){if(!this.rowsBuffer[g]){var j=a||(this.rowsBuffer.length-g);if(this.callEvent("onDynXLS",[g,j])){var c=this;this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+g+"&count="+j,function(){window.setTimeout(function(){c.forceFullLoading(a,l)},100)},this._data_type)}return}}if(l){l.call(this)}};dhtmlXGridObject.prototype.setAwaitedRowHeight=function(a){this._srdh=parseInt(a)};dhtmlXGridObject.prototype._get_view_size=function(){return Math.floor(parseInt(this.entBox.offsetHeight)/this._srdh)+2};dhtmlXGridObject.prototype._add_filler=function(n,a,c,j){if(!a){return null}var m="__filler__";var l=this._prepareRow(m);l.firstChild.style.width="1px";l.firstChild.style.padding=l.firstChild.style.margin="0px";for(var g=1;g<l.childNodes.length;g++){l.childNodes[g].style.display="none"}l.firstChild.style.height=a*this._srdh+"px";c=c||this.rowsCol[n];if(c&&c.nextSibling){c.parentNode.insertBefore(l,c.nextSibling)}else{if(_isKHTML){this.obj.appendChild(l)}else{this.obj.rows[0].parentNode.appendChild(l)}}this.callEvent("onAddFiller",[n,a,l,c,j]);return[n,a,l]};dhtmlXGridObject.prototype._update_srnd_view=function(){var n=Math.floor(this.objBox.scrollTop/this._srdh);var c=n+this._get_view_size();if(this.multiLine){var o=this.objBox.scrollTop;n=0;while(o>0){o-=this.rowsCol[n]?this.rowsCol[n].offsetHeight:this._srdh;n++}c=n+this._get_view_size();if(n>0){n--}}c+=(this._srnd_pr||0);if(c>this.rowsBuffer.length){c=this.rowsBuffer.length}for(var l=n;l<c;l++){if(!this.rowsCol[l]){var m=this._add_from_buffer(l);if(m==-1){if(this.xmlFileUrl){if(this._dpref&&this.rowsBuffer[c-1]){var g=this._dpref?this._dpref:(c-l);var a=Math.max(0,Math.min(l,c-this._dpref));this._current_load=[a,c-a]}else{this._current_load=[l,(this._dpref?this._dpref:(c-l))]}if(this.callEvent("onDynXLS",this._current_load)){this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+this._current_load[0]+"&count="+this._current_load[1],this._data_type)}}return}else{if(this._tgle){this._updateLine(this._h2.get[this.rowsBuffer[l].idd],this.rowsBuffer[l]);this._updateParentLine(this._h2.get[this.rowsBuffer[l].idd],this.rowsBuffer[l])}if(l&&l==(this._realfake?this._fake:this)["_r_select"]){this.selectCell(l,this.cell?this.cell._cellIndex:0,true)}}}}if(this._fake&&!this._realfake&&this.multiLine){this._fake.objBox.scrollTop=this.objBox.scrollTop}};dhtmlXGridObject.prototype._add_from_buffer=function(j){var l=this.render_row(j);if(l==-1){return -1}if(l._attrs.selected||l._attrs.select){this.selectRow(l,false,true);l._attrs.selected=l._attrs.select=null}if(!this._cssSP){if(this._cssEven&&j%2==0){l.className=this._cssEven+((l.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(l._css||"")}else{if(this._cssUnEven&&j%2==1){l.className=this._cssUnEven+((l.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(l._css||"")}}}else{if(this._h2){var a=this._h2.get[l.idd];l.className+=" "+((a.level%2)?(this._cssUnEven+" "+this._cssUnEven):(this._cssEven+" "+this._cssEven))+"_"+a.level+(this.rowsAr[a.id]._css||"")}}for(var c=0;c<this._fillers.length;c++){var g=this._fillers[c];if(g&&g[0]<=j&&(g[0]+g[1])>j){var m=j-g[0];if(m==0){this._insert_before(j,l,g[2]);this._update_fillers(c,-1,1)}else{if(m==g[1]-1){this._insert_after(j,l,g[2]);this._update_fillers(c,-1,0)}else{this._fillers.push(this._add_filler(j+1,g[1]-m-1,g[2],1));this._insert_after(j,l,g[2]);this._update_fillers(c,-g[1]+m,0)}}return}}};dhtmlXGridObject.prototype._update_fillers=function(g,a,j){var c=this._fillers[g];c[1]=c[1]+a;c[0]=c[0]+j;if(!c[1]){this.callEvent("onRemoveFiller",[c[2]]);c[2].parentNode.removeChild(c[2]);this._fillers.splice(g,1)}else{c[2].firstChild.style.height=parseFloat(c[2].firstChild.style.height)+a*this._srdh+"px";this.callEvent("onUpdateFiller",[c[2]])}};dhtmlXGridObject.prototype._insert_before=function(c,g,a){a.parentNode.insertBefore(g,a);this.rowsCol[c]=g;this.callEvent("onRowInserted",[g,null,a,"before"])};dhtmlXGridObject.prototype._insert_after=function(c,g,a){if(a.nextSibling){a.parentNode.insertBefore(g,a.nextSibling)}else{a.parentNode.appendChild(g)}this.rowsCol[c]=g;this.callEvent("onRowInserted",[g,null,a,"after"])};if(typeof(window.dhtmlxValidation)!="undefined"){dhtmlxValidation.trackInput=function(g,j,c,a){dhtmlxEvent(g,"keyup",function(l){if(dhtmlxValidation._timer){window.clearTimeout(dhtmlxValidation._timer);dhtmlxValidation._timer=null}dhtmlxValidation._timer=window.setTimeout(function(){if(!dhtmlxValidation.checkInput(g,j)){if(!c||c(g,g.value,j)){g.className+=" dhtmlx_live_validation_error"}}else{g.className=g.className.replace(/[ ]*dhtmlx_live_validation_error/g,"");if(a){a(g,g.value,j)}}},250)})};dhtmlxValidation.checkInput=function(a,c){return dhtmlxValidation.checkValue(a.value,c)};dhtmlxValidation.checkValue=function(g,j){if(typeof j=="string"){j=j.split(",")}var a=true;for(var c=0;c<j.length;c++){if(!this["is"+j[c]]){alert("Incorrect validation rule: "+j[c])}else{a=a&&this["is"+j[c]](g)}}return a}}dhtmlXGridObject.prototype.enableValidation=function(c,a){c=dhx4.s2b(c);if(c){this._validators={data:[]}}else{this._validators=false}if(arguments.length>1){this._validators._live=a}if(!this._validators._event){this._validators._event=this.attachEvent("onEditCell",this.validationEvent)}};dhtmlXGridObject.prototype.setColValidators=function(a){if(!this._validators){this.enableValidation(true)}if(typeof a=="string"){a=a.split(this.delim)}this._validators.data=a};dhtmlXGridObject.prototype.validationEvent=function(m,c,j,g,o){var q=this._validators;if(!q){return true}var n=(q.data[j]||this.cells(c,j).getAttribute("validate"))||"";if(m==1&&n){var l=this.editor||(this._fake||{}).editor;if(!l){return true}l.cell.className=l.cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");if(q._live){var a=this;dhtmlxValidation.trackInput(l.getInput(),n,function(r,s,u){return a.callEvent("onLiveValidationError",[c,j,s,r,u])},function(r,s,u){return a.callEvent("onLiveValidationCorrect",[c,j,s,r,u])})}}if(m==2){this.validateCell(c,j,n,g)}return true};dhtmlXGridObject.prototype.validateCell=function(n,l,m,j){m=m||(this._validators.data[l]||this.cells(n,l).getAttribute("validate"));j=j||this.cells(n,l).getValue();if(!m){return}var c=this.cells(n,l).cell;var a=true;if(typeof m=="string"){m=m.split(this.delim)}for(var g=0;g<m.length;g++){if(!dhtmlxValidation.checkValue(j,m[g])){if(this.callEvent("onValidationError",[n,l,j,m[g]])){c.className+=" dhtmlx_validation_error"}a=false}}if(a){this.callEvent("onValidationCorrect",[n,l,j,m]);c.className=c.className.replace(/[ ]*dhtmlx_validation_error/g,"")}return a};function eXcell_stree(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_trees){return}this._sub=this.grid._sub_trees[a._cellIndex];if(!this._sub){return}this._sub=this._sub[0]}this.getValue=function(){return this.cell._val};this.setValue=function(c){this.cell._val=c;c=this._sub.getItemText(this.cell._val);this.setCValue((c||"&nbsp;"),c)};this.edit=function(){this._sub.parentObject.style.display="block";var g=this.grid.getPosition(this.cell);this._sub.parentObject.style.top=g[1]+"px";this._sub.parentObject.style.left=g[0]+"px";this._sub.parentObject.style.position="absolute";var c=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=c};this.detach=function(){this._sub.parentObject.style.display="none";if(this.grid._sub_id!=null){var c=this.cell._val;this.setValue(this._sub.getSelectedItemId());this.grid._sub_id=null;return this.cell._val!=c}}}eXcell_stree.prototype=new eXcell;dhtmlXGridObject.prototype.setSubTree=function(a,c){if(!this._sub_trees){this._sub_trees=[]}this._sub_trees[c]=[a];a.parentObject.style.display="none";var g=this;a.parentObject.onclick=function(j){(j||window.event).cancelBubble=true;return false};a.ev_onDblClick=null;a.attachEvent("onDblClick",function(j){g._sub_id=j;g.editStop();return true});a._chRRS=true};function eXcell_link(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.isDisabled=function(){return true};this.edit=function(){};this.getValue=function(){if(this.cell.firstChild.getAttribute){var c=this.cell.firstChild.getAttribute("target");return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")+(c?("^"+c):"")}else{return""}};this.setValue=function(g){if((typeof(g)!="number")&&(!g||g.toString()._dhx_trim()=="")){this.setCValue("&nbsp;",c);return(this.cell._clearCell=true)}var c=g.split("^");if(c.length==1){c[1]=""}else{if(c.length>1){c[1]="href='"+c[1]+"'";if(c.length==3){c[1]+=" target='"+c[2]+"'"}else{c[1]+=" target='_blank'"}}}this.setCValue("<a "+c[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+c[0]+"</a>",c)}}eXcell_link.prototype=new eXcell;eXcell_link.prototype.getTitle=function(){var a=this.cell.firstChild;return((a&&a.tagName)?a.getAttribute("href"):"")};eXcell_link.prototype.getContent=function(){var a=this.cell.firstChild;return((a&&a.tagName)?a.innerHTML:"")};function eXcell_grid(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_grids){return}this._sub=this.grid._sub_grids[a._cellIndex];if(!this._sub){return}this._sindex=this._sub[1];this._sub=this._sub[0]}this.getValue=function(){return this.cell.val};this.setValue=function(c){this.cell.val=c;if(this._sub.getRowById(c)){c=this._sub.cells(c,this._sindex);if(c){c=c.getValue()}else{c=""}}this.setCValue((c||"&nbsp;"),c)};this.edit=function(){this.val=this.cell.val;this._sub.entBox.style.display="block";var g=this.grid.getPosition(this.cell);this._sub.entBox.style.top=g[1]+"px";this._sub.entBox.style.left=g[0]+"px";this._sub.entBox.style.position="absolute";this._sub.setSizes();var c=this.grid.editStop;this.grid.editStop=function(){};if(this._sub.getRowById(this.cell.val)){this._sub.setSelectedRow(this.cell.val)}this._sub.setActive(true);this.grid.editStop=c};this.detach=function(){var c=this.cell.val;this._sub.entBox.style.display="none";if(this._sub.getSelectedId()===null){return false}this.setValue(this._sub.getSelectedId());this.grid.setActive(true);return this.cell.val!=c}}eXcell_grid.prototype=new eXcell;dhtmlXGridObject.prototype.setSubGrid=function(c,a,j){if(!this._sub_grids){this._sub_grids=[]}this._sub_grids[a]=[c,j];c.entBox.style.display="none";var g=this;c.entBox.onclick=function(l){(l||window.event).cancelBubble=true;return false};c.attachEvent("onRowSelect",function(l){g.editStop();return true});c._chRRS=false};function eXcell_dhxCalendar(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var g=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[g]);var c=this.grid;g.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){c.editStop()},1);return true});var j=function(l){(l||event).cancelBubble=true};dhtmlxEvent(g.base,"click",j);g=null}}}eXcell_dhxCalendar.prototype=new eXcell;eXcell_dhxCalendar.prototype.edit=function(){var c=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(c[0],c[1]+this.cell.offsetHeight);this.grid._grid_calendarA._last_operation_calendar=false;this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;var a=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=function(){};this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val||(new Date()));this.grid._grid_calendarA.draw=a};eXcell_dhxCalendar.prototype.getDate=function(){if(this.cell.val){return this.cell.val}return null};eXcell_dhxCalendar.prototype.getValue=function(){if(this.cell._clearCell){return""}if(this.grid._dtmask_inc&&this.cell.val){return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString()}return this.cell.innerHTML.toString()._dhx_trim()};eXcell_dhxCalendar.prototype.detach=function(){if(!this.grid._grid_calendarA){return}this.grid._grid_calendarA.hide();if(this.cell._cediton){this.cell._cediton=false}else{return}if(this.grid._grid_calendarA._last_operation_calendar){var g=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"));var c=this.grid._grid_calendarA.getDate();this.cell.val=new Date(c);this.setCValue(g,c);this.cell._clearCell=!g;var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=a)}return false};eXcell_dhxCalendar.prototype.setValue=function(a){if(a&&typeof a=="object"){this.cell.val=a;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),a).toString(),this.cell.val);return}if(!a||a.toString()._dhx_trim()==""){a="&nbsp";this.cell._clearCell=true;this.cell.val=""}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),a.toString(),null,true));if(this.grid._dtmask_inc){a=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val)}}if((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell._clearCell=true;this.cell.val=new Date();this.setCValue("&nbsp;",0)}else{this.setCValue((a||"").toString(),this.cell.val)}};function eXcell_dhxCalendarA(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var g=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[g]);var c=this.grid;g.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){c.editStop()},1);return true});var j=function(l){(l||event).cancelBubble=true};dhtmlxEvent(g.base,"click",j)}}}eXcell_dhxCalendarA.prototype=new eXcell;eXcell_dhxCalendarA.prototype.edit=function(){var c=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(c[0]*1+this.cell.offsetWidth,c[1]*1);this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid._grid_calendarA._last_operation_calendar=false;this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;var a=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=function(){};this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val);this.grid._grid_calendarA.draw=a;this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.obj=document.createElement(this.cell.atag);this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(g){(g||event).cancelBubble=true};this.obj.onmousedown=function(g){(g||event).cancelBubble=true};this.obj.value=this.getValue();this.cell.innerHTML="";this.cell.appendChild(this.obj);if(window.dhx4.isIE){this.obj.style.overflow="visible";if((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){this.obj.style.height="36px";this.obj.style.overflow="scroll"}}this.obj.onselectstart=function(g){if(!g){g=event}g.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};eXcell_dhxCalendarA.prototype.getDate=function(){if(this.cell.val){return this.cell.val}return null};eXcell_dhxCalendarA.prototype.getValue=function(){if(this.cell._clearCell){return""}if(this.grid._dtmask_inc&&this.cell.val){return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString()}return this.cell.innerHTML.toString()._dhx_trim()};eXcell_dhxCalendarA.prototype.detach=function(){if(!this.grid._grid_calendarA){return}this.grid._grid_calendarA.hide();if(this.cell._cediton){this.cell._cediton=false}else{return}if(this.grid._grid_calendarA._last_operation_calendar){this.grid._grid_calendarA._last_operation_calendar=false;var g=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y");var c=this.grid._grid_calendarA.getDate();this.cell.val=new Date(c);this.setCValue(g,c);this.cell._clearCell=!g;var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=(a|"").valueOf())}this.setValue(this.obj.value);var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=(a||"").valueOf())};eXcell_dhxCalendarA.prototype.setValue=function(a){if(a&&typeof a=="object"){this.cell.val=a;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),a).toString(),this.cell.val);return}if(!a||a.toString()._dhx_trim()==""){a="&nbsp";this.cell._clearCell=true;this.cell.val=""}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),a.toString(),null,true));if(this.grid._dtmask_inc){a=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val)}}if((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell.val=new Date();this.cell._clearCell=true;this.setCValue("&nbsp;",0)}else{this.setCValue((a||"").toString(),this.cell.val)}};function eXcell_cntr(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._ex_cntr_ready&&!this._realfake){this.grid._ex_cntr_ready=true;if(this.grid._h2){this.grid.attachEvent("onOpenEn",function(g){this.resetCounter(a._cellIndex)})}var c=function(){var g=this;window.setTimeout(function(){if(!g.resetCounter){return}if(g._fake&&!g._realfake&&a._cellIndex<g._fake._cCount){g._fake.resetCounter(a._cellIndex)}else{g.resetCounter(a._cellIndex)}},1);return true};this.grid.attachEvent("onBeforeSorting",c);this.grid.attachEvent("onFilterEnd",c)}this.edit=function(){};this.getValue=function(){return this.cell.innerHTML};this.setValue=function(j){this.cell.style.paddingRight="2px";var g=this.cell;window.setTimeout(function(){if(!g.parentNode){return}var l=g.parentNode.rowIndex;if(g.parentNode.grid.currentPage||l<0||g.parentNode.grid._srnd){l=g.parentNode.grid.rowsBuffer._dhx_find(g.parentNode)+1}if(l<=0){return}g.innerHTML=l;if(g.parentNode.grid._fake&&g._cellIndex<g.parentNode.grid._fake._cCount&&g.parentNode.grid._fake.rowsAr[g.parentNode.idd]){g.parentNode.grid._fake.cells(g.parentNode.idd,g._cellIndex).setCValue(l)}g=null},100)}}dhtmlXGridObject.prototype.resetCounter=function(c){if(this._fake&&!this._realfake&&c<this._fake._cCount){this._fake.resetCounter(c,this.currentPage)}var a=arguments[0]||0;if(this.currentPage){a=(this.currentPage-1)*this.rowsBufferOutSize}for(a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].tagName=="TR"&&this.rowsAr[this.rowsBuffer[a].idd]){this.rowsAr[this.rowsBuffer[a].idd].childNodes[c].innerHTML=a+1}}};eXcell_cntr.prototype=new eXcell;function eXcell_acheck(a){try{this.cell=a;this.grid=this.cell.parentNode.grid;this.cell.obj=this}catch(c){}this.changeState=function(){if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("<checkbox state='false'>")}else{this.setValue("<checkbox state='true'>")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){try{return this.cell.chstate.toString()}catch(g){return null}};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(g){this.setValue(g.toString())};this.detach=function(){return this.val!=this.getValue()};this.drawCurrentState=function(){if(this.cell.chstate==1){return"<div  onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;'  style='cursor:pointer; font-weight:bold; text-align:center; '><span style='height:8px; width:8px; background:green; display:inline-block;'></span>&nbsp;Yes</div>"}else{return"<div  onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;' style='cursor:pointer;  text-align:center; '><span style='height:8px; width:8px; background:red; display:inline-block;'></span>&nbsp;No</div>"}}}eXcell_acheck.prototype=new eXcell;eXcell_acheck.prototype.setValue=function(c){c=(c||"").toString();if(c.indexOf("1")!=-1||c.indexOf("true")!=-1){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.setCValue(this.drawCurrentState(),this.cell.chstate)};function eXcell_context(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_context){return}this._sub=this.grid._sub_context[a._cellIndex];if(!this._sub){return}this._sindex=this._sub[1];this._sub=this._sub[0]}this.getValue=function(){return _isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(g){this.cell._val=g;var c=this._sub.itemPull[this._sub.idPrefix+this.cell._val];g=c?c.title:g;this.setCValue((g||"&nbsp;"),g)};this.edit=function(){var g=this.grid.getPosition(this.cell);this._sub.showContextMenu(g[0]+this.cell.offsetWidth,g[1]);var c=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=c};this.detach=function(){if(this.grid._sub_id!=null){var c=this.cell._val;this.setValue(this.grid._sub_id);this.grid._sub_id=null;return this.cell._val!=c}this._sub.hideContextMenu()}}eXcell_context.prototype=new eXcell;dhtmlXGridObject.prototype.setSubContext=function(a,c,j){var g=this;a.attachEvent("onClick",function(m,l){g._sub_id=m;g.editStop();a.hideContextMenu();return true});if(!this._sub_context){this._sub_context=[]}this._sub_context[c]=[a,j];a.hideContextMenu()};function dhtmlXGridFromTable(obj,init){if(typeof(obj)!="object"){obj=document.getElementById(obj)}var w=document.createElement("DIV");w.setAttribute("width",obj.getAttribute("gridWidth")||(obj.offsetWidth?(obj.offsetWidth+"px"):0)||(window.getComputedStyle?window.getComputedStyle(obj,null)["width"]:(obj.currentStyle?obj.currentStyle.width:0)));w.setAttribute("height",obj.getAttribute("gridHeight")||(obj.offsetHeight?(obj.offsetHeight+"px"):0)||(window.getComputedStyle?window.getComputedStyle(obj,null)["height"]:(obj.currentStyle?obj.currentStyle.height:0)));w.className=obj.className;obj.className="";if(obj.id){w.id=obj.id}var mr=obj;var drag=obj.getAttribute("dragAndDrop");mr.parentNode.insertBefore(w,mr);var f=mr.getAttribute("name")||("name_"+(new Date()).valueOf());var windowf=new dhtmlXGridObject(w);window[f]=windowf;var acs=mr.getAttribute("onbeforeinit");var acs2=mr.getAttribute("oninit");if(acs){eval(acs)}windowf.setImagePath(windowf.imgURL||(mr.getAttribute("imgpath")||mr.getAttribute("image_path")||""));var skin=mr.getAttribute("skin");if(skin){windowf.setSkin(skin)}if(init){init(windowf)}var hrow=mr.rows[0];var za="";var zb="";var zc="";var zd="";var ze="";for(var i=0;i<hrow.cells.length;i++){za+=(za?",":"")+hrow.cells[i].innerHTML;var width=hrow.cells[i].getAttribute("width")||hrow.cells[i].offsetWidth||(window.getComputedStyle?window.getComputedStyle(hrow.cells[i],null)["width"]:(hrow.cells[i].currentStyle?hrow.cells[i].currentStyle.width:0));zb+=(zb?",":"")+(width=="*"?width:parseInt(width));zc+=(zc?",":"")+(hrow.cells[i].getAttribute("align")||"left");zd+=(zd?",":"")+(hrow.cells[i].getAttribute("type")||"ed");ze+=(ze?",":"")+(hrow.cells[i].getAttribute("sort")||"str");var f_a=hrow.cells[i].getAttribute("format");if(f_a){if(hrow.cells[i].getAttribute("type").toLowerCase().indexOf("calendar")!=-1){windowf._dtmask=f_a}else{windowf.setNumberFormat(f_a,i)}}}windowf.setHeader(za);windowf.setInitWidths(zb);windowf.setColAlign(zc);windowf.setColTypes(zd);windowf.setColSorting(ze);if(obj.getAttribute("gridHeight")=="auto"){windowf.enableAutoHeigth(true)}if(obj.getAttribute("multiline")){windowf.enableMultiline(true)}var lmn=mr.getAttribute("lightnavigation");if(lmn){windowf.enableLightMouseNavigation(lmn)}var evr=mr.getAttribute("evenrow");var uevr=mr.getAttribute("unevenrow");if(evr||uevr){windowf.enableAlterCss(evr,uevr)}if(drag){windowf.enableDragAndDrop(true)}windowf.init();if(obj.getAttribute("split")){windowf.splitAt(obj.getAttribute("split"))}windowf._process_inner_html(mr,1);if(acs2){eval(acs2)}if(obj.parentNode&&obj.parentNode.removeChild){obj.parentNode.removeChild(obj)}return windowf}dhtmlXGridObject.prototype._process_html=function(c){if(c.tagName&&c.tagName=="TABLE"){return this._process_inner_html(c,0)}var a=document.createElement("DIV");a.innerHTML=c.xmlDoc.responseText;var g=a.getElementsByTagName("TABLE")[0];this._process_inner_html(g,0)};dhtmlXGridObject.prototype._process_inner_html=function(g,m){var c=g.rows.length;for(var a=m;a<c;a++){var l=g.rows[a].getAttribute("id")||a;this.rowsBuffer.push({idd:l,data:g.rows[a],_parser:this._process_html_row,_locator:this._get_html_data})}this.render_dataset();this.setSizes()};dhtmlXGridObject.prototype._process_html_row=function(q,m){var o=m.getElementsByTagName("TD");var c=[];q._attrs=this._xml_attrs(m);for(var l=0;l<o.length;l++){var n=o[l];var a=n.getAttribute("type");if(q.childNodes[l]){if(a){q.childNodes[l]._cellType=a}q.childNodes[l]._attrs=this._xml_attrs(o[l])}if(n.firstChild){c.push(n.innerHTML)}else{c.push("")}if(n.colSpan>1){q.childNodes[l]._attrs.colspan=n.colSpan;for(var g=1;g<n.colSpan;g++){c.push("")}}}for(l<o.length;l<q.childNodes.length;l++){q.childNodes[l]._attrs={}}this._fillRow(q,(this._c_order?this._swapColumns(c):c));return q};dhtmlXGridObject.prototype._get_html_data=function(c,a){c=c.firstChild;while(true){if(!c){return""}if(c.tagName=="TD"){a--}if(a<0){break}c=c.nextSibling}return(c.firstChild?c.firstChild.data:"")};dhtmlxEvent(window,"load",function(){var g=document.getElementsByTagName("table");for(var c=0;c<g.length;c++){if(g[c].className=="dhtmlxGrid"){dhtmlXGridFromTable(g[c])}}});function dhtmlXForm(l,j,m){this.idef={position:"label-left",labelWidth:"auto",labelHeight:"auto",inputWidth:"auto",inputHeight:"auto",labelAlign:"left",noteWidth:"auto",offsetTop:0,offsetLeft:0,blockOffset:20};this.idef_const={offsetNested:20};this.apos_css={"label-left":"dhxform_item_label_left","label-right":"dhxform_item_label_right","label-top":"dhxform_item_label_top","label-bottom":"dhxform_item_label_bottom",absolute:"dhxform_item_absolute"};this.align_css={left:"dhxform_label_align_left",center:"dhxform_label_align_center",right:"dhxform_label_align_right"};var g=this;this.setSkin=function(a){this.skin=a;this.cont.className="dhxform_obj_"+this.skin;this.cont.style.fontSize=(a=="dhx_terrace"?"13px":"12px");this._updateBlocks();this.forEachItem(function(o){var n=g.getItemType(o);if(typeof(g.items[n])!="undefined"&&typeof(g.items[n].setSkin)=="function"){g.doWithItem(o,"setSkin",a)}})};this.skin=(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_form")||"dhx_skyblue");this.separator=",";this.live_validate=false;this._type="checkbox";this._rGroup="default";this._idIndex={};this._indexId=[];this.cont=(typeof(l)=="object"?l:document.getElementById(l));if(!l._isNestedForm){this._parentForm=true;this.cont.style.fontSize=(this.skin=="dhx_terrace"?"13px":"12px");this.cont.className="dhxform_obj_"+this.skin;this.setFontSize=function(a){this.cont.style.fontSize=a;this._updateBlocks()};this.getForm=function(){return this};this.cont.onkeypress=function(n){n=(n||event);if(n.keyCode==13){var a=(n.target||n.srcElement);if(typeof(a.tagName)!="undefined"&&String(a.tagName).toLowerCase()=="textarea"&&!n.ctrlKey){return}g.callEvent("onEnter",[])}}}this.b_index=null;this.base=[];this._prepare=function(v,x){if(this.b_index==null){this.b_index=0}else{this.b_index++}var o=null;var n=null;if(x!=null){if(x<0){x=0}var s=0;for(var a=0;a<this.cont.childNodes.length;a++){for(var u=0;u<this.cont.childNodes[a].childNodes.length;u++){if(n==null&&this.cont.childNodes[a].childNodes[u]._isNestedForm!=true){if(s==x){o=this.cont.childNodes[a].nextSibling;n=this.cont.childNodes[a].childNodes[u]}s++}}}}this.base[this.b_index]=document.createElement("DIV");this.base[this.b_index].className="dhxform_base";if(typeof(v)!="undefined"){this.base[this.b_index].style.cssText+=" margin-left:"+v+"px!important;"}if(o!=null){this.cont.insertBefore(this.base[this.b_index],o);o=null}else{this.cont.appendChild(this.base[this.b_index])}if(n!=null){while(n!=null){var r=n;n=n.nextSibling;this.base[this.b_index].appendChild(r);r=null}}};this.setSizes=function(){};this._mergeSettings=function(v){var o=-1;var r={type:"settings"};for(var n in this.idef){r[n]=this.idef[n]}for(var s=0;s<v.length;s++){if(typeof(v[s])!="undefined"&&v[s].type=="settings"){for(var n in v[s]){r[n]=v[s][n]}o=s}}v[o>=0?o:v.length]=r;return v};this._genStr=function(a){var n="";var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=0;o<a;o++){n+=r.charAt(Math.floor(Math.random()*r.length))}return n};this.idPrefix="dhxForm_"+this._genStr(12)+"_";this._rId=(this._parentForm?this._genStr(12)+"_":l._rId);this.objPull={};this.itemPull={};this._ic=0;this._addItem=function(F,s,y,v,D,H,C){if(this.items[F]._index){this.getForm()._indexId.push(s);this.getForm()._idIndex[s]={ind:this.getForm()._indexId.length-1}}if(!F){F=this._type}if(F=="list"&&D!=null&&this.itemPull[this.idPrefix+D]!=null&&typeof(this.itemPull[this.idPrefix+D]._addSubListNode)=="function"){var E=this.itemPull[this.idPrefix+D]._addSubListNode()}else{if(F=="newcolumn"){var E={}}else{var u=this.base[this.b_index];var n=null;if(typeof(H)!="undefined"&&!isNaN(H)&&F!="list"){H=Math.max(parseInt(H),0)+1;for(var J=0;J<this.cont.childNodes.length;J++){for(var o=0;o<this.cont.childNodes[J].childNodes.length;o++){if(n==null&&this.cont.childNodes[J].childNodes[o]._isNestedForm!=true){H--;if(H==0){n=this.cont.childNodes[J].childNodes[o];u=this.cont.childNodes[J]}}}}}else{if(F=="list"){for(var I in this.itemPull){if(I==this.idPrefix+s){n=this.itemPull[I].nextSibling;if(this.itemPull[I]._listBase!=null&&this.itemPull[I]._listBase.length>0){n=this.itemPull[I]._listBase[this.itemPull[I]._listBase.length-1]}}}}}var E=document.createElement("DIV");if(C==true&&n!=null){n=n.nextSibling}if(n!=null){u.insertBefore(E,n)}else{u.appendChild(E)}}}E._idd=s;E._rId=this._rId;if(typeof(E.style)!="undefined"){if(typeof(y.offsetLeft)=="undefined"&&this.idef.offsetLeft>0){y.offsetLeft=this.idef.offsetLeft}if(typeof(y.offsetTop)=="undefined"&&this.idef.offsetTop>0){y.offsetTop=this.idef.offsetTop}var x="";if(typeof(y.offsetLeft)!="undefined"){x+=" padding-left:"+y.offsetLeft+"px!important;"}if(typeof(y.offsetTop)!="undefined"){x+=" padding-top:"+y.offsetTop+"px!important;"}E.style.cssText+=x}if(F=="block"){if(isNaN(y.blockOffset)){y.blockOffset=this.idef.blockOffset}}if(F=="list"){if(typeof(E._ofsNested)=="undefined"){E._ofsNested=this.idef_const.offsetNested}if(v!=null){E._sId=v}var A=this.items[F].render(E,this.skin);if(!this.itemPull[this.idPrefix+s]._listObj){this.itemPull[this.idPrefix+s]._listObj=[]}if(!this.itemPull[this.idPrefix+s]._list){this.itemPull[this.idPrefix+s]._list=[]}if(!this.itemPull[this.idPrefix+s]._listBase){this.itemPull[this.idPrefix+s]._listBase=[]}(this.itemPull[this.idPrefix+s]._listObj).push(A[0]);(this.itemPull[this.idPrefix+s]._list).push(A[1]);(this.itemPull[this.idPrefix+s]._listBase).push(E);A[1].checkEvent=function(a){return g.checkEvent(a)};A[1].callEvent=function(a,q){return g.callEvent(a,q)};A[1].getForm=function(){return g.getForm()};A[1]._initObj(this._mergeSettings(y));if(E._inBlcok){E.className+=" in_block"}return A[1]}if(F=="newcolumn"){this._prepare(y.offset,H);return}if(F=="label"&&this._ic++==0){y._isTopmost=true}y.position=this.apos_css[(!y.position||!this.apos_css[y.position]?this.idef.position:y.position)];E.className=y.position+(typeof(y.className)=="string"?" "+y.className:"");if(!y.labelWidth){y.labelWidth=this.idef.labelWidth}if(!y.labelHeight){y.labelHeight=this.idef.labelHeight}if(typeof(y.wrap)!="undefined"){y.wrap=window.dhx4.s2b(y.wrap)}y.labelAlign=(this.align_css[y.labelAlign]?this.align_css[y.labelAlign]:this.align_css[this.idef.labelAlign]);y.inputWidth=(y.width?y.width:(y.inputWidth?y.inputWidth:this.idef.inputWidth));if(!y.inputHeight){y.inputHeight=this.idef.inputHeight}if(typeof(y.note)!="undefined"){if(y.note.length!=null&&y.note[0]!=null){y.note=y.note[0]}if(typeof(y.note.width)=="undefined"){y.note.width=this.idef.noteWidth}if(y.note.width=="auto"){y.note.width=y.inputWidth}}E.checkEvent=function(a){return g.checkEvent(a)};E.callEvent=function(a,q){return g.callEvent(a,q)};E.getForm=function(){return g.getForm()};E._autoCheck=function(a){g._autoCheck(a)};if(typeof(y.readonly)=="string"){y.readonly=window.dhx4.s2b(y.readonly)}if(typeof(y.autoStart)=="string"){y.autoStart=window.dhx4.s2b(y.autoStart)}if(typeof(y.autoRemove)=="string"){y.autoRemove=window.dhx4.s2b(y.autoRemove)}if(typeof(y.titleScreen)=="string"){y.titleScreen=window.dhx4.s2b(y.titleScreen)}if(typeof(y.info)=="string"){y.info=window.dhx4.s2b(y.info)}if(typeof(y.hidden)=="string"){y.hidden=window.dhx4.s2b(y.hidden)}if(typeof(y.checked)=="string"){y.checked=window.dhx4.s2b(y.checked)}if(typeof(y.userdata)!="undefined"){for(var I in y.userdata){this.getForm().setUserData(s,I,y.userdata[I])}}if(y.validate){if(typeof(y.validate!="undefined")&&(typeof(y.validate)=="function"||typeof(window[y.validate])=="function")){E._validate=[y.validate]}else{E._validate=String(y.validate).split(this.separator)}}if(typeof(y.required)!="undefined"){if(typeof(y.required)=="string"){y.required=window.dhx4.s2b(y.required)}E._required=(y.required==true)}if(E._required){if(!E._validate){E._validate=[]}var r=false;for(o=0;o<E._validate.length;o++){r=(r||(E._validate[o]=="NotEmpty"))}if(!r){E._validate.push("NotEmpty")}}E._ll=(y.position==this.apos_css["label-left"]||y.position==this.apos_css["label-top"]);this.objPull[this.idPrefix+s]=this.items[F].render(E,y);this.itemPull[this.idPrefix+s]=E};this._initObj=function(s,o){if(typeof(s.data)!="undefined"){var u=null;if(typeof(o)!="undefined"){u=o.match(/(\?|\&)id\=([a-z0-9_\-]*)/i);if(u!=null&&u[0]!=null){u=u[0].split("=")[1]}}if(this.callEvent("onBeforeDataLoad",[u,window.dhx4._copyObj(s.data)])===true){this.formId=u;this._last_load_data=s;this.setFormData(s.data);this.resetDataProcessor("updated")}return}this._prepare();for(var r=0;r<s.length;r++){if(typeof(s[r])!="undefined"&&s[r].type=="settings"){for(var n in s[r]){this.idef[n]=s[r][n]}}}for(var r=0;r<s.length;r++){this._prepareItem(s[r])}this._autoCheck()};this._prepareItem=function(r,v,q){var o=(r!=null&&r.type!=null?r.type:"");if(this.items[o]){if(!r.name){r.name=this._genStr(12)}var u=r.name;if(this.objPull[this.idPrefix+u]!=null||o=="radio"){u=this._genStr(12)}var s=r;s.label=s.label||"";s.value=s.value;s.checked=window.dhx4.s2b(s.checked);s.disabled=window.dhx4.s2b(s.disabled);s.name=s.name||this._genStr(12);s.options=s.options||[];s.rows=s.rows||"none";s.uid=this._genStr(12);this._addItem(o,u,s,null,null,v,q);v=null;if(this._parentEnabled===false){this._disableItem(u)}for(var n=0;n<s.options.length;n++){if(s.options[n].list!=null){if(!s.options[n].value){s.options[n].value=this._genStr()}var a=this._addItem("list",u,s.options[n].list,s.options[n].value,null);a._subSelect=true;a._subSelectId=s.options[n].value}}if(r.list!=null){if(!r.listParent){r.listParent=s.name}var a=this._addItem("list",u,r.list,null,r.listParent)}}};this._xmlSubItems={item:"list",option:"options",note:"note",userdata:"_userdata"};this._xmlToObject=function(D,n){if(typeof(n)=="undefined"){n=true}if(n){var F=D.getElementsByTagName("items");F=(F!=null&&F[0]!=null?F[0]:null);var o=D.getElementsByTagName("data");o=(o!=null&&o[0]!=null?o[0]:null)}else{F=D}var A=(n?[]:{});if(F!=null){for(var s=0;s<F.childNodes.length;s++){if(typeof(F.childNodes[s].tagName)!="undefined"){var u=F.childNodes[s].tagName;if(this._xmlSubItems[u]!=null){var v=this._xmlSubItems[u];if(typeof(A[v])=="undefined"){A[v]=[]}var C=F.childNodes[s];var y={};for(var K=0;K<C.attributes.length;K++){var H=C.attributes[K].name;var E=C.attributes[K].value;y[H]=E}if(v=="note"){y.text=C.firstChild.nodeValue}if(v=="_userdata"){y.value=(C.firstChild!=null&&C.firstChild.nodeValue!=null?C.firstChild.nodeValue:"")}var x=this._xmlToObject(C,false);for(var I in x){if(I=="_userdata"){if(!y.userdata){y.userdata={}}for(var K=0;K<x[I].length;K++){y.userdata[x[I][K].name]=x[I][K].value}}else{y[I]=x[I]}}C=null;if(n){A.push(y)}else{A[v].push(y)}}}}}if(o!=null){A={data:{}};for(var s=0;s<o.childNodes.length;s++){if(typeof(o.childNodes[s].tagName)!="undefined"){var r=o.childNodes[s].tagName;var J=(o.childNodes[s].firstChild!=null?o.childNodes[s].firstChild.nodeValue:"");A.data[r]=J}}}return A};this._autoCheck=function(u){if(this._locked===true){u=false}else{if(typeof(u)=="undefined"){u=true}}for(var r in this.itemPull){var x=(u&&(this.itemPull[r]._udis!==true));this[x?"_enableItem":"_disableItem"](this.itemPull[r]._idd);if(this.getForm()._idIndex[this.itemPull[r]._idd]!=null){this.getForm()._idIndex[this.itemPull[r]._idd].enabled=x}var o=(x&&(typeof(this.itemPull[r]._checked)=="boolean"?this.itemPull[r]._checked:true));if(this.itemPull[r]._list){for(var A=0;A<this.itemPull[r]._list.length;A++){var y=true;if(this.itemPull[r]._list[A]._subSelect==true){y=false;var s=this.getItemValue(this.itemPull[r]._idd);if(!(typeof(s)=="object"&&typeof(s.length)=="number")){s=[s]}for(var n=0;n<s.length;n++){y=(s[n]==this.itemPull[r]._list[A]._subSelectId)||y}this.itemPull[r]._listObj[A][y?"show":"hide"](this.itemPull[r]._listBase[A])}this.itemPull[r]._list[A]._autoCheck(o&&y)}}}};this.doWithItem=function(r,n,y,x,w,v){if(typeof(r)=="object"){var C=r[0];var A=r[1];var D=null;var u=null;for(var s in this.itemPull){if((this.itemPull[s]._value==A||A===null)&&this.itemPull[s]._group==C){return this.objPull[s][n](this.itemPull[s],y,x,w,v)}if(this.itemPull[s]._list!=null&&!u){for(var o=0;o<this.itemPull[s]._list.length;o++){u=this.itemPull[s]._list[o].doWithItem(r,n,y,x,w)}}}if(u!=null){return u}else{if(n=="getType"){return this.doWithItem(r[0],"getType")}}}else{if(!this.itemPull[this.idPrefix+r]){var u=null;for(var s in this.itemPull){if(this.itemPull[s]._list&&!u){for(var o=0;o<this.itemPull[s]._list.length;o++){if(u==null){u=this.itemPull[s]._list[o].doWithItem(r,n,y,x,w,v)}}}}return u}else{return this.objPull[this.idPrefix+r][n](this.itemPull[this.idPrefix+r],y,x,w,v)}}};this._removeItem=function(n,a){if(a!=null){n=this.doWithItem([n,a],"destruct")}else{this.doWithItem(n,"destruct")}this._clearItemData(n)};this._clearItemData=function(r){if(this.itemPull[this.idPrefix+r]){r=this.idPrefix+r;try{this.objPull[r]=null;this.itemPull[r]=null;delete this.objPull[r];delete this.itemPull[r]}catch(o){}}else{for(var a in this.itemPull){if(this.itemPull[a]._list){for(var n=0;n<this.itemPull[a]._list.length;n++){this.itemPull[a]._list[n]._clearItemData(r)}}}}};this.isItem=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isExist")};this.getItemType=function(n,a){n=[n,(a||null)];return this.doWithItem(n,"getType")};this.forEachItem=function(o){for(var n in this.objPull){if(this.objPull[n].t=="radio"){o(this.itemPull[n]._group,this.itemPull[n]._value)}else{o(String(n).replace(this.idPrefix,""))}if(this.itemPull[n]._list){for(var r=0;r<this.itemPull[n]._list.length;r++){this.itemPull[n]._list[r].forEachItem(o)}}}};this.setItemLabel=function(o,a,n){if(n!=null){o=[o,a]}else{n=a}this.doWithItem(o,"setText",n)};this.getItemLabel=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"getText")};this._enableItem=function(a){this.doWithItem(a,"enable")};this._disableItem=function(a){this.doWithItem(a,"disable")};this._isItemEnabled=function(a){return this.doWithItem(a,"isEnabled")};this.checkItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"check");this._autoCheck()};this.uncheckItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"unCheck");this._autoCheck()};this.isItemChecked=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isChecked")};this.getCheckedValue=function(a){return this.doWithItem([a,null],"getChecked")};this._getRGroup=function(v,u){for(var n in this.itemPull){if(this.itemPull[n]._group==v&&(u==null||this.itemPull[n]._value==u)){return this.itemPull[n]._idd}if(this.itemPull[n]._list!=null){for(var s=0;s<this.itemPull[n]._list.length;s++){var o=this.itemPull[n]._list[s]._getRGroup(v,u);if(o!=null){return o}}}}return null};this.setItemValue=function(n,a){this.resetValidateCss(n,a);if(this.getItemType(n)=="radio"){if(this._getRGroup(n,a)!=null){this.checkItem(n,a)}else{this.uncheckItem(n,this.getCheckedValue(n))}return null}return this.doWithItem(n,"setValue",a)};this.getItemValue=function(n,a){if(this.getItemType(n)=="radio"){return this.getCheckedValue(n)}return this.doWithItem(n,"getValue",a)};this.updateValues=function(){this._updateValues()};this.showItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"show")};this.hideItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"hide")};this.isItemHidden=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isHidden")};this.getOptions=function(a){return this.doWithItem(a,"getOptions")};this.setItemWidth=function(n,a){this.doWithItem(n,"setWidth",a)};this.getItemWidth=function(a){return this.doWithItem(a,"getWidth")};this.setItemHeight=function(n,a){this.doWithItem(n,"setHeight",a)};this.setItemFocus=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"setFocus")};this._updateValues=function(){for(var n in this.itemPull){if(this.objPull[n]&&typeof(this.objPull[n].updateValue)=="function"){this.objPull[n].updateValue(this.itemPull[n])}if(this.itemPull[n]._list){for(var o=0;o<this.itemPull[n]._list.length;o++){this.itemPull[n]._list[o]._updateValues()}}}};this._getItemByName=function(u){for(var n in this.itemPull){if(this.itemPull[n]._idd==u){return this.itemPull[n]}if(this.itemPull[n]._list!=null){for(var s=0;s<this.itemPull[n]._list.length;s++){var o=this.itemPull[n]._list[s]._getItemByName(u);if(o!=null){return o}}}}return null};this._resetValidateCss=function(a){a.className=(a.className).replace(a._vcss,"");a._vcss=null};this.setValidateCss=function(a,q,o){var n=this[this.getItemType(a)=="radio"?"_getRGroup":"_getItemByName"](a);if(!n){return}if(n._vcss!=null){this._resetValidateCss(n)}n._vcss=(typeof(o)=="string"?o:"validate_"+(q===true?"ok":"error"));n.className+=" "+n._vcss};this.resetValidateCss=function(o){for(var n in this.itemPull){if(this.itemPull[n]._vcss!=null){this._resetValidateCss(this.itemPull[n])}if(this.itemPull[n]._list!=null){for(var r=0;r<this.itemPull[n]._list.length;r++){this.itemPull[n]._list[r].resetValidateCss()}}}};this.validate=function(n){if(this.callEvent("onBeforeValidate",[])==false){return}var a=true;this.forEachItem(function(q,r){if(typeof(r)!="undefined"){q=[q,r]}var o=g.doWithItem(q,"_validate");if(typeof(o)!="boolean"){o=true}a=o&&a});this.callEvent("onAfterValidate",[a]);return a};this.validateItem=function(a,n){if(typeof(n)!="undefined"){a=[a,n]}return this.doWithItem(a,"_validate")};this.enableLiveValidation=function(a){this.live_validate=(a==true)};this.setReadonly=function(n,a){this.doWithItem(n,"setReadonly",a)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};this.getFirstActive=function(n){for(var r=0;r<this._indexId.length;r++){var a=true;if(n==true){var o=this.getItemType(this._indexId[r]);if(!dhtmlXForm.prototype.items[o].setFocus){a=false}}if(a&&this._idIndex[this._indexId[r]].enabled){return this._indexId[r]}}return null};this.setFocusOnFirstActive=function(){var a=this.getFirstActive(true);if(a!=null){this.setItemFocus(a)}};this.enableItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"userEnable");this._autoCheck()};this.disableItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"userDisable");this._autoCheck()};this.isItemEnabled=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isUserEnabled")};this.clear=function(){var n={};this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");for(var o in this.itemPull){var r=this.itemPull[o]._idd;if(this.itemPull[o]._type=="ch"){this.uncheckItem(r)}if(this.itemPull[o]._type in {ta:1,editor:1,calendar:1,pw:1,hd:1}){this.setItemValue(r,"")}if(this.itemPull[o]._type=="combo"){this.itemPull[o]._apiChange=true;var w=this.getCombo(r);w.selectOption(0);w=null;this.itemPull[o]._apiChange=false}if(this.itemPull[o]._type=="se"){var u=this.getOptions(r);if(u.length>0){u[0].selected=true}}if(this.itemPull[o]._type=="ra"){var s=this.itemPull[o]._group;if(!n[s]){this.checkItem(s,this.doWithItem(r,"_getFirstValue"));n[s]=true}}if(this.itemPull[o]._list){for(var v=0;v<this.itemPull[o]._list.length;v++){this.itemPull[o]._list[v].clear()}}if(this["setFormData_"+this.itemPull[o]._type]){this["setFormData_"+this.itemPull[o]._type](r,"")}}n=null;if(this._parentForm){this._autoCheck()}this.resetValidateCss()};this.unload=function(){window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");for(var n in this.objPull){this._removeItem(String(n).replace(this.idPrefix,""))}if(this._ccTm){window.clearTimeout(this._ccTm)}this._formLS=null;for(var o=0;o<this.base.length;o++){while(this.base[o].childNodes.length>0){this.base[o].removeChild(this.base[o].childNodes[0])}if(this.base[o].parentNode){this.base[o].parentNode.removeChild(this.base[o])}this.base[o]=null}this.base=null;this.cont.onkeypress=null;this.cont.className="";this.cont=null;for(var n in this){this[n]=null}g=null};for(var c in this.items){this.items[c].t=c;if(typeof(this.items[c]._index)=="undefined"){this.items[c]._index=true}if(!this.items[c].show){this.items[c].show=function(a){a.style.display="";if(a._listObj){for(var n=0;n<a._listObj.length;n++){a._listObj[n].show(a._listBase[n])}}}}if(!this.items[c].hide){this.items[c].hide=function(a){a.style.display="none";if(a._listObj){for(var n=0;n<a._listObj.length;n++){a._listObj[n].hide(a._listBase[n])}}}}if(!this.items[c].isHidden){this.items[c].isHidden=function(a){return(a.style.display=="none")}}if(!this.items[c].userEnable){this.items[c].userEnable=function(a){a._udis=false}}if(!this.items[c].userDisable){this.items[c].userDisable=function(a){a._udis=true}}if(!this.items[c].isUserEnabled){this.items[c].isUserEnabled=function(a){return(a._udis!==true)}}if(!this.items[c].getType){this.items[c].getType=function(){return this.t}}if(!this.items[c].isExist){this.items[c].isExist=function(){return true}}if(!this.items[c]._validate){this.items[c]._validate=function(o){if(!o._validate||!o._enabled){return true}if(o._type=="ch"){var w=(this.isChecked(o)?this.getValue(o):0)}else{var w=this.getValue(o)}var n=true;for(var u=0;u<o._validate.length;u++){var a="is"+o._validate[u];if((w==null||w.length==0)&&a!="isNotEmpty"&&o._type!="container"){}else{var s=dhtmlxValidation[a];if(o._type=="container"&&typeof(s)=="function"){s=function(){return true}}if(typeof(s)!="function"&&typeof(o._validate[u])=="function"){s=o._validate[u]}if(typeof(s)!="function"&&typeof(window[o._validate[u]])=="function"){s=window[o._validate[u]]}n=((typeof(s)=="function"?s(w,o._idd):new RegExp(o._validate[u]).test(w))&&n);s=null}}if(!(o.callEvent("onValidate"+(n?"Success":"Error"),[o._idd,w,n])===false)){o.getForm().setValidateCss(o._idd,n)}return n}}}this._locked=false;this._doLock=function(n){var a=(n===true?true:false);if(this._locked==a){return}else{this._locked=a}this._autoCheck(!this._locked)};this.lock=function(){this._doLock(true)};this.unlock=function(){this._doLock(false)};this.isLocked=function(){return this._locked};this.setNumberFormat=function(q,n,a,o){return this.doWithItem(q,"setNumberFormat",n,a,o)};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObject","items",{struct:true,data:true});window.dhx4._eventable(this);this.attachEvent("_onButtonClick",function(a,n){this.callEvent("onButtonClick",[a,n])});this._updateBlocks=function(){this.forEachItem(function(a){if(g.getItemType(a)=="block"||g.getItemType(a)=="combo"){g.doWithItem(a,"_setCss",g.skin,g.cont.style.fontSize)}})};this._isObj=function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")};this._copyObj=function(q){if(this._isObj(q)){var o={};for(var n in q){if(typeof(q[n])=="object"&&q[n]!=null){o[n]=this._copyObj(q[n])}else{o[n]=q[n]}}}else{var o=[];for(var n=0;n<q.length;n++){if(typeof(q[n])=="object"&&q[n]!=null){o[n]=this._copyObj(q[n])}else{o[n]=q[n]}}}return o};if(j!=null&&typeof(j)=="object"){this._initObj(this._copyObj(j))}if(this._parentForm){this._updateBlocks()}this._ccActive=false;this._ccTm=null;return this}dhtmlXForm.prototype.getInput=function(a){return this.doWithItem(a,"getInput")};dhtmlXForm.prototype.getSelect=function(a){return this.doWithItem(a,"getSelect")};dhtmlXForm.prototype.items={};dhtmlXForm.prototype.items.checkbox={render:function(a,c){a._type="ch";a._enabled=true;a._checked=false;a._value=(typeof(c.value)=="undefined"?null:String(c.value));a._ro=(c.readonly==true);if(c._autoInputWidth!==false){c.inputWidth=14}this.doAddLabel(a,c);this.doAddInput(a,c,"INPUT","TEXT",true,true,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var g=document.createElement("DIV");g.className="dhxform_img chbx0";a.appendChild(g);if(!isNaN(c.inputLeft)){a.childNodes[a._ll?1:0].style.left=parseInt(c.inputLeft)+"px"}if(!isNaN(c.inputTop)){a.childNodes[a._ll?1:0].style.top=parseInt(c.inputTop)+"px"}a.childNodes[a._ll?1:0].appendChild(g);a.childNodes[a._ll?1:0].firstChild.value=String(c.value);a._updateImgNode=function(l,m){var j=l.childNodes[l._ll?1:0].lastChild;j.className=(m?"dhxform_actv_c":"dhxform_img")+" "+(l._checked?"chbx1":"chbx0");l=j=null};a._doOnFocus=function(j){j.getForm().callEvent("onFocus",[j._idd])};a._doOnBlur=function(j){j.getForm().callEvent("onBlur",[j._idd])};a._doOnKeyUpDown=function(l,j){this.callEvent(l,[this.childNodes[this._ll?0:1].childNodes[0],j,this._idd])};if(c.checked==true){this.check(a)}if(c.hidden==true){this.hide(a)}if(c.disabled==true){this.userDisable(a)}this.doAttachEvents(a);return this},destruct:function(a){a._doOnFocus=a._doOnBlur=a._updateImgNode=null;this.doUnloadNestedLists(a);this.doDestruct(a)},doAddLabel:function(c,g){var a=document.createElement("DIV");a.className="dhxform_label "+g.labelAlign;if(g.wrap==true){a.style.whiteSpace="normal"}if(c._ll){c.insertBefore(a,c.firstChild)}else{c.appendChild(a)}if(typeof(g.tooltip)!="undefined"){a.title=g.tooltip}a.innerHTML="<div class='dhxform_label_nav_link' onfocus='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,true);this.parentNode.parentNode._doOnFocus(this.parentNode.parentNode);' onblur='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,false);this.parentNode.parentNode._doOnBlur(this.parentNode.parentNode);' onkeypress='var e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;if(e.preventDefault)e.preventDefault();else e.returnValue=false;_dhxForm_doClick(this,\"mousedown\");return false;}' onkeyup='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyUp\",e);' onkeydown='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyDown\",e);' "+(window.dhx4.isIPad?"ontouchstart='var e=event;e.preventDefault();_dhxForm_doClick(this,\"mousedown\");' ":"")+"role='link' tabindex='0'>"+g.label+(g.info?"<span class='dhxform_info'>[?]</span>":"")+(c._required?"<span class='dhxform_item_required'>*</span>":"")+"</div>";if(!isNaN(g.labelWidth)){a.firstChild.style.width=parseInt(g.labelWidth)+"px"}if(!isNaN(g.labelHeight)){a.firstChild.style.height=parseInt(g.labelHeight)+"px"}if(!isNaN(g.labelLeft)){a.style.left=parseInt(g.labelLeft)+"px"}if(!isNaN(g.labelTop)){a.style.top=parseInt(g.labelTop)+"px"}},doAddInput:function(C,E,g,m,n,y,r){var x=document.createElement("DIV");x.className="dhxform_control";if(C._ll){C.appendChild(x)}else{C.insertBefore(x,C.firstChild)}var v=document.createElement(g);v.className=r;v.name=C._idd;v._idd=C._idd;v.id=E.uid;if(typeof(m)=="string"){v.type=m}if(g=="INPUT"||g=="TEXTAREA"){v.onkeyup=function(u){u=u||event;C.callEvent("onKeyUp",[this,u,this._idd])};v.onkeydown=function(u){u=u||event;C.callEvent("onKeyDown",[this,u,this._idd])}}x.appendChild(v);if(E.readonly){this.setReadonly(C,true)}if(E.hidden==true){this.hide(C)}if(E.disabled==true){this.userDisable(C)}if(n){if(!isNaN(E.inputLeft)){x.style.left=parseInt(E.inputLeft)+"px"}if(!isNaN(E.inputTop)){x.style.top=parseInt(E.inputTop)+"px"}}var s="";var l=false;if(y){if(!isNaN(E.inputWidth)){s+="width:"+parseInt(E.inputWidth)+"px;";l=true}if(!isNaN(E.inputHeight)){s+="height:"+parseInt(E.inputHeight)+"px;"}}if(typeof(E.style)=="string"){s+=E.style}v.style.cssText=s;if(E.maxLength){v.setAttribute("maxLength",E.maxLength)}if(E.connector){v.setAttribute("connector",E.connector)}var A=(dhtmlXForm.prototype.items[this.t]!=null?dhtmlXForm.prototype.items[this.t]._dimFix==true:false);if(l&&({input:1,password:1,select:1,multiselect:1,calendar:1,colorpicker:1}[this.t]==1||A)){if(dhtmlXForm.prototype.items[this.t]._dim==null){var c=document.createElement("DIV");c.className="dhxform_dim_test_"+C.getForm().skin;document.body.appendChild(c);var a=x.parentNode;var D=x.nextSibling;c.appendChild(x);var q=parseInt(v.style.width);var o=(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?v.offsetWidth:v.clientWidth);dhtmlXForm.prototype.items[this.t]._dim=o-q;if(D!=null){a.insertBefore(x,D)}else{a.appendChild(x)}c.parentNode.removeChild(c);a=D=c=null}v.style.width=parseInt(v.style.width)-dhtmlXForm.prototype.items[this.t]._dim+"px"}if(typeof(E.note)=="object"){var j=document.createElement("DIV");j.className="dhxform_note";j.style.width=(isNaN(E.note.width)?v.offsetWidth:parseInt(E.note.width))+"px";j._w=E.note.width;j.innerHTML=E.note.text;x.appendChild(j);j=null}},doUnloadNestedLists:function(a){if(!a._list){return}for(var c=0;c<a._list.length;c++){a._list[c].unload();a._list[c]=null;a._listObj[c]=null;a._listBase[c].parentNode.removeChild(a._listBase[c]);a._listBase[c]=null}a._list=null;a._listObj=null;a._listBase=null},doDestruct:function(a){a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._group=null;a.onselectstart=null;a.childNodes[a._ll?1:0].onmousedown=null;a.childNodes[a._ll?1:0].ontouchstart=null;a.childNodes[a._ll?0:1].onmousedown=null;a.childNodes[a._ll?0:1].ontouchstart=null;a.childNodes[a._ll?0:1].childNodes[0].onfocus=null;a.childNodes[a._ll?0:1].childNodes[0].onblur=null;a.childNodes[a._ll?0:1].childNodes[0].onkeypress=null;a.childNodes[a._ll?0:1].childNodes[0].onkeyup=null;a.childNodes[a._ll?0:1].childNodes[0].onkeydown=null;a.childNodes[a._ll?0:1].childNodes[0].onmousedown=null;a.childNodes[a._ll?0:1].childNodes[0].ontouchstart=null;a.childNodes[a._ll?0:1].removeChild(a.childNodes[a._ll?0:1].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAttachEvents:function(c){var a=this;c.childNodes[c._ll?1:0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}var g=(j.target||j.srcElement);if(!this.parentNode._enabled||this.parentNode._ro||(typeof(g.className)!="undefined"&&g.className=="dhxform_note")){j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}a.doClick(this.parentNode)};c.childNodes[c._ll?0:1].childNodes[0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}if(!this.parentNode.parentNode._enabled){j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}var g=j.target||j.srcElement;if(typeof(g.className)!="undefined"&&g.className=="dhxform_info"){this.parentNode.parentNode.callEvent("onInfo",[this.parentNode.parentNode._idd]);j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}a.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();if(!a._enabled||a._ro){return}if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._checked])!==true){return}}this.setChecked(a,!a._checked);a._autoCheck();a.callEvent("onChange",[a._idd,a._value,a._checked])},doCheckValue:function(a){if(a._checked&&a._enabled){a.childNodes[a._ll?1:0].firstChild.name=String(a._idd);a.childNodes[a._ll?1:0].firstChild.value=this.getValue(a)}else{a.childNodes[a._ll?1:0].firstChild.name="";a.childNodes[a._ll?1:0].firstChild.value=""}},setChecked:function(a,c){a._checked=(c===true?true:false);a.childNodes[a._ll?1:0].lastChild.className=a.childNodes[a._ll?1:0].lastChild.className.replace(/chbx[0-1]{1}/gi,"")+(a._checked?" chbx1":" chbx0");this.doCheckValue(a)},check:function(a){this.setChecked(a,true)},unCheck:function(a){this.setChecked(a,false)},isChecked:function(a){return a._checked},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=0;a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("disabled");this.doCheckValue(a)},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;if(a._updateImgNode!=null){a._updateImgNode(a,false)}a.childNodes[a._ll?0:1].childNodes[0].tabIndex=-1;a.childNodes[a._ll?0:1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,c){a.childNodes[a._ll?0:1].childNodes[0].innerHTML=c+(a._required?"<span class='dhxform_item_required'>*</span>":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},setValue:function(a,c){this.setChecked(a,(c===true||parseInt(c)==1||c=="true"||a._value===c))},getValue:function(a,c){if(c=="realvalue"){return a._value}return((typeof(a._value)=="undefined"||a._value==null)?(a._checked?1:0):a._value)},setReadonly:function(a,c){a._ro=(c===true)},isReadonly:function(a){return a._ro},setFocus:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus()}};dhtmlXForm.prototype.items.radio={input:{},r:{},firstValue:{},render:function(g,j,c){g._type="ra";g._enabled=true;g._checked=false;g._group=j.name;g._value=j.value;g._uid=c;g._ro=(j.readonly==true);g._rName=g._rId+g._group;this.r[g._idd]=g;j.inputWidth=14;this.doAddLabel(g,j);this.doAddInput(g,j,"INPUT","TEXT",true,true,"dhxform_textarea");g.childNodes[g._ll?1:0].className+=" dhxform_img_node";var l=document.createElement("DIV");l.className="dhxform_img rdbt0";g.appendChild(l);if(!isNaN(j.inputLeft)){g.childNodes[g._ll?1:0].style.left=parseInt(j.inputLeft)+"px"}if(!isNaN(j.inputTop)){g.childNodes[g._ll?1:0].style.top=parseInt(j.inputTop)+"px"}g.childNodes[g._ll?1:0].appendChild(l);g.childNodes[g._ll?1:0].firstChild.name="";g.childNodes[g._ll?1:0].firstChild.value="";g._updateImgNode=function(n,o){var m=n.childNodes[n._ll?1:0].lastChild;m.className=(o?"dhxform_actv_r":"dhxform_img")+" "+(n._checked?"rdbt1":"rdbt0");n=m=null};g._doOnFocus=function(m){m.getForm().callEvent("onFocus",[m._group,m._value])};g._doOnBlur=function(m){m.getForm().callEvent("onBlur",[m._group,m._value])};g._doOnKeyUpDown=function(n,m){this.callEvent(n,[this.childNodes[this._ll?0:1].childNodes[0],m,this._group,this._value])};if(this.input[g._rName]==null){var a=document.createElement("INPUT");a.type="HIDDEN";a.name=j.name;a.firstValue=g._value;g.appendChild(a);this.input[g._rName]=a}if(!this.firstValue[g._rName]){this.firstValue[g._rName]=j.value}if(j.checked==true){this.check(g)}if(j.hidden==true){this.hide(g)}if(j.disabled==true){this.userDisable(g)}this.doAttachEvents(g);return this},destruct:function(j,l){if(j.lastChild==this.input[j._rName]){var g=false;for(var c in this.r){if(!g&&this.r[c]._group==j._group&&this.r[c]._idd!=j._idd){this.r[c].appendChild(this.input[j._rName]);g=true}}if(!g){this.input[j._rName].parentNode.removeChild(this.input[j._rName]);this.input[j._rName]=null;this.firstValue[j._rName]=null}}var m=j._idd;j._doOnFocus=j._doOnBlur=j._updateImgNode=null;this.doUnloadNestedLists(j);this.doDestruct(j);return m},doClick:function(c){c.childNodes[c._ll?0:1].childNodes[0].focus();if(!(c._enabled&&!c._checked)){return}if(c._ro){return}var a=[c._group,c._value,true];if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",a)!==true){return}}this.setChecked(c,true);c.getForm()._autoCheck();c.callEvent("onChange",a)},doCheckValue:function(g){var j=null;for(var c in this.r){if(this.r[c]._checked&&this.r[c]._group==g._group&&this.r[c]._rId==g._rId){j=this.r[c]._value}}if(j!=null&&this.r[c]._enabled){this.input[g._rName].name=String(g._group);this.input[g._rName].value=j}else{this.input[g._rName].name="";this.input[g._rName].value=""}this.input[g._rName]._value=j},setChecked:function(l,m){m=(m===true);for(var c in this.r){if(this.r[c]._group==l._group&&this.r[c]._rId==l._rId){var j=false;if(this.r[c]._idd==l._idd){if(this.r[c]._checked!=m){this.r[c]._checked=m;j=true}}else{if(this.r[c]._checked){this.r[c]._checked=false;j=true}}if(j){var g=this.r[c].childNodes[this.r[c]._ll?1:0].childNodes[1];g.className=g.className.replace(/rdbt[0-1]{1}/gi,"")+(this.r[c]._checked?" rdbt1":" rdbt0");g=null}}}this.doCheckValue(l)},getChecked:function(a){return this.input[a._rName]._value},_getFirstValue:function(a){return this.firstValue[a._rName]},_getId:function(a){return a._idd},setValue:function(a,c){}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doDestruct:1,doUnloadNestedLists:1,doAttachEvents:1,check:1,unCheck:1,isChecked:1,enable:1,disable:1,isEnabled:1,setText:1,getText:1,getValue:1,setReadonly:1,isReadonly:1,setFocus:1}){dhtmlXForm.prototype.items.radio[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.select={render:function(a,c){a._type="se";a._enabled=true;a._value=null;a._newValue=null;this.doAddLabel(a,c);this.doAddInput(a,c,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,c);if(c.connector!=null){this.doLoadOptsConnector(a,c.connector)}if(typeof(c.value)!="undefined"&&c.value!=null){this.setValue(a,c.value)}return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._newValue=null;a.onselectstart=null;a.childNodes[a._ll?1:0].childNodes[0].onclick=null;a.childNodes[a._ll?1:0].childNodes[0].onkeydown=null;a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a.childNodes[a._ll?1:0].childNodes[0].onfocus=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;a.childNodes[a._ll?1:0].childNodes[0].onkeyup=null;a.childNodes[a._ll?1:0].removeChild(a.childNodes[a._ll?1:0].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAddLabel:function(c,g){var a=document.createElement("DIV");a.className="dhxform_label "+g.labelAlign;a.innerHTML="<label for='"+g.uid+"'>"+g.label+(g.info?"<span class='dhxform_info'>[?]</span>":"")+(c._required?"<span class='dhxform_item_required'>*</span>":"")+"</label>";if(g.wrap==true){a.style.whiteSpace="normal"}if(typeof(g.tooltip)!="undefined"){a.title=g.tooltip}c.appendChild(a);if(typeof(g.label)=="undefined"||g.label==null||g.label.length==0){a.style.display="none"}if(!isNaN(g.labelWidth)){a.style.width=parseInt(g.labelWidth)+"px"}if(!isNaN(g.labelHeight)){a.style.height=parseInt(g.labelHeight)+"px"}if(!isNaN(g.labelLeft)){a.style.left=parseInt(g.labelLeft)+"px"}if(!isNaN(g.labelTop)){a.style.top=parseInt(g.labelTop)+"px"}if(g.info){a.onclick=function(l){l=l||event;var j=l.target||l.srcElement;if(typeof(j.className)!="undefined"&&j.className=="dhxform_info"){this.parentNode.callEvent("onInfo",[this.parentNode._idd]);l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false}}}},doAttachEvents:function(g){var a=g.childNodes[g._ll?1:0].childNodes[0];var c=this;a.onclick=function(){c.doOnChange(this)};a.onkeydown=function(j){j=j||event;c.doOnChange(this);this.parentNode.parentNode.callEvent("onKeyDown",[this,j,this.parentNode.parentNode._idd])};a.onchange=function(){c.doOnChange(this)};a.onkeyup=function(j){j=j||event;this.parentNode.parentNode.callEvent("onKeyUp",[this,j,this.parentNode.parentNode._idd])};a=null;this.doAttachChangeLS(g)},doAttachChangeLS:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];a.onfocus=function(){var g=this.parentNode.parentNode;g.getForm()._ccActivate(g._idd,this,g.getForm().getItemValue(g._idd,true));g.getForm().callEvent("onFocus",[g._idd]);g=null};a.onblur=function(){var g=this.parentNode.parentNode;g.getForm()._ccDeactivate(g._idd);g.getForm().callEvent("onBlur",[g._idd]);g=null};a=null},doValidate:function(a){if(a.getForm().live_validate){this._validate(a)}},doLoadOpts:function(n,l,r){var o=n.childNodes[n._ll?1:0].childNodes[0];var a=l.options;var j=false;for(var c=0;c<a.length;c++){var m=a[c].text||a[c].label;if(!m||typeof(m)=="undefined"){m=""}var g=new Option(m,a[c].value);if(typeof(a[c].img_src)=="string"){g.setAttribute("img_src",a[c].img_src)}o.options.add(g);if(typeof(a[c].selected)!="undefined"&&window.dhx4.s2b(a[c].selected)==true){g.selected=true;n._value=a[c].value;j=true}if(typeof(a[c].checked)!="undefined"&&window.dhx4.s2b(a[c].checked)==true){g.setAttribute("checked","1")}if(typeof(a[c].img)!="undefined"){g.setAttribute("img",a[c].img)}if(typeof(a[c].img_dis)!="undefined"){g.setAttribute("img_dis",a[c].img_dis)}}if(!j&&o.selectedIndex>=0){n._value=o.options[o.selectedIndex].value}if(r===true){n.callEvent("onOptionsLoaded",[n._idd])}this._checkNoteWidth(n)},doLoadOptsConnector:function(g,a){var c=this;g._connector_working=true;window.dhx4.ajax.get(a,function(n){n=n.xmlDoc.responseXML;if(n==null){return}var j=n.getElementsByTagName("data");if(j==null||j[0]==null){return}j=j[0];var m=[];for(var o=0;o<j.childNodes.length;o++){if(typeof(j.childNodes[o].tagName)!="undefined"&&String(j.childNodes[o].tagName).toLowerCase()=="item"){var l=j.childNodes[o];m.push({label:l.getAttribute("label"),value:l.getAttribute("value"),selected:(l.getAttribute("selected")!=null)});l=null}}c.doLoadOpts(g,{options:m},true);g._connector_working=false;if(g._connector_value!=null){c.setValue(g,g._connector_value);g._connector_value=null}c=g=null})},doOnChange:function(g){var a=g.parentNode.parentNode;a._newValue=(g.selectedIndex>=0?g.options[g.selectedIndex].value:null);if(a._newValue!=a._value){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._newValue])!==true){for(var c=0;c<g.options.length;c++){if(g.options[c].value==a._value){g.options[c].selected=true}}return}}a._value=a._newValue;a.callEvent("onChange",[a._idd,a._value]);if(a._type=="se"&&a.getForm().live_validate){this._validate(a)}}a._autoCheck()},setText:function(a,c){if(!c){c=""}a.childNodes[a._ll?0:1].childNodes[0].innerHTML=c+(a._required?"<span class='dhxform_item_required'>*</span>":"");a.childNodes[a._ll?0:1].style.display=(c.length==0||c==null?"none":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("disabled")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?1:0].childNodes[0].setAttribute("disabled",true)},getOptions:function(a){return a.childNodes[a._ll?1:0].childNodes[0].options},setValue:function(c,j){if(c._connector_working){c._connector_value=j;return}var a=this.getOptions(c);for(var g=0;g<a.length;g++){if(a[g].value==j){a[g].selected=true;c._value=a[g].value}}if(c._list!=null&&c._list.length>0){c.getForm()._autoCheck()}c.getForm()._ccReload(c._idd,c._value)},getValue:function(g){var a=-1;var c=this.getOptions(g);for(var j=0;j<c.length;j++){if(c[j].selected){a=c[j].value}}return a},setWidth:function(c,a){c.childNodes[c._ll?1:0].childNodes[0].style.width=a+"px"},getSelect:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setFocus:function(a){a.childNodes[a._ll?1:0].childNodes[0].focus()},_checkNoteWidth:function(c){var a;if(c.childNodes[c._ll?1:0].childNodes[1]!=null){a=c.childNodes[c._ll?1:0].childNodes[1];if(a.className!=null&&a.className.search(/dhxform_note/gi)>=0&&a._w=="auto"){a.style.width=c.childNodes[c._ll?1:0].childNodes[0].offsetWidth+"px"}}a=null}};(function(){for(var c in {doAddInput:1,doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.select[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(j,m,n){var c=j.childNodes[j._ll?1:0].childNodes[0];c.multiple=true;if(!isNaN(m.size)){c.size=Number(m.size)}j._value=[];j._newValue=[];var g=m.options;for(var l=0;l<g.length;l++){var a=new Option(g[l].text||g[l].label,g[l].value);c.options.add(a);if(g[l].selected==true||g[l].selected=="true"){a.selected=true;j._value.push(g[l].value)}}if(n===true){j.callEvent("onOptionsLoaded",[j._idd])}this._checkNoteWidth(j)},doAttachEvents:function(g){var a=g.childNodes[g._ll?1:0].childNodes[0];var c=this;a.onfocus=function(){c.doOnChange(this);var j=this.parentNode.parentNode;j.getForm().callEvent("onFocus",[j._idd]);j=null};a.onblur=function(){c.doOnChange(this);var j=this.parentNode.parentNode;j.getForm().callEvent("onBlur",[j._idd]);j=null};a.onclick=function(){c.doOnChange(this);var j=this.parentNode.parentNode;j._autoCheck();j=null}},doOnChange:function(j){var c=j.parentNode.parentNode;c._newValue=[];for(var g=0;g<j.options.length;g++){if(j.options[g].selected){c._newValue.push(j.options[g].value)}}if((c._value).sort().toString()!=(c._newValue).sort().toString()){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,c._newValue])!==true){var a={};for(var g=0;g<c._value.length;g++){a[c._value[g]]=true}for(var g=0;g<j.options.length;g++){j.options[g].selected=(a[j.options[g].value]==true)}a=null;return}}c._value=[];for(var g=0;g<c._newValue.length;g++){c._value.push(c._newValue[g])}c.callEvent("onChange",[c._idd,c._value])}c._autoCheck()},setValue:function(g,l){var a={};if(typeof(l)=="string"){l=l.split(",")}if(typeof(l)!="object"){l=[l]}for(var j=0;j<l.length;j++){a[l[j]]=true}var c=this.getOptions(g);for(var j=0;j<c.length;j++){c[j].selected=(a[c[j].value]==true)}g._autoCheck()},getValue:function(g){var a=[];var c=this.getOptions(g);for(var j=0;j<c.length;j++){if(c[j].selected){a.push(c[j].value)}}return a}};(function(){for(var c in dhtmlXForm.prototype.items.select){if(!dhtmlXForm.prototype.items.multiselect[c]){dhtmlXForm.prototype.items.multiselect[c]=dhtmlXForm.prototype.items.select[c]}}})();dhtmlXForm.prototype.items.input={render:function(m,n){var l=(!isNaN(n.rows));m._type="ta";m._enabled=true;this.doAddLabel(m,n);this.doAddInput(m,n,(l?"TEXTAREA":"INPUT"),(l?null:"TEXT"),true,true,"dhxform_textarea");this.doAttachEvents(m);if(l){m.childNodes[m._ll?1:0].childNodes[0].rows=Number(n.rows)+(window.dhx4.isIE6?1:0)}if(typeof(n.numberFormat)!="undefined"){var j,g=null,o=null;if(typeof(n.numberFormat)!="string"){j=n.numberFormat[0];g=n.numberFormat[1]||null;o=n.numberFormat[2]||null}else{j=n.numberFormat;if(typeof(n.groupSep)=="string"){g=n.groupSep}if(typeof(n.decSep)=="string"){o=n.decSep}}this.setNumberFormat(m,j,g,o,false)}this.setValue(m,n.value);return this},doAttachEvents:function(c){var a=this;if(c._type=="ta"||c._type=="se"||c._type=="pw"){c.childNodes[c._ll?1:0].childNodes[0].onfocus=function(){var g=this.parentNode.parentNode;if(g._df!=null){this.value=g._value||""}g.getForm()._ccActivate(g._idd,this,this.value);g.getForm().callEvent("onFocus",[g._idd]);g=null}}c.childNodes[c._ll?1:0].childNodes[0].onblur=function(){var g=this.parentNode.parentNode;g.getForm()._ccDeactivate(g._idd);a.updateValue(g,true);if(g.getForm().live_validate){a._validate(g)}g.getForm().callEvent("onBlur",[g._idd]);g=null}},updateValue:function(l,a){var m=l.childNodes[l._ll?1:0].childNodes[0].value;var j=l.getForm();var c=(j._ccActive==true&&j._formLS!=null&&j._formLS[l._idd]!=null);j=null;if(!c&&l._df!=null&&m==window.dhx4.template._getFmtValue(l._value,l._df)){return}if(!a&&l._df!=null&&l._value==m&&m==window.dhx4.template._getFmtValue(m,l._df)){return}var g=this;if(l._value!=m){if(l.checkEvent("onBeforeChange")){if(l.callEvent("onBeforeChange",[l._idd,l._value,m])!==true){if(l._df!=null){g.setValue(l,l._value)}else{l.childNodes[l._ll?1:0].childNodes[0].value=l._value}return}}if(l._df!=null&&a){g.setValue(l,m)}else{l._value=m}l.callEvent("onChange",[l._idd,m]);return}if(l._df!=null&&a){this.setValue(l,l._value)}},setValue:function(g,j){g._value=(typeof(j)!="undefined"&&j!=null?j:"");var c=(String(g._value)||"");var a=g.childNodes[g._ll?1:0].childNodes[0];if(g._df!=null){c=window.dhx4.template._getFmtValue(c,g._df)}if(a.value!=c){a.value=c;g.getForm()._ccReload(g._idd,c)}a=null},getValue:function(a){var c=a.getForm();if(c._formLS&&c._formLS[a._idd]!=null){this.updateValue(a)}c=null;return(typeof(a._value)!="undefined"&&a._value!=null?a._value:"")},setReadonly:function(a,c){a._ro=(c===true);if(a._ro){a.childNodes[a._ll?1:0].childNodes[0].setAttribute("readOnly","true")}else{a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("readOnly")}},isReadonly:function(a){if(!a._ro){a._ro=false}return a._ro},getInput:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setNumberFormat:function(j,l,g,m,c){if(typeof(c)!="boolean"){c=true}if(l==""){j._df=null;if(c){this.setValue(j,j._value)}return true}if(typeof(l)!="string"){return}var a=window.dhx4.template._parseFmt(l,g,m);if(a==false){return false}else{j._df=a}if(c){this.setValue(j,j._value)}return true}};(function(){for(var c in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setFocus:1}){dhtmlXForm.prototype.items.input[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype.items.password={render:function(a,c){a._type="pw";a._enabled=true;this.doAddLabel(a,c);this.doAddInput(a,c,"INPUT","PASSWORD",true,true,"dhxform_textarea");this.doAttachEvents(a);this.setValue(a,c.value);return this}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doAttachEvents:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,setValue:1,getValue:1,updateValue:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.password[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.file={render:function(g,j){g._type="fl";g._enabled=true;this.doAddLabel(g,j);this.doAddInput(g,j,"INPUT","FILE",true,false,"dhxform_textarea");var a=g.childNodes[g._ll?1:0].childNodes[0];var c=this;a.onfocus=function(){var l=this.parentNode.parentNode;l.getForm().callEvent("onFocus",[l._idd]);l=null};a.onblur=function(){var l=this.parentNode.parentNode;if(l.getForm().live_validate){c._validate(l)}l.getForm().callEvent("onBlur",[l._idd]);l=null};a=null;g.childNodes[g._ll?1:0].childNodes[0].onchange=function(){g.callEvent("onChange",[g._idd,this.value])};return this},setValue:function(){},getValue:function(a){return a.childNodes[a._ll?1:0].childNodes[0].value}};(function(){for(var c in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,getInput:1,enable:1,disable:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.file[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.label={_index:false,render:function(c,g){c._type="lb";c._enabled=true;c._checked=true;var a=document.createElement("DIV");a.className="dhxform_txt_label2"+(g._isTopmost?" topmost":"");a.innerHTML=g.label;c.appendChild(a);if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}if(!isNaN(g.labelWidth)){a.style.width=parseInt(g.labelWidth)+"px"}if(!isNaN(g.labelHeight)){a.style.height=parseInt(g.labelHeight)+"px"}if(!isNaN(g.labelLeft)){a.style.left=parseInt(g.labelLeft)+"px"}if(!isNaN(g.labelTop)){a.style.top=parseInt(g.labelTop)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._autoCheck=null;a._enabled=null;a._type=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.onselectstart=null;a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false},setText:function(a,c){a.firstChild.innerHTML=c},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.label[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.button={render:function(g,j){g._type="bt";g._enabled=true;g._name=j.name;g.className=String(g.className).replace("item_label_top","item_label_left").replace("item_label_right","item_label_left");if(!isNaN(j.width)){var a=Math.max(j.width,10)}var c=(typeof(a)!="undefined");g._doOnKeyUpDown=function(m,l){this.callEvent(m,[this.childNodes[0].childNodes[0],l,this._idd])};g.innerHTML='<div class="dhxform_btn" role="link" tabindex="0" dir="ltr"><div class="dhxform_btn_txt" '+(c?' style="width:'+a+'px;"':"")+">"+j.value+'</div><div class="dhxform_btn_filler" disabled="true"></div></div>';if(!isNaN(j.inputLeft)){g.childNodes[0].style.left=parseInt(j.inputLeft)+"px"}if(!isNaN(j.inputTop)){g.childNodes[0].style.top=parseInt(j.inputTop)+"px"}if(j.hidden==true){this.hide(g)}if(j.disabled==true){this.userDisable(g)}if(typeof(j.tooltip)!="undefined"){g.firstChild.title=j.tooltip}g.onselectstart=function(l){l=l||event;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.firstChild.onselectstart=function(l){l=l||event;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.firstChild.onkeypress=function(l){l=l||event;if((l.keyCode==32||l.charCode==32||l.keyCode==13||l.charCode==13)&&!this.parentNode._busy){this.parentNode._busy=true;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"]);return false}};g.firstChild.onfocus=function(){this.parentNode._doOnFocus(this.parentNode)};g.firstChild.onblur=function(){_dhxForm_doClick(this.childNodes[0],"mouseout");this.parentNode._doOnBlur(this.parentNode)};g.firstChild.onkeyup=function(l){this.parentNode._doOnKeyUpDown("onKeyUp",l||event)};g.firstChild.onkeydown=function(l){this.parentNode._doOnKeyUpDown("onKeyDown",l||event)};g.firstChild.onmouseover=function(){var l=this.parentNode;if(!l._enabled){return}this._isOver=true;this.className="dhxform_btn dhxform_btn_over";l=null};g.firstChild.onmouseout=function(){var l=this.parentNode;if(!l._enabled){return}this.className="dhxform_btn";this._allowClick=false;this._pressed=false;this._isOver=false;l=null};g.firstChild.ontouchstart=g.firstChild.onmousedown=function(m){m=m||event;if(m.type=="touchstart"&&m.preventDefault){m.preventDefault()}if(m.button>=2){return}if(this._pressed){return}var l=this.parentNode;if(!l._enabled){return}this.className="dhxform_btn dhxform_btn_pressed";this._allowClick=true;this._pressed=true;l=null};g.firstChild.ontouchend=g.firstChild.onmouseup=function(m){m=m||event;if(m.button>=2){return}if(!this._pressed){return}var l=this.parentNode;if(!l._enabled){return}l._busy=false;this.className="dhxform_btn"+(this._isOver?" dhxform_btn_over":"");if(this._pressed&&this._allowClick){l.callEvent("_onButtonClick",[l._name,l._cmd])}this._allowClick=false;this._pressed=false;l=null};g._doOnFocus=function(l){l.getForm().callEvent("onFocus",[l._idd])};g._doOnBlur=function(l){l.getForm().callEvent("onBlur",[l._idd])};return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._type=null;a._enabled=null;a._cmd=null;a._name=null;a._doOnFocus=null;a._doOnBlur=null;a._doOnKeyUpDown=null;a.onselectstart=null;a.firstChild.onselectstart=null;a.firstChild.onkeypress=null;a.firstChild.ontouchstart=null;a.firstChild.ontouchend=null;a.firstChild.onfocus=null;a.firstChild.onblur=null;a.firstChild.onkeyup=null;a.firstChild.onkeydown=null;a.firstChild.onmouseover=null;a.firstChild.onmouseout=null;a.firstChild.onmousedown=null;a.firstChild.onmouseup=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[0].removeAttribute("disabled");a.childNodes[0].setAttribute("role","link");a.childNodes[0].setAttribute("tabIndex","0")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[0].setAttribute("disabled","true");a.childNodes[0].removeAttribute("role");a.childNodes[0].removeAttribute("tabIndex")},setText:function(a,c){a.childNodes[0].childNodes[0].innerHTML=c},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},setFocus:function(a){a.childNodes[0].focus()}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.button[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.hidden={_index:false,render:function(c,g){c.style.display="none";c._name=g.name;c._type="hd";c._enabled=true;var a=document.createElement("INPUT");a.type="HIDDEN";a.name=g.name;a.value=(g.value||"");c.appendChild(a);return this},destruct:function(a){this.doUnloadNestedLists(a);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a._autoCheck=null;a._name=null;a._type=null;a._enabled=null;a.onselectstart=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.parentNode.removeChild(a);a=null},enable:function(a){a._enabled=true;a.childNodes[0].setAttribute("name",a._name)},disable:function(a){a._enabled=false;a.childNodes[0].removeAttribute("name")},show:function(){},hide:function(){},isHidden:function(){return true},setValue:function(a,c){a.childNodes[0].value=c},getValue:function(a){return a.childNodes[0].value},getInput:function(a){return a.childNodes[0]}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.hidden[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.list={_index:false,render:function(a,c){a._type="list";a._enabled=true;a._isNestedForm=true;a.style.paddingLeft=a._ofsNested+"px";a.className="dhxform_base_nested"+(a._custom_css||"");return[this,new dhtmlXForm(a,null,c)]},destruct:function(a){}};dhtmlXForm.prototype.items.fieldset={_index:false,render:function(c,j){c._type="fs";if(typeof(parseInt(j.inputWidth))=="number"){}c._width=j.width;c._enabled=true;c._checked=true;c.className="fs_"+j.position+(typeof(j.className)=="string"?" "+j.className:"");var g=document.createElement("FIELDSET");g.className="dhxform_fs";var l=String(j.labelAlign).replace("align_","");g.innerHTML="<legend class='fs_legend' align='"+l+"' style='text-align:"+l+"'>"+j.label+"</legend>";c.appendChild(g);if(!isNaN(j.inputLeft)){g.style.left=parseInt(j.inputLeft)+"px"}if(!isNaN(j.inputTop)){g.style.top=parseInt(j.inputTop)+"px"}if(j.inputWidth!="auto"){if(!isNaN(j.inputWidth)){g.style.width=parseInt(j.inputWidth)+"px";var a=parseInt(g.style.width);if(g.offsetWidth>a){g.style.width=a+(a-g.offsetWidth)+"px"}}}c._addSubListNode=function(){var m=document.createElement("DIV");m._custom_css=" dhxform_fs_nested";this.childNodes[0].appendChild(m);return m};if(j.hidden==true){this.hide(c)}if(j.disabled==true){this.userDisable(c)}return this},destruct:function(a){this.doUnloadNestedLists(a);a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._width=null;a.onselectstart=null;a._addSubListNode=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,c){a.childNodes[0].childNodes[0].innerHTML=c},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}},setWidth:function(c,a){c.childNodes[0].style.width=a+"px";c._width=a},getWidth:function(a){return a._width}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.fieldset[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.block={_index:false,render:function(c,g){c._type="bl";c._width=g.width;c._enabled=true;c._checked=true;c.className="block_"+g.position+(typeof(g.className)=="string"?" "+g.className:"");var a=document.createElement("DIV");a.className="dhxform_obj_"+c.getForm().skin+" dhxform_block";a.style.fontSize=c.getForm().cont.style.fontSize;if(g.style){a.style.cssText=g.style}if(typeof(g.id)!="undefined"){a.id=g.id}c.appendChild(a);if(!isNaN(g.inputLeft)){a.style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){a.style.top=parseInt(g.inputTop)+"px"}if(g.inputWidth!="auto"){if(!isNaN(g.inputWidth)){a.style.width=parseInt(g.inputWidth)+"px"}}if(!isNaN(g.blockOffset)){c._ofsNested=g.blockOffset}c._addSubListNode=function(){var j=document.createElement("DIV");j._inBlcok=true;if(typeof(this._ofsNested)!="undefined"){j._ofsNested=this._ofsNested}this.childNodes[0].appendChild(j);return j};if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}return this},_setCss:function(a,g,c){a.firstChild.className="dhxform_obj_"+g+" dhxform_block";a.firstChild.style.fontSize=c}};(function(){for(var c in {enable:1,disable:1,isEnabled:1,setWidth:1,getWidth:1,doUnloadNestedLists:1,destruct:1}){dhtmlXForm.prototype.items.block[c]=dhtmlXForm.prototype.items.fieldset[c]}})();dhtmlXForm.prototype.items.newcolumn={_index:false};dhtmlXForm.prototype.items.template={render:function(c,g){var a=(!isNaN(g.rows));c._type="tp";c._enabled=true;if(g.format!=null){if(typeof(g.format)=="function"){c.format=g.format}else{if(typeof(g.format)=="string"&&typeof(window[g.format])=="function"){c.format=window[g.format]}}}if(c.format==null){c.format=function(j,l){return l}}this.doAddLabel(c,g);this.doAddInput(c,g,"DIV",null,true,true,"dhxform_item_template");this.setValue(c,g.value||"");return this},destruct:function(a){a.format=null;this.d2(a);a=null},setValue:function(a,c){a._value=c;a.childNodes[a._ll?1:0].childNodes[0].innerHTML=a.format(a._idd,a._value)},getValue:function(a){return a._value},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false}};(function(){dhtmlXForm.prototype.items.template.d2=dhtmlXForm.prototype.items.input.destruct;for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.template[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype._ulToObject=function(l,r){var m=[];for(var c=0;c<l.childNodes.length;c++){if(String(l.childNodes[c].tagName||"").toLowerCase()=="li"){var g={};var u=l.childNodes[c];for(var s=0;s<r.length;s++){if(u.getAttribute(r[s])!=null){g[String(r[s]).replace("ftype","type")]=u.getAttribute(r[s])}}if(!g.label){try{g.label=u.firstChild.nodeValue}catch(o){}}var j=u.getElementsByTagName("UL");if(j[0]!=null){g[(g.type=="select"?"options":"list")]=dhtmlXForm.prototype._ulToObject(j[0],r)}for(var s=0;s<u.childNodes.length;s++){if(String(u.childNodes[s].tagName||"").toLowerCase()=="userdata"){if(!g.userdata){g.userdata={}}g.userdata[u.childNodes[s].getAttribute("name")]=u.childNodes[s].firstChild.nodeValue}}m[m.length]=g}if(String(l.childNodes[c].tagName||"").toLowerCase()=="div"){var g={};g.type="label";try{g.label=l.childNodes[c].firstChild.nodeValue}catch(o){}m[m.length]=g}}return m};dhtmlXForm.prototype.setUserData=function(l,g,j,a){if(typeof(a)!="undefined"){var c=this.doWithItem([l,g],"_getId");if(c!=null){l=c;g=j;j=a}}if(!this._userdata){this._userdata={}}this._userdata[l]=(this._userdata[l]||{});this._userdata[l][g]=j};dhtmlXForm.prototype.getUserData=function(j,g,a){if(typeof(a)!="undefined"){var c=this.doWithItem([j,g],"_getId");if(c!=null){j=c;g=a}}if(this._userdata!=null&&typeof(this._userdata[j])!="undefined"&&typeof(this._userdata[j][g])!="undefined"){return this._userdata[j][g]}return""};dhtmlXForm.prototype.setRTL=function(a){this._rtl=(a===true?true:false);if(this._rtl){if(String(this.cont).search(/dhxform_rtl/gi)<0){this.cont.className+=" dhxform_rtl"}}else{if(String(this.cont).search(/dhxform_rtl/gi)>=0){this.cont.className=String(this.cont.className).replace(/dhxform_rtl/gi,"")}}};_dhxForm_doClick=function(j,c){if(typeof(c)=="object"){var a=c[1];c=c[0]}if(document.createEvent){var g=document.createEvent("MouseEvents");g.initEvent(c,true,false);j.dispatchEvent(g)}else{if(document.createEventObject){var g=document.createEventObject();g.button=1;j.fireEvent("on"+c,g)}}if(a){window.setTimeout(function(){_dhxForm_doClick(j,a)},100)}};dhtmlXForm.prototype.setFormData=function(g){for(var c in g){var j=this.getItemType(c);switch(j){case"checkbox":this[g[c]==true||parseInt(g[c])==1||g[c]=="true"||g[c]==this.getItemValue(c,"realvalue")?"checkItem":"uncheckItem"](c);break;case"radio":this.checkItem(c,g[c]);break;case"input":case"textarea":case"password":case"select":case"multiselect":case"hidden":case"template":case"combo":case"calendar":case"colorpicker":case"editor":this.setItemValue(c,g[c]);break;default:if(this["setFormData_"+j]){this["setFormData_"+j](c,g[c])}else{if(!this.hId){this.hId=this._genStr(12)}this.setUserData(this.hId,c,g[c])}break}}};dhtmlXForm.prototype.getFormData=function(w,m){var c={};var s=this;for(var v in this.itemPull){var o=this.itemPull[v]._idd;var x=this.itemPull[v]._type;if(x=="ch"){c[o]=(this.isItemChecked(o)?this.getItemValue(o):0)}if(x=="ra"&&!c[this.itemPull[v]._group]){c[this.itemPull[v]._group]=this.getCheckedValue(this.itemPull[v]._group)}if(x in {se:1,ta:1,pw:1,hd:1,tp:1,fl:1,calendar:1,combo:1,editor:1,colorpicker:1}){c[o]=this.getItemValue(o,w)}if(this["getFormData_"+x]){c[o]=this["getFormData_"+x](o)}if(x=="up"){var l=this.getItemValue(o);for(var j in l){c[j]=l[j]}}if(this.itemPull[v]._list){for(var g=0;g<this.itemPull[v]._list.length;g++){var n=this.itemPull[v]._list[g].getFormData(w,m);for(var u in n){c[u]=n[u]}}}}if(!m&&this.hId&&this._userdata[this.hId]){for(var v in this._userdata[this.hId]){if(!c[v]){c[v]=this._userdata[this.hId][v]}}}return c};dhtmlXForm.prototype.adjustParentSize=function(){var l=0;var j=-1;for(var m=0;m<this.base.length;m++){l+=this.base[m].firstChild.offsetWidth;if(this.base[m].offsetHeight>j){j=this.base[m].offsetHeight}}var g=false;try{g=(this.cont.parentNode.parentNode.parentNode.parentNode._isCell==true);if(g){var a=this.cont.parentNode.parentNode.parentNode.parentNode}}catch(n){}if(g&&typeof(a)!="undefined"){if(l>0){a.setWidth(l+10)}if(j>0){a.setHeight(j+a.firstChild.firstChild.offsetHeight+5)}g=a=null;return}var c=false;try{c=(this.cont.parentNode.parentNode.parentNode._isWindow==true);if(c){var o=this.cont.parentNode.parentNode;if(typeof(o.callEvent)=="function"){this.cont.style.display="none";o.callEvent("_setCellSize",[l+15,j+15]);this.cont.style.display=""}}}catch(n){}};dhtmlXForm.prototype.reset=function(){if(this.callEvent("onBeforeReset",[this.formId,this.getFormData()])){if(this._last_load_data){this.setFormData(this._last_load_data)}this.callEvent("onAfterReset",[this.formId])}};dhtmlXForm.prototype.send=function(c,n,o,j){if(typeof n=="function"){o=n;n="post"}else{n=(n=="get"?"get":"post")}if(j!==true&&!this.validate()){return}var m=this.getFormData(true);var l=[];for(var g in m){l.push(g+"="+encodeURIComponent(m[g]))}var a=function(q){if(o){o.call(this,q,q.xmlDoc.responseText)}};if(n=="get"){window.dhx4.ajax.get(c+(c.indexOf("?")==-1?"?":"&")+l.join("&"),a)}else{window.dhx4.ajax.post(c,l.join("&"),a)}};dhtmlXForm.prototype.save=function(a,c){};dhtmlXForm.prototype.dummy=function(){};dhtmlXForm.prototype._changeFormId=function(c,a){this.formId=a};dhtmlXForm.prototype._dp_init=function(a){a._methods=["dummy","dummy","_changeFormId","dummy"];a._getRowData=function(j,c){var g=this.obj.getFormData(true);g[this.action_param]=this.obj.getUserData(j,this.action_param);return g};a._clearUpdateFlag=function(){};a.attachEvent("onAfterUpdate",function(g,j,l,c){if(j=="inserted"||j=="updated"){this.obj.resetDataProcessor("updated");this.obj._last_load_data=this.obj.getFormData(true)}this.obj.callEvent("onAfterSave",[this.obj.formId,c]);return true});a.autoUpdate=false;a.setTransactionMode("POST",true);this.dp=a;this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");this.save=function(){if(!this.callEvent("onBeforeSave",[this.formId,this.getFormData()])){return}if(!this.validate()){return}a.sendData()}};dhtmlXForm.prototype.resetDataProcessor=function(a){if(!this.dp){return}this.dp.updatedRows=[];this.dp._in_progress=[];this.dp.setUpdated(this.formId,true,a)};dhtmlXForm.prototype._ccActivate=function(g,a,c){if(!this._formLS){this._formLS={}}if(!this._formLS[g]){this._formLS[g]={input:a,value:c}}if(!this._ccActive){this._ccActive=true;this._ccDo()}a=null};dhtmlXForm.prototype._ccDeactivate=function(a){if(this._ccTm){window.clearTimeout(this._ccTm)}this._ccActive=false;if(this._formLS!=null&&this._formLS[a]!=null){this._formLS[a].input=null;this._formLS[a]=null;delete this._formLS[a]}};dhtmlXForm.prototype._ccDo=function(){if(this._ccTm){window.clearTimeout(this._ccTm)}for(var c in this._formLS){var l=this._formLS[c].input;if(String(l.tagName).toLowerCase()=="select"){var g="";if(l.selectedIndex>=0&&l.selectedIndex<l.options.length){g=l.options[l.selectedIndex].value}}else{var g=l.value}if(g!=this._formLS[c].value){this._formLS[c].value=g;this.callEvent("onInputChange",[l._idd,g,this])}l=null}if(this._ccActive){var j=this;this._ccTm=window.setTimeout(function(){j._ccDo();j=null},100)}};dhtmlXForm.prototype._ccReload=function(c,a){if(this._formLS&&this._formLS[c]){this._formLS[c].value=a}};dhtmlXForm.prototype._autoload=function(){var c=["ftype","name","value","label","check","checked","disabled","text","rows","select","selected","width","style","className","labelWidth","labelHeight","labelLeft","labelTop","inputWidth","inputHeight","inputLeft","inputTop","position","size"];var g=document.getElementsByTagName("UL");var j=[];for(var n=0;n<g.length;n++){if(g[n].className=="dhtmlxForm"){var m=document.createElement("DIV");j[j.length]={nodeUL:g[n],nodeForm:m,data:dhtmlXForm.prototype._ulToObject(g[n],c),name:(g[n].getAttribute("name")||null)}}}for(var n=0;n<j.length;n++){j[n].nodeUL.parentNode.insertBefore(j[n].nodeForm,j[n].nodeUL);var o=new dhtmlXForm(j[n].nodeForm,j[n].data);if(j[n].name!==null){window[j[n].name]=o}var l=(j[n].nodeUL.getAttribute("oninit")||null);j[n].nodeUL.parentNode.removeChild(j[n].nodeUL);j[n].nodeUL=null;j[n].nodeForm=null;j[n].data=null;j[n]=null;if(l){if(typeof(l)=="function"){l()}else{if(typeof(window[l])=="function"){window[l]()}}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.detachEvent("onload",dhtmlXForm.prototype._autoload)}};if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.attachEvent("onload",dhtmlXForm.prototype._autoload)}if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachForm=function(a){this.callEvent("_onBeforeContentAttach",["form"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";if(window.dhtmlx&&dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(c)}else{c.style.overflow="auto"}this._attachObject(c);this.dataType="form";this.dataObj=new dhtmlXForm(c,a);this.dataObj.setSkin(this.conf.skin);c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXForm.prototype.items.combo={render:function(c,g){c._type="combo";c._enabled=true;c._value=null;c._newValue=null;this.doAddLabel(c,g);this.doAddInput(c,g,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(c);this.doLoadOpts(c,g);c.onselectstart=function(j){return true};c.childNodes[c._ll?1:0].childNodes[0].setAttribute("mode",g.comboType||"");if(g.comboImagePath){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("imagePath",g.comboImagePath)}if(g.comboDefaultImage){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("defaultImage",g.comboDefaultImage)}if(g.comboDefaultImageDis){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("defaultImageDis",g.comboDefaultImageDis)}c._combo=new dhtmlXComboFromSelect(c.childNodes[c._ll?1:0].childNodes[0]);c._combo.setSkin(c.getForm().skin);c._combo._currentComboValue=c._combo.getSelectedValue();c._combo.getInput().id=g.uid;var a=this;c._combo.attachEvent("onChange",function(){a.doOnChange(this)});if(g.connector){this.doLoadOptsConnector(c,g.connector)}if(g.filtering){c._combo.enableFilteringMode(true)}else{if(g.serverFiltering){c._combo.enableFilteringMode(true,g.serverFiltering,g.filterCache,g.filterSubLoad)}}if(g.readonly==true){this.setReadonly(c,true)}if(g.style){c._combo.DOMelem_input.style.cssText+=g.style}c._combo.attachEvent("onFocus",function(){var j=this.cont.parentNode.parentNode;var l=j.getForm();if(l.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)<0){this.cont.className+=" combo_in_focus"}l.callEvent("onFocus",[j._idd]);l=j=null});c._combo.attachEvent("onBlur",function(){var j=this.cont.parentNode.parentNode;var l=j.getForm();if(l.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)>=0){this.cont.className=this.cont.className.replace(/\s{0,}combo_in_focus/gi,"")}l.callEvent("onBlur",[j._idd]);l=j=null});return this},destruct:function(a){a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a._combo._currentComboValue=null;a._combo.unload();a._combo=null;a._apiChange=null;this.d2(a);a=null},doAttachEvents:function(c){var a=this;c.childNodes[c._ll?1:0].childNodes[0].onchange=function(){a.doOnChange(this);a.doValidate(this.DOMParent.parentNode.parentNode)}},doValidate:function(a){if(a.getForm().hot_validate){this._validate(a)}},doOnChange:function(c){var a=c.base.parentNode.parentNode.parentNode;if(a._apiChange){return}c._newComboValue=c.getSelectedValue();if(c._newComboValue!=c._currentComboValue){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,c._currentComboValue,c._newComboValue])!==true){window.setTimeout(function(){c.setComboValue(c._currentComboValue)},1);return false}}c._currentComboValue=c._newComboValue;a.callEvent("onChange",[a._idd,c._currentComboValue])}a._autoCheck(a._enabled)},doLoadOptsConnector:function(j,a){var g=this;var c=j;j._connector_working=true;j._apiChange=true;j._combo.load(a,function(){c.callEvent("onOptionsLoaded",[c._idd]);c._connector_working=false;if(c._connector_value!=null){g.setValue(c,c._connector_value);c._connector_value=null}c._apiChange=false;g=c=null})},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a._combo.enable()},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a._combo.disable()},getCombo:function(a){return a._combo},setValue:function(a,c){if(a._connector_working){a._connector_value=c;return}a._apiChange=true;a._combo.setComboValue(c);a._combo._currentComboValue=a._combo.getActualValue();a._apiChange=false},getValue:function(a){return a._combo.getActualValue()},setWidth:function(c,a){c.childNodes[c._ll?1:0].childNodes[0].style.width=a+"px"},setReadonly:function(a,c){if(!a._combo){return}a._combo_ro=c;a._combo.readonly(a._combo_ro)},isReadonly:function(a,c){return a._combo_ro||false},setFocus:function(a){if(a._enabled){a._combo.setFocus()}},_setCss:function(a,g,c){a._combo.setFontSize(c,c)}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,_checkNoteWidth:1}){dhtmlXForm.prototype.items.combo[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype.items.combo.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.getCombo=function(a){return this.doWithItem(a,"getCombo")};dhtmlXForm.prototype.items.calendar={render:function(g,l){var c=this;g._type="calendar";g._enabled=true;var m=navigator.userAgent;var a=(m.indexOf("MSIE 6.0")>=0||m.indexOf("MSIE 7.0")>=0||m.indexOf("MSIE 8.0")>=0);this.doAddLabel(g,l);this.doAddInput(g,l,"INPUT","TEXT",true,true,"dhxform_textarea calendar");this.doAttachChangeLS(g);if(a){g.childNodes[g._ll?1:0].childNodes[0].onfocus2=g.childNodes[g._ll?1:0].childNodes[0].onfocus;g.childNodes[g._ll?1:0].childNodes[0].onfocus=function(){if(this._skipOnFocus==true){this._skipOnFocus=false;return}this.onfocus2.apply(this,arguments)}}g.childNodes[g._ll?1:0].childNodes[0]._idd=g._idd;g.childNodes[g._ll?1:0].childNodes[0].onblur=function(){var n=this.parentNode.parentNode;if(n._c.base._formMouseDown){n._c.base._formMouseDown=false;this._skipOnFocus=true;this.focus();this.value=this.value;n=null;return true}var o=n.getForm();o._ccDeactivate(n._idd);c.checkEnteredValue(this.parentNode.parentNode);if(o.live_validate){c._validate(n)}o.callEvent("onBlur",[n._idd]);o=n=null};g._f=(l.dateFormat||null);g._f0=(l.serverDateFormat||g._f);var j=g.getForm();g._c=new dhtmlXCalendarObject(g.childNodes[g._ll?1:0].childNodes[0],l.skin||j.skin||"dhx_skyblue");g._c._nullInInput=true;g._c.enableListener(g.childNodes[g._ll?1:0].childNodes[0]);if(g._f!=null){g._c.setDateFormat(g._f)}if(!window.dhx4.s2b(l.enableTime)){g._c.hideTime()}if(window.dhx4.s2b(l.showWeekNumbers)){g._c.showWeekNumbers()}if(!isNaN(l.weekStart)){g._c.setWeekStartDay(l.weekStart)}if(typeof(l.calendarPosition)!="undefined"){g._c.setPosition(l.calendarPosition)}if(l.minutesInterval!=null){g._c.setMinutesInterval(l.minutesInterval)}g._c._itemIdd=g._idd;g._c.attachEvent("onBeforeChange",function(n){if(g._value!=n){if(g.checkEvent("onBeforeChange")){if(g.callEvent("onBeforeChange",[g._idd,g._value,n])!==true){return false}}g._tempValue=g._value=n;c.setValue(g,n,false);g.callEvent("onChange",[this._itemIdd,g._value])}return true});g._c.attachEvent("onClick",function(){g._tempValue=null});if(a){g._c.base.onmousedown=function(){this._formMouseDown=true;return false}}this.setValue(g,l.value);j=null;return this},getCalendar:function(a){return a._c},setSkin:function(a,c){a._c.setSkin(c)},setValue:function(c,g,a){if(!g||g==null||typeof(g)=="undefined"||g==""){c._value=null;c.childNodes[c._ll?1:0].childNodes[0].value=""}else{c._value=(g instanceof Date?g:c._c._strToDate(g,c._f0||c._c._dateFormat));c.childNodes[c._ll?1:0].childNodes[0].value=c._c._dateToStr(c._value,c._f||c._c._dateFormat)}if(a!==false){c._c.setDate(c._value)}},getValue:function(c,a){var g=c._tempValue||c._c.getDate();if(a===true&&g==null){return""}return(a===true?c._c._dateToStr(g,c._f0||c._c._dateFormat):g)},setDateFormat:function(c,a,g){c._f=a;c._f0=(g||c._f);c._c.setDateFormat(c._f);this.setValue(c,this.getValue(c))},destruct:function(a){a._c.disableListener(a.childNodes[a._ll?1:0].childNodes[0]);a._c.unload();a._c=null;try{delete a._c}catch(c){}a._f=null;try{delete a._f}catch(c){}a._f0=null;try{delete a._f0}catch(c){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;this.d2(a);a=null},checkEnteredValue:function(a){this.setValue(a,a._c.getDate())}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.calendar[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.calendar.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};dhtmlXForm.prototype.setCalendarDateFormat=function(c,a,g){this.doWithItem(c,"setDateFormat",a,g)};dhtmlXForm.prototype.items.btn2state={setChecked:function(a,c){a._checked=(c===true?true:false);a.childNodes[a._ll?1:0].lastChild.className="dhxform_img "+a._cssName+"_"+(a._checked?"1":"0");this.doCheckValue(a)}};(function(){for(var c in dhtmlXForm.prototype.items.checkbox){if(!dhtmlXForm.prototype.items.btn2state[c]){dhtmlXForm.prototype.items.btn2state[c]=dhtmlXForm.prototype.items.checkbox[c]}}})();dhtmlXForm.prototype.items.btn2state.render2=dhtmlXForm.prototype.items.btn2state.render;dhtmlXForm.prototype.items.btn2state.render=function(a,c){c._autoInputWidth=false;this.render2(a,c);a._type="btn2state";a._cssName=(typeof(c.cssName)=="undefined"?"btn2state":c.cssName);a._updateImgNode=function(){};a._doOnFocus=function(){a.getForm().callEvent("onFocus",[a._idd])};a._doOnBlur=function(){a.getForm().callEvent("onBlur",[a._idd])};a._doOnKeyUpDown=function(j,g,l){this.callEvent(j,[this.childNodes[this._ll?0:1].childNodes[0],g,this._idd])};this.setChecked(a,a._checked);return this};dhtmlXForm.prototype.setFormData_btn2state=function(a,c){this[c==true||parseInt(c)==1||c=="true"||c==this.getItemValue(a)?"checkItem":"uncheckItem"](a)};dhtmlXForm.prototype.getFormData_btn2state=function(a){return(this.isItemChecked(a)?this.getItemValue(a):0)};dhtmlXForm.prototype.items.colorpicker={colorpicker:{},render:function(g,j){var c=this;g._type="colorpicker";g._enabled=true;this.doAddLabel(g,j);this.doAddInput(g,j,"INPUT","TEXT",true,true,"dhxform_textarea");g._value=(j.value||"");g.childNodes[g._ll?1:0].childNodes[0].value=g._value;var a={input:g.childNodes[g._ll?1:0].childNodes[0],custom_colors:(window.dhx4.s2b(j.enableCustomColors)==true),skin:g.getForm().skin};this.colorpicker[g._idd]=new dhtmlXColorPicker(a);this.colorpicker[g._idd]._nodes[0].valueColor=null;this.colorpicker[g._idd].base.className+=" dhtmlxcp_in_form";if(typeof(j.customColors)!="undefined"){this.colorpicker[g._idd].setCustomColors(j.customColors)}if(typeof(j.cpPosition)=="string"){this.colorpicker[g._idd].setPosition(j.cpPosition)}this.colorpicker[g._idd].attachEvent("onSelect",function(l){if(g._value!=l){if(g.checkEvent("onBeforeChange")){if(g.callEvent("onBeforeChange",[g._idd,g._value,l])!==true){g.childNodes[g._ll?1:0].childNodes[0].value=g._value;return}}g._value=l;c.setValue(g,l);g.callEvent("onChange",[g._idd,g._value])}});this.colorpicker[g._idd].attachEvent("onHide",function(l){var m=g.childNodes[g._ll?1:0].childNodes[0];if(m.value!=g._value){m.value=g._value}m=null});g.childNodes[g._ll?1:0].childNodes[0]._idd=g._idd;return this},getColorPicker:function(a){return this.colorpicker[a._idd]},destruct:function(a){if(this.colorpicker[a._idd].unload){this.colorpicker[a._idd].unload()}this.colorpicker[a._idd]=null;try{delete this.colorpicker[a._idd]}catch(c){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null},setSkin:function(a,c){this.colorpicker[a._idd].setSkin(c)}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setValue:1,getValue:1,updateValue:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.colorpicker[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.colorpicker.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getColorPicker=function(a){return this.doWithItem(a,"getColorPicker")};dhtmlXForm.prototype.items.container={render:function(a,c){a._type="container";a._enabled=true;this.doAddLabel(a,c);this.doAddInput(a,c,"DIV",null,true,true,"dhxform_container");return this},getContainer:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a.callEvent("onEnable",[a._idd])},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a.callEvent("onDisable",[a._idd])},doAttachEvents:function(){},setValue:function(){},getValue:function(){return null}};dhtmlXForm.prototype.getContainer=function(a){return this.doWithItem(a,"getContainer")};(function(){for(var c in dhtmlXForm.prototype.items.input){if(!dhtmlXForm.prototype.items.container[c]){dhtmlXForm.prototype.items.container[c]=dhtmlXForm.prototype.items.input[c]}}})();dhtmlXForm.prototype.items.editor={editor:{},render:function(g,j){var a=(!isNaN(j.rows));g._type="editor";g._enabled=true;g._editor_id=g.getForm().idPrefix+g._idd;this.doAddLabel(g,j);this.doAddInput(g,j,"DIV",null,true,true,"dhxform_item_template");g._value=(j.value||"");var c=this;this.editor[g._editor_id]=new dhtmlXEditor({parent:g.childNodes[g._ll?1:0].childNodes[0],content:g._value,iconsPath:j.iconsPath,toolbar:j.toolbar});this.editor[g._editor_id].attachEvent("onAccess",function(m,n){g.callEvent("_onBeforeEditorAccess",[]);_dhxForm_doClick(document.body,"click");if(m=="blur"){c.doOnBlur(g,this);g.callEvent("onBlur",[g._idd]);if(g.getForm().skin=="dhx_terrace"){var l=g.childNodes[g._ll?1:0].className;if(l.indexOf("dhxeditor_focus")>=0){g.childNodes[g._ll?1:0].className=(l).replace(/\s{0,}dhxeditor_focus/gi,"")}}}else{g.callEvent("onEditorAccess",[g._idd,m,n,this,g.getForm()]);g.callEvent("onFocus",[g._idd]);if(g.getForm().skin=="dhx_terrace"){var l=g.childNodes[g._ll?1:0].className;if(l.indexOf("dhxeditor_focus")==-1){g.childNodes[g._ll?1:0].className+=" dhxeditor_focus"}}}});this.editor[g._editor_id].attachEvent("onToolbarClick",function(l){g.callEvent("onEditorToolbarClick",[g._idd,l,this,g.getForm()])});if(j.readonly){this.setReadonly(g,true)}g.childNodes[g._ll?0:1].childNodes[0].removeAttribute("for");g.childNodes[g._ll?0:1].childNodes[0].onclick=function(){c.editor[g._editor_id]._focus()};return this},doOnBlur:function(g,c){var a=c.getContent();if(g._value!=a){if(g.checkEvent("onBeforeChange")){if(g.callEvent("onBeforeChange",[g._idd,g._value,a])!==true){c.setContent(g._value);return}}g._value=a;g.callEvent("onChange",[g._idd,a])}},setValue:function(a,c){if(a._value==c){return}a._value=c;this.editor[a._editor_id].setContent(a._value)},getValue:function(a){a._value=this.editor[a._editor_id].getContent();return a._value},enable:function(a){if(this.isEnabled(a)!=true){this.editor[a._editor_id].setReadonly(false);this.doEn(a)}},disable:function(a){if(this.isEnabled(a)==true){this.editor[a._editor_id].setReadonly(true);this.doDis(a)}},setReadonly:function(a,c){this.editor[a._editor_id].setReadonly(c)},getEditor:function(a){return(this.editor[a._editor_id]||null)},destruct:function(a){a.childNodes[a._ll?0:1].childNodes[0].onclick=null;this.editor[a._editor_id].unload();this.editor[a._editor_id]=null;this.d2(a);a=null},setFocus:function(a){this.editor[a._editor_id]._focus()}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,setWidth:1,isEnabled:1}){dhtmlXForm.prototype.items.editor[c]=dhtmlXForm.prototype.items.template[c]}})();dhtmlXForm.prototype.items.editor.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.items.editor.doEn=dhtmlXForm.prototype.items.select.enable;dhtmlXForm.prototype.items.editor.doDis=dhtmlXForm.prototype.items.select.disable;dhtmlXForm.prototype.getEditor=function(a){return this.doWithItem(a,"getEditor")};dhtmlXForm.prototype.items.upload={render:function(c,g){c._type="up";c._enabled=true;c._checked=true;c.className=g.position+(typeof(g.className)=="string"?" "+g.className:"");var a=document.createElement("DIV");c.appendChild(a);if(!isNaN(g.inputLeft)){c.style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){c.style.top=parseInt(g.inputTop)+"px"}if(g.inputWidth!="auto"){if(!isNaN(g.inputWidth)){a.style.width=parseInt(g.inputWidth)+"px"}}c._uploader=new dhtmlXFileUploader(a,g.swfPath||"",g.swfUrl||"",g.mode||null,g.swfLogs,g.slXap||"",g.slUrl||"",g.slLogs||"",g.multiple);c._uploader.setURL(g.url||"");c._uploader.callEvent=c.callEvent;if(typeof(g.autoStart)!="undefined"){c._uploader.setAutoStart(g.autoStart)}if(typeof(g.autoRemove)!="undefined"){c._uploader.setAutoRemove(g.autoRemove)}if(typeof(g.titleScreen)!="undefined"){c._uploader.enableTitleScreen(g.titleScreen)}if(typeof(g.titleText)!="undefined"){c._uploader.setTitleText(g.titleText)}if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}if(!(g.inputHeight=="auto"||parseInt(g.inputHeight)==NaN)){c._uploader.p_files.style.height=parseInt(g.inputHeight)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._uploader.callEvent=function(){return true};a._uploader.unload();a._uploader.callEvent=null;a._uploader=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a.onselectstart=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,c){},getText:function(a){},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._uploader.enable()},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._uploader.disable()},setWidth:function(c,a){c.childNodes[0].style.width=a+"px";c._width=a},getWidth:function(a){return a._width||parseInt(a.childNodes[0].style.width)},setValue:function(a){a._uploader.clear()},getValue:function(m){var j=m._uploader.getData();var l={};var g=0;for(var c in j){l[m._idd+"_r_"+g]=j[c].realName;l[m._idd+"_s_"+g]=j[c].serverName;g++}l[m._idd+"_count"]=g;return l},getUploader:function(a){return a._uploader},getStatus:function(a){return a._uploader.getStatus()}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.upload[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.setFormData_upload=function(a){this.doWithItem(a,"setValue")};dhtmlXForm.prototype.getUploader=function(a){return this.doWithItem(a,"getUploader")};dhtmlXForm.prototype.getUploaderStatus=function(a){return this.doWithItem(a,"getStatus")};function dhtmlXFileUploader(c,n,m,o,s,l,v,j,w){var q=this;if(typeof(o)=="string"&&typeof(this[o])=="function"){this.engine=o}else{this.engine="html4";var g=null;if(typeof(window.FormData)!="undefined"&&typeof(window.XMLHttpRequest)!="undefined"){g=new XMLHttpRequest();if(typeof(g.upload)=="undefined"){g=null}}if(g!=null){this.engine="html5"}else{if(typeof(window.swfobject)!="undefined"||g===false){var g=swfobject.getFlashPlayerVersion();if(g.major>=10){this.engine="flash"}}else{this._sl_v=this.getSLVersion();if(this._sl_v){this.engine="sl"}}}g=null}if(typeof(c)=="string"){c=document.getElementById(c)}this._upload_mp=(typeof(w)!="undefined"?w==true:true);this._upload_dnd=true;this._swf_file_url=n||"";this._swf_upolad_url=m||"";this._swf_logs=s;this._sl_xap=l;this._sl_upload_url=v;this._sl_logs=j;this.p=document.createElement("DIV");this.p.className+=" dhx_file_uploader";c.appendChild(this.p);this.p_files=document.createElement("DIV");this.p_files.className="dhx_upload_files";this.p.appendChild(this.p_files);this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_upload_controls";this.p.appendChild(this.p_controls);this._files={};this._items={};this._data={};this._autoStart=false;this._autoRemove=false;this._titleScreen=true;this._enabled=true;this._uploaded_count=0;this._initToolbar=function(){this.b_opts={info:{onclick:null},browse:{onclick:null,tooltip:"Browse"},upload:{onclick:function(){if(!q._enabled){return}if(!q._uploading){q._uploadStart()}},tooltip:"Upload"},cancel:{onclick:function(){if(!q._enabled){return}q._uploadStop();q._switchButton(false)},tooltip:"Stop"},clear:{onclick:function(){if(!q._enabled){return}q.clear()},tooltip:"Clear list"}};this.buttons={};for(var x in this.b_opts){var y=document.createElement("DIV");y.innerHTML="&nbsp;";y.className="dhx_file_uploader_button button_"+x;y.onclick=this.b_opts[x].onclick;if(this.b_opts[x].tooltip){y.title=this.b_opts[x].tooltip}this.p_controls.appendChild(y);this.buttons[x]=y;y=null}this.buttons.cancel.style.display="none"};this._readableSize=function(y){var x=false;var a=["b","Kb","Mb","Gb","Tb","Pb","Eb"];for(var A=0;A<a.length;A++){if(y>1024){y=y/1024}else{if(x===false){x=A}}}if(x===false){x=a.length-1}return Math.round(y*100)/100+" "+a[x]};this._beforeAddFileToList=function(a,x){return(this.callEvent("onBeforeFileAdd",[a,x])===true)};this._addFileToList=function(D,x,A,C,a){this._checkTitleScreen();var y=document.createElement("DIV");y._idd=D;y.className="dhx_file dhx_file_"+C;y.innerHTML="<div class='dhx_file_param dhx_file_name'>&nbsp;</div><div class='dhx_file_param dhx_file_progress'>"+a+"%</div><div class='dhx_file_param dhx_file_delete' title='Remove from list'>&nbsp;</div>";this.p_files.appendChild(y);y.childNodes[0].style.width=y.offsetWidth-127+"px";this._items[D]=y;this._updateFileNameSize(D);y.childNodes[2].onclick=function(){if(!q._enabled){return}var E=this.parentNode._idd;q._removeFileFromQueue(E)};this.callEvent("onFileAdd",[x])};this._removeFileFromList=function(a){if(!this._items[a]){return}this._items[a].childNodes[2].onclick=null;this._items[a].parentNode.removeChild(this._items[a]);this._items[a]=null;delete this._items[a];if(this._data[a]){this._data[a]=null;delete this._data[a]}this._checkTitleScreen()};this._updateFileNameSize=function(a){this._items[a].childNodes[0].innerHTML=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"&nbsp;");this._items[a].childNodes[0].title=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"")};this._updateFileInList=function(y,x,a){if(!this._items[y]){return}this._items[y].className="dhx_file dhx_file_"+x;this._updateProgress(y,x,a);this._updateFileNameSize(y)};this._updateProgress=function(y,x,a){if(x=="uploading"&&a<100&&this._progress_type=="loader"){this._items[y].childNodes[1].className="dhx_file_param dhx_file_uploading";this._items[y].childNodes[1].innerHTML="&nbsp;"}else{this._items[y].childNodes[1].className="dhx_file_param dhx_file_progress";this._items[y].childNodes[1].innerHTML=a+"%"}this._updateFileNameSize(y)};this._removeFilesByState=function(y){for(var x in this._files){if(y===true||this._files[x].state==y){this._removeFileFromQueue(x)}}};this._switchButton=function(x){if(x==true){this.buttons.upload.style.display="none";this.buttons.cancel.style.display=""}else{var a=this._uploaded_count;this.buttons.upload.style.display="";this.buttons.cancel.style.display="none";this._uploaded_count=0;if(a>0){this.callEvent("onUploadComplete",[a])}}};this._uploadStart=function(){this._switchButton(true);if(!this._uploading){for(var x in this._files){if(this._files[x].state=="fail"){this._files[x].state="added";this._updateFileInList(x,"added",0)}}}this._uploading=true;var y=false;for(var x in this._files){if(!y&&[this._files[x].state]=="added"){y=true;this._files[x].state="uploading";this._updateFileInList(x,"uploading",0);this._doUploadFile(x)}}if(!y){this._uploading=false;this._switchButton(false)}};this._onUploadSuccess=function(C,A,y,a){if(typeof(y)!="undefined"&&this.engine=="flash"){var x=dhx4.s2j(y.data);if(x!=null&&x.state==true&&x.name!=null){A=x.name;if(x.extra!=null){a=x.extra}}else{this._onUploadFail(C,(x!=null&&x.extra!=null?x.extra:null));return}}this._uploaded_count++;this._data[C]={realName:this._files[C].name,serverName:A};this._files[C].state="uploaded";this._updateFileInList(C,"uploaded",100);this.callEvent("onUploadFile",[this._files[C].name,A,a]);if(this._autoRemove){this._removeFileFromQueue(C)}if(this._uploading){this._uploadStart()}};this._onUploadFail=function(x,a){this._files[x].state="fail";this._updateFileInList(x,"fail",0);this.callEvent("onUploadFail",[this._files[x].name,a]);if(this._uploading){this._uploadStart()}};this._onUploadAbort=function(a){this._uploading=false;this._files[a].state="added";this._updateFileInList(a,"added",0);this.callEvent("onUploadCancel",[this._files[a].name])};this._checkTitleScreen=function(){var y=0;for(var x in this._files){y++}if(y==0&&this.p.className.search("dhx_file_uploader_title")<0&&this._titleScreen){this.p.className+=" dhx_file_uploader_title";this.buttons.info.innerHTML=this._titleText;this.buttons.info.style.width=Math.max(this.p_controls.offsetWidth-134,0)+"px"}if((y>0||!this._titleScreen)&&this.p.className.search("dhx_file_uploader_title")>=0){this.p.className=this.p.className.replace(/dhx_file_uploader_title/g,"");this.buttons.info.innerHTML=""}};this.callEvent=function(){};this.upload=function(){if(!this._uploading){this._uploadStart()}};this.setAutoStart=function(a){this._autoStart=(a==true)};this.setAutoRemove=function(a){this._autoRemove=(a==true)};this.enableTitleScreen=function(a){this._titleScreen=(a==true);this._checkTitleScreen()};this.setTitleText=function(a){this._titleText=a;if(this.p.className.search("dhx_file_uploader_title")>=0){this.buttons.info.innerHTML=this._titleText}};this.setURL=function(a){this._url=a};this.setSWFURL=function(a){this._swf_upolad_url=a};this.enable=function(){this._enabled=true;this.p_files.className="dhx_upload_files";this.p_controls.className="dhx_upload_controls"};this.disable=function(){this._enabled=false;this.p_files.className="dhx_upload_files dhx_uploader_dis";this.p_controls.className="dhx_upload_controls dhx_uploader_dis"};this.getStatus=function(){var y=0;for(var x in this._files){if(this._files[x].state!="uploaded"){return -1}y=1}return y};this.getData=function(){return this._data};this.clear=function(){if(this.callEvent("onBeforeClear",[])!==true){return}if(this._uploading){q._uploadStop()}q._switchButton(false);q._removeFilesByState(true);this.callEvent("onClear",[])};this.unload=function(){this._removeFilesByState(true);this._data=null;this._files=null;this._items=null;this._unloadEngine();for(var x in this.buttons){this.buttons[x].onclick=null;this.buttons[x].parentNode.removeChild(this.buttons[x]);this.buttons[x]=null;delete this.buttons[x]}this.buttons=null;for(var x in this.b_opts){this.b_opts[x].onclick=null;this.b_opts[x]=null;delete this.b_opts[x]}this.b_opts=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_files.parentNode.removeChild(this.p_files);this.p.className=this.p.className.replace(/dhx_file_uploader_title/gi,"").replace(/dhx_file_uploader/gi,"");for(var x in this){this[x]=null}q=x=null};var r=new this[this.engine]();for(var u in r){this[u]=r[u];r[u]=null}u=r=c=null;this._initToolbar();this._initEngine();this._checkTitleScreen();return this}dhtmlXFileUploader.prototype.html5=function(){};dhtmlXFileUploader.prototype.html5.prototype={_initEngine:function(){var c=this;this.buttons.browse.onclick=function(){if(c._enabled){c.f.click()}};this._progress_type="percentage";var a=window.navigator.userAgent;if(a.match(/Windows/gi)!=null&&a.match(/AppleWebKit/gi)!=null&&a.match(/Safari/gi)!=null){if(a.match(/Version\/5\.1\.5/gi)){this._upload_mp=false}if(a.match(/Version\/5\.1[^\.\d{1,}]/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.1/gi)){this._upload_mp=false;this._upload_dnd=false}if(a.match(/Version\/5\.1\.2/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.7/gi)){this._upload_mp=false}}this._addFileInput();if(this._upload_dnd){this.p.ondragenter=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault()};this.p.ondragover=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault()};this.p.ondrop=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault();if(c._enabled){c._parseFilesInInput(g.dataTransfer.files)}};this._titleText="Drag-n-Drop files here or<br>click to select files for upload."}else{this._titleText="Click to select files for upload."}},_addFileInput:function(){if(this.f!=null){this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null}var a=this;this.f=document.createElement("INPUT");this.f.type="file";if(this._upload_mp){this.f.multiple="1"}this.f.className="dhx_uploader_input";this.p_controls.appendChild(this.f);this.f.onchange=function(){a._parseFilesInInput(this.files);if(window.dhx4.isOpera){a._addFileInput()}else{this.value=""}}},_doUploadFile:function(g){var c=this;if(!this._loader){this._loader=new XMLHttpRequest();this._loader.upload.onprogress=function(j){if(c._files[this._idd].state=="uploading"){c._updateFileInList(this._idd,"uploading",Math.round(j.loaded*100/j.total))}};this._loader.onload=function(l){var j=dhx4.s2j(this.responseText);if(typeof(j)=="object"&&j!=null&&typeof(j.state)!="undefined"&&j.state==true){c._onUploadSuccess(this.upload._idd,j.name,null,j.extra);j=null}else{c._onUploadFail(this.upload._idd,(j!=null&&j.extra!=null?j.extra:null))}};this._loader.onerror=function(j){c._onUploadFail(this.upload._idd)};this._loader.onabort=function(j){c._onUploadAbort(this.upload._idd)}}this._loader.upload._idd=g;var a=new FormData();a.append("file",this._files[g].file);this._loader.open("POST",this._url+(String(this._url).indexOf("?")<0?"?":"&")+"mode=html5&dhxr"+new Date().getTime(),true);this._loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this._loader.send(a)},_uploadStop:function(){if(!this._uploading||!this._loader){return}this._loader.abort()},_parseFilesInInput:function(c){for(var a=0;a<c.length;a++){this._addFileToQueue(c[a])}},_addFileToQueue:function(a){if(!this._beforeAddFileToList(a.name,a.size)){return}var c=(a._idd||window.dhx4.newId());this._files[c]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(c,a.name,a.size,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(j){if(!this._files[j]){return}var c=this._files[j].name;var g=(this._data!=null&&this._data[j]!=null?this._data[j].serverName:null);if(this.callEvent("onBeforeFileRemove",[c,g])!==true){return}var a=false;if(this._uploading&&j==this._loader.upload._idd&&this._files[j].state=="uploading"){this._uploadStop();a=true}this._files[j].file=null;this._files[j].name=null;this._files[j].size=null;this._files[j].state=null;this._files[j]=null;delete this._files[j];this._removeFileFromList(j);this.callEvent("onFileRemove",[c,g]);if(a){this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=null;this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;this.p.ondragenter=null;this.p.ondragover=null;this.p.ondrop=null;if(this._loader){this._loader.upload.onprogress=null;this._loader.onload=null;this._loader.onerror=null;this._loader.onabort=null;this._loader.upload._idd=null;this._loader=null}this._initEngine=null;this._doUploadFile=null;this._uploadStop=null;this._parseFilesInInput=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.html4=function(){};dhtmlXFileUploader.prototype.html4.prototype={_initEngine:function(){this._addForm();this._progress_type="loader";this._titleText="Click button<br>to select files for upload."},_addForm:function(){var a=this;var g=window.dhx4.newId();if(!this.k){this.k=document.createElement("DIV");this.k.className="dhx_file_form_cont";this.buttons.browse.appendChild(this.k);this.fr_name="dhx_file_"+window.dhx4.newId();this.k.innerHTML='<iframe name="'+this.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>';this.fr=this.k.firstChild;if(window.navigator.userAgent.indexOf("MSIE")>=0){this.fr.onreadystatechange=function(){if(this.readyState=="complete"){a._onLoad()}}}else{this.fr.onload=function(){a._onLoad()}}}var c=document.createElement("DIV");c.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.fr_name+"' class='dhx_file_form' name='dhx_file_form_"+window.dhx4.newId()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value='"+g+"'><input type='file' name='file' class='dhx_file_input'></form>";this.k.appendChild(c);c.firstChild.lastChild._idd=g;c.firstChild.lastChild.onchange=function(){if(!a._beforeAddFileToList(this.value,null)){return}a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};c=null},_onLoad:function(){if(this._uploading){var a=dhx4.s2j(this.fr.contentWindow.document.body.innerHTML);if(typeof(a)=="object"&&a!=null){if(typeof(a.state)!="undefined"){if(a.state=="cancelled"){this._onUploadAbort(this.fr._idd);a=null;return}else{if(a.state==true){if(typeof(a.size)!="undefined"&&!isNaN(a.size)){this._files[this.fr._idd].size=a.size}this._onUploadSuccess(this.fr._idd,a.name,null,a.extra);a=null;return}}}}this._onUploadFail(this.fr._idd,(a!=null&&a.extra!=null?a.extra:null))}},_addFileToQueue:function(c){var a=c.value.match(/[^\\\/]*$/g);if(a[0]!=null){a=a[0]}else{a=c.value}this._files[c._idd]={name:a,form:c.parentNode,node:c.parentNode.parentNode,input:c,state:"added"};this._addFileToList(c._idd,c.value,false,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(g){var a=this._files[g].name;var c=(this._data!=null&&this._data[g]!=null?this._data[g].serverName:null);if(this.callEvent("onBeforeFileRemove",[a,c])!==true){return}this._files[g].input.onchange=null;this._files[g].form.removeChild(this._files[g].input);this._files[g].node.removeChild(this._files[g].form);this._files[g].node.parentNode.removeChild(this._files[g].node);this._files[g].input=null;this._files[g].name=null;this._files[g].form=null;this._files[g].node=null;this._files[g].size=null;this._files[g].state=null;this._files[g]=null;delete this._files[g];this._removeFileFromList(g);this.callEvent("onFileRemove",[a,c])},_doUploadFile:function(a){this.fr._idd=a;this._files[a].form.action=this._url;this._files[a].form.submit()},_uploadStop:function(){if(!this._uploading){return}this.fr.contentWindow.location.href=(this._url)+(this._url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&dhxr"+new Date().getTime()},_unloadEngine:function(){if(this.k){this.fr_name=null;this.fr.onreadystatechange=null;this.fr.onload=null;this.fr.parentNode.removeChild(this.fr);this.fr=null;this.k.firstChild.firstChild.lastChild.onchange=null;this.k.parentNode.removeChild(this.k);this.k=null}this._initEngine=null;this._addForm=null;this._onLoad=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.flash=function(){};dhtmlXFileUploader.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXFileUploaderSWFObjects){window.dhtmlXFileUploaderSWFObjects={items:{},callEvent:function(l,g,j){return window.dhtmlXFileUploaderSWFObjects.items[l].uploader[g].apply(window.dhtmlXFileUploaderSWFObjects.items[l].uploader,j)}}}var c=this;this._swf_obj_id="dhtmlXFileUploaderSWFObject_"+window.dhx4.newId();this._swf_file_url=this._swf_file_url+(this._swf_file_url.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime();this.buttons.browse.innerHTML="<div id='"+this._swf_obj_id+"' style='width:100%;height:100%;'></div>";swfobject.embedSWF(this._swf_file_url,this._swf_obj_id,"100%","100%","9",null,{ID:this._swf_obj_id,enableLogs:this._swf_logs},{wmode:"transparent"});var a=swfobject.getFlashPlayerVersion();this._titleText="Engine successfuly inited<br>Flash Player: "+a.major+"."+a.minor+"."+a.release;this._progress_type="percentage";window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]={id:this._swf_obj_id,uploader:this}},_beforeAddFileToQueue:function(a,c){return(this.callEvent("onBeforeFileAdd",[a,c])===true)},_addFileToQueue:function(j,c,g){if(window.dhx4.isIE){var a=document.createElement("INPUT");a.type="TEXT";a.style.position="absolute";a.style.left="0px";a.style.top=window.dhx4.absTop(this.buttons.browse)+"px";a.style.width="10px";document.body.appendChild(a);a.focus();document.body.removeChild(a);a=null}this._files[j]={name:c,size:g,state:"added"};this._addFileToList(j,c,g,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(j){if(!this._files[j]){return}var c=this._files[j].name;var g=(this._data!=null&&this._data[j]!=null?this._data[j].serverName:null);if(this.callEvent("onBeforeFileRemove",[c,g])!==true){return}var a=false;if(this._uploading&&this._files[j].state=="uploading"){this._uploadStop();a=true}swfobject.getObjectById(this._swf_obj_id).removeFileById(j);this._files[j].name=null;this._files[j].size=null;this._files[j].state=null;this._files[j]=null;delete this._files[j];this._removeFileFromList(j);this.callEvent("onFileRemove",[c,g]);if(a){this._uploadStart()}},_doUploadFile:function(a){swfobject.getObjectById(this._swf_obj_id).upload(a,this._swf_upolad_url)},_uploadStop:function(g){for(var c in this._files){if(this._files[c].state=="uploading"){swfobject.getObjectById(this._swf_obj_id).uploadStop(c)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]){window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].id=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].uploader=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]=null;delete window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]}this._swf_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.sl=function(){};dhtmlXFileUploader.prototype.sl.prototype={_initEngine:function(){if(typeof(this._sl_v)=="undefined"){this._sl_v=this.getSLVersion()}if(!window.dhtmlXFileUploaderSLObjects){window.dhtmlXFileUploaderSLObjects={items:{},callEvent:function(g,a,c){window.dhtmlXFileUploaderSLObjects.items[g].uploader[a].apply(window.dhtmlXFileUploaderSLObjects.items[g].uploader,c)}}}this._sl_obj_id="dhtmlXFileUploaderSLObject_"+window.dhx4.newId();if(this._sl_v!=false){this._titleText="Engine successfuly inited<br>Silverlight version: "+this._sl_v[0]+"."+this._sl_v[1];this.buttons.browse.innerHTML='<div style="width:100%;height:100%;"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" id="'+this._sl_obj_id+'"><param name="source" value="'+this._sl_xap+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="SLID='+this._sl_obj_id+",LOGS="+this._sl_logs+'"/><param name="minRuntimeVersion" value="5.0"/></object></div>'}else{this._titleText="Silverlight plugin not found<br>or version less than 4.0";this.buttons.browse.style.cursor="wait";this.buttons.browse.title=""}this._progress_type="percentage";window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]={id:this._sl_obj_id,uploader:this}},_addFileToQueue:function(g,a,c){this._files[g]={name:a,size:c,state:"added"};this._addFileToList(g,a,c,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(c){if(!this._files[c]){return}var a=false;if(this._uploading&&this._files[c].state=="uploading"){this._uploadStop();a=true}document.getElementById([this._sl_obj_id]).Content.a.removeFileById(c);this._files[c].name=null;this._files[c].size=null;this._files[c].state=null;this._files[c]=null;delete this._files[c];this._removeFileFromList(c);if(a){this._uploadStart()}},_doUploadFile:function(c){var a=this._sl_upload_url.split("?");a=(a[1]!=null?"&"+a[1]:"");document.getElementById(this._sl_obj_id).Content.a.upload(c,this._sl_upload_url,a+"&mode=sl&dhxr"+new Date().getTime())},_uploadStop:function(g){this._uploading=false;for(var c in this._files){if(this._files[c].state=="uploading"){document.getElementById(this._sl_obj_id).Content.a.uploadStop(c)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]){window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].id=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].uploader=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]=null;delete window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]}this._sl_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.setSLURL=function(a){this._sl_upload_url=a};dhtmlXFileUploader.prototype.getSLVersion=function(){var a=false;if(window.dhx4.isIE){try{var c=new ActiveXObject("AgControl.AgControl");if(c!=null){var l=4,j=0;while(c.isVersionSupported([l,j].join("."))){a=[l,j];if(++j>9){l++;j=0}}}c=null}catch(g){}}else{if(navigator.plugins["Silverlight Plug-In"]!=null){a=navigator.plugins["Silverlight Plug-In"].description.split(".")}}return a};dhtmlXForm.prototype.saveBackup=function(){if(!this._backup){this._backup={};this._backupId=new Date().getTime()}this._backup[++this._backupId]=this.getFormData();return this._backupId};dhtmlXForm.prototype.restoreBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this.setFormData(this._backup[a])}};dhtmlXForm.prototype.clearBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this._backup[a]=null;delete this._backup[a]}};dhtmlXForm.prototype.addItem=function(g,a,m,j){var c=null;if(g instanceof Array){c=g[1];g=g[0]}var l=null;if(g!=null){var l=this._getParentForm(g,c);if(l!=null){if(l.item._list==null){if(!a.listParent){a.listParent=l.item._idd}l.form._addItem("list",l.item._idd,[a],null,l.item._idd,m,j)}else{l.item._list[0].addItem(null,a,m,j)}l.form=l.item=null;l=null;this._autoCheck();return}}this._prepareItem(a,m,j);this._autoCheck()};dhtmlXForm.prototype.removeItem=function(c,a){this._removeItem(c,a)};dhtmlXForm.prototype.removeColumn=function(n,m,j,g){var r=null;if(n instanceof Array){r=n[1];n=n[0]}if(n!=null){var l=this._getParentForm(n,r);if(l!=null){if(l.item._list!=null&&l.item._list[0]!=null){l.item._list[0].removeColumn(null,m,j,g)}l.form=l.item=null;l=null}return}m=Math.min(Math.max(m,0),this.cont.childNodes.length-1);if(this.cont.childNodes.length==1){if(j==true){this._removeItemsInColumn(this.cont.childNodes[m])}}else{if(j==true){this._removeItemsInColumn(this.cont.childNodes[m])}else{if(!g){var a=m-1;if(a<0){a=m+1}}else{var a=m+1;if(a>this.cont.childNodes.length-1){a=m-1}}while(this.cont.childNodes[m].childNodes.length>0){this.cont.childNodes[a].appendChild(this.cont.childNodes[m].childNodes[0])}}var o=[];for(var c=0;c<this.base.length;c++){if(this.cont.childNodes[m]!=this.base[c]){o.push(this.base[c])}}this.base=o;this.cont.removeChild(this.cont.childNodes[m]);this.b_index--;o=null}};dhtmlXForm.prototype.getColumnNode=function(g,c){var j=null;var a=null;if(g instanceof Array){a=g[1];g=g[0]}if(g!=null){var l=this._getParentForm(g,a);if(l!=null){if(l.item._list!=null&&l.item._list[0]!=null&&j==null){j=l.item._list[0].getColumnNode(null,c)}l.form=l.item=null;l=null}return j}if(c<0||c>this.cont.childNodes.length-1){return null}return this.cont.childNodes[c]};dhtmlXForm.prototype._removeItemsInColumn=function(j){var a=[];for(var g=0;g<j.childNodes.length;g++){var c=j.childNodes[g];if(c._idd!=null&&c._type!=null){a.push([c._idd,(c._type=="ra"?c._value:null)])}c=null}for(var g=0;g<a.length;g++){this.removeItem(a[g][0],a[g][1])}};dhtmlXForm.prototype._getParentForm=function(m,l){if(this.itemPull[this.idPrefix+m]!=null){return{form:this,item:this.itemPull[this.idPrefix+m]}}for(var c in this.itemPull){if(this.itemPull[c]._type=="ra"&&this.itemPull[c]._group==m&&this.itemPull[c]._value==l){return{form:this,item:this.itemPull[c]}}}var j=null;for(var c in this.itemPull){if(!j&&this.itemPull[c]._list!=null){for(var g=0;g<this.itemPull[c]._list.length;g++){if(!j){j=this.itemPull[c]._list[g]._getParentForm(m,l)}}}}return j};(function(){for(var c in dhtmlXForm.prototype.items){if(!dhtmlXForm.prototype.items[c]._getItemNode){dhtmlXForm.prototype.items[c]._getItemNode=function(a){return a}}}})();dhtmlXForm.prototype._getItemNode=function(c,a){if(a!=null){c=[c,a]}return this.doWithItem(c,"_getItemNode")};dhtmlXForm.prototype.setRequired=function(o,m,l){if(typeof(l)=="undefined"){l=m}else{o=[o,m]}var g=this._getItemNode(o);if(!g){return}l=window.dhx4.s2b(l);g._required=(l==true);if(g._required){if(!g._validate){g._validate=[]}var c=false;for(var j=0;j<g._validate.length;j++){c=(g._validate[j]=="NotEmpty"||c)}if(!c){g._validate.push("NotEmpty")}var n=g.childNodes[g._ll?0:1].childNodes[0];if(!(n.lastChild&&n.lastChild.className&&n.lastChild.className.search(/required/)>=0)){var a=document.createElement("SPAN");a.className="dhxform_item_required";a.innerHTML="*";n.appendChild(a);a=n=null}}else{if(g._validate!=null){var c=g._validate;g._validate=[];for(var j=0;j<c.length;j++){if(c[j]!="NotEmpty"){g._validate.push(c[j])}}if(g._validate.length==0){g._validate=null}}var n=g.childNodes[g._ll?0:1].childNodes[0];if(n.lastChild&&n.lastChild.className&&n.lastChild.className.search(/required/)>=0){n.removeChild(n.lastChild);n=null}}this._resetValidateCss(g);g=null};dhtmlXForm.prototype.setNote=function(l,g,a){if(typeof(a)=="undefined"){a=g}else{l=[l,g]}var c=this._getItemNode(l);if(!c){return}var j=this._getNoteNode(c);if(!j){if(!a.width){a.width=c.childNodes[c._ll?1:0].childNodes[0].offsetWidth}j=document.createElement("DIV");j.className="dhxform_note";if({ch:1,ra:1}[c._type]){c.childNodes[c._ll?1:0].insertBefore(j,c.childNodes[c._ll?1:0].lastChild)}else{c.childNodes[c._ll?1:0].appendChild(j)}}j.innerHTML=a.text;if(a.width!=null){j.style.width=a.width+"px";j._w=a.width}j=null};dhtmlXForm.prototype.clearNote=function(j,c){if(typeof(c)!="undefined"){j=[j,c]}var a=this._getItemNode(j);if(!a){return}var g=this._getNoteNode(a);if(g!=null){g.parentNode.removeChild(g);g=null}};dhtmlXForm.prototype._getNoteNode=function(a){var g=null;for(var c=0;c<a.childNodes[a._ll?1:0].childNodes.length;c++){if(String(a.childNodes[a._ll?1:0].childNodes[c].className).search(/dhxform_note/)>=0){g=a.childNodes[a._ll?1:0].childNodes[c]}}a=null;return g};dhtmlXForm.prototype.setValidation=function(m,j,l){if(typeof(note)=="undefined"){l=j}else{m=[m,j]}var c=this._getItemNode(m);if(!c){return}if(c._validate!=null){for(var g=0;g<c._validate.length;g++){c._validate[g]=null}}c._validate=[];if(typeof(l)=="function"||typeof(window[l])=="function"){c._validate=[l]}else{c._validate=String(l).split(this.separator)}if(c._required){var a=false;for(var g=0;g<c._validate.length;g++){a=(c._validate[g]=="NotEmpty"||a)}if(!a){c._validate.push("NotEmpty")}}c=null};dhtmlXForm.prototype.clearValidation=function(j,g){if(typeof(g)!="undefined"){j=[j,g]}var a=this._getItemNode(j);if(!a){return}if(a._validate!=null){for(var c=0;c<a._validate.length;c++){a._validate[c]=null}}a._validate=a._required?["NotEmpty"]:null;a=null};dhtmlXForm.prototype.reloadOptions=function(a,m){var c=this.getItemType(a);if(!{select:1,multiselect:1,combo:1}[c]){return}if(c=="select"||c=="multiselect"){var j=this.getOptions(a);while(j.length>0){j.remove(0)}j.length=0;j=null;if(typeof(m)=="string"){this.doWithItem(a,"doLoadOptsConnector",m)}else{if(m instanceof Array){this.doWithItem(a,"doLoadOpts",{options:m})}}}if(c=="combo"){var n=this.getCombo(a);n.clearAll();n.setComboValue("");if(typeof(m)=="string"){this.doWithItem(a,"doLoadOptsConnector",m)}else{if(m instanceof Array){var g=null;for(var l=0;l<m.length;l++){if(window.dhx4.s2b(m[l].selected)){g=m[l].value}}n.addOption(m);if(g!=null){this.setItemValue(a,g)}n=null}}}};dhtmlXForm.prototype.setTooltip=function(m,l,j){if(typeof(j)=="undefined"){j=l}else{m=[m,l]}var c=this._getItemNode(m);if(!c){return}var a=null;if(c.childNodes.length==1){a=c.childNodes[0]}else{for(var g=0;g<c.childNodes.length;g++){if(c.childNodes[g].className!=null&&c.childNodes[g].className.search("dhxform_label")>=0){a=c.childNodes[g]}}}if(a!=null){if(j==null||j.length==0){a.removeAttribute("title")}else{a.title=j}}a=null};function dhtmlXAccordion(l,n){var j=this;var g=window.dhx4.transDetect();this.conf={skin:(n||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxacc")||"dhx_skyblue"),css:"dhxacc",icons_path:"",multi_mode:false,last_opened:null,on_active_id:null,on_active_click:false,size_changed:true,def_height:90,total_count:0,hiden_count:0,cont_w:null};this.conf.tr={prop:g.transProp,ev:g.transEv,height_open:"height 0.2s cubic-bezier(0.25,0.1,0.25,1)",height_close:"height 0.18s cubic-bezier(0.25,0.1,0.25,1)",op_open:"opacity 0.16s ease-in",op_close:"opacity 0.2s ease-out",op_v_open:"1",op_v_close:"0.4",dnd_top:"top 0.16s"};this.ofs={m:{},s:{},def:{m:{left:0,right:0,first:0,between:8},s:{left:0,right:0,first:0,between:-1,last:0}},base:{s:{},m:{}},skin:{dhx_web:{s:{between:3},m:{between:3}},dhx_terrace:{m:{between:12,left:0,right:0}}}};if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0){this.conf.tr.height_open=this.conf.tr.height_close}else{this.conf.tr.height_open=this.conf.tr.height_close}var m=null;if(typeof(l)=="object"&&!l.tagName){m={};for(var c in l){m[c]=l[c];l[c]=null}l=m.parent;m.parent=null}window.dhtmlXCellTop.apply(this,[l,l._ofs]);this._adjustCont();if(this.base._ofs!=null){for(var o in this.ofs.base){if(this.base._ofs[o]!=null){for(var c in this.base._ofs[o]){this.ofs.base[o][c]=this.base._ofs[o][c]}}}}this._applyOffsets=function(){for(var v in this.ofs.def){var s=this.ofs.def[v];var u=(this.ofs.skin[this.conf.skin]!=null&&this.ofs.skin[this.conf.skin][v]!=null?this.ofs.skin[this.conf.skin][v]:null);var r=(this.base._ofs!=null?this.base._ofs[v]:null);for(var q in s){if(u!=null&&u[q]!=null){this.ofs[v][q]=u[q]}else{if(r!=null&&r[q]!=null){this.ofs[v][q]=r[q]}else{this.ofs[v][q]=s[q]}}}}};this._applyOffsets();this.t={};this.addItem=function(x,w,r,q,v){if(x==null){x="a"+window.dhx4.newId()}while(this.t[x]!=null){x="a"+window.dhx4.newId()}var a=new dhtmlXAccordionCell(x,this);a.conf.skin=this.conf.skin;a.setText(w);if(v!=null){a.setIcon(v)}a.cell._accId=x;a.cell.childNodes[a.conf.idx.hdr].onselectstart=function(y){y=y||event;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}return false};a.cell.childNodes[a.conf.idx.hdr].onclick=function(A){A=A||event;if(A.preventDefault){A.preventDefault()}else{A.returnValue=false}if(j._dnd!=null&&j._dnd.ofs==true){return}var y=(A.target||A.srcElement);var C=null;while(y._accId!=this&&C==null){if(y._accId!=null){C=y._accId}else{y=y.parentNode}}if(C!=null){j._hdrClick(C)}};this.t[x]={cell:a};this.conf.total_count++;if(this.conf.multi_mode){if(typeof(r)=="undefined"){r=true}this.cont.appendChild(a.cell);a.conf.opened=(r==true);if(typeof(q)=="undefined"||q==null||q=="*"){if(q=="*"){a.conf.h_auto=true}q=this.conf.def_height}else{q=Math.max(parseInt(q),30)}a._setSize(this.ofs.m.left,0,this.conf.cont_w||this._getAvailItemWidth(),a.conf.opened?q:a._getHdrHeight());a.cell.style.marginTop=(a.cell==this.cont.firstChild?this.ofs.m.first:this.ofs.m.between)+"px";if(r!=true){a.conf.size.h=q;a._adjustCell();a.cell.className+=" dhx_cell_closed"}this._adjustOpened();if(this._dnd!=null){this._dndAttachEvent(x)}}else{r=(this.conf.last_opened==null?true:window.dhx4.s2b(r));var u=this._updateCellsHeight();if(this.conf.last_opened!=null){if(r){this._closeItem(this.conf.last_opened,false)}else{var s=this.t[this.conf.last_opened].cell;s._setSize(s.conf.size.x,s.conf.size.y,s.conf.size.w,u);s=null}}this.cont.appendChild(a.cell);a.conf.opened=r;a.cell.style.marginTop=String(a.cell==this.cont.firstChild?this.ofs.s.first:this.ofs.s.between)+"px";a._setSize(this.ofs.s.left,0,this.conf.cont_w||this._getAvailItemWidth(),r?u:a._getHdrHeight());if(r){this.conf.last_opened=x}else{a.conf.size.h=u;a._adjustCell();a.cell.className+=" dhx_cell_closed"}}a=null;return this.t[x].cell};this.removeItem=function(a){if(!this.t[a]){return}if(this.conf.last_opened==a){this.conf.last_opened=null}if(this.conf.on_active_id==a){this.conf.on_active_id=null}if(this._dnd!=null){this._dndClearCell(a)}this.conf.total_count--;if(!this.conf.multi_mode&&!this.t[a].cell.conf.visible){this.conf.hiden_count--}this.t[a].cell._unload();this.t[a].cell=null;this.t[a]=null;delete this.t[a];if(!this.conf.unloading){if(!this.conf.multi_mode){this._updateCellsMargin()}this.setSizes()}};this.cells=function(a){return this.t[a].cell};this.enableMultiMode=function(a,q){this.conf.multi_mode=true;if(!isNaN(q)){this.conf.def_height=q}if(a=="auto"||a=="scroll"){this.cont.style.overflowX="hidden";this.cont.style.overflowY=a}else{this.cont.style.overflow="visible"}};this.forEachItem=function(r){for(var q in this.t){if(typeof(r)=="function"){r.apply(this,[this.t[q].cell])}else{if(typeof(r)=="string"&&typeof(window[r])=="function"){window[r].apply(this,[this.t[q].cell])}}}};this._openItem=function(q,a){if(typeof(a)=="undefined"){a=true}if(this.t[q].cell.conf.opened==false){if(this.conf.multi_mode){this.t[q].cell._open(a)}else{if(this.conf.tr.prop==false){if(this.conf.last_opened!=null){this.t[this.conf.last_opened].cell._close(false)}this.t[q].cell._open(false);this.conf.last_opened=q}else{this.conf.on_active_id=q;this.t[q].cell._open(a);if(this.conf.last_opened!=null){this.t[this.conf.last_opened].cell._close(a)}this.conf.last_opened=q}}}};this._closeItem=function(q,a){if(typeof(a)=="undefined"){a=true}if(this.t[q].cell.conf.opened==true){this.t[q].cell._close(a);this.conf.last_opened=null}};this._adjustOpened=function(){if(this.conf.multi_mode==true){if(this._openCache==null){var u=this._getDynData();for(var r in u){this.t[r].cell.conf.size.h=u[r];this.t[r].cell.cell.style.height=u[r]+"px"}}else{var v=false;for(var r in this._openCache){v=(v||this._openCache[r])}if(v==true){return}this._openCache=this._openId=null}var q=this._getAvailItemWidth();for(var r in this.t){var s=true;if(q==this.t[r].cell.conf.size.w&&(this._openMode=="close"||this.t[r].cell.conf.opened==false)){s=false}if(s){this.t[r].cell._setWidth(q)}}this._openMode=null}else{if(this.conf.last_opened!=null){var w=this.conf.last_opened;this.t[w].cell._setSize(this.t[w].cell.conf.size.x,this.t[w].cell.conf.size.y,this.t[w].cell.conf.size.w,this.t[w].cell.conf.size.h)}}};this._getDynData=function(E,D){if(typeof(E)=="undefined"||E==null){E={}}if(typeof(D)=="undefined"||D==null){D={}}var x={};var C=0;var w=0;var u=0;for(var r=0;r<this.cont.childNodes.length;r++){var s=this.cont.childNodes[r]._accId;var H=this.t[s].cell;if(H.conf.visible==true){var y=this.ofs.m[u==0?"first":"between"];if(E[s]==true||D[s]==true||(H.conf.opened==true&&H.conf.h_auto==true)){if(D[s]==true){var A=H._getHdrHeight();x[s]=A;w+=A+y}else{if(H.conf.h_auto==true){x[s]=true;w+=y;C++}else{if(E[s]==true){x[s]=H.conf.size.h;w+=H.conf.size.h+y}}}}else{w+=H.cell.offsetHeight+y}u++}H=null}if(C>0){var v=this.cont.offsetHeight-w;var w=Math.floor(v/C);for(var F in x){if(x[F]==true){if(C>1){v-=w}else{w=v}x[F]=w;C--}}}return x};this.setSizes=function(){this._adjustCont();if(this.conf.multi_mode==true){this._adjustOpened()}else{this.conf.cont_w=null;var r=this._updateCellsHeight();for(var q in this.t){this.t[q].cell._setSize(this.ofs.s.left,0,this.conf.cont_w||this._getAvailItemWidth(),this.t[q].cell.conf.opened?r:this.t[q].cell._getHdrHeight());if(!this.t[q].cell.conf.opened){this.t[q].cell.conf.size.h=r;this.t[q].cell._adjustCell()}}this.conf.size_changed=true}this.callEvent("_onSetSizes",[])};this.setSkin=function(r){this._setBaseSkin(r);this.conf.skin=r;for(var q in this.t){this.t[q].cell.conf.cells_cont=null;this.t[q].cell.conf.skin=this.conf.skin}this._applyOffsets();this._updateCellsMargin();this.setSizes()};this.setIconsPath=function(a){this.conf.icons_path=a};this._getAvailItemWidth=function(){var q=this.ofs[(this.conf.multi_mode?"m":"s")];var a=Math.max(this.cont.clientWidth-q.left-q.right,10);this.conf.cont_w=a;q=null;return a};this._updateCellsHeight=function(){if(this.conf.multi_mode==true){return}var s=this.conf.total_count-this.conf.hiden_count;var u=this.cont.offsetHeight-this.ofs.s.last;if(s==0){return u}var w=false;for(var v=0;v<this.cont.childNodes.length;v++){if(w==false){var x=this.cont.childNodes[v]._accId;if(this.t[x].cell.conf.visible){u-=this.t[x].cell._getHdrHeight()*(s-1);w=true}}}u-=(s-1)*this.ofs.s.between+this.ofs.s.first;for(var r in this.t){if(this.t[r].cell.conf.size!=null){this.t[r].cell.conf.size.h=u;this.t[r].cell._adjustCell()}}return u};this._updateCellsMargin=function(){var a=0;for(var r=0;r<this.cont.childNodes.length;r++){var s=this.cont.childNodes[r]._accId;if(this.t[s].cell.conf.visible){this.t[s].cell.cell.style.marginTop=String(this.ofs[this.conf.multi_mode?"m":"s"][a++==0?"first":"between"])+"px"}}};this._hdrClick=function(q){if(!this.conf.multi_mode&&this.t[q].cell.conf.opened){return}var a=this.t[q].cell.conf.opened;if(this.callEvent("onBeforeActive",[q,(a?false:true)])!==true){return}this.conf.on_active_click=true;this[a?"_closeItem":"_openItem"](q);if(this.conf.multi_mode&&this.conf.tr.prop==false){this._adjustOpened()}};this.unload=function(){this.conf.unloading=true;for(var q in this.t){this.removeItem(q)}this.t=null;if(typeof(this._unloadDND)=="function"){this._unloadDND()}if(this.conf.fs_mode){if(this.conf.fs_tm){window.clearTimeout(this.conf.fs_tm)}if(window.addEventListener){window.removeEventListener("resize",this._doOnResizeStart,false)}else{window.detachEvent("onresize",this._doOnResizeStart)}this._doOnResizeStart=null;this._doOnResizeEnd=null;this.conf.fs_tm=null}if(this.dhxWins){this.dhxWins.unload();this.dhxWins=null}this._unloadTop();window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.ofs=this.conf=null;for(var q in this){this[q]=null}j=null};this.setOffset=function(a){this.ofs.s.between=a;this.ofs.m.between=a;this._updateCellsMargin();this.setSizes()};this._initObj=function(r){if(r.skin!=null){this.setSkin(r.skin)}if(window.dhx4.s2b(r.multi_mode)){this.enableMultiMode()}if(r.icons_path!=null){this.setIconsPath(r.icons_path)}if(r.icon_path!=null){this.setIconsPath(r.icon_path)}if(r.items!=null){for(var a=0;a<r.items.length;a++){this.addItem(r.items[a].id,r.items[a].text,r.items[a].open,r.items[a].height,r.items[a].icon||r.items[a].img)}}if(window.dhx4.s2b(r.dnd)==true&&typeof(this.enableDND)=="function"){this.enableDND()}};this._xmlToObj=function(v){var s={items:[]};var a=v.getElementsByTagName("accordion")[0];if(a.getAttribute("skin")!=null){s.skin=a.getAttribute("skin")}if(a.getAttribute("mode")=="multi"){s.multi_mode=true}if(a.getAttribute("multiMode")!=null){s.multi_mode=window.dhx4.s2b(a.getAttribute("multiMode"))}if(a.getAttribute("iconsPath")!=null){s.icons_path=a.getAttribute("iconsPath")}for(var u=0;u<a.childNodes.length;u++){var w=a.childNodes[u];if(typeof(w.tagName)!="undefined"&&String(w.tagName).toLowerCase()=="cell"){var r={};if(w.getAttribute("id")!=null){r.id=w.getAttribute("id")}if(w.getAttribute("icon")!=null){r.icon=w.getAttribute("icon")}if(w.getAttribute("height")!=null){r.height=w.getAttribute("height")}if(w.getAttribute("open")!=null){r.open=window.dhx4.s2b(w.getAttribute("open"))}r.text=w.firstChild.nodeValue;s.items.push(r)}w=null}return s};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","accordion",{struct:true});window.dhx4._eventable(this);this._callMainEvent=function(q,a){return this.callEvent(q,a)};this.attachEvent("onActive",function(a){if(this.t[a].cell.dataObj!=null&&this.t[a].cell.dataType=="editor"){this.t[a].cell.dataObj._prepareContent(true)}if(this.t[a].cell.conf.opened==true){this.t[a].cell._adjustProgress()}});if(typeof(window.dhtmlXWindows)=="function"){this.dhxWins=new dhtmlXWindows();this.dhxWins.setSkin(this.conf.skin)}if(m!=null){this._initObj(m);m=null}return this}dhtmlXAccordion.prototype=new dhtmlXCellTop();function dhtmlXAccordionCell(j,g){dhtmlXCellObject.apply(this,[j,"_acc"]);this.acc=g;this.conf.visible=true;this.conf.docked=true;this.attachEvent("_onCellUnload",function(){this._trDetachEv();this._unloadDocking();this.acc=null;this.cell._accObj=null;this.cell.childNodes[this.conf.idx.hdr].onselectstart=null;this.cell.childNodes[this.conf.idx.hdr].onclick=null;this._initHeader=null;this._getHdrHeight=null;this._setWidth=null;this._adjustCell=null;this._open=null;this._close=null;this._isOpened=null;this._trInitEv=null;this._trAttachEv=null;this._trDetachEv=null;this._trOnEnd=null;this._onActiveCall=null;this.setText=null;this.getText=null;this.setIcon=null;this.clearIcon=null;this.show=null;this.hide=null;this.isVisible=null;this.setHeight=null;this.moveOnTop=null});this.acc.attachEvent("onBeforeDrag",function(m){if(this.t[m].cell.dataObj!=null&&this.t[m].cell.dataType=="editor"){if(this.conf.editor_data==null){this.conf.editor_data={}}this.conf.editor_data[m]=this.t[m].cell.dataObj.getContent()}for(var l in this.t){this.t[l].cell._showCellCover()}return true});this.acc.attachEvent("onDrop",function(m){if(this.t[m].cell.dataObj!=null&&this.t[m].cell.dataType=="editor"){this.t[m].cell.dataObj._prepareContent(true);if(this.conf.editor_data!=null&&this.conf.editor_data[m]!=null){this.t[m].cell.dataObj.setContent(this.conf.editor_data[m]);this.conf.editor_data[m]=null}}for(var l in this.t){this.t[l].cell._hideCellCover()}});this.attachEvent("_onContentLoaded",function(){this.acc._callMainEvent("onContentLoaded",arguments)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="sidebar"){this._hideBorders()}});this._initHeader();this.conf.tr={};for(var c in this.acc.conf.tr){this.conf.tr[c]=this.acc.conf.tr[c]}if(this.conf.tr.prop!=false){this.attachEvent("_onIdxUpdated",function(){this._cellSetOpacity((this.conf.opened?"open":"close"),false)})}this.open=function(){this.acc._openItem(this._idd)};this.close=function(){this.acc._closeItem(this._idd)};this._setWidth=function(a){if(a!=this.conf.size.w){this.conf.size.w=a;this.cell.style.width=a+"px"}this._adjustCell()};this._adjustCell=function(){this._adjustCont();if(this.dataObj!=null&&typeof(this.dataObj.setSizes)=="function"){this.dataObj.setSizes()}};this._initDocking();return this}dhtmlXAccordionCell.prototype=new dhtmlXCellObject();dhtmlXAccordionCell.prototype._initHeader=function(){var a=document.createElement("DIV");a.className="dhx_cell_hdr";a.innerHTML="<div class='dhx_cell_hdr_text'></div><div class='dhx_cell_hdr_arrow'></div>";this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cont]);a=null;this.conf.ofs_nodes.t._getHdrHeight="func";this.conf.hdr={visible:true};this.conf.idx_data.hdr="dhx_cell_hdr";this._updateIdx()};dhtmlXAccordionCell.prototype._getHdrHeight=function(){return this.cell.childNodes[this.conf.idx.hdr].offsetHeight};dhtmlXAccordionCell.prototype.setText=function(a){this.conf.text=a;this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML="<span>"+a+"</span>"};dhtmlXAccordionCell.prototype.getText=function(){return this.conf.text};dhtmlXAccordionCell.prototype.setIcon=function(g){var c=this.cell.childNodes[this.conf.idx.hdr];if(c.firstChild.className!="dhx_cell_hdr_icon"){c.firstChild.className+=" dhx_cell_hdr_icon";var a=document.createElement("IMG");a.className="dhx_cell_hdr_icon";c.insertBefore(a,c.firstChild);a=null}c.firstChild.src=this.acc.conf.icons_path+g;c=null};dhtmlXAccordionCell.prototype.clearIcon=function(){var a=this.cell.childNodes[this.conf.idx.hdr];if(a.firstChild.className=="dhx_cell_hdr_icon"){a.removeChild(a.firstChild);a.firstChild.className=String(a.firstChild.className).replace(/\s{1,}dhx_cell_hdr_icon/gi,"")}a=null};dhtmlXAccordionCell.prototype._open=function(c){var l={};if(this.acc.conf.multi_mode){var j={};j[this._idd]=true;l=this.acc._getDynData(j);this.acc._openId=this._idd;this.acc._openCache={};this.acc._openMode="open"}else{l[this._idd]=this.conf.size.h}for(var g in l){if(this.acc._openCache!=null){this.acc._openCache[g]=true}var m=this.acc.t[g].cell;m.cell.className=String(m.cell.className).replace(/\s{1,}dhx_cell_closed/gi,"");m.conf.opened=true;m._trInitEv("open",c);m.conf.size.h=l[g];m.cell.style.height=m.conf.size.h+"px";m=null}if(this.conf.tr.prop==false){this.acc._openId=this.acc._openCache=this.acc._openMode=null;this._onActiveCall(true)}};dhtmlXAccordionCell.prototype._close=function(c){var j={};if(this.acc.conf.multi_mode){var l={};l[this._idd]=true;j=this.acc._getDynData(null,l);this.acc._openId=this._idd;this.acc._openCache={};this.acc._openMode="close"}else{j[this._idd]=this._getHdrHeight()}for(var g in j){var m=this.acc.t[g].cell;if(this.acc._openCache!=null){this.acc._openCache[g]=true}if(g==this._idd){m.cell.className+=" dhx_cell_closed";m.conf.opened=false;m._trInitEv("close",c)}else{m.conf.size.h=j[g];m._adjustCell();m._trInitEv("open",c)}m.cell.style.height=j[g]+"px";m=null}if(this.conf.tr.prop==false){this.acc._openId=this.acc._openCache=this.acc._openMode=null;this._onActiveCall(false)}};dhtmlXAccordionCell.prototype.isOpened=function(){return(this.conf.opened==true)};dhtmlXAccordionCell.prototype._trInitEv=function(c,a){if(this.conf.tr.prop==false){return}this._trAttachEv();if(!this.cell._accObj){this.cell._accObj=this.acc}if(a){this.cell.style[this.conf.tr.prop]=this.conf.tr["height_"+c]}this._cellSetOpacity(c,a)};dhtmlXAccordionCell.prototype._trAttachEv=function(){if(!this.conf.tr.ev_attached){this.cell._trProp=this.conf.tr.prop;this.cell.addEventListener(this.conf.tr.ev,this._trOnEnd,false);this.conf.tr.ev_attached=true}};dhtmlXAccordionCell.prototype._trDetachEv=function(){if(this.conf.tr.ev_attached){this.cell.addEventListener(this.conf.tr.ev,this._trOnEnd,false);this.conf.tr.ev_attached=false}};dhtmlXAccordionCell.prototype._trOnEnd=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.propertyName=="height"&&this._accObj!=null){this.style[this._trProp]="";if(this._accObj.conf.multi_mode){if(this._accObj._openCache!=null){this._accObj._openCache[this._accId]=false}this._accObj._adjustOpened()}if(this._accObj.conf.on_active_click==true){if(this._accObj.conf.multi_mode){this._accObj._callMainEvent("onActive",[this._accId,this._accObj.t[this._accId].cell.conf.opened]);this._accObj.conf.on_active_click=false}else{this._accObj._callMainEvent("onActive",[this._accObj.conf.on_active_id,true]);this._accObj.conf.on_active_id=null;this._accObj.conf.on_active_click=false}}this._accObj=null}};dhtmlXAccordionCell.prototype._cellSetOpacity=function(j,c){for(var g in this.conf.idx){if({hdr:true,pr1:true,pr2:true,cover:true}[g]!=true){if(c){this.cell.childNodes[this.conf.idx[g]].style[this.conf.tr.prop]=this.conf.tr["op_"+j]}this.cell.childNodes[this.conf.idx[g]].style.opacity=this.conf.tr["op_v_"+j]}}};dhtmlXAccordionCell.prototype._onActiveCall=function(a){if(this.acc.conf.on_active_click==false){return}if(this.acc.conf.multi_mode==true){this.acc._callMainEvent("onActive",[this._idd,this.conf.opened]);this.acc.conf.on_active_click=false}else{if(a==true){this.acc._callMainEvent("onActive",[this._idd,true]);this.acc.conf.on_active_click=false}}};dhtmlXAccordionCell.prototype.show=function(){if(this.conf.visible){return}if(this.conf.docked==false){this.dock();return}this.cell.style.display="";this.conf.visible=true;if(!this.acc.conf.multi_mode){this.acc.conf.hiden_count--;this.acc._updateCellsHeight();this.acc._updateCellsMargin()}if(this.acc.conf.size_changed){this.acc.setSizes();this.acc.conf.size_changed=false}else{this.acc._adjustOpened()}};dhtmlXAccordionCell.prototype.hide=function(){if(!this.conf.visible){return}if(!this.acc.conf.multi_mode&&this.conf.opened){this._close(false);this.acc.conf.last_opened=null}this.cell.style.display="none";this.conf.visible=false;if(!this.acc.conf.multi_mode){this.acc.conf.hiden_count++;this.acc._updateCellsHeight();this.acc._updateCellsMargin()}this.acc._adjustOpened()};dhtmlXAccordionCell.prototype.isVisible=function(){return(this.conf.visible==true)};dhtmlXAccordionCell.prototype.setHeight=function(a){if(!this.acc.conf.multi_mode){return}if(a=="*"){this.conf.h_auto=true}else{this.conf.h_auto=false;this.conf.size.h=a}if(this.conf.opened){if(a!="*"){this.cell.style.height=a+"px"}this.acc._adjustOpened()}};dhtmlXAccordionCell.prototype.moveOnTop=function(){if(this.cell.parentNode.firstChild==this.cell){return}this.cell.parentNode.insertBefore(this.cell,this.cell.parentNode.firstChild);this.acc._updateCellsMargin()};dhtmlXAccordionCell.prototype._initDocking=function(){var a=this;this.dock=function(){if(this.acc.dhxWins==null||this.conf.docked==true){return}var c=this.acc.dhxWins.window(this._idd);c.close();this._attachFromCell(c);this.conf.docked=true;this.show();if(this.conf.dock_opened){this.open()}c=null;this.acc._callMainEvent("onDock",[this._idd])};this.undock=function(c,m,j,l){if(this.acc.dhxWins==null||this.conf.docked==false){return}this.conf.dock_opened=this.conf.opened;if(this.acc.dhxWins.window(this._idd)!=null){var g=this.acc.dhxWins.window(this._idd);g.show()}else{if(c==null){c=20}if(m==null){m=20}if(j==null){j=320}if(l==null){l=200}var g=this.acc.dhxWins.createWindow(this._idd,c,m,j,l);g.button("close").hide();g.addUserButton("dock",99,"Dock");g.button("dock").show();g.button("dock").attachEvent("onClick",this._doOnDockClick);g.setText(this.getText());g.attachEvent("onClose",this._doOnDockWinClose)}this.conf.docked=false;this.hide();g._attachFromCell(this);g=null;this.acc._callMainEvent("onUnDock",[this._idd])};this._doOnDockClick=function(){a.dock()};this._doOnDockWinClose=function(c){c.hide();return false};this._unloadDocking=function(){a=null}};dhtmlXCellObject.prototype.attachAccordion=function(a){this.callEvent("_onBeforeContentAttach",["acc"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";this._attachObject(c);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={s:{first:-1},m:{first:4}}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_web"){c._ofs={l:2}}else{c._ofs={l:-1}}}this.dataType="acc";this.dataObj=new dhtmlXAccordion(a);a.obj=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXAccordion.prototype.enableDND=function(){if(this.conf.multi_mode==false||this._dnd!=null){return}var g=this;this._dnd={tr_count:0,tr_items:{}};this._dndAttachEvent=function(j){var a=this.t[j].cell;if(a.conf.dnd_inited!=true){if(typeof(window.addEventListener)=="function"){a.cell.childNodes[a.conf.idx.hdr].addEventListener("mousedown",this._dndOnMouseDown,false)}else{a.cell.childNodes[a.conf.idx.hdr].attachEvent("onmousedown",this._dndOnMouseDown)}a.conf.dnd_inited=true}a=null};this._dndDetachEvent=function(j){var a=this.t[j].cell;if(a.conf.dnd_inited==true){if(typeof(window.addEventListener)=="function"){a.cell.childNodes[a.conf.idx.hdr].removeEventListener("mousedown",this._dndOnMouseDown,false)}else{a.cell.childNodes[a.conf.idx.hdr].detachEvent("onmousedown",this._dndOnMouseDown)}a.conf.dnd_inited=false}a=null};this._dndOnMouseDown=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}var a=(j.target||j.srcElement);while(a!=null&&a.parentNode!=g.cont){a=a.parentNode}if(a!=null){g._dndDragStart(j,a)}a=null};this._dndDragStart=function(n,l){if(this._dnd.tr_waiting==true){return}var a=-1;for(var m=0;m<l.parentNode.childNodes.length;m++){if(l.parentNode.childNodes[m]==l){a=m}}if(this.callEvent("onBeforeDrag",[l._accId,a])!==true){return}if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",this._dndOnMouseMove,false);document.body.addEventListener("mouseup",this._dndOnMouseUp,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove,false);document.body.attachEvent("onmouseup",this._dndOnMouseUp,false)}this._dnd.dragObj=l;this._dnd.dy=n.clientY;var j=0;for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){this._dnd.dragObj.parentNode.childNodes[m]._ind=m;if(this._dnd.dragObj.parentNode.childNodes[m]==this._dnd.dragObj){this._dnd.dragObj._k0=j;if(m>0){this._dnd.dragObj._k0+=this.ofs.m.between-this.ofs.m.first}j=0}else{j+=this._dnd.dragObj.parentNode.childNodes[m].offsetHeight+parseInt(this._dnd.dragObj.parentNode.childNodes[m].style.marginTop)}}this._dnd.dragObj._k1=j;this._dnd.h=this._dnd.dragObj.offsetHeight;this._dnd.ofs=false};this._dndDoDrag=function(v){if(!this._dnd.dragObj){return}if(this._dnd.tr_waiting==true){return}var n=v.clientY-this._dnd.dy;if(this._dnd.ofs==false&&Math.abs(n)>5){this._dnd.dragObj.className+=" acc_cell_dragged";this._dnd.ofs=true}if(n<0){if(n<-this._dnd.dragObj._k0){n=-this._dnd.dragObj._k0}}else{if(n>this._dnd.dragObj._k1){n=this._dnd.dragObj._k1}}this._dnd.dragObj.style.top=n+"px";var u=v.clientY-this._dnd.dy;var m=0;var j=0;for(var o=this._dnd.dragObj._ind+1;o<=this._dnd.dragObj.parentNode.lastChild._ind;o++){var a=this._dnd.dragObj.parentNode.childNodes[o].offsetHeight;if(u>m+a*2/3){j++}m+=a}var l=this._dnd.dragObj.nextSibling;var o=0;while(l!=null){if(++o<=j&&l!=null){if(!l._ontop){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,false,parseInt(l.style.top||0),-this._dnd.h-this.ofs.m.between);l._ontop=true}}else{if(l._ontop){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,true,parseInt(l.style.top||0),0);l._ontop=false}}l=l.nextSibling}var u=this._dnd.dy-v.clientY;var m=0;var j=0;for(var o=this._dnd.dragObj._ind-1;o>=this._dnd.dragObj.parentNode.firstChild._ind;o--){var a=this._dnd.dragObj.parentNode.childNodes[o].offsetHeight;if(u>m+a*2/3){j++}m+=a}var l=this._dnd.dragObj.previousSibling;var o=0;while(l!=null){if(++o<=j&&l!=null){if(!l._onbottom){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,true,parseInt(l.style.top||0),this._dnd.h+this.ofs.m.between);l._onbottom=true}}else{if(l._onbottom){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,false,parseInt(l.style.top),0);l._onbottom=false}}l=l.previousSibling}};this._dndDragStop=function(r,n){if(n){}else{if(this._dnd.tr_count>0){this._dnd.tr_waiting=true;return}}if(!this._dnd.dragObj){return}this._dnd.dragObj.className=String(this._dnd.dragObj.className).replace(/\s{0,}acc_cell_dragged/gi,"");this._dnd.dragObj.style.top="0px";var o=false;for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){var l=this._dnd.dragObj.parentNode.childNodes[m];if(l!=this._dnd.dragObj){if(l._tm){window.clearTimeout(l._tm)}l.style.top="0px";if(l._ontop&&((l.nextSibling!=null&&l.nextSibling._ontop!=true)||!l.nextSibling)){o=(l.nextSibling||null)}if(l._onbottom&&((l.previousSibling!=null&&l.previousSibling._onbottom!=true)||!l.previousSibling)){o=l}}l=null}for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){this._dnd.dragObj.parentNode.childNodes[m]._ontop=null;this._dnd.dragObj.parentNode.childNodes[m]._onbottom=null}if(o!==false){if(o==null){this._dnd.dragObj.parentNode.appendChild(this._dnd.dragObj)}else{this._dnd.dragObj.parentNode.insertBefore(this._dnd.dragObj,o)}}var u=this._dnd.dragObj._accId;var j=this._dnd.dragObj._ind;var a=j;for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){if(this._dnd.dragObj.parentNode.childNodes[m]==this._dnd.dragObj){a=m}}this._dnd.dragObj=null;this._dnd.tr_waiting=false;this._updateCellsMargin();if(j!=a){this.setSizes();this.callEvent("onDrop",[u,j,a])}if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousemove",this._dndOnMouseMove,false);document.body.removeEventListener("mouseup",this._dndOnMouseUp,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove,false);document.body.detachEvent("onmouseup",this._dndOnMouseUp,false)}};this._dndAnim=function(n,a,m,l){if(this.conf.tr.prop!=false){if(!n._dnd_ev){n._dnd_ev=true;n._dnd_tr_prop=this.conf.tr.prop;n.addEventListener(this.conf.tr.ev,this._dndOnTrEnd,false)}if(this._dnd.tr_items[n._accId]!=true){this._dnd.tr_items[n._accId]=true;this._dnd.tr_count++}n.style[this.conf.tr.prop]=this.conf.tr.dnd_top;n.style.top=l+"px";return}var j=false;if(a){m+=5;if(m>=l){m=l;j=true}}else{m-=5;if(m<=l){m=l;j=true}}n.style.top=m+"px";if(n._tm){window.clearTimeout(n._tm)}if(!j){n._tm=window.setTimeout(function(){g._dndAnim(n,a,m,l)},5)}else{n._tm=null}};this._dndOnTrEnd=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.propertyName=="top"){if(g._dnd.tr_items[this._accId]==true){g._dnd.tr_count--;g._dnd.tr_items[this._accId]=false}this.style[this._dnd_tr_prop]="";if(g._dnd.tr_count==0&&g._dnd.tr_waiting==true){g._dndDragStop(null,true)}}};this._dndOnMouseMove=function(a){g._dndDoDrag(a||event)};this._dndOnMouseUp=function(a){g._dndDragStop(a||event)};this._dndClearCell=function(a){if(this.t[a].cell.cell._dnd_ev){this.t[a].cell.cell.addEventListener(this.conf.tr.ev,this._dndOnTrEnd,false)}this._dndDetachEvent(a)};this._unloadDND=function(){for(var j in this){if(String(j).indexOf("_dnd")==0&&typeof(this[j])=="function"){this[j]=null}}this._dnd=null;g=null};for(var c in this.t){this._dndAttachEvent(c)}};function dhtmlXLayoutObject(g,o,w){var u=null;if(g!=null&&typeof(g)=="object"&&typeof(g.tagName)=="undefined"&&g._isCell!=true){u={};if(g.autosize!=null){u.autosize=g.autosize}if(g.cells!=null){u.cells=g.cells}if(g.pattern!=null){o=g.pattern}if(g.skin!=null){w=g.skin}if(g.offsets!=null){u.offsets=g.offsets}g=g.parent}this.cdata={};this.conf={skin:(w||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxlayout")||"dhx_skyblue"),css:"dhxlayout",hh:20,autosize:"b",nextCell:{a:"b",b:"a"},inited:false,b_size:{w:-1,h:-1}};if(typeof(g)=="object"&&g._isCell==true){var n=(typeof(u)!="undefined"&&u!=null?u:{});if(n.pattern==null&&o!=null){n.pattern=o}if(n.skin==null&&w!=null){n.skin=w}var l=g.attachLayout(n);return l}window.dhtmlXCellTop.apply(this,[g,(u==null?null:u.offsets)]);this.conf.sw=this._detectSW();var m=this;this._getLayout=function(){return this};this.mainInst=(g._layoutMainInst!=null?g._layoutMainInst:null);this._getMainInst=function(){if(this.mainInst!=null){return this.mainInst._getMainInst()}return this};this._init=function(A){var y=(typeof(A)=="string"?this.tplData[A]:A);this.conf.mode=y.mode;if(this.conf.mode=="c"){this.cdata.a=new dhtmlXLayoutCell("a",this)}else{this.cdata.a=new dhtmlXLayoutCell("a",this);this.cdata.b=new dhtmlXLayoutCell("b",this)}for(var x in this.cdata){this.cont.appendChild(this.cdata[x].cell);this.cdata[x].conf.init={w:0.5,h:0.5}}if(this.conf.mode!="c"){var q=this._getMainInst();if(q.conf.sep_idx==null){q.conf.sep_idx=1}else{q.conf.sep_idx++}this.sep=new dhtmlXLayoutSepObject(this.conf.mode,q.conf.sep_idx);this.cont.appendChild(this.sep.sep);this.sep._getLayout=function(){return m._getLayout()};q=null}if(y.cells!=null){for(var x in y.cells){if(y.cells[x].width!=null){this.cdata[x].conf.init.w=y.cells[x].width}if(y.cells[x].height!=null){this.cdata[x].conf.init.h=y.cells[x].height}if(y.cells[x].name!=null){this.cdata[x].conf.name=y.cells[x].name;this.cdata[x].setText(y.cells[x].name)}if(y.cells[x].fsize!=null){this.cdata[x].conf.fsize=y.cells[x].fsize}}}this.setSizes();for(var x in this.cdata){this.cdata[x].conf.init={}}if(y.cells!=null){for(var x in y.cells){if(y.cells[x].layout!=null){this.cdata[x].dataNested=true;this.cdata[x]._layoutMainInst=this;this.cdata[x].attachLayout({pattern:y.cells[x].layout});this.cdata[x]._layoutMainInst=null}}}};this.setSizes=function(E,M,I,x){var F=(this.conf.inited==true&&this._getMainInst()==this&&this.checkEvent("onResizeFinish")==true?{}:false);this._adjustCont();var L=this.cont.offsetWidth;var C=this.cont.offsetHeight;if(this.conf.mode=="c"){var a=0;var N=0;var q=L;var K=C;this.cdata.a._setSize(a,N,q,K,E,I,x);this.callEvent("_onSetSizes",[]);if(F&&(!(this.conf.b_size.w==L&&this.conf.b_size.h==C))){this._callMainEvent("onResizeFinish",[])}this.conf.b_size={w:L,h:C};return}if(typeof(M)=="undefined"){var y=(this.conf.mode=="v"?"w":"h");M=this.conf.autosize;if(this.cdata.a.conf.collapsed){M="b"}else{if(this.cdata.b.conf.collapsed){M="a"}else{if(E=="a"||E=="b"){M=this.conf.nextCell[E]}}}}else{}if(this.conf.mode=="v"){if(M=="a"){if(this.cdata.b.conf.init.w!=null){var J=Math.round(L*this.cdata.b.conf.init.w-this.conf.sw/2)}else{var J=this.cdata.b.conf.size.w}var H=L-J;var D=0;var A=C;var a=0;var N=D;var q=H-a-this.conf.sw;var K=A}else{var a=0;var N=0;if(this.cdata.a.conf.init.w!=null){var q=Math.round(L*this.cdata.a.conf.init.w-this.conf.sw/2)-a}else{var q=this.cdata.a.conf.size.w}var K=C-N;var H=a+q+this.conf.sw;var D=N;var J=L-H;var A=K}this.cdata.a._setSize(a,N,q,K,E,I,x);this.cdata.b._setSize(H,D,J,A,E,I,x);this.sep._setSize(a+q,N,this.conf.sw,K)}else{if(M=="a"){if(this.cdata.b.conf.init.h!=null){var A=Math.round(C*this.cdata.b.conf.init.h-this.conf.sw/2)}else{var A=this.cdata.b.conf.size.h}var H=0;var D=C-A;var J=L-H;var a=H;var N=0;var q=J;var K=D-N-this.conf.sw}else{var a=0;var N=0;var q=L-a;if(this.cdata.a.conf.init.h!=null){var K=Math.round(C*this.cdata.a.conf.init.h-this.conf.sw/2)}else{var K=this.cdata.a.conf.size.h}var H=a;var D=N+K+this.conf.sw;var J=q;var A=C-D}this.cdata.a._setSize(a,N,q,K,E,I,x);this.cdata.b._setSize(H,D,J,A,E,I,x);this.sep._setSize(a,N+K,q,this.conf.sw)}this.callEvent("_onSetSizes",[]);if(F&&(!(this.conf.b_size.w==L&&this.conf.b_size.h==C))){this._callMainEvent("onResizeFinish",[])}this.conf.b_size={w:L,h:C}};this._getAvailWidth=function(){var A=[];for(var E=0;E<this.conf.as_cells.h.length;E++){var x=this.cells(this.conf.as_cells.h[E]);var C=x.layout;var y=C.conf.autosize;if(x.conf.collapsed){x=C.cdata[C.conf.nextCell[x._idd]];y=C.conf.nextCell[y]}A.push(Math.max(0,x.getWidth()-x._getMinWidth(y)));C=x=null}var D=(A.length>0?Math.min.apply(window,A):0);return this.cont.offsetWidth-D};this._getAvailHeight=function(){var C=[];for(var E=0;E<this.conf.as_cells.v.length;E++){var x=this.cells(this.conf.as_cells.v[E]);var A=x.layout;var y=A.conf.autosize;if(x.conf.collapsed){x=A.cdata[A.conf.nextCell[x._idd]];y=A.conf.nextCell[y]}C.push(Math.max(0,x.getHeight()-x._getHdrHeight()-x._getMinHeight(y)));A=x=null}var D=Math.min.apply(window,C);return this.cont.offsetHeight-D};this.setSkin=function(a){this._setBaseSkin(a);this.conf.skin=a};this.unload=function(){this.conf.unloading=true;this.mainInst=null;this.parentLayout=null;if(this.items!=null){for(var y=0;y<this.items.length;y++){this.items[y]=null}this.items=null}if(this.dhxWins!=null){this.dhxWins.unload();this.dhxWins=null}if(this.sep!=null){this.sep._unload();this.sep=null}for(var x in this.cdata){this.cdata[x]._unload();this.cdata[x]=null}this._unloadTop();window.dhx4._eventable(this,"clear");for(var x in this){this[x]=null}m=null};this._getWindowMinDimension=function(y){var a=m._getAvailWidth()+7+7;var x=m._getAvailHeight()+7+31;var q={w:Math.max(a,200),h:Math.max(x,140)};y=null;return q};window.dhx4._eventable(this);this._callMainEvent=function(q,a){return this.callEvent(q,a)};this._init(o||"3E");var r=this._availAutoSize[o];if(r!=null){this.conf.pattern=o;this.setAutoSize(r.h[r.h.length-1],r.v[r.v.length-1])}if(typeof(window.dhtmlXWindows)=="function"){this.dhxWins=new dhtmlXWindows();this.dhxWins.setSkin(this.conf.skin)}this.conf.inited=true;if(this==this._getMainInst()){var s=0;this.items=[];this.forEachItem(function(a){m.items.push(a);a.conf.index=s++})}if(this==this._getMainInst()&&u!=null){if(u.autosize!=null){this.setAutoSize.apply(this,u.autosize)}if(u.cells!=null){for(var c=0;c<u.cells.length;c++){var j=u.cells[c];var v=this.cells(j.id);if(j.width){v.setWidth(j.width)}if(j.height){v.setHeight(j.height)}if(j.text){v.setText(j.text)}if(j.collapsed_text){v.setCollapsedText(j.collapsed_text)}if(j.collapse){v.collapse()}if(j.fix_size){v.fixSize(j.fix_size[0],j.fix_size[1])}if(typeof(j.header)!="undefined"&&window.dhx4.s2b(j.header)==false){v.hideHeader()}}}}u=null;return this}dhtmlXLayoutObject.prototype=new dhtmlXCellTop();dhtmlXLayoutObject.prototype.cells=function(j){for(var c in this.cdata){if(this.cdata[c].conf.name==j){return this.cdata[c]}if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){var g=this.cdata[c].dataObj.cells(j);if(g!=null){return g}}}return null};dhtmlXLayoutObject.prototype.forEachItem=function(j,g){if(typeof(j)!="function"){return}if(typeof(g)=="undefined"){g=this}for(var c in this.cdata){if(typeof(this.cdata[c].conf.name)!="undefined"){j.apply(g,[this.cdata[c]])}if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){this.cdata[c].dataObj.forEachItem(j,g)}}g=null};dhtmlXLayoutObject.prototype._forEachSep=function(j,g){if(typeof(j)!="function"){return}if(typeof(g)=="undefined"){g=this}if(this.sep!=null){j.apply(g,[this.sep])}for(var c in this.cdata){if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){this.cdata[c].dataObj._forEachSep(j,g)}}g=null};dhtmlXLayoutObject.prototype._detectSW=function(){if(this._confGlob.sw==null){this._confGlob.sw={}}if(this._confGlob.sw[this.conf.skin]==null){this._confGlob.sw[this.conf.skin]=window.dhx4.readFromCss("dhxlayout_sep_sw_"+this.conf.skin)}return this._confGlob.sw[this.conf.skin]};dhtmlXLayoutObject.prototype._confGlob={};dhtmlXLayoutObject.prototype.listPatterns=function(){var g=[];for(var c in this.tplData){g.push(c)}return g};dhtmlXLayoutObject.prototype.listAutoSizes=function(){var j=(this.conf.as_cells!=null?(this.conf.as_cells.h).join(";"):"");var g=(this.conf.as_cells!=null?(this.conf.as_cells.v).join(";"):"");var c=this._availAutoSize[this.conf.pattern].h;var a=this._availAutoSize[this.conf.pattern].v;return[j,g,c,a]};dhtmlXLayoutObject.prototype._getCellsNames=function(j){var l={};if(this.cdata[j].conf.name!=null){l[this.cdata[j].conf.name]=true}if(this.cdata[j].dataType=="layout"&&this.cdata[j].dataObj!=null&&this.cdata[j].dataObj.mainInst==this){var c=this.cdata[j].dataObj._getCellsNames("a");var m=this.cdata[j].dataObj._getCellsNames("b");for(var g in c){l[g]=c[g]}for(var g in m){l[g]=m[g]}}return l};dhtmlXLayoutObject.prototype.setAutoSize=function(c,r,u){if(u!==true){var w=this.listAutoSizes();if(w[0]==c&&w[1]==r){return}var o=false;var n=false;for(var g=0;g<w[2].length;g++){o=o||w[2][g]==c}for(var g=0;g<w[3].length;g++){n=n||w[3][g]==r}if(!o||!n){return}}this.conf.as_cells={h:c.split(";"),v:r.split(";")};var j=(this.conf.mode=="v"?"h":"v");for(var v in this.cdata){var l=this._getCellsNames(v);var x=false;for(var g=0;g<this.conf.as_cells[j].length;g++){x=x||l[this.conf.as_cells[j][g]]}if(x){this.conf.autosize=v}if(this.cdata[v].dataType=="layout"&&this.cdata[v].dataObj!=null){this.cdata[v].dataObj.setAutoSize(c,r,true)}}};dhtmlXLayoutObject.prototype.tplData={"1C":{mode:"c",cells:{a:{name:"a"}}},"2E":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{name:"b",fsize:{v:1}}}},"2U":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{name:"b",fsize:{h:1}}}},"3E":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{v:[1,2]}},b:{name:"c",fsize:{v:2}}}}}}},"3W":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{name:"c",fsize:{h:2}}}}}}},"3J":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"c",fsize:{h:1,v:2}}}}},b:{name:"b",fsize:{h:1}}}},"3L":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:2}},b:{name:"c",fsize:{h:1,v:2}}}}}}},"3T":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:2,v:1}},b:{name:"c",fsize:{h:2,v:1}}}}}}},"3U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2,v:1}},b:{name:"b",fsize:{h:2,v:1}}}}},b:{name:"c",fsize:{v:1}}}},"4H":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:[1,2],v:3}},b:{name:"c",fsize:{h:[1,2],v:3}}}}},b:{name:"d",fsize:{h:2}}}}}}},"4I":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:3,v:[1,2]}},b:{name:"c",fsize:{h:3,v:[1,2]}}}}},b:{name:"d",fsize:{v:2}}}}}}},"4T":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[2,3],v:1}},b:{name:"d",fsize:{h:3,v:1}}}}}}}}}},"4U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[2,3],v:1}},b:{name:"c",fsize:{h:3,v:1}}}}}}}},b:{name:"d",fsize:{v:1}}}},"4E":{mode:"h",cells:{a:{name:"a",height:1/4,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{v:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{v:[2,3]}},b:{name:"d",fsize:{v:3}}}}}}}}}},"4W":{mode:"v",cells:{a:{name:"a",width:1/4,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[2,3]}},b:{name:"d",fsize:{h:3}}}}}}}}}},"4A":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"b",fsize:{h:1,v:2}}}}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[1,3]}},b:{name:"d",fsize:{h:3}}}}}}},"4L":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:2,v:3}},b:{name:"d",fsize:{h:2,v:3}}}}}}}}}},"4J":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:3,v:2}},b:{name:"d",fsize:{h:3,v:2}}}}}}}}}},"4F":{mode:"h",cells:{a:{height:1/3,layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2,v:1}},b:{name:"b",fsize:{h:2,v:1}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{v:[1,3]}},b:{name:"d",fsize:{v:3}}}}}}},"4G":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{name:"d",fsize:{h:1}}}},"4C":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:1,v:[2,3]}},b:{name:"d",fsize:{h:1,v:3}}}}}}}}}},"5H":{mode:"v",cells:{a:{width:1/3,name:"a",fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:[1,2],v:[3,4]}},b:{name:"d",fsize:{h:[1,2],v:4}}}}}}}},b:{name:"e",fsize:{h:2}}}}}}},"5I":{mode:"h",cells:{a:{height:1/3,name:"a",fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[3,4],v:[1,2]}},b:{name:"d",fsize:{h:4,v:[1,2]}}}}}}}},b:{name:"e",fsize:{v:2}}}}}}},"5U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",width:1/4,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:[2,3],v:1}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[3,4],v:1}},b:{name:"d",fsize:{h:4,v:1}}}}}}}}}}},b:{name:"e",fsize:{v:1}}}},"5E":{mode:"h",cells:{a:{name:"a",height:1/5,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{v:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{v:[3,4]}},b:{name:"e",fsize:{v:4}}}}}}}}}}}}},"5W":{mode:"v",cells:{a:{name:"a",width:1/5,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/4,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/3,fsize:{h:[2,3]}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[3,4]}},b:{name:"e",fsize:{h:4}}}}}}}}}}}}},"5K":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:4}},b:{name:"e",fsize:{h:1,v:4}}}}}}},"5S":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"b",fsize:{h:1,v:2}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[3,2]}},b:{name:"e",fsize:{h:1,v:4}}}}}}}}}},"5G":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[1,4]}},b:{name:"e",fsize:{h:4}}}}}}},"5C":{mode:"v",cells:{a:{width:2/3,layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2}},b:{name:"b",fsize:{h:[2,1]}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[3,4]}},b:{name:"e",fsize:{h:1,v:4}}}}}}}}}},"6H":{mode:"v",cells:{a:{width:1/3,name:"a",fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:[1,2],v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:[1,2],v:[4,5]}},b:{name:"e",fsize:{h:[1,2],v:5}}}}}}}}}}},b:{name:"f",fsize:{h:2}}}}}}},"6I":{mode:"h",cells:{a:{height:1/3,name:"a",fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/4,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/3,fsize:{h:[3,4],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[4,5],v:[1,2]}},b:{name:"e",fsize:{h:5,v:[1,2]}}}}}}}}}}},b:{name:"f",fsize:{v:2}}}}}}},"6A":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/5,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[4,5]}},b:{name:"e",fsize:{h:1,v:5}}}}}}}}}}}}}},b:{name:"f",fsize:{h:1}}}},"6C":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/5,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:1,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:1,v:[4,5]}},b:{name:"f",fsize:{h:1,v:5}}}}}}}}}}}}}}}},"6J":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",height:1/4,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:1,v:[3,4]}},b:{name:"d",fsize:{h:1,v:4}}}}}}}}}}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[1,5]}},b:{name:"f",fsize:{h:5}}}}}}},"6E":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:2,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:2,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:2,v:[4,5]}},b:{name:"f",fsize:{h:2,v:5}}}}}}}}}}}}}}}},"6W":{mode:"v",cells:{a:{name:"a",width:1/6,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/5,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/4,fsize:{h:[2,3]}},b:{layout:{mode:"v",cells:{a:{name:"d",width:1/3,fsize:{h:[3,4]}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[4,5]}},b:{name:"f",fsize:{h:5}}}}}}}}}}}}}}}},"7H":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/5,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:[1,2],v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:[1,2],v:[4,5]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:[1,2],v:[5,6]}},b:{name:"f",fsize:{h:[1,2],v:6}}}}}}}}}}}}}},b:{name:"g",fsize:{h:2}}}}}}},"7I":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/5,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/4,fsize:{h:[3,4],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"d",width:1/3,fsize:{h:[4,5],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[5,6],v:[1,2]}},b:{name:"f",fsize:{h:6,v:[1,2]}}}}}}}}}}}}}},b:{name:"g",fsize:{v:2}}}}}}}};dhtmlXLayoutObject.prototype._availAutoSize={"1C":{h:["a"],v:["a"]},"2E":{h:["a;b"],v:["a","b"]},"2U":{h:["a","b"],v:["a;b"]},"3E":{h:["a;b;c"],v:["a","b","c"]},"3W":{h:["a","b","c"],v:["a;b;c"]},"3J":{h:["a;c","b"],v:["a;b","b;c"]},"3L":{h:["a","b;c"],v:["a;b","a;c"]},"3T":{h:["a;b","a;c"],v:["a","b;c"]},"3U":{h:["a;c","b;c"],v:["a;b","c"]},"4H":{h:["a","b;c","d"],v:["a;b;d","a;c;d"]},"4I":{h:["a;b;d","a;c;d"],v:["a","b;c","d"]},"4T":{h:["a;b","a;c","a;d"],v:["a","b;c;d"]},"4U":{h:["a;d","b;d","c;d"],v:["a;b;c","d"]},"4E":{h:["a;b;c;d"],v:["a","b","c","d"]},"4W":{h:["a","b","c","d"],v:["a;b;c;d"]},"4A":{h:["a;b","c","d"],v:["a;c;d","b;c;d"]},"4L":{h:["a","b","c;d"],v:["a;b;c","a;b;d"]},"4J":{h:["a;b;c","a;b;d"],v:["a","b","c;d"]},"4F":{h:["a;c;d","b;c;d"],v:["a;b","c","d"]},"4G":{h:["a;b;c","d"],v:["a;d","b;d","c;d"]},"4C":{h:["a","b;c;d"],v:["a;b","a;c","a;d"]},"5H":{h:["a","b;c;d","e"],v:["a;b;e","a;c;e","a;d;e"]},"5I":{h:["a;b;e","a;c;e","a;d;e"],v:["a","b;c;d","e"]},"5U":{h:["a;e","b;e","c;e","d;e"],v:["a;b;c;d","e"]},"5E":{h:["a;b;c;d;e"],v:["a","b","c","d","e"]},"5W":{h:["a","b","c","d","e"],v:["a;b;c;d;e"]},"5K":{h:["a;b;c","d;e"],v:["a;d","b;d","c;d","a;e","b;e","c;e"]},"5S":{h:["a;b","c;d;e"],v:["a;c","a;d","a;e","b;c","b;d","b;e"]},"5G":{h:["a;b;c","d","e"],v:["a;d;e","b;d;e","c;d;e"]},"5C":{h:["a","b","c;d;e"],v:["a;b;c","a;b;d","a;b;e"]},"6H":{h:["a","b;c;d;e","f"],v:["a;b;f","a;c;f","a;d;f","a;e;f"]},"6I":{h:["a;b;f","a;c;f","a;d;f","a;e;f"],v:["a","b;c;d;e","f"]},"6A":{h:["a;b;c;d;e","f"],v:["a;f","b;f","c;f","d;f","e;f"]},"6C":{h:["a","b;c;d;e;f"],v:["a;b","a;c","a;d","a;e","a;f"]},"6J":{h:["a;b;c;d","e","f"],v:["a;e;f","b;e;f","c;e;f","d;e;f"]},"6E":{h:["a","b","c;d;e;f"],v:["a;b;c","a;b;d","a;b;e","a;b;f"]},"6W":{h:["a","b","c","d","e","f"],v:["a;b;c;d;e;f"]},"7H":{h:["a","b;c;d;e;f","g"],v:["a;b;g","a;c;g","a;d;g","a;e;g","a;f;g"]},"7I":{h:["a;b;g","a;c;g","a;d;g","a;e;g","a;f;g"],v:["a","b;c;d;e;f","g"]}};function dhtmlXLayoutSepObject(g,a){var c=this;this.conf={mode:g,idx:a,blocked:false,locked:false,btn_left:((window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8)&&typeof(window.addEventListener)=="undefined"?1:0)};if(window.dhx4.isIE&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")>=0){this.conf.btn_left=1}this.sep=document.createElement("DIV");this.sep.className="dhxlayout_sep";if(window.dhx4.isIE==true){this.sep.onselectstart=function(){return false}}this.sep.className="dhxlayout_sep dhxlayout_sep_resize_"+this.conf.mode;this._setSize=function(j,n,l,m){this.sep.style.left=j+"px";this.sep.style.top=n+"px";this.sep.style.width=Math.max(l,0)+"px";this.sep.style.height=Math.max(m,0)+"px"};this._lockSep=function(j){this.conf.locked=(j==true);this._blockSep()};this._setWH=function(j){var l=this._getLayout();l.conf.sw=(j==null?l._detectSW():Math.max(parseInt(j)||-1,-1));l._getMainInst().setSizes();l=null};this._blockSep=function(){var j=this._getLayout();var l=j.cdata.a.conf.collapsed||j.cdata.b.conf.collapsed||this.conf.locked;j=null;if(this.conf.blocked==l){return}this.sep.className="dhxlayout_sep"+(l?"":" dhxlayout_sep_resize_"+this.conf.mode);this.conf.blocked=l};this._beforeResize=function(l){if(this.conf.blocked){return}if(this.conf.resize!=null&&this.conf.resize.active==true){return}if(l.type=="touchstart"){this.sep.className+=" dhxlayout_sep_resize_actv";var n=(l.pageX||l.touches[0].pageX);var m=(l.pageY||l.touches[0].pageY)}else{if(l.button!==this.conf.btn_left){return}var n=l.clientX;var m=l.clientY}var j=this._getLayout();this.conf.resize={sx:n,sy:m,tx:l.layerX,ty:l.layerY,sep_x:parseInt(this.sep.style.left),sep_y:parseInt(this.sep.style.top),min_wa:j.cdata.a._getAvailWidth("a"),min_wb:j.cdata.b._getAvailWidth("b"),min_ha:j.cdata.a._getAvailHeight("a"),min_hb:j.cdata.b._getAvailHeight("b")};this.conf.resize.nx=this.conf.resize.sep_x;this.conf.resize.ny=this.conf.resize.sep_y;if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._doOnMouseMove,false);window.addEventListener("mouseup",this._doOnMouseUp,false);window.addEventListener("touchmove",this._doOnMouseMove,false);window.addEventListener("touchend",this._doOnMouseUp,false)}else{document.body.attachEvent("onmousemove",this._doOnMouseMove);document.body.attachEvent("onmouseup",this._doOnMouseUp)}j=null};this._onResize=function(m){if(!this.conf.resize.active){this._initResizeArea();this.conf.resize.active=true}if(this.conf.mode=="v"){var j=(m.type=="mousemove"?m.clientX:(m.pageX||m.touches[0].pageX));var l=this.conf.resize.sx-j;this.conf.resize.nx=this.conf.resize.sep_x-l;if(this.conf.resize.nx>this.conf.resize.sep_x+this.conf.resize.min_wb){this.conf.resize.nx=this.conf.resize.sep_x+this.conf.resize.min_wb}else{if(this.conf.resize.nx<this.conf.resize.sep_x-this.conf.resize.min_wa){this.conf.resize.nx=this.conf.resize.sep_x-this.conf.resize.min_wa}}this.r_sep.style.left=this.conf.resize.nx+"px"}else{var n=(m.type=="mousemove"?m.clientY:(m.pageY||m.touches[0].pageY));var l=this.conf.resize.sy-n;this.conf.resize.ny=this.conf.resize.sep_y-l;if(this.conf.resize.ny>this.conf.resize.sep_y+this.conf.resize.min_hb){this.conf.resize.ny=this.conf.resize.sep_y+this.conf.resize.min_hb}else{if(this.conf.resize.ny<this.conf.resize.sep_y-this.conf.resize.min_ha){this.conf.resize.ny=this.conf.resize.sep_y-this.conf.resize.min_ha}}this.r_sep.style.top=this.conf.resize.ny+"px"}};this._afterResize=function(r){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._doOnMouseMove,false);window.removeEventListener("mouseup",this._doOnMouseUp,false);window.removeEventListener("touchmove",this._doOnMouseMove,false);window.removeEventListener("touchend",this._doOnMouseUp,false)}else{document.body.detachEvent("onmousemove",this._doOnMouseMove);document.body.detachEvent("onmouseup",this._doOnMouseUp)}if(!this.conf.resize.active){this.conf.resize=null;return}if(r.type=="touchend"){this.sep.className=this.sep.className.replace(/\s{0,}dhxlayout_sep_resize_actv/gi,"")}else{if(r.button!==this.conf.btn_left){return}}var n=this._getLayout();var l=n._getMainInst();var o=(l.checkEvent("onPanelResizeFinish")==true?{}:false);if(o!==false){l.forEachItem(function(u){o[u.conf.name]={w:u.conf.size.w,h:u.conf.size.h};u=null})}var m=this.conf.resize.nx-this.conf.resize.sep_x;var j=this.conf.resize.ny-this.conf.resize.sep_y;n.cdata.a._setSize(n.cdata.a.conf.size.x,n.cdata.a.conf.size.y,n.cdata.a.conf.size.w+m,n.cdata.a.conf.size.h+j,"a");n.cdata.b._setSize(n.cdata.b.conf.size.x+m,n.cdata.b.conf.size.y+j,n.cdata.b.conf.size.w-m,n.cdata.b.conf.size.h-j,"b");this._setSize(parseInt(this.r_sep.style.left),parseInt(this.r_sep.style.top),parseInt(this.r_sep.style.width),parseInt(this.r_sep.style.height));if(window.dhx4.isIE){var s=this;window.setTimeout(function(){s._removeResizeArea();s=null},1)}else{this._removeResizeArea()}if(o!==false){var q=[];l.forEachItem(function(u){var v=o[u.conf.name];if(!(v.w==u.conf.size.w&&v.h==u.conf.size.h)){q.push(u.conf.name)}u=null});l._callMainEvent("onPanelResizeFinish",[q])}l=n=null;this.conf.resize.active=false;this.conf.resize=null};this._initResizeArea=function(){if(this.r_sep==null){this.r_sep=document.createElement("DIV");this.r_sep.className="dhxlayout_resize_sep";this.r_sep.style.left=this.sep.style.left;this.r_sep.style.top=this.sep.style.top;this.r_sep.style.width=this.sep.style.width;this.r_sep.style.height=this.sep.style.height;this.sep.parentNode.appendChild(this.r_sep);if(window.dhx4.isIE){this.r_sep.onselectstart=function(){return false}}}if(this.r_area==null){this.r_area=document.createElement("DIV");this.r_area.className="dhxlayout_resize_area";this.sep.parentNode.appendChild(this.r_area);if(window.dhx4.isIE){this.r_area.onselectstart=function(){return false}}if(this.conf.mode=="v"){var j=parseInt(this.r_sep.style.left)-this.conf.resize.min_wa;var n=parseInt(this.r_sep.style.top);var l=this.conf.resize.min_wa+this.conf.resize.min_wb+parseInt(this.r_sep.style.width);var m=parseInt(this.r_sep.style.height)}else{var j=parseInt(this.r_sep.style.left);var n=parseInt(this.r_sep.style.top)-this.conf.resize.min_ha;var l=parseInt(this.r_sep.style.width);var m=this.conf.resize.min_ha+this.conf.resize.min_hb+parseInt(this.r_sep.style.height)}this.r_area.style.left=j+"px";this.r_area.style.top=n+"px";if(!dhtmlXLayoutObject.prototype._confGlob.reszieCover){dhtmlXLayoutObject.prototype._confGlob.reszieCover={};this.r_area.style.width=l+"px";this.r_area.style.height=m+"px";dhtmlXLayoutObject.prototype._confGlob.reszieCover.w=parseInt(this.r_area.style.width)-this.r_area.offsetWidth;dhtmlXLayoutObject.prototype._confGlob.reszieCover.h=parseInt(this.r_area.style.height)-this.r_area.offsetHeight}this.r_area.style.width=l+dhtmlXLayoutObject.prototype._confGlob.reszieCover.w+"px";this.r_area.style.height=m+dhtmlXLayoutObject.prototype._confGlob.reszieCover.h+"px"}document.body.className+=" dhxlayout_resize_"+this.conf.mode};this._removeResizeArea=function(){this.r_sep.onselectstart=null;this.r_sep.parentNode.removeChild(this.r_sep);this.r_sep=null;this.r_area.onselectstart=null;this.r_area.parentNode.removeChild(this.r_area);this.r_area=null;document.body.className=String(document.body.className).replace(/\s{0,}dhxlayout_resize_[vh]/gi,"")};this._doOnMouseDown=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.cancelBubble=true}c._beforeResize(j)};this._doOnMouseMove=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.cancelBubble=true}c._onResize(j)};this._doOnMouseUp=function(j){j=j||event;c._afterResize(j)};if(typeof(window.addEventListener)=="function"){this.sep.addEventListener("mousedown",this._doOnMouseDown,false);this.sep.addEventListener("touchstart",this._doOnMouseDown,false)}else{this.sep.attachEvent("onmousedown",this._doOnMouseDown)}this._unload=function(){if(typeof(window.addEventListener)=="function"){this.sep.removeEventListener("mousedown",this._doOnMouseDown,false);this.sep.removeEventListener("touchstart",this._doOnMouseDown,false)}else{this.sep.detachEvent("onmousedown",this._doOnMouseDown)}if(window.dhx4.isIE==true){this.sep.onselectstart=null}this.sep.parentNode.removeChild(this.sep);this.sep=null;for(var j in this){this[j]=null}c=null};return this}dhtmlXLayoutObject.prototype.setSeparatorSize=function(g,j){if(typeof(g)=="number"){var l=this.setSeparatorSize({index:g,current:-1},j);if(l.sep!=null){l.sep._setWH(j)}return}for(var c in this.cdata){if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){g=this.cdata[c].dataObj.setSeparatorSize(g,j);if(g.sep!=null){return g}}if(c=="a"&&this.sep!=null){g.current++;if(g.index==g.current){return{sep:this.sep}}}}return g};window.dhtmlXLayoutCell=function(j,g){dhtmlXCellObject.apply(this,[j,"_layout"]);var c=this;this.layout=g;this.conf.skin=this.layout.conf.skin;this.conf.mode=this.layout.conf.mode;this.conf.collapsed=false;this.conf.fixed={w:false,h:false};this.conf.docked=true;this.conf.min_width=26;this.conf.min_height=26;this.attachEvent("_onCellUnload",function(){this.cell.childNodes[this.conf.idx.hdr].ondblclick=null;if(this.conf.mode!="c"){this.cell.childNodes[this.conf.idx.hdr].lastChild.ondblclick=null}this._unloadDocking();this.layout=null;c=null});this._hdrInit();this.cell.childNodes[this.conf.idx.hdr].ondblclick=function(){var l=c.layout._getMainInst();l._callMainEvent("onDblClick",[c.conf.name]);l=null};this.attachEvent("_onContentLoaded",function(){var l=this.layout._getMainInst();l._callMainEvent("onContentLoaded",[this.conf.name]);l=null});if(this.conf.mode!="c"){var a=document.createElement("DIV");a.className="dhxlayout_arrow dhxlayout_arrow_"+this.conf.mode+this._idd;this.cell.childNodes[this.conf.idx.hdr].appendChild(a);a.onclick=function(l){if(c.conf.collapsed){c.expand()}else{c.collapse()}};a=null}this.attachEvent("_onBeforeContentAttach",function(l){if(l=="tabbar"||l=="layout"||l=="acc"){this._hideBorders()}if(l=="sidebar"){this._hideBorders();this.showHeader()}});this._initDocking();return this};dhtmlXLayoutCell.prototype=new dhtmlXCellObject();dhtmlXLayoutCell.prototype.getId=function(){return this.conf.name};dhtmlXLayoutCell.prototype._initDocking=function(){var a=this;this.dock=function(){var g=this.layout._getMainInst();if(g.dhxWins==null||this.conf.docked){g=null;return}var c=g.dhxWins.window(this.conf.name);c.close();this._attachFromCell(c);this.conf.docked=true;if(!this.conf.dock_collapsed){this.expand()}g._callMainEvent("onDock",[this.conf.name]);g=c=null};this.undock=function(c,n,l,m){var j=this.layout._getMainInst();if(j.dhxWins==null||this.conf.docked==false){j=null;return}this.conf.dock_collapsed=this.conf.collapsed;if(!this.conf.collapsed){this.collapse()}if(j.dhxWins.window(this.conf.name)!=null){var g=j.dhxWins.window(this.conf.name);g.show()}else{if(c==null){c=20}if(n==null){n=20}if(l==null){l=320}if(m==null){m=200}var g=j.dhxWins.createWindow(this.conf.name,c,n,l,m);g.button("close").hide();g.addUserButton("dock",99,"Dock");g.button("dock").show();g.button("dock").attachEvent("onClick",this._doOnDockClick);g.setText(this.getText());g.attachEvent("onClose",this._doOnDockWinClose)}this.conf.docked=false;g._attachFromCell(this);j._callMainEvent("onUnDock",[this.conf.name]);j=g=null};this._doOnDockClick=function(){a.dock()};this._doOnDockWinClose=function(c){c.hide();return false};this._unloadDocking=function(){a=null}};dhtmlXLayoutCell.prototype._hdrInit=function(){var c="";if(window.dhx4.isIE){if(navigator.userAgent.indexOf("MSIE 9.0")!=-1){c=" dhx_cell_hdr_text_ie9"}else{if(window.dhx4.isIE8){c=" dhx_cell_hdr_text_ie8"}else{if(window.dhx4.isIE7){c=" dhx_cell_hdr_text_ie7"}else{if(window.dhx4.isIE6){c=" dhx_cell_hdr_text_ie6"}}}}}else{if(window.dhx4.isChrome||window.dhx4.isKHTML){c=" dhx_cell_hdr_text_chrome"}}var a=document.createElement("DIV");a.className="dhx_cell_hdr";a.innerHTML="<div class='dhx_cell_hdr_text"+c+"'></div>";this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cont]);a=null;this.conf.ofs_nodes.t._getHdrHeight="func";this.conf.hdr={visible:true};this.conf.idx_data.hdr="dhx_cell_hdr";this._updateIdx();this.attachEvent("_onSetSize",this._hdrOnSetSize);this.attachEvent("_onBorderChange",this._hdrOnBorderChange);this.attachEvent("_onViewSave",this._hdrOnViewSave);this.attachEvent("_onViewRestore",this._hdrOnViewRestore)};dhtmlXLayoutCell.prototype.showHeader=function(a){if(this.conf.hdr.visible||this.conf.collapsed){return}if(this.conf.hdr.w_saved>this._getAvailWidth()||this.conf.hdr.h_saved>this._getAvailHeight()){return}this.conf.hdr.w_saved=this.conf.hdr.h_saved=null;this.conf.hdr.visible=true;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr";if(a!==true){this._adjustCont(this._idd)}};dhtmlXLayoutCell.prototype.hideHeader=function(a){if(!this.conf.hdr.visible||this.conf.collapsed){return}this.conf.hdr.w_saved=this._getMinWidth();this.conf.hdr.h_saved=this._getMinHeight();this.conf.hdr.visible=false;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden";this._hdrUpdBorder();this._mtbUpdBorder();if(a!==true){this._adjustCont(this._idd)}};dhtmlXLayoutCell.prototype.isHeaderVisible=function(){return(this.conf.hdr.visible==true)};dhtmlXLayoutCell.prototype.showArrow=function(){this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display=""};dhtmlXLayoutCell.prototype.hideArrow=function(){this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display="none"};dhtmlXLayoutCell.prototype.isArrowVisible=function(){return(this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display=="")};dhtmlXLayoutCell.prototype.setText=function(a){this.conf.hdr.text=a;this._hdrUpdText()};dhtmlXLayoutCell.prototype.getText=function(){return this.conf.hdr.text};dhtmlXLayoutCell.prototype.setCollapsedText=function(a){this.conf.hdr.text_collapsed=a;this._hdrUpdText()};dhtmlXLayoutCell.prototype.getCollapsedText=function(){return(this.conf.hdr.text_collapsed!=null?this.conf.hdr.text_collapsed:this.conf.hdr.text)};dhtmlXLayoutCell.prototype._hdrUpdText=function(){var a=(this.conf.collapsed==true&&this.conf.hdr.text_collapsed!=null?this.conf.hdr.text_collapsed:this.conf.hdr.text);this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML="<span>"+a+"</span>"};dhtmlXLayoutCell.prototype._hdrUpdBorder=function(){if(this.conf.borders==true){this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr"+(this.conf.hdr.visible?"":" dhx_cell_hdr_hidden")}else{if(!this.conf.hdr.visible){this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden_no_borders"}}};dhtmlXLayoutCell.prototype._hdrOnSetSize=function(){if(this.conf.collapsed&&this.conf.mode=="v"){this._fitHdr()}};dhtmlXLayoutCell.prototype._hdrOnBorderChange=function(){this.hideHeader(true);this._hdrUpdBorder()};dhtmlXLayoutCell.prototype._hdrOnViewSave=function(a){this.views[a].hdr_vis=this.conf.hdr.visible};dhtmlXLayoutCell.prototype._hdrOnViewRestore=function(a){if(this.conf.hdr.visible!=this.views[a].hdr_vis){this[this.views[a].hdr_vis?"showHeader":"hideHeader"](true)}this.views[a].hdr_vis=null;delete this.views[a].hdr_vis};dhtmlXLayoutCell.prototype._getHdrHeight=function(a){if(this.conf.collapsed&&this.conf.mode=="v"&&a!==true){return 27}return this.cell.childNodes[this.conf.idx.hdr].offsetHeight};dhtmlXLayoutCell.prototype._fitHdr=function(){if(this.conf.collapsed){if(typeof(dhtmlXLayoutObject.prototype._confGlob.hdrColH)=="undefined"){this.cell.childNodes[this.conf.idx.hdr].style.height=this.cell.offsetHeight+"px";dhtmlXLayoutObject.prototype._confGlob.hdrColH=parseInt(this.cell.childNodes[this.conf.idx.hdr].style.height)-this._getHdrHeight(true)}this.cell.childNodes[this.conf.idx.hdr].style.height=this.cell.offsetHeight+dhtmlXLayoutObject.prototype._confGlob.hdrColH+"px"}else{this.cell.childNodes[this.conf.idx.hdr].style.height=null}};dhtmlXLayoutCell.prototype.expand=function(n){if(!this.conf.collapsed){return true}var g=this.layout;if(this.conf.mode=="v"){var m=(n?g.conf.hh:g.cdata[g.conf.nextCell[this._idd]]._getMinWidth(this._idd));var j=g.cont.offsetWidth-g.conf.sw;if(m+this.conf.size.w_avl>j){g=null;return false}}else{var l=(n?g.conf.hh:g.cdata[g.conf.nextCell[this._idd]]._getMinHeight(this._idd)+g.cdata[g.conf.nextCell[this._idd]]._getHdrHeight());var c=g.cont.offsetHeight-g.conf.sw;if(l+this.conf.size.h_avl>c){g=null;return false}}if(this.conf.docked==false){this.dock();return}this.cell.className=String(this.cell.className).replace(/\s{0,}dhxlayout_collapsed_[hv]/gi,"");this.conf.collapsed=false;if(this.conf.mode=="v"){this.conf.size.w=Math.min(j-m,this.conf.size.w_saved);this.conf.size.w_saved=this.conf.size.w_avl=null}else{this.conf.size.h=Math.min(c-l,this.conf.size.h_saved);this.conf.size.h_saved=this.conf.size.h_avl=null}if(this.conf.mode=="v"){this._fitHdr()}g.setSizes(g.conf.nextCell[this._idd],g.conf.nextCell[this._idd],n==true,"expand");g.sep._blockSep();g=null;this._hdrUpdText();var a=this.layout._getMainInst();a._callMainEvent("onExpand",[this.conf.name]);a=null;return true};dhtmlXLayoutCell.prototype.collapse=function(){if(this.conf.collapsed){return false}var c=this.layout;if(c.cdata[c.conf.nextCell[this._idd]].expand(true)==false){return false}if(this.conf.mode=="v"){this.conf.size.w_saved=this.conf.size.w;this.conf.size.w_avl=this._getMinWidth(this._idd)}else{this.conf.size.h_saved=this.conf.size.h;this.conf.size.h_avl=this._getMinHeight(this._idd)+this._getHdrHeight()}this.cell.className+=" dhxlayout_collapsed_"+this.conf.mode;this.conf.collapsed=true;if(this.conf.mode=="v"){this.conf.size.w=c.conf.hh}else{this.conf.size.h=this._getHdrHeight()}c.setSizes(c.conf.nextCell[this._idd],c.conf.nextCell[this._idd],false,"collapse");c.sep._blockSep();c=null;this._hdrUpdText();var a=this.layout._getMainInst();a._callMainEvent("onCollapse",[this.conf.name]);a=null;return true};dhtmlXLayoutCell.prototype.isCollapsed=function(){return(this.conf.collapsed==true)};dhtmlXLayoutCell.prototype.setMinWidth=function(a){this.conf.min_height=parseInt(h)||0};dhtmlXLayoutCell.prototype.setMinHeight=function(a){this.conf.min_height=parseInt(a)||0};dhtmlXLayoutCell.prototype._getMinWidth=function(c){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return Math.max(this.conf.min_width,this.dataObj.cdata.a._getMinWidth(c))}else{if(this.dataObj.conf.mode=="v"){var a=c||this._idd;if(this.dataObj.cdata[a].conf.collapsed){a=this.dataObj.conf.nextCell[a]}return Math.max(this.conf.min_width,this.dataObj.cdata[a]._getMinWidth(c)+this.dataObj.cdata[this.dataObj.conf.nextCell[a]]._getWidth()+this.dataObj.conf.sw)}else{return Math.max(this.conf.min_width,this.dataObj.cdata.a._getMinWidth(c),this.dataObj.cdata.b._getMinWidth(c))}}}return Math.max(this.conf.min_width,1)};dhtmlXLayoutCell.prototype._getMinHeight=function(g){var c=0;if(this.conf.idx.menu!=null){c+=this.cell.childNodes[this.conf.idx.menu].offsetHeight}if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return Math.max(this.conf.min_height,this.dataObj.cdata.a._getMinHeight(g))}else{if(this.dataObj.conf.mode=="h"){var a=g;if(this.dataObj.cdata[a].conf.collapsed){a=this.dataObj.conf.nextCell[a]}return Math.max(this.conf.min_height,this.dataObj.cdata[a]._getMinHeight(g)+this.dataObj.cdata[a]._getHdrHeight()+this.dataObj.cdata[this.dataObj.conf.nextCell[a]]._getHeight()+this.dataObj.conf.sw)}else{return Math.max(this.conf.min_height,this.dataObj.cdata.a._getMinHeight(g)+this.dataObj.cdata.a._getHdrHeight(),this.dataObj.cdata.b._getMinHeight(g)+this.dataObj.cdata.b._getHdrHeight())}}}return Math.max(this.conf.min_height,c)};dhtmlXLayoutCell.prototype._getAvailWidth=function(g){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return this.dataObj.cdata.a._getAvailWidth(g)}else{if(this.dataObj.conf.mode=="v"){var a=(this.dataObj.cdata.a.conf.collapsed==true);var c=(this.dataObj.cdata.b.conf.collapsed==true);if(g=="a"){return this.dataObj.cdata[c?"a":"b"]._getAvailWidth(g)}else{return this.dataObj.cdata[a?"b":"a"]._getAvailWidth(g)}}else{return Math.min(this.dataObj.cdata.a._getAvailWidth(g),this.dataObj.cdata.b._getAvailWidth(g))}}}return this.cell.offsetWidth-this._getMinWidth()};dhtmlXLayoutCell.prototype._getAvailHeight=function(j){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return this.dataObj.cdata.a._getAvailHeight(j)}else{if(this.dataObj.conf.mode=="h"){var c=(this.dataObj.cdata.a.conf.collapsed==true);var g=(this.dataObj.cdata.b.conf.collapsed==true);if(j=="a"){return this.dataObj.cdata[g?"a":"b"]._getAvailHeight(j)}else{return this.dataObj.cdata[c?"b":"a"]._getAvailHeight(j)}}else{return Math.min(this.dataObj.cdata.a._getAvailHeight(j),this.dataObj.cdata.b._getAvailHeight(j))}}}var a=this._getHdrHeight();if(this.conf.mode=="v"&&this.conf.collapsed){a=this.conf.hh}return this.cell.offsetHeight-a-this._getMinHeight()};dhtmlXLayoutCell.prototype.setWidth=function(j){if(this.conf.mode=="v"){if(this.conf.collapsed){return}var l=this.layout;var m=l.cdata[l.conf.nextCell[this._idd]];if(m.conf.collapsed){j=j+l.conf.sw+m._getWidth();n=l=m=null;return}var g=this._getMinWidth(this._idd);var o=l.cont.offsetWidth-m._getMinWidth(this._idd)-l.conf.sw;j=Math.max(g,Math.min(j,o));this.conf.size.w=j;l.setSizes(m._idd,m._idd);l=m=null}else{if(this.layout==null||this.layout.parentLayout==null){return}var n=this.layout.parentLayout;var l=this.layout;var m=l.cdata[l.conf.nextCell[this._idd]];for(var c in n.cdata){if(n.cdata[c].dataObj==l){n.cdata[c].setWidth(j)}}n=l=null}};dhtmlXLayoutCell.prototype.setHeight=function(n){if(this.conf.mode=="h"){if(this.conf.collapsed){return}var j=this.layout;var m=j.cdata[j.conf.nextCell[this._idd]];if(m.conf.collapsed){n=n+j.conf.sw+m._getHeight();var o=(this.layout!=null&&this.layout.parentLayout!=null?this.layout.parentLayout:null);if(o!=null){for(var c in o.cdata){if(o.cdata[c].dataObj==j){o.cdata[c].setHeight(n)}}}o=j=m=null;return}var l=this._getMinHeight(this._idd)+this._getHdrHeight();var g=j.cont.offsetHeight-m._getMinHeight(this._idd)-m._getHdrHeight()-j.conf.sw;n=Math.max(l,Math.min(n,g));this.conf.size.h=n;j.setSizes(m._idd,m._idd);j=m=null}else{if(this.layout==null||this.layout.parentLayout==null){return}var o=this.layout.parentLayout;var j=this.layout;var m=j.cdata[j.conf.nextCell[this._idd]];for(var c in o.cdata){if(o.cdata[c].dataObj==j){o.cdata[c].setHeight(n)}}o=j=null}};dhtmlXLayoutCell.prototype.getWidth=function(){return this.conf.size.w};dhtmlXLayoutCell.prototype.getHeight=function(){return this.conf.size.h};dhtmlXLayoutCell.prototype.fixSize=function(c,j){this.conf.fixed.w=window.dhx4.s2b(c);this.conf.fixed.h=window.dhx4.s2b(j);var a=this.layout._getMainInst();var g={};a.forEachItem(function(l){if(l.conf.fsize!=null){var r=l.getId();var o={h:(l.conf.fixed.w==true),v:(l.conf.fixed.h==true)};for(var m in o){if(o[m]==true&&l.conf.fsize[m]!=null){if(!(l.conf.fsize[m] instanceof Array)){l.conf.fsize[m]=[l.conf.fsize[m]]}for(var n=0;n<l.conf.fsize[m].length;n++){g[l.conf.fsize[m][n]]=true}}}}l=null});a._forEachSep(function(l){l._lockSep(g[l.conf.idx]==true);l=null});a=null};dhtmlXCellObject.prototype.attachLayout=function(a){this.callEvent("_onBeforeContentAttach",["layout"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(this._layoutMainInst)!="undefined"){c._layoutMainInst=this._layoutMainInst}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof dhtmlXLayoutCell){c._isParentCell=true}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1,r:-1,l:-1,b:-1}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_web"){c._ofs={l:8}}if(this.conf.skin=="dhx_terrace"){c._ofs={l:11}}else{c._ofs={l:-1}}}if(typeof(a)=="string"){a={pattern:a}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;this.dataType="layout";this.dataObj=new dhtmlXLayoutObject(a);if(this instanceof dhtmlXLayoutCell){this.dataObj.parentLayout=this.layout}c._layoutMainInst=null;a.parent=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXTabBar(c,l){var g=this;this.conf={skin:(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtabbar")||"dhx_skyblue"),css:"dhxtabbar",lastActive:null,closeButton:false,align:"left",tabsMode:(l=="bottom"?"bottom":"top"),tabsContCss:(navigator.userAgent.indexOf("Safari")>=0&&navigator.userAgent.indexOf("5.1.7")>=0?" safari_517_fix":""),contZone:true,transSpeed:"0.15s",arwMode:"always",tabsOfs:1,tabsTop:0,url_demand:false,urls:{},autoload:{}};var j;if(c!=null&&typeof(c)=="object"&&typeof(c.tagName)=="undefined"){j=c.parent;if(typeof(c.skin)!="undefined"){this.conf.skin=c.skin}if(typeof(c.mode)!="undefined"){this.conf.tabsMode=(c.mode=="bottom"?"bottom":"top")}if(typeof(c.align)!="undefined"){this.conf.align=(c.align=="right"?"right":"left")}if(typeof(c.close_button)!="undefined"){this.conf.closeButton=window.dhx4.s2b(c.close_button)}if(typeof(c.content_zone)!="undefined"){this.conf.contZone=window.dhx4.s2b(c.content_zone)}if(typeof(c.xml)!="undefined"){this.conf.autoload.xml=c.xml}if(typeof(c.json)!="undefined"){this.conf.autoload.xml=c.json}if(typeof(c.tabs)!="undefined"){this.conf.autoload.tabs=c.tabs}if(typeof(c.onload)!="undefined"){this.conf.autoload.tabs=c.tabs}if(typeof(c.arrows_mode)!="undefined"){this.conf.autoload.arrows_mode=c.arrows_mode}}else{j=c}window.dhtmlXCellTop.apply(this,[j,c.offsets]);if(this.base._ofs!=null&&this.base._ofs.t!=null){this.conf.tabsTop=this.base._ofs.t}this.tabsMode=document.createElement("DIV");this.tabsMode.className="dhxtabbar_tabs_"+this.conf.tabsMode;this.cont.appendChild(this.tabsMode);this.tabsArea=document.createElement("DIV");this.tabsArea.className="dhxtabbar_tabs dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.innerHTML="<div class='dhxtabbar_tabs_ar_left'><div class='dhxtabbar_arrow_img'></div></div><div class='dhxtabbar_tabs_base'><div class='dhxtabbar_tabs_cont_"+this.conf.align+this.conf.tabsContCss+"'><div class='dhxtabbar_tabs_line'></div></div></div><div class='dhxtabbar_tabs_ar_right'><div class='dhxtabbar_arrow_img'></div></div>";this.tabsArea.style.top=(this.conf.tabsMode=="top"?this.conf.tabsTop+"px":"auto");this.tabsMode.appendChild(this.tabsArea);this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";this.tabsArea.childNodes[0].onclick=function(){if(g.conf.align=="left"){g._moveTabs(1)}else{g._moveTabs(-1)}};this.tabsArea.childNodes[2].onclick=function(){if(g.conf.align=="left"){g._moveTabs(-1)}else{g._moveTabs(1)}};this._onTabsAreaClick=function(m){return this._callMainEvent("onTabClose",[m])};this.tabsArea.onclick=function(n){n=n||event;var m=(n.target||n.srcElement);while(m!=null){if(typeof(m._tabCloseId)!="undefined"){if(g._onTabsAreaClick(m._tabCloseId)!==true){return}g.t[m._tabCloseId].conf.remove=true;g._hideTab(m._tabCloseId);m=null}else{if(typeof(m._tabId)!="undefined"){g._doOnClick(m._tabId);m=null}}if(m!=null){m=m.parentNode;if(m==this){m=null}}}};this.tabsArea.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this._doOnClick=function(m){this.callEvent("onTabClick",[m,this.conf.lastActive]);if(this.t[m].conf.enabled){this._setTabActive(m)}};this.t={};this.addTab=function(m,v,o,s,r,w){if(typeof(w)!="boolean"){w=(this.conf.closeButton==true)}r=window.dhx4.s2b(r);var q=document.createElement("DIV");q.className="dhxtabbar_tab";q.innerHTML="<div class='dhxtabbar_tab_text"+(w?" dhxtabbar_tab_text_close":"")+"'>"+v+"</div>"+(w?"<div class='dhxtabbar_tab_close'></div>":"");q._tabId=m;if(w){q.childNodes[1]._tabCloseId=m}var n=this.tabsArea.childNodes[1].firstChild;if(s!=null&&s+1>0&&s+1<n.childNodes.length){n.insertBefore(q,n.childNodes[s+1])}else{n.appendChild(q)}var x=false;if(typeof(o)=="undefined"||o==null||o=="*"){o=this._getLabelWidth(v,w);x=true}else{o=parseInt(o)}q.style.width=o+"px";var u=new dhtmlXTabBarCell(m,this);this.tabsMode.appendChild(u.cell);this.t[m]={tab:q,cell:u,conf:{text:v,visible:true,active:false,enabled:true,close:w,width:o,autowidth:x}};n=u=null;if(r){this._setTabActive(m)}else{this._adjustCell(m)}if(this.conf.initSeq!=true&&this.conf.arwMode=="auto"){this.setSizes()}};this.setSizes=function(){this._adjustCont();if(this.conf.tabsAreaOfs==null){this.tabsArea.style.width=this.cont.offsetWidth+"px";this.conf.tabsAreaOfs=parseInt(this.tabsArea.style.width)-this.tabsArea.offsetWidth}this.tabsArea.style.width=this.cont.offsetWidth+this.conf.tabsAreaOfs+"px";this._adjustCell(this.conf.lastActive);this._adjustTabs(true);this.callEvent("_onSetSizes",[])};this._adjustCell=function(q){if(!this.conf.contZone||q==null){return}var o=(this.conf.tabsMode=="top"?this.tabsArea.offsetHeight:0)+this.conf.tabsTop;var n=this.cont.offsetHeight-this.tabsArea.offsetHeight-this.conf.tabsTop;var m=this.t[q].cell.dataType;if(this.conf.skin=="dhx_skyblue"&&(m=="layout"||m=="tabbar"||m=="acc")){if(this.conf.tabsMode=="top"){o=o-1}n=n+1}if(q!=this.conf.lastActive){o=-5000;this.t[q].cell.cell.style.visibility="hidden";this.t[q].cell.cell.style.zIndex=0}this.t[q].cell._setSize(0,o,this.cont.offsetWidth,n)};this.setTabsMode=function(m){this.conf.tabsMode=(m=="bottom"?"bottom":"top");this.tabsMode.className="dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.className="dhxtabbar_tabs dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.style.top=(this.conf.tabsMode=="top"?this.conf.tabsTop+"px":"auto");this.setSizes()};this._tabCss=function(r,o){var m=this.t[r].conf.active;var q=!this.t[r].conf.enabled;var n=!this.t[r].conf.visible;return"dhxtabbar_tab"+(n?" dhxtabbar_tab_hidden":(m||q?" dhxtabbar_tab"+(m?"_actv":"")+(q?"_dis":""):""))};this._getLabelWidth=function(o,n){if(this.tabsTextTest==null){this.tabsTextTest=document.createElement("SPAN");this.tabsTextTest.className="dhxtabbar_tabs_text_test_"+this.conf.skin}document.body.appendChild(this.tabsTextTest);this.tabsTextTest.innerHTML=o;var m=this.tabsTextTest.offsetWidth;if(window.dhx4.isIE&&m==0){m=this.tabsTextTest.offsetWidth}m+=(this.conf.skin=="dhx_terrace"?44:35);m+=(n?(this.conf.skin=="dhx_terrace"?14:9):0);document.body.removeChild(this.tabsTextTest);return m};this._adjustTabs=function(r){if(this._checkArrows()==true||r==true){this.tabsArea.childNodes[1].style.left=this.tabsArea.childNodes[0].offsetWidth-1+"px";this.tabsArea.childNodes[1].style.width=Math.max(0,this.tabsArea.offsetWidth-this.tabsArea.childNodes[0].offsetWidth-this.tabsArea.childNodes[2].offsetWidth)+1+"px"}var u=this.tabsArea.childNodes[1];if(u.offsetWidth<5){u=null;return}var m=parseInt(u.childNodes[0].style[this.conf.align]);var o=null;for(var s=0;s<u.childNodes[0].childNodes.length;s++){var v=u.childNodes[0].childNodes[s]._tabId;if(v!=null&&this.t[v].conf.visible){var n=this.t[v].tab.offsetWidth-this.conf.tabsOfs;if(this.t[v].conf.active){if(m<0||u.offsetWidth<n){o={d:1,id:v}}else{if(m+n>u.offsetWidth){o={d:-1,id:v}}}}m+=n}}if(o!=null){this._moveTabs(o.d,o.id)}else{if(u.offsetWidth>m+1){u.childNodes[0].style[this.conf.align]=Math.min(0,parseInt(u.childNodes[0].style[this.conf.align])+(u.offsetWidth-m))+"px"}}u=o=null};this._moveTabs=function(y,r){var o=this.tabsArea.childNodes[1].childNodes[0];var v=0;var A=[];var D=null;for(var m=0;m<o.childNodes.length;m++){var n=o.childNodes[m]._tabId;if(n!=null&&this.t[n].conf.visible){A.push({id:n,w:this.t[n].tab.offsetWidth-this.conf.tabsOfs,ind:v});if(n==r){D=v}v++}}var C=parseInt(this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]);var u=this.tabsArea.offsetWidth-this.tabsArea.childNodes[0].offsetWidth-this.tabsArea.childNodes[2].offsetWidth;var w=null;var s=null;for(var m=0;m<A.length;m++){A[m].x=C;if(w==null&&C>=0&&C+A[m].w>0){w=A[m]}if(C<u&&C+A[m].w<=u){s=A[m]}C+=A[m].w}if(D!=null){var E=A[D]}else{var E=null;if(y>0){if(w==null){if(A.length>0){E=A[A.length-1]}}else{if(w.ind>0&&A.length>=w.ind){E=A[w.ind-1]}}}else{if(s==null){if(A.length>0){E=A[0]}}else{if(A.length>s.ind){E=A[s.ind+1]}}}}if(E!=null){if(y>0){if(C<u){o.style[this.conf.align]=Math.min(0,parseInt(o.style[this.conf.align])+(u-C))+"px"}else{o.style[this.conf.align]=parseInt(o.style[this.conf.align])-E.x+"px"}}else{o.style[this.conf.align]=parseInt(o.style[this.conf.align])-E.x+u-E.w+"px"}}o=E=A=null};this._getNextVisible=function(n,m){return this._getNearVisible(n,m,"next")};this._getPrevVisible=function(n,m){return this._getNearVisible(n,m,"previous")};this._getFirstVisible=function(){return this._getNearVisible(null,false,"first")};this._getNearVisible=function(s,o,r){if(r=="first"){var q=this.tabsArea.childNodes[1].childNodes[0].childNodes[1];r="next"}else{if(s==null||this.t[s]==null){return(o?this._getFirstVisible():null)}var q=this.t[s].tab[r+"Sibling"]}var n=null;while(q!=null&&n==null){var m=q._tabId;if(m!=null&&n==null&&this.t[m].conf.visible){n=m}else{q=q[r+"Sibling"]}}q=null;return n};this._showTab=function(n,m){if(this.t[n]==null){return}if(this.t[n].conf.transActv==true){if(this.t[n].conf.transMode=="show"){return}}else{if(this.t[n].conf.visible==true){return}}if(this.conf.transProp!==false){this.t[n].conf.transActv=true;this.t[n].conf.transMode="show";this.t[n].conf.transProp=this.conf.transProp;this.t[n].conf.transActvId=(m?n:null);if(!this.t[n].conf.transEv){this.t[n].tab.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[n].conf.transEv=true}this.t[n].conf.visible=true;this.t[n].tab.className=this._tabCss(n);this.t[n].tab.style[this.conf.transProp]=this.conf.transValueWidth;this.t[n].tab.style.width=this.t[n].conf.width+"px";if(this.t[n].tab.clientWidth>=this.t[n].conf.width){this.t[n].tab.style.visibility="visible"}}else{this.t[n].conf.visible=true;this.t[n].tab.style.display="";if(m){this._setTabActive(n)}else{this._adjustTabs()}}};this._hideTab=function(s,m){if(this.t[s]==null){return}if(this.t[s].conf.transActv==true){if(this.t[s].conf.transMode=="hide"){return}}else{if(this.t[s].conf.visible!=true){return}}var n=false;if(this.conf.lastActive==s){this.conf.lastActive=null;this.t[s].conf.active=false;this.t[s].tab.className=this._tabCss(s);n=true}var q=this._getPrevVisible(s);var o=this._getNextVisible(s);var r=(n&&m!==false?(m==true?null:m)||o||q:null);if(this.conf.transProp!==false){this.t[s].conf.transActv=true;this.t[s].conf.transMode="hide";this.t[s].conf.transProp=this.conf.transProp;this.t[s].conf.transActvId=r;this.t[s].conf.visible=false;if(!this.t[s].conf.transEv){this.t[s].tab.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[s].conf.transEv=true}this.t[s].tab.style.visibility="hidden";this.t[s].tab.className=g._tabCss(s);this.t[s].tab.style[this.conf.transProp]=this.conf.transValueWidth;this.t[s].tab.style.width="0px"}else{this.t[s].tab.style.display="none";this.t[s].conf.visible=false;if(this.conf.contZone){this.t[s].cell.cell.style.visibility="hidden";this.t[s].cell.cell.style.top="-5000px"}if(r!=null){this._setTabActive(r)}this._adjustTabs();if(this.t[s].conf.remove){this._removeTab(s)}}};this._isTabVisible=function(m){return(this.t[m].conf.visible==true)};this._doOnTrEnd=function(){var o=this._tabId;if(g.t[o]==null){return}var m=g.t[o];var n=m.conf.transActvId;if(m.conf.transMode=="hide"){if(m.conf.remove){g._removeTab(o)}else{m.tab.style[m.conf.transProp]="";if(g.conf.contZone){m.cell.cell.style.visibility="hidden";m.cell.cell.style.top="-5000px"}m.conf.transActv=false}}else{if(m.conf.transMode=="show"){m.tab.style[m.conf.transProp]="";m.tab.style.visibility="visible";m.conf.transMode=null;m.conf.transActv=false}}if(n!=null){g._setTabActive(n)}else{g._adjustTabs()}m=null};this.enableTabCloseButton=function(m){this.conf.closeButton=window.dhx4.s2b(m)};this.unload=function(){this.conf.unloading=true;this.clearAll();this.t=null;if(this.tabsTextTest!=null){if(this.tabsTextTest.parentNode){this.tabsTextTest.parentNode.removeChild(this.tabsTextTest)}this.tabsTextTest=null}window.dhx4._enableDataLoading(this,null,null,null,"clear");this.tabsArea.childNodes[0].onclick=null;this.tabsArea.childNodes[2].onclick=null;this.tabsArea.onclick=null;this.tabsArea.onselectstart=null;this.tabsArea.parentNode.removeChild(this.tabsArea);this.tabsArea=null;this.tabsMode.parentNode.removeChild(this.tabsMode);this.tabsMode=null;this._unloadTop();window.dhx4._eventable(this,"clear");for(var m in this){this[m]=null}g=null};this.enableContentZone=function(m){this.conf.contZone=(m==true)};this.setSkin=function(n){this._setBaseSkin(n);this.conf.skin=n;if(this.tabsTextTest!=null){this.tabsTextTest.className="dhxtabbar_tabs_text_test_"+this.conf.skin}for(var m in this.t){this.t[m].cell._resetSizeState();if(this.t[m].conf.autowidth==true){this.t[m].conf.width=this._getLabelWidth(this.t[m].conf.text,this.t[m].conf.close);if(this.t[m].conf.visible){this.t[m].tab.style.width=this.t[m].conf.width+"px"}}}this.conf.tabsAreaOfs=null;this._fixTabsOfs();this.setSizes()};this.setAlign=function(m){m=(m=="left"?"left":"right");if(m==this.conf.align){this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";return}if(this.conf.transProp!==false){this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=""}this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="";this.conf.align=m;this.tabsArea.childNodes[1].childNodes[0].className="dhxtabbar_tabs_cont_"+this.conf.align+this.conf.tabsContCss;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";if(this.conf.transProp!==false){this.conf.transValuePos=this.conf.align+" "+this.conf.transSpeed;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=this.conf.transValuePos}};this._initObj=function(r){this.conf.initSeq=true;this.clearAll();var m=false;if(r.settings!=null){if(r.settings.skin!=null){this.setSkin(r.settings.skin)}if(r.settings.closeButton!=null){this.enableTabCloseButton(window.dhx4.s2b(r.settings.closeButton))}if(r.settings.align!=null){this.setAlign(r.settings.align)}if(r.settings.hrefmode=="ajax"){m=true}if(r.settings.hrefmode=="ajax-html"){m=true;this.conf.url_demand=true}}if(r.tabs!=null){for(var o=0;o<r.tabs.length;o++){var n=r.tabs[o];if(typeof(n.id)=="undefined"){n.id=window.dhx4.newId()}if(!isNaN(parseInt(n.width))){n.width=parseInt(n.width)}else{n.width=null}this.addTab(n.id,n.text||n.label||"",n.width,n.index,window.dhx4.s2b(n.selected)||window.dhx4.s2b(n.active),n.close);if(n.content!=null){this.cells(n.id).attachHTMLString(n.content)}else{if(n.href!=null){if(this.conf.url_demand==true){this.conf.urls[n.id]={href:n.href,ajax:m}}else{this.cells(n.id).attachURL(n.href,m)}}}if(typeof(n.enabled)!="undefined"&&window.dhx4.s2b(n.enabled)==false){this.tabs(n.id).disable()}else{if(typeof(n.disabled)!="undefined"&&window.dhx4.s2b(n.disabled)==true){this.tabs(n.id).disable()}}}}this.conf.initSeq=false;if(this.conf.arwMode=="auto"){this.setSizes()}if(this.conf.url_demand==true){this._loadURLOnDemand(this.conf.lastActive)}};this._xmlToObj=function(u){var s={settings:{},tabs:[]};var m=u.getElementsByTagName("tabbar")[0];if(m!=null){for(var v in {skin:1,align:1,closeButton:1,hrefmode:1}){if(m.getAttribute(v)!=null){s.settings[v]=m.getAttribute(v)}}var y=m.getElementsByTagName("tab");for(var n=0;n<y.length;n++){var o={text:(y[n].firstChild.nodeValue||"")};for(var v in {id:1,width:1,close:1,selected:1,active:1,enabled:1,disabled:1,href:1}){if(y[n].getAttribute(v)!=null){o[v]=y[n].getAttribute(v)}}var A=y[n].getElementsByTagName("content")[0];if(A!=null){o.content="";for(var x=0;x<A.childNodes.length;x++){o.content+=(A.childNodes[x].nodeValue||"")}}s.tabs.push(o)}}return s};dhx4._enableDataLoading(this,"_initObj","_xmlToObj","tabbar",{struct:true});var a=window.dhx4.transDetect();this.conf.transProp=a.transProp;this.conf.transEv=a.transEv;this.conf.transValueWidth="width "+this.conf.transSpeed;a=null;if(this.conf.transProp!==false){this.conf.transValuePos=this.conf.align+" "+this.conf.transSpeed;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=this.conf.transValuePos}this._callMainEvent=function(n,m){return this.callEvent(n,m)};window.dhx4._eventable(this);if(this.conf.autoload.json!=null){this.loadStruct(this.conf.autoload.json,this.conf.autoload.onload)}else{if(this.conf.autoload.xml!=null){this.loadStruct(this.conf.autoload.xml,this.conf.autoload.onload)}else{if(this.conf.autoload.tabs!=null){this.loadStruct({tabs:this.conf.autoload.tabs})}}}if(this.conf.autoload.arrows_mode!=null){this.setArrowsMode(this.conf.autoload.arrows_mode)}this._fixTabsOfs();this.setSizes();return this}dhtmlXTabBar.prototype=new dhtmlXCellTop();dhtmlXTabBar.prototype._fixTabsOfs=function(){this.conf.tabsOfs=(this.conf.skin=="dhx_web"?0:1)};dhtmlXTabBar.prototype.cells=dhtmlXTabBar.prototype.tabs=function(a){if(this.t[a]){return this.t[a].cell}return null};dhtmlXTabBar.prototype.getAllTabs=function(){var g=[];for(var c in this.t){g.push(c)}return g};dhtmlXTabBar.prototype._setTabActive=function(c,a){if(!this.t[c]||!this.t[c].conf.visible||this.t[c].conf.active){return}if(typeof(a)=="undefined"){a=true}if(a==true&&this.callEvent("onSelect",[c,this.conf.lastActive])!==true){return}this.setTabInActive();this.t[c].conf.active=true;if(this.conf.contZone){this.t[c].cell.cell.style.visibility="visible";this.t[c].cell.cell.style.top="0px";this.t[c].cell.cell.style.zIndex=1}this.t[c].tab.className=this._tabCss(c);this.conf.lastActive=c;this.setSizes();if(this.conf.url_demand==true){this._loadURLOnDemand(c)}};dhtmlXTabBar.prototype.setTabInActive=function(){if(this.conf.lastActive&&this.t[this.conf.lastActive]){this.t[this.conf.lastActive].conf.active=false;if(this.conf.contZone){this.t[this.conf.lastActive].cell.cell.style.visibility="hidden";this.t[this.conf.lastActive].cell.cell.style.top="-5000px";this.t[this.conf.lastActive].cell.cell.style.zIndex=0}this.t[this.conf.lastActive].tab.className=this._tabCss(this.conf.lastActive);this.conf.lastActive=null}};dhtmlXTabBar.prototype._isTabActive=function(a){return(a==this.conf.lastActive&&this.conf.lastActive!=null)};dhtmlXTabBar.prototype.getActiveTab=function(){return this.conf.lastActive};dhtmlXTabBar.prototype.goToNextTab=function(){var a=this._getNextVisible(this.conf.lastActive,true);if(a!=null){this._setTabActive(a)}};dhtmlXTabBar.prototype.goToPrevTab=function(){var a=this._getPrevVisible(this.conf.lastActive,true);if(a!=null){this._setTabActive(a)}};dhtmlXTabBar.prototype._enableTab=function(c,a){if(!this.t[c]||this.t[c].conf.enabled){return}this.t[c].conf.enabled=true;this.t[c].tab.className=this._tabCss(c);if(a==true){this._setTabActive(c)}};dhtmlXTabBar.prototype._disableTab=function(c,a){if(!this.t[c]||!this.t[c].conf.enabled){return}this.t[c].conf.enabled=false;this.t[c].tab.className=this._tabCss(c);if(a!==false&&this.conf.lastActive==c){if(a==true){a=this._getNextVisible(c)||this._getPrevVisible(c)}this._setTabActive(a)}};dhtmlXTabBar.prototype._isTabEnabled=function(a){return(this.t[a]!=null&&this.t[a].conf.enabled==true)};dhtmlXTabBar.prototype._setTabText=function(j,g,c){if(!this.t[j]){return}var a=false;if(typeof(c)=="undefined"||c==null){c=this._getLabelWidth(g,this.t[j].conf.close);a=true}this.t[j].tab.style.width=c+"px";this.t[j].tab.childNodes[0].innerHTML=g;this.t[j].conf.text=g;this.t[j].conf.width=c;this.t[j].conf.autowidth=a};dhtmlXTabBar.prototype._getTabText=function(a){if(!this.t[a]){return null}return this.t[a].conf.text};dhtmlXTabBar.prototype._removeTab=function(o,g,m){if(!this.t[o]){return}if(m!=true&&this.t[o].conf.remove!=true){this.t[o].conf.remove=true;this._hideTab(o,g);return}if(typeof(g)=="undefined"){g=true}var j=this._getNextVisible(o);var l=this._getPrevVisible(o);if(this.t[o].conf.transEv==true){this.t[o].tab.removeEventListener(this.conf.transEv,this._doOnTrEnd);this.t[o].conf.transEv=false}for(var c in this.t[o].conf){this.t[o].conf[c]=null}this.t[o].conf=null;delete this.t[o].conf;this.t[o].cell._unload();this.t[o].cell=null;this.t[o].tab.parentNode.removeChild(this.t[o].tab);this.t[o].tab=null;this.t[o]=null;delete this.t[o];if(this.conf.lastActive==o&&g!=false){this.conf.lastActive=null;var n=(g==true?(j||l||this._getFirstVisible()):g);if(n!=null){this._setTabActive(n)}}else{if(m!=true){this._adjustTabs()}}};dhtmlXTabBar.prototype.clearAll=function(){for(var c in this.t){this._removeTab(c,false,true)}this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px"};dhtmlXTabBar.prototype.moveTab=function(g,a){if(!this.t[g]||a<0){return}a+=1;var c=this.tabsArea.childNodes[1].firstChild;if(c.childNodes[a]!=this.t[g].tab){c.removeChild(this.t[g].tab);if(a>=c.childNodes.length){c.appendChild(this.t[g].tab)}else{c.insertBefore(this.t[g].tab,c.childNodes[a])}}c=null};dhtmlXTabBar.prototype._getIndex=function(j){var a=-1;var g=this.tabsArea.childNodes[1].firstChild;for(var c=1;c<g.childNodes.length;c++){if(g.childNodes[c]._tabId==j){a=c-1}}g=null;return a};dhtmlXTabBar.prototype.getNumberOfTabs=function(j){var g=0;for(var c in this.t){g+=(j!=true?1:(this.t[c].conf.visible==true?1:0))}return g};dhtmlXTabBar.prototype.forEachCell=dhtmlXTabBar.prototype.forEachTab=function(g){for(var c in this.t){g.apply(window,[this.t[c].cell])}};dhtmlXTabBar.prototype.enableAutoReSize=function(){this._initFSResize()};dhtmlXTabBar.prototype.setArrowsMode=function(a){a={auto:"auto",always:"always"}[String(a)];if(a==null||a==this.conf.mode){return}this.conf.arwMode=a;if(a=="always"){this.tabsArea.childNodes[0].className="dhxtabbar_tabs_ar_left";this.tabsArea.childNodes[2].className="dhxtabbar_tabs_ar_right"}this.setSizes()};dhtmlXTabBar.prototype._checkArrows=function(){var l=false;if(this.conf.arwMode=="auto"){var j=0;for(var g in this.t){j+=this.t[g].tab.offsetWidth}var c=this.tabsArea.childNodes[0];var m=this.tabsArea.childNodes[2];if(j>this.cont.offsetWidth){if(c.className.search(/dhxtabbar_tabs_ar_hidden/)>=0){c.className=c.className.replace(/\s{0,}dhxtabbar_tabs_ar_hidden/,"");m.className=m.className.replace(/\s{0,}dhxtabbar_tabs_ar_hidden/,"");l=true}}else{if(c.className.search(/dhxtabbar_tabs_ar_hidden/)<1){c.className+=" dhxtabbar_tabs_ar_hidden";m.className+=" dhxtabbar_tabs_ar_hidden";l=true}}c=m=null}return l};dhtmlXTabBar.prototype._loadURLOnDemand=function(a){if(a!=null&&this.conf.urls[a]!=null){this.cells(a).attachURL(this.conf.urls[a].href,this.conf.urls[a].ajax);this.conf.urls[a]=null}};window.dhtmlXTabBarCell=function(j,g){dhtmlXCellObject.apply(this,[j,"_tabbar"]);this.tabbar=g;this.conf.skin=this.tabbar.conf.skin;this.conf.tabbar_funcs={show:"_showTab",hide:"_hideTab",isVisible:"_isTabVisible",enable:"_enableTab",disable:"_disableTab",isEnabled:"_isTabEnabled",getIndex:"_getIndex",getText:"_getTabText",setText:"_setTabText",setActive:"_setTabActive",isActive:"_isTabActive",close:"_removeTab"};this._tabbarCall=function(a){return function(){var l=[this._idd];for(var m=0;m<arguments.length;m++){l.push(arguments[m])}return this.tabbar[a].apply(this.tabbar,l)}};for(var c in this.conf.tabbar_funcs){this[c]=this._tabbarCall(this.conf.tabbar_funcs[c])}this.attachEvent("_onCellUnload",function(){this.tabbar=null;for(var l in this.conf.tabbar_funcs){this[l]=null;this.conf.tabbar_funcs[l]=null}this.conf.tabbar_funcs=null});this.attachEvent("_onContentLoaded",function(){this.tabbar._callMainEvent("onContentLoaded",arguments);this.tabbar._callMainEvent("onTabContentLoaded",arguments)});this.attachEvent("_onContentAttach",function(){this.tabbar._adjustCell(this.tabbar.conf.lastActive)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="sidebar"){this._hideBorders()}})};window.dhtmlXTabBarCell.prototype=new dhtmlXCellObject();dhtmlXCellObject.prototype.attachTabbar=function(a){this.callEvent("_onBeforeContentAttach",["tabbar"]);if(typeof(a)=="string"){a={mode:a}}else{if(typeof(a)!="object"||a==null){a={}}}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:-1}}this._attachObject(c);a.skin=this.conf.skin;a.parent=c;this.dataType="tabbar";this.dataObj=new dhtmlXTabBar(a);a.parent=c=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXTabBarInitFromHTML(){var z=document.getElementsByTagName("div");for(var i=0;i<z.length;i++){if(z[i].className.indexOf("dhtmlxTabBar")!=-1){var conf={settings:{},tabs:[]};var n=z[i];var id=n.id;n.className="";var k=new Array();for(var j=0;j<n.childNodes.length;j++){if(n.childNodes[j].tagName&&n.childNodes[j].tagName!="!"){k[k.length]=n.childNodes[j]}}var skin=n.getAttribute("skin");if(skin!=null){conf.settings.skin=skin}var w=new dhtmlXTabBar({parent:id,mode:n.getAttribute("mode")});window[id]=w;acs=n.getAttribute("onbeforeinit");if(acs){eval(acs)}align=n.getAttribute("align");if(align){conf.settings.align=align}var cont={};for(var j=0;j<k.length;j++){var m=k[j];var tab={id:m.id,text:m.getAttribute("name"),width:m.getAttribute("width"),selected:m.getAttribute("selected"),active:m.getAttribute("active"),close:m.getAttribute("close")};var href=m.getAttribute("href");if(href){cont[m.id]={href:href}}else{cont[m.id]={cont:m}}conf.tabs.push(tab)}w.loadStruct(conf);for(var a in cont){if(cont[a].href){w.cells(a).attachURL(cont[a].href);cont[a].href=null}else{w.cells(a).attachObject(cont[a].cont);if(cont[a].cont.style.display=="none"){cont[a].cont.style.display=""}cont[a].cont=null}cont[a]=null}var selId=n.getAttribute("select");if(selId!=null){w.tabs(selId).setActive()}else{if(w.getActiveTab()==null){var v=w._getFirstVisible();if(v!=null){w.cells(v).setActive()}}}acs=n.getAttribute("oninit");if(acs){eval(acs)}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXTabBarInitFromHTML,false)}else{window.detachEvent("onload",dhtmlXTabBarInitFromHTML)}}if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXTabBarInitFromHTML,false)}else{window.attachEvent("onload",dhtmlXTabBarInitFromHTML)}function dhtmlXSideBar(c){var g=this;this.conf={skin:(c.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxsidebar")||"dhx_skyblue"),css:"dhxsidebar",width:c.width||200,scroll_size:12,scroll_mult:20,close_button:false,icons_path:c.icons_path||"",selected:null};this.setTemplate(c.template);window.dhtmlXCellTop.apply(this,[c.parent,(c==null?null:c.offsets)]);window.dhx4._eventable(this);if(window.navigator.msPointerEnabled==true){this.conf.touch_ms=true;this.conf.touch_start="MSPointerDown",this.conf.touch_end="MSPointerUp"}else{this.conf.touch_ms=false;this.conf.touch_start="touchstart",this.conf.touch_end="touchend"}this.side=document.createElement("DIV");this.side.className="dhxsidebar_side dhxsidebar_tpl_"+this.conf.tpl_name;this.side.innerHTML="<div class='dhxsidebar_side_items'></div>";this.cont.appendChild(this.side);window.setTimeout(function(){if(g!=null&&g.side!=null){g.side.firstChild.style.top="0px"}},1);this.arw=document.createElement("DIV");this.arw.className="dhxsidebar_arrows dhxsidebar_arrows_hidden";this.arw.innerHTML="<div class='dhxsidebar_arrow dhxsidebar_arrow_left'><div class='dhxsidebar_arrow_image'></div></div><div class='dhxsidebar_arrow dhxsidebar_arrow_right'><div class='dhxsidebar_arrow_image'></div></div>";this.cont.appendChild(this.arw);this._doOnArwClick=function(l){l=l||event;if(l.type!="click"&&l.preventDefault){l.preventDefault()}var j=l.target||l.srcElement;if(j.className.match(/dhxsidebar_arrow_image/)!=null){j=j.parentNode}if(j.className.match(/dhxsidebar_arrow_left/)!=null){g._scrollSide(-g.conf.scroll_size)}else{if(j.className.match(/dhxsidebar_arrow_right/)!=null){g._scrollSide(g.conf.scroll_size)}}j=null};if(typeof(window.addEventListener)=="function"){this.arw.addEventListener(this.conf.touch_start,this._doOnArwClick,false);this.arw.addEventListener("click",this._doOnArwClick,false)}else{this.arw.attachEvent("onclick",this._doOnArwClick)}this._doOnSideClick=function(l){l=l||event;var j=l.target||l.srcElement;var m=null;if(l.type=="touchstart"||l.type=="pointerdown"||l.type=="MSPointerDown"){if(l.preventDefault){l.preventDefault()}if(this.className.match(/dhxsidebar_touch/gi)==null){if(l.type=="touchstart"||(l.type=="pointerdown"&&l.pointerType=="touch")){this.className+=" dhxsidebar_touch"}}}while(j!=null&&m==null&&l.type!="pointerdown"&&l.type!="MSPointerDown"){if(typeof(j.className)!="undefined"&&j.className.match(/^dhxsidebar_item/)!=null&&typeof(j._idd)!="undefined"){m=j._idd}else{j=j.parentNode}}if(m!=null){g._setItemActive(m,true)}j=null};if(typeof(window.addEventListener)=="function"){this.side.addEventListener(this.conf.touch_start,this._doOnSideClick,false);this.side.addEventListener(this.conf.touch_end,this._doOnSideClick,false);this.side.addEventListener("mouseup",this._doOnSideClick,false)}else{this.side.attachEvent("onclick",this._doOnSideClick)}this.side.onmouseover=function(){this.className=this.className.replace(/\s*dhxsidebar_touch/gi,"")};this._doOnSideScroll=function(j){j=j||event;var l=(j.type=="mousewheel"?-j.wheelDelta:j.deltaY);g._scrollSide(l/Math.abs(l)*3)};this._scrollSide=function(j){var l=parseInt(this.side.firstChild.style.top||0)-j*this.conf.scroll_mult;if(l+this.side.firstChild.offsetHeight<this.side.clientHeight){l=this.side.clientHeight-this.side.firstChild.offsetHeight}if(l>0){l=0}this.side.firstChild.style.top=l+"px"};if(typeof(window.addEventListener)=="function"){this.side.addEventListener("wheel",this._doOnSideScroll,false)}else{this.side.attachEvent("onmousewheel",this._doOnSideScroll)}this.t={};this.s={};this._adjustCell=function(o){if(o==null){return}var j=this.conf.width;var l=this.cont.offsetWidth-j;var n=0;var m=this.cont.offsetHeight;if(o!=this.conf.selected){n=-5000;this.t[o].cell.cell.style.visibility="hidden";this.t[o].cell.cell.style.zIndex=0}this.t[o].cell._setSize(j,n,l,m)};var a=window.dhx4.transDetect();this.conf.transProp=a.transProp;this.conf.transEv=a.transEv;this.conf.transValue="all 0.1s";this._doOnTrEnd=function(l){var n=this._idd;if(g.t[n]==null){return}var j=g.t[n];var m=j.conf.transActvId;if(j.conf.transMode=="hide"){if(j.conf.remove==true){g._removeItem(n)}else{j.item.style[j.conf.transProp]="";j.cell.cell.style.visibility="hidden";j.cell.cell.style.top="-5000px";j.conf.transActv=false}}else{if(j.conf.transMode=="show"){j.item.style[j.conf.transProp]="";j.item.style.visibility="visible";j.conf.transMode=null;j.conf.transActv=false}}if(m!=null){g._setItemActive(m)}else{g._checkHeight()}j=null};this._initObj=function(j){this.clearAll();if(j.items!=null){this.addItem(j.items)}};this._xmlToObj=function(u){var l=[];var o=u.getElementsByTagName("sidebar");if(o!=null&&o[0]!=null){var m=o[0].getElementsByTagName("item");for(var s=0;s<m.length;s++){var n={};for(var j=0;j<m[s].attributes.length;j++){n[m[s].attributes[j].nodeName]=m[s].attributes[j].nodeValue}l.push(n)}}return{items:l}};dhx4._enableDataLoading(this,"_initObj","_xmlToObj","sidebar",{struct:true});this.unload=function(){this.conf.unloading=true;if(typeof(window.addEventListener)=="function"){this.side.removeEventListener("wheel",this._doOnSideScroll,false)}else{this.side.detachEvent("onmousewheel",this._doOnSideScroll)}this.clearAll();this.s=this.t=null;if(typeof(window.addEventListener)=="function"){this.arw.removeEventListener(this.conf.touch_start,this._doOnArwClick,false);this.arw.removeEventListener("click",this._doOnArwClick,false)}else{this.arw.detachEvent("onclick",this._doOnArwClick)}this.arw.parentNode.removeChild(this.arw);this.arw=null;if(typeof(window.addEventListener)=="function"){this.side.removeEventListener(this.conf.touch_start,this._doOnSideClick,false);this.side.removeEventListener(this.conf.touch_end,this._doOnSideClick,false);this.side.removeEventListener("click",this._doOnSideClick,false)}else{this.side.detachEvent("onclick",this._doOnSideClick)}this.side.onmouseover=null;this.side.parentNode.removeChild(this.side);this.side=null;this._unloadTop();window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");g=null};this.setSizes();if(c.items!=null){this._initObj(c)}else{if(c.json!=null){this.loadStruct(c.json,c.onload)}else{if(c.xml!=null){this.loadStruct(c.xml,c.onload)}}}return this}dhtmlXSideBar.prototype=new dhtmlXCellTop();dhtmlXSideBar.prototype._addItem=function(c){var j=(typeof(c.id)!="undefined"?c.id:window.dhx4.newId());if(c.type=="separator"){var g=document.createElement("DIV");g.className="dhxsidebar_sep";this.side.firstChild.appendChild(g);this.s[j]={sep:g};g=null;return}c.icons_path=this.conf.icons_path;var g=document.createElement("DIV");g.className="dhxsidebar_item";g.innerHTML=window.dhx4.template(this.conf.tpl_str,c);g._idd=j;this.side.firstChild.appendChild(g);g.ondragstart=function(){return false};var a=new dhtmlXSideBarCell(j,this);this.cont.appendChild(a.cell);this.t[j]={item:g,cell:a,init:c,conf:{selected:false,visible:true,close:close}};g=null;if(window.dhx4.s2b(c.selected)==true){this._setItemActive(j)}else{this._adjustCell(j)}this._checkHeight()};dhtmlXSideBar.prototype.addItem=function(a){if(!(a instanceof Array)){a=[a]}for(var c=0;c<a.length;c++){this._addItem(a[c])}};dhtmlXSideBar.prototype.items=dhtmlXSideBar.prototype.cells=function(a){if(this.t[a]!=null){return this.t[a].cell}return null};dhtmlXSideBar.prototype.forEachCell=dhtmlXSideBar.prototype.forEachItem=function(g){for(var c in this.t){if(typeof(g)=="function"){g.apply(window,[this.t[c].cell])}else{if(typeof(g)=="string"&&typeof(window[g])=="function"){window[g].apply(window,[this.t[c].cell])}}}};dhtmlXSideBar.prototype.getAllItems=function(){var g=[];for(var c in this.t){g.push(c)}return g};dhtmlXSideBar.prototype.getNumberOfItems=function(){return this.getAllItems().length};dhtmlXSideBar.prototype.clearAll=function(){for(var c in this.t){this._removeItem(c,false,true)}for(var c in this.s){this.removeSep(c)}};dhtmlXSideBar.prototype.setSizes=function(){this._adjustCont();this._adjustSide();this._checkHeight();this._adjustCell(this.conf.selected);this.callEvent("_onSetSizes",[])};dhtmlXSideBar.prototype.setSideWidth=function(a){this.conf.width=a;this.setSizes()};dhtmlXSideBar.prototype._adjustSide=function(){if(this.conf.side_ofs==null){this.conf.side_ofs={};this.side.style.width=this.conf.width+"px";this.side.style.height=this.cont.offsetHeight+"px";this.conf.side_ofs.w=this.side.offsetWidth-parseInt(this.side.style.width);this.conf.side_ofs.h=this.side.offsetHeight-parseInt(this.side.style.height)}this.side.style.width=this.conf.width-this.conf.side_ofs.w+"px";this.side.style.height=this.cont.offsetHeight-this.arw.offsetHeight-this.conf.side_ofs.h+"px";this.arw.style.width=this.side.style.width;this._scrollSide(0)};dhtmlXSideBar.prototype._checkHeight=function(){var a=(this.arw.className.match(/dhxsidebar_arrows_hidden/)!=null);if(this.conf.side_hfix==null){this.conf.side_hfix=this.side.offsetHeight-this.side.clientHeight}if(this.side.firstChild.offsetHeight>this.cont.clientHeight-this.conf.side_hfix){if(a==true){this.arw.className="dhxsidebar_arrows";this._adjustSide()}}else{if(a==false){this.arw.className="dhxsidebar_arrows dhxsidebar_arrows_hidden";this.side.firstChild.style.top="0px";this._adjustSide()}}};dhtmlXSideBar.prototype.removeSep=function(c){if(this.s[c]==null){return}this.side.firstChild.removeChild(this.s[c].sep);this.s[c].sep=null;this.s[c]=null;try{delete this.s[c]}catch(a){}};dhtmlXSideBar.prototype._setItemActive=function(g,c){if(this.conf.selected==g){return}if(typeof(c)=="undefined"){c=false}if(c==true&&this.callEvent("onBeforeSelect",[g,this.conf.selected])!==true){return}var a=null;if(this.conf.selected!=null){a=this.conf.selected;this._setItemInactive(this.conf.selected)}if(this.t[g]!=null){this.conf.selected=g;this.t[g].selected=true;this.t[g].item.className+=" dhxsidebar_item_selected";this.t[g].cell.cell.style.visibility="visible";this.t[g].cell.cell.style.top="0px";this.t[g].cell.cell.style.zIndex=1}else{this.conf.selected=null}this._adjustCell(g);if(c==true){this.callEvent("onSelect",[g,a])}};dhtmlXSideBar.prototype._setItemInactive=function(a){if(this.t[a]==null){return}this.t[a].selected=false;this.t[a].item.className=this.t[a].item.className.replace(/\s{0,}dhxsidebar_item_selected/gi,"");this.t[a].cell.cell.style.visibility="hidden";this.t[a].cell.cell.style.top="-5000px";this.t[a].cell.cell.style.zIndex=0};dhtmlXSideBar.prototype._isItemActive=function(a){return(this.conf.selected==a)};dhtmlXSideBar.prototype._getNextVisible=function(c,a){return this._getNearVisible(c,a,"next")};dhtmlXSideBar.prototype._getPrevVisible=function(c,a){return this._getNearVisible(c,a,"previous")};dhtmlXSideBar.prototype._getFirstVisible=function(){return this._getNearVisible(null,false,"first")};dhtmlXSideBar.prototype._getNearVisible=function(m,c,l){if(l=="first"){var g=this.side.firstChild.firstChild;l="next"}else{if(m==null||this.t[m]==null){return(c?this._getFirstVisible():null)}var g=this.t[m].item[l+"Sibling"]}var j=null;while(g!=null&&j==null){var a=g._idd;if(a!=null&&j==null&&this.t[a].conf.visible){j=a}else{g=g[l+"Sibling"]}}g=null;return j};dhtmlXSideBar.prototype.goToNextItem=function(a){var c=this._getNextVisible(this.conf.selected,true);if(c!=null){this._setItemActive(c,a)}};dhtmlXSideBar.prototype.goToPrevItem=function(a){var c=this._getPrevVisible(this.conf.selected,true);if(c!=null){this._setItemActive(c,a)}};dhtmlXSideBar.prototype.getActiveItem=function(){return this.conf.selected};dhtmlXSideBar.prototype.setTemplate=function(j,c){this.conf.tpl_name=(j!=null&&this.templates[j]!=null?j:"details");this.conf.tpl_str=this.templates[this.conf.tpl_name];if(c!=null){this.conf.icons_path=c}for(var g in this.t){this.t[g].init.icons_path=this.conf.icons_path;this.t[g].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[g].init)}if(this.side!=null){this.side.className="dhxsidebar_side dhxsidebar_tpl_"+this.conf.tpl_name}if(this._scrollSide!=null){this._scrollSide(0);this._checkHeight()}};dhtmlXSideBar.prototype.templates={details:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'><div class='dhxsidebar_item_text'>#text#</div>",tiles:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'><div class='dhxsidebar_item_text'>#text#</div>",icons:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'>",icons_text:"<div class='dhxsidebar_item_icon'><img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'></div><div class='dhxsidebar_item_text'>#text#</div>",text:"<div class='dhxsidebar_item_text'>#text#</div>"};window.dhtmlXSideBarCell=function(j,g){dhtmlXCellObject.apply(this,[j,"_sidebar"]);this.sidebar=g;this.conf.skin=this.sidebar.conf.skin;this.conf.sidebar_funcs={show:"_showItem",hide:"_hideItem",isVisible:"_isItemVisible",setActive:"_setItemActive",isActive:"_isItemActive",setText:"_setItemText",getText:"_getItemText",remove:"_removeItem"};this._sidebarCall=function(a){return function(){var l=[this._idd];for(var m=0;m<arguments.length;m++){l.push(arguments[m])}return this.sidebar[a].apply(this.sidebar,l)}};for(var c in this.conf.sidebar_funcs){this[c]=this._sidebarCall(this.conf.sidebar_funcs[c])}this.attachEvent("_onCellUnload",function(){this.sidebar=null;for(var l in this.conf.sidebar_funcs){this[l]=this.conf.sidebar_funcs[l]=null}this.conf.sidebar_funcs=null});this.attachEvent("_onContentLoaded",function(){this.sidebar.callEvent("onContentLoaded",arguments)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="tabbar"||a=="layout"||a=="acc"||a=="sidebar"){this._hideBorders()}if((this.conf.skin=="dhx_web"||this.conf.skin=="dhx_terrace")&&(a=="menu"||a=="toolbar"||a=="ribbon")){if(this.cell.className.match(/dhx_cell_cont_no_top/gi)==null){this.cell.className+=" dhx_cell_cont_no_top"}}})};dhtmlXSideBarCell.prototype=new dhtmlXCellObject();dhtmlXSideBar.prototype._setItemText=function(j,g){if(this.t[j]!=null){for(var c in g){this.t[j].init[c]=g[c]}this.t[j].init.icons_path=this.conf.icons_path;this.t[j].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[j].init)}};dhtmlXSideBar.prototype._getItemText=function(j){var g={};if(this.t[j]!=null){for(var c in this.t[j].init){g[c]=this.t[j].init[c]}}return g};dhtmlXSideBar.prototype._removeItem=function(o,n,l){if(this.t[o]==null){return}if(l!=true&&this.t[o].conf.remove!=true){this.t[o].conf.remove=true;this._hideItem(o,n);return}if(typeof(n)=="undefined"){n=true}var g=this._getNextVisible(o);var j=this._getPrevVisible(o);if(this.t[o].conf.transEv==true){this.t[o].item.removeEventListener(this.conf.transEv,this._doOnTrEnd);this.t[o].conf.transEv=false}this.t[o].cell._unload();this.t[o].cell=null;this.t[o].item.parentNode.removeChild(this.t[o].item);this.t[o].item=null;for(var c in this.t[o]){this.t[o][c]=null}this.t[o]=null;try{delete this.t[o]}catch(m){}if(this.conf.selected==o&&n!=false){this.conf.selected=null;var n=(n==true?(g||j||this._getFirstVisible()):n);if(n!=null){this._setItemActive(n)}}else{if(l!=true){this._checkHeight()}}};dhtmlXSideBar.prototype._showItem=function(c,a){if(this.t[c]==null||this.t[c].conf.visible==true||this.t[c].conf.transActv==true){return}if(this.conf.transProp!==false){this.t[c].conf.transActv=true;this.t[c].conf.transMode="show";this.t[c].conf.transProp=this.conf.transProp;this.t[c].conf.transActvId=(a?c:null);if(this.t[c].conf.transEv!=true){this.t[c].item.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[c].conf.transEv=true}this.t[c].conf.visible=true;this.t[c].item.style[this.conf.transProp]=this.conf.transValue;this.t[c].item.className="dhxsidebar_item"}else{this.t[c].conf.visible=true;this.t[c].item.style.display="";if(a==true){this._setItemActive(c)}else{this._checkHeight()}}};dhtmlXSideBar.prototype._hideItem=function(l,j){if(this.t[l]==null||this.t[l].conf.visible!=true||this.t[l].conf.transActv==true){return}var g=false;if(this.conf.selected==l){this.conf.selected=null;this.t[l].conf.active=false;this.t[l].item.className="dhxsidebar_item";g=true}var c=this._getPrevVisible(l);var a=this._getNextVisible(l);var j=(g&&j!==false?(j==true?null:j)||a||c:null);if(this.conf.transProp!==false){this.t[l].conf.transActv=true;this.t[l].conf.transMode="hide";this.t[l].conf.transProp=this.conf.transProp;this.t[l].conf.transActvId=j;this.t[l].conf.visible=false;if(this.t[l].conf.transEv!=true){this.t[l].item.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[l].conf.transEv=true}this.t[l].item.style[this.conf.transProp]=this.conf.transValue;this.t[l].item.className="dhxsidebar_item dhxsidebar_item_hidden"}else{this.t[l].item.style.display="none";this.t[l].conf.visible=false;this.t[l].cell.cell.style.visibility="hidden";this.t[l].cell.cell.style.top="-5000px";if(j!=null){this._setItemActive(j)}this._checkHeight();if(this.t[l].conf.remove==true){this._removeItem(l)}}};dhtmlXSideBar.prototype._isItemVisible=function(a){return(this.t[a].conf.visible==true)};dhtmlXCellObject.prototype.attachSidebar=function(a){this.callEvent("_onBeforeContentAttach",["sidebar"]);if(a==null){a={}}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof window.dhtmlXWindowsCell)){}else{if(this.conf.skin=="dhx_skyblue"){c._ofs={t:-1,r:-1,b:-1,l:-1}}if(this.conf.skin=="dhx_web"){if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:8}}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&(this instanceof window.dhtmlXLayoutCell)){c._ofs={t:2}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){c._ofs={t:8}}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:2}}}if(this.conf.skin=="dhx_terrace"){if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:-1}}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&(this instanceof window.dhtmlXLayoutCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1,r:-1,b:-1,l:-1}}}}this._attachObject(c);a.skin=this.conf.skin;a.parent=c;this.dataType="sidebar";this.dataObj=new dhtmlXSideBar(a);a.parent=c=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXWindows(o){var m=this;var j={};if(typeof(o)!="undefined"){for(var g in o){j[g]=o[g]}}o=null;this.conf={skin:window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxwins")||"dhx_skyblue",vp_pos_ofs:20,vp_custom:false,ofs_w:null,ofs_h:null,button_last:null,dblclick_tm:300,dblclick_last:null,dblclick_id:null,dblclick_mode:"minmax",dblclick_active:false,dblclick_ev:(navigator.userAgent.indexOf("MSIE 6.0")>=0||navigator.userAgent.indexOf("MSIE 7.0")>=0||navigator.userAgent.indexOf("MSIE 8.0")>=0),fr_cover:(navigator.userAgent.indexOf("MSIE 6.0")>=0)};var c=window.dhx4.transDetect();this.conf.tr={prop:c.transProp,ev:c.transEv,height_open:"height 0.2s cubic-bezier(0.25,0.1,0.25,1)",height_close:"height 0.18s cubic-bezier(0.25,0.1,0.25,1)",op_open:"opacity 0.16s ease-in",op_close:"opacity 0.2s ease-out",op_v_open:"1",op_v_close:"0.4"};if(!j.viewport){this.attachViewportTo(document.body)}else{if(j.viewport.object!=null){this.attachViewportTo(j.viewport.object)}else{if(j.viewport.left!=null&&j.viewport.top!=null&&j.viewport.width!=null&&j.viewport.height!=null){this.setViewport(j.viewport.left,j.viewport.top,j.viewport.width,j.viewport.height,j.viewport.parent)}else{this.attachViewportTo(document.body)}}}this.w={};this.createWindow=function(s,H,E,u,J){var q={};if(arguments.length==1&&typeof(s)=="object"){q=s}else{q.id=s;q.left=H;q.top=E;q.width=u;q.height=J;if(typeof(q.id)=="undefined"||q.id==null){q.id=window.dhx4.newId()}while(this.w[q.id]!=null){q.id=window.dhx4.newId()}}if(q.left==null){q.left=0}if(q.top==null){q.top=0}q.move=(q.move!=null&&window.dhx4.s2b(q.move)==false?false:(q.deny_move!=null&&window.dhx4.s2b(q.deny_move)==true?false:true));q.park=(q.park!=null&&window.dhx4.s2b(q.park)==false?false:(q.deny_park!=null&&window.dhx4.s2b(q.deny_park)==true?false:true));q.resize=(q.resize!=null&&window.dhx4.s2b(q.resize)==false?false:(q.deny_resize!=null&&window.dhx4.s2b(q.deny_resize)==true?false:true));q.keep_in_viewport=(q.keep_in_viewport!=null&&window.dhx4.s2b(q.keep_in_viewport));q.modal=(q.modal!=null&&window.dhx4.s2b(q.modal));q.center=(q.center!=null&&window.dhx4.s2b(q.center));q.text=(q.text!=null?q.text:(q.caption!=null?q.caption:"dhtmlxWindow"));q.header=(!(q.header!=null&&window.dhx4.s2b(q.header)==false));var K=document.createElement("DIV");K.className="dhxwin_active";this.vp.appendChild(K);K._isWindow=true;K._idd=q.id;var A=document.createElement("DIV");A.className="dhxwin_hdr";A.style.zIndex=0;A.innerHTML="<div class='dhxwin_icon'></div><div class='dhxwin_text'><div class='dhxwin_text_inside'>"+q.text+"</div></div><div class='dhxwin_btns'></div>";K.appendChild(A);A.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};A.oncontextmenu=function(a){a=a||event;a.cancelBubble=true;return false};A._isWinHdr=true;A.firstChild._isWinIcon=true;var v=document.createElement("DIV");v.className="dhxwin_brd";K.appendChild(v);var D=document.createElement("DIV");D.className="dhxwin_fr_cover";D.innerHTML="<iframe class='dhxwin_fr_cover_inner' frameborder='0' border='0'></iframe><div class='dhxwin_fr_cover_inner'></div>";K.appendChild(D);this.w[q.id]={win:K,hdr:A,brd:v,fr_cover:D,b:{},conf:{z_id:window.dhx4.newId(),actv:false,modal:false,maxed:false,parked:false,sticked:false,visible:true,header:true,text:q.text,keep_in_vp:q.keep_in_viewport,allow_move:q.move,allow_park:q.park,allow_resize:q.resize,max_w:null,max_h:null,min_w:80,min_h:80}};var w={help:{title:"Help",visible:false},stick:{title:"Stick",visible:false},park:{title:"Park",visible:true},minmax:{title:"Min/Max",visible:true},close:{title:"Close",visible:true}};for(var F in w){var C=new dhtmlXWindowsButton(this,q.id,F,w[F].title,false);if(w[F].visible==false){C.hide()}A.lastChild.appendChild(C.button);this.w[q.id].b[F]=C;C=null}this._winAdjustTitle(q.id);this.w[q.id].win.style.zIndex=window.dhx4.zim.reserve(this.w[q.id].conf.z_id);var I=new dhtmlXWindowsCell(q.id,this);this.w[q.id].win.insertBefore(I.cell,D);this.w[q.id].cell=I;if(typeof(window.addEventListener)=="function"){this.w[q.id].win.addEventListener("mousedown",this._winOnMouseDown,false);this.w[q.id].win.addEventListener("mouseup",this._winOnMouseDown,false);if(this.conf.dblclick_ev){this.w[q.id].win.addEventListener("dblclick",this._winOnMouseDown,false)}if(this.conf.dnd_evs!=null){this.w[q.id].win.addEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);if(window.navigator.msPointerEnabled!=true){this.w[q.id].win.addEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);this.w[q.id].win.addEventListener(this.conf.dnd_evs.end,this._winOnMouseDown,false)}}}else{this.w[q.id].win.attachEvent("onmousedown",this._winOnMouseDown);this.w[q.id].win.attachEvent("onmouseup",this._winOnMouseDown);if(this.conf.dblclick_ev){this.w[q.id].win.attachEvent("ondblclick",this._winOnMouseDown)}}this._winInitFRM(q.id);this._winSetPosition(q.id,q.left,q.top);this._winSetSize(q.id,q.width,q.height);this._winMakeActive(q.id);if(q.center==true){this.w[q.id].cell.center()}if(q.modal==true){this.w[q.id].cell.setModal(true)}if(q.header==false){this.w[q.id].cell.hideHeader()}f=K=A=v=D=I=null;return this.w[q.id].cell};this._winOnMouseDown=function(r){r=r||event;var a=r.target||r.srcElement;var q={press_type:r.type};if(r.type=="MSPointerDown"){m.conf.ev_skip=true}else{if(m.conf.ev_skip==true){m.conf.ev_skip=false;a=null;return}}while(a!=null&&a._isWindow!=true){if(typeof(a.className)!="undefined"&&q.mode==null){if(typeof(a._buttonName)!="undefined"){q.mode="button";q.button_name=a._buttonName}else{if(a._isWinHdr==true){q.mode="hdr"}else{if(a._isWinIcon==true){q.mode="icon"}}}}a=a.parentNode}if(q.mode==null){q.mode="win"}q.id=(a!=null&&a._isWindow==true?a._idd:null);a=null;if(q.id!=null){m.callEvent("_winMouseDown",[r,q])}};this._winOnParkTrans=function(q){if(q.stopPropagation){q.stopPropagation()}var a=m.w[this._idd];if(q.propertyName=="opacity"){m._winCellClearOpacity(this._idd)}if(q.propertyName=="height"&&a.conf.tr_mode=="park"){if(a.conf.tr_mode=="park"){a.win.style[m.conf.tr.prop]="";if(!a.conf.parked){m._winAdjustCell(this._idd);m._callMainEvent("onParkDown",this._idd);if(a.conf.keep_in_vp){m._winAdjustPosition(this._idd,a.conf.x,a.conf.y)}}else{a.hdr.style.zIndex=3;m._callMainEvent("onParkUp",this._idd)}}}a=null};this.unload=function(){this.conf.unloading=true;if(this._dndInitModule){this._dndUnloadModule()}for(var q in this.w){this._winClose(q)}this.w=null;if(this.cm!=null&&typeof(this._unloadContextMenu)=="function"){this._unloadContextMenu()}window.dhx4._eventable(this,"clear");this.attachViewportTo(null);for(var q in this.conf){this.conf[q]=null;delete this.conf[q]}for(var q in this){this[q]=null}m=q=null};window.dhx4._eventable(this);this.attachEvent("_winMouseDown",this._winMouseDownHandler);if(this._dndInitModule){this._dndInitModule()}if(j.wins!=null){for(var n=0;n<j.wins.length;n++){var l=j.wins[n];this.createWindow(l)}}j=null;return this}dhtmlXWindows.prototype.forEachWindow=function(g){for(var c in this.w){g.apply(window,[this.w[c].cell])}};dhtmlXWindows.prototype.window=function(a){if(this.w[a]!=null){return this.w[a].cell}return null};dhtmlXWindows.prototype.isWindow=function(a){return(this.w[a]!=null)};dhtmlXWindows.prototype.findByText=function(j){var g=[];for(var c in this.w){if((this.w[c].cell.getText()).indexOf(String(j))>=0){g.push(this.w[c])}}return g};dhtmlXWindows.prototype.setSkin=function(g){if(g==this.conf.skin){return}if(this.vp!=null){this.vp.className=String(this.vp.className).replace("dhxwins_vp_"+this.conf.skin," dhxwins_vp_"+g)}for(var c in this.w){this.w[c].cell._resetSizeState();this._winAdjustCell(c);this._winAdjustTitle(c)}this.conf.skin=g};dhtmlXWindows.prototype.getBottommostWindow=function(){return this._getTopBottomWin(false)};dhtmlXWindows.prototype.getTopmostWindow=function(){return this._getTopBottomWin(true)};dhtmlXWindows.prototype._getTopBottomWin=function(l){var j=null;for(var c in this.w){if(this.w[c].conf.visible){var g=false;if(j!=null){g=j.z>this.w[c].win.style.zIndex;if(l){g=!g}}if(j==null||g){j={win:this.w[c].cell,z:this.w[c].win.style.zIndex}}}}return(j?j.win:null)};dhtmlXWindows.prototype._winMakeActive=function(g,l){if(g!=null&&l!==true&&this.w[g].conf.actv==true){return}var x=[];var r=[{name:"modal",value:true},{name:"sticked",value:true},{name:"sticked",value:false}];var o={};for(var c=0;c<r.length;c++){var n=r[c].name;var j=r[c].value;var y=[];for(var u in this.w){var v=this.w[u];if(o[u]==null&&v.conf[n]===j&&v.conf.visible==true){if(g!=u){window.dhx4.zim.clear(v.conf.z_id);y.push([u,Number(v.win.style.zIndex)]);o[u]=true}}v=null}y.sort(function(w,q){return(w[1]<q[1]?1:-1)});if(g!=null&&this.w[g].conf[n]===j&&o[g]==null){window.dhx4.zim.clear(this.w[g].conf.z_id);var m=[[g,Number(this.w[g].win.style.zIndex)]];y=m.concat(y);o[g]=true}x=x.concat(y)}for(var c=x.length-1;c>=0;c--){var u=x[c][0];var v=this.w[u];v.win.style.zIndex=window.dhx4.zim.reserve(v.conf.z_id);if(v.conf.modal&&this.mcover!=null){for(var s in this.mcover){this.mcover[s].style.zIndex=v.win.style.zIndex}}this._winAdjustFRMZIndex(u);if(g==null&&c==0){g=u}v.conf.actv=(g==u);v.win.className=(v.conf.actv?"dhxwin_active":"dhxwin_inactive");v=null}if(g!=null&&this.conf.last_active!=g){this._callMainEvent("onFocus",g)}this.conf.last_active=g};dhtmlXWindows.prototype._vpPull={};dhtmlXWindows.prototype._vpPullAdd=function(){if(this.vp==null){return}var g=null;for(var c in this._vpPull){if(this._vpPull[c].vp==this.vp){this._vpPull[c].count++;g=c}}if(g==null){this._vpPull[window.dhx4.newId()]={vp:this.vp,count:1}}};dhtmlXWindows.prototype._vpPullRemove=function(){if(this.vp==null){return 0}var g=0;for(var c in this._vpPull){if(this._vpPull[c].vp==this.vp){g=--this._vpPull[c].count;if(g==0){this._vpPull[c].vp=null;this._vpPull[c].count=null;delete this._vpPull[c]}}}return g};dhtmlXWindows.prototype.attachViewportTo=function(l){var g=this._vpPullRemove();if(this.conf.vp_custom){while(this.vp.childNodes.length>0){this.vp.removeChild(this.vp.lastChild)}this.vp.parentNode.removeChild(this.vp);this.vp=null}else{if(this.vp!=null&&g==0){this.vp.className=String(this.vp.className).replace(new RegExp("\\s{1,}dhxwins_vp_"+this.conf.skin),"")}}if(l==null){this.vp=null}else{this.vp=(typeof(l)=="string"?document.getElementById(l):l);var j="dhxwins_vp_"+this.conf.skin;if(this.vp.className.indexOf(j)<0){this.vp.className+=" "+j}l=null;for(var c in this.w){this.vp.appendChild(this.w[c].win)}this.conf.vp_custom=false}if(this.vp==document.body){document.body.style.position="static"}this._vpPullAdd()};dhtmlXWindows.prototype.setViewport=function(c,m,j,a,l){var g=document.createElement("DIV");g.style.position="absolute";g.style.left=c+"px";g.style.top=m+"px";g.style.width=j+"px";g.style.height=a+"px";if(typeof(l)=="undefined"||l==null){l=document.body}else{if(typeof(l)=="string"){l=document.getElementById(l)}}l.appendChild(g);this.attachViewportTo(g);this.conf.vp_custom=true;l=g=null};dhtmlXWindows.prototype._winSetPosition=function(j,a,g){var c=this.w[j];if(c.conf.maxed){c.conf.lastMX+=(a-c.conf.x);c.conf.lastMY+=(g-c.conf.y)}c.conf.x=a;c.conf.y=g;c.win.style.left=c.conf.x+"px";c.win.style.top=c.conf.y+"px";this._winAdjustFRMPosition(j);c=null};dhtmlXWindows.prototype._winAdjustPosition=function(n,c,m){var g=this.w[n];if(typeof(c)=="undefined"){c=g.conf.x}if(typeof(m)=="undefined"){m=g.conf.y}var a=(g.conf.keep_in_vp?0:-g.conf.w+this.conf.vp_pos_ofs);var l=(g.conf.keep_in_vp?this.vp.clientWidth-g.conf.w:this.vp.clientWidth-this.conf.vp_pos_ofs);if(c<a){c=a}else{if(c>l){c=l}}var j=(g.conf.keep_in_vp?this.vp.clientHeight-g.conf.h:this.vp.clientHeight-this.conf.vp_pos_ofs);if(m<0){m=0}else{if(m>j){m=j}}if(c!=g.conf.x||m!=g.conf.y){this._winSetPosition(n,c,m)}g=null};dhtmlXWindows.prototype._winSetSize=function(o,m,g,n,c){var j=this.w[o];var a=(m!=null?m:j.conf.w);var l=(g!=null?g:j.conf.h);if(this.conf.ofs_w==null){j.win.style.width=a+"px";j.win.style.height=l+"px";this.conf.ofs_w=j.win.offsetWidth-a;this.conf.ofs_h=j.win.offsetHeight-l}if(j.conf.min_w!=null&&a<j.conf.min_w){a=j.conf.min_w}if(j.conf.max_w!=null&&a>j.conf.max_w){a=j.conf.max_w}if(!j.conf.parked&&j.conf.min_h!=null&&l<j.conf.min_h){l=j.conf.min_h}if(j.conf.max_h!=null&&l>j.conf.max_h){l=j.conf.max_h}if(j.conf.keep_in_vp){if(a>this.vp.clientWidth){a=this.vp.clientWidth}if(l>this.vp.clientHeight){l=this.vp.clientHeight}}j.win.style.width=a-this.conf.ofs_w+"px";j.win.style.height=l-this.conf.ofs_h+"px";j.conf.w=a;j.conf.h=l;this._winAdjustFRMSize(o);if(c){this._winAdjustPosition(o,j.conf.x,j.conf.y)}if(!j.conf.parked&&n!=true){this._winAdjustCell(o)}j=null};dhtmlXWindows.prototype._winMinmax=function(l,g){if(typeof(g)!="undefined"&&this.w[l].conf.maxed==g){return}if(this.w[l].conf.allow_resize==false){return}var c=this.w[l];if(c.conf.parked){this._winPark(l,false)}if(c.conf.maxed){this._winSetSize(l,c.conf.lastMW,c.conf.lastMH);this._winAdjustPosition(l,c.conf.lastMX,c.conf.lastMY);c.conf.maxed=false}else{var a=0;var j=0;if(c.conf.max_w!=null){a=c.conf.x+Math.round(c.conf.w-c.conf.max_w)/2}if(c.conf.max_h!=null){j=Math.max(c.conf.y+Math.round(c.conf.h-c.conf.max_h)/2,0)}c.conf.lastMX=c.conf.x;c.conf.lastMY=c.conf.y;c.conf.lastMW=c.conf.w;c.conf.lastMH=c.conf.h;this._winSetSize(l,this.vp.clientWidth,this.vp.clientHeight);this._winAdjustPosition(l,a,j);c.conf.maxed=true}c.b.minmax.setCss(c.conf.maxed?"minmaxed":"minmax");if(c.conf.maxed){this._callMainEvent("onMaximize",l)}else{this._callMainEvent("onMinimize",l)}c=null};dhtmlXWindows.prototype._winShow=function(c,a){if(this.w[c].conf.visible==true){return}this.w[c].win.style.display="";this.w[c].conf.visible=true;if(a==true||this.conf.last_active==null){this._winMakeActive(c,true)}this._callMainEvent("onShow",c)};dhtmlXWindows.prototype._winHide=function(c,a){if(this.w[c].conf.visible==false){return}this.w[c].win.style.display="none";this.w[c].conf.visible=false;if(this.w[c].conf.actv){this.w[c].conf.actv=false;this.w[c].win.className="dhxwin_inactive";this._winMakeActive(null,true)}this._callMainEvent("onHide",c)};dhtmlXWindows.prototype._winPark=function(g,a){if(this.w[g].conf.allow_park==false){return}if(this.w[g].conf.header==false){return}var c=this.w[g];if(a==true&&this.conf.tr.prop!==false){c.win.style[this.conf.tr.prop]=this.conf.tr[c.conf.parked?"height_open":"height_close"];if(!c.conf.tr_ev){c.win.addEventListener(this.conf.tr.ev,this._winOnParkTrans,false);c.conf.tr_ev=true}}if(c.conf.parked){c.hdr.className=String(c.hdr.className).replace(/\s{1,}dhxwin_hdr_parked/gi,"");c.hdr.style.zIndex=0;c.conf.parked=false;c.conf.tr_mode="park";this._winCellSetOpacity(g,"open",a);this._winSetSize(g,c.conf.w,c.conf.lastPH,(a==true&&this.conf.tr.prop!==false));if(!(a==true&&this.conf.tr.prop!==false)){this._callMainEvent("onParkDown",g);if(c.conf.keep_in_vp){this._winAdjustPosition(g,c.conf.x,c.conf.y)}}if(window.dhx4.isIE8==true&&this.conf.tr.prop==false&&c.cell.cell.className.match(/dhxwin_parked/)!=null){c.cell.cell.className=c.cell.cell.className.replace(/\s{0,}dhxwin_parked/gi,"")}}else{c.conf.lastPH=c.conf.h;c.hdr.className+=" dhxwin_hdr_parked";if(a==false||this.conf.tr.prop==false){c.hdr.style.zIndex=3}c.conf.parked=true;c.conf.tr_mode="park";this._winCellSetOpacity(g,"close",a);this._winSetSize(g,c.conf.w,c.hdr.offsetHeight+this.conf.ofs_h,(a==true&&this.conf.tr.prop!==false));if(!(a==true&&this.conf.tr.prop!==false)){this._callMainEvent("onParkUp",g)}if(window.dhx4.isIE8==true&&this.conf.tr.prop==false&&c.cell.cell.className.match(/dhxwin_parked/)==null){c.cell.cell.className+=" dhxwin_parked"}}c=null};dhtmlXWindows.prototype._winCellSetOpacity=function(n,m,g,l){var c=this.w[n].cell;for(var j in c.conf.idx){if({pr1:true,pr2:true}[j]!=true){if(g==true&&this.conf.tr.prop!=false){c.cell.childNodes[c.conf.idx[j]].style[this.conf.tr.prop]=this.conf.tr["op_"+m]}c.cell.childNodes[c.conf.idx[j]].style.opacity=this.conf.tr["op_v_"+m]}}c=null};dhtmlXWindows.prototype._winCellClearOpacity=function(j){var c=this.w[j].cell;for(var g in c.conf.idx){if({pr1:true,pr2:true}[g]!=true){if(this.conf.tr.prop!=false){c.cell.childNodes[c.conf.idx[g]].style[this.conf.tr.prop]=""}}}c=null};dhtmlXWindows.prototype._winStick=function(c,a){if(typeof(a)!="undefined"&&this.w[c].conf.sticked==a){return}this.w[c].conf.sticked=!this.w[c].conf.sticked;this.w[c].b.stick.setCss(this.w[c].conf.sticked?"sticked":"stick");this._winMakeActive(this.conf.last_active,true);if(this.w[c].conf.sticked){this._callMainEvent("onStick",c)}else{this._callMainEvent("onUnStick",c)}};dhtmlXWindows.prototype._winClose=function(j){if(this._callMainEvent("onClose",j)!==true&&this.conf.unloading!=true){return}var g=this.w[j];if(g.conf.fs_mode){g.cell.setToFullScreen(false)}if(g.conf.modal){this._winSetModal(j,false)}window.dhx4.zim.clear(g.conf.z_id);if(this.cm!=null&&this.cm.icon[j]!=null){this._detachContextMenu("icon",j,null)}if(typeof(window.addEventListener)=="function"){g.win.removeEventListener("mousedown",this._winOnMouseDown,false);g.win.removeEventListener("mouseup",this._winOnMouseDown,false);if(this.conf.dblclick_ev){g.win.removeEventListener("dblclick",this._winOnMouseDown,false)}if(this.conf.dnd_evs!=null){g.win.removeEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);if(window.navigator.msPointerEnabled!=true){g.win.removeEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);g.win.removeEventListener(this.conf.dnd_evs.end,this._winOnMouseDown,false)}}}else{g.win.detachEvent("onmousedown",this._winOnMouseDown);g.win.detachEvent("onmouseup",this._winOnMouseDown);if(this.conf.dblclick_ev){g.win.attachEvent("ondblclick",this._winOnMouseDown)}}for(var c in g.b){this._winRemoveButton(j,c,true)}g.b=null;g.cell._unload();g.cell=null;g.brd.parentNode.removeChild(g.brd);g.brd=null;if(g.fr_cover!=null){g.fr_cover.parentNode.removeChild(g.fr_cover);g.fr_cover=null}if(g.fr_m_cover!=null){g.fr_m_cover.parentNode.removeChild(g.fr_m_cover);g.fr_m_cover=null}g.hdr._isWinHdr=true;g.hdr.firstChild._isWinIcon=true;g.hdr.onselectstart=null;g.hdr.parentNode.removeChild(g.hdr);g.hdr=null;for(var c in g.conf){g.conf[c]=null;delete g.conf[c]}g.conf=null;g.win._idd=null;g.win._isWindow=null;g.win.parentNode.removeChild(g.win);g.win=null;g=null;this.w[j]=null;delete this.w[j];if(!this.conf.unloading){this._winMakeActive(null,true)}};dhtmlXWindows.prototype._winSetModal=function(n,j,m){if(this.w[n].conf.modal==j){return}if(typeof(m)=="undefined"){m=true}var g=this.w[n];if(j==true&&g.conf.modal==false){if(this.conf.last_modal!=null){this._winSetModal(this.conf.last_modal,false,false)}if(this.mcover==null){var l=document.createElement("DIV");l.className="dhxwins_mcover";this.vp.insertBefore(l,g.fr_m_cover||g.win);this.mcover={d:l};if(this.conf.fr_cover){this.mcover.f=document.createElement("IFRAME");this.mcover.f.className="dhxwins_mcover";this.mcover.f.border=0;this.mcover.f.frameBorder=0;this.vp.insertBefore(this.mcover.f,l)}l=null}else{if(this.mcover.d.nextSibling!=(g.fr_m_cover||g.win)){this.vp.insertBefore(this.mcover.d,g.fr_m_cover||g.win);if(this.mcover.f!=null){this.vp.insertBefore(this.mcover.f,this.mcover.d)}}}g.conf.modal=true;this.conf.last_modal=n;this._winMakeActive(n,true)}else{if(j==false&&g.conf.modal==true){g.conf.modal=false;this.conf.last_modal=null;if(m&&this.mcover!=null){for(var c in this.mcover){this.vp.removeChild(this.mcover[c]);this.mcover[c]=null}this.mcover=null}}}g=null};dhtmlXWindows.prototype._winMouseDownHandler=function(g,c){var a=g.target||g.srcElement;if(g.button>=2){return}if(c.mode=="button"){if(c.press_type=="mousedown"){this.conf.button_last=c.button_name}else{if((c.press_type=="mouseup"&&c.button_name==this.conf.button_last)||c.press_type=="MSPointerDown"){this.conf.button_last=null;if(this._winButtonClick(c.id,c.button_name,g)!==true){return}}}}if((c.press_type=="mousedown"||c.press_type=="dblclick")&&c.mode=="hdr"){this.conf.dblclick_active=false;if(this.conf.dblclick_ev==true){if(c.press_type=="dblclick"){this.conf.dblclick_active=true}}else{if(this.conf.dblclick_last==null){this.conf.dblclick_last=new Date().getTime();this.dblclick_id=c.id}else{var a=new Date().getTime();if(this.conf.dblclick_last+this.conf.dblclick_tm>a&&this.dblclick_id==c.id){this.conf.dblclick_active=true;this.conf.dblclick_last=null;this.dblclick_id=null}else{this.conf.dblclick_last=a;this.dblclick_id=c.id}}}if(this.conf.dblclick_active){this._winDoHeaderDblClick(c.id);return}}if(c.press_type=="mousedown"||(this.conf.dnd_evs!=null&&c.press_type==this.conf.dnd_evs.start)){this._winMakeActive(c.id)}if(c.press_type=="touchend"){}};dhtmlXWindows.prototype._winDoHeaderDblClick=function(a){if(this.conf.dblclick_mode=="minmax"){this._winMinmax(a);return}if(this.conf.dblclick_mode=="park"){this._winPark(a,true);return}if(typeof(this.conf.dblclick_mode)=="function"){this.conf.dblclick_mode.apply(window,[a]);return}if(typeof(window[this.conf.dblclick_mode])=="function"){window[this.conf.dblclick_mode].apply(window,[a]);return}};dhtmlXWindows.prototype._winAdjustCell=function(c){var r=this.w[c];var q=1;var o=(r.conf.header?r.hdr.offsetHeight:1);var j=r.win.clientWidth-2;var s=r.win.clientHeight-o-1;r.brd.style.left=q+"px";r.brd.style.top=o+"px";if(r.conf.brd==null){r.brd.style.width=j+"px";r.brd.style.height=s+"px";r.conf.brd={w:j-r.brd.offsetWidth,h:s-r.brd.offsetHeight}}r.brd.style.width=j+r.conf.brd.w+"px";r.brd.style.height=s+r.conf.brd.h+"px";var g=5;var a=1+g;var n=(r.conf.header?o:o+g);var l=r.brd.clientWidth;var m=r.brd.clientHeight;r.cell._setSize(a,n,l,m);r.fr_cover.style.left=a+"px";r.fr_cover.style.top=n+"px";r.fr_cover.style.width=l+"px";r.fr_cover.style.height=m+"px";r=null};dhtmlXWindows.prototype._winAdjustTitle=function(j){var a=this.w[j].hdr.childNodes[0];var g=this.w[j].hdr.childNodes[1];var c=this.w[j].hdr.childNodes[2];g.style.paddingLeft=a.offsetWidth+12+"px";g.style.paddingRight=c.offsetWidth+10+"px";g=c=a=null};dhtmlXWindows.prototype._callMainEvent=function(c,j){var a=this.w[j];if(a.cell.checkEvent(c)){var g=a.cell._callMainEvent(c,[a.cell])}else{var g=this.callEvent(c,[a.cell])}a=null;return g};dhtmlXWindows.prototype._winInitFRM=function(g){if(this.conf.fr_cover!=true){return}var a=this.w[g];var c=document.createElement("IFRAME");c.className="dhxwin_main_fr_cover";c.border=0;c.frameBorder=0;c.style.zIndex=a.win.style.zIndex;a.win.parentNode.insertBefore(c,a.win);a.fr_m_cover=c;c=null};dhtmlXWindows.prototype._winAdjustFRMSize=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.width=a.conf.w+"px";a.fr_m_cover.style.height=a.conf.h+"px"}a=null};dhtmlXWindows.prototype._winAdjustFRMPosition=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.left=a.win.style.left;a.fr_m_cover.style.top=a.win.style.top}a=null};dhtmlXWindows.prototype._winAdjustFRMZIndex=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.zIndex=a.win.style.zIndex}a=null};function dhtmlXWindowsCell(l,j){dhtmlXCellObject.apply(this,[l,"_wins"]);this.wins=j;this.cell._winId=l;this.conf.skin=this.wins.conf.skin;this.attachEvent("_onCellUnload",function(){if(this._unloadResize){this._unloadResize()}window.dhx4._eventable(this.cell,"clear");this.cell._winId=null;this.wins=null;this.setText=null;this.getText=null;this.allowMove=null;this.denyMove=null;this.isMovable=null;this.allowResize=null;this.denyResize=null;this.isResizable=null;this.maximize=null;this.minimize=null;this.isMaximized=null;this.setPosition=null;this.getPosition=null;this.adjustPosition=null;this.park=null;this.isParked=null;this.allowPark=null;this.denyPark=null;this.isParkable=null;this.show=null;this.hide=null;this.isHidden=null;this.stick=null;this.unstick=null;this.isSticked=null;this.setDimension=null;this.getDimension=null;this.setMinDimension=null;this.getMinDimension=null;this.setMaxDimension=null;this.getMaxDimension=null;this.keepInViewport=null;this.center=null;this.centerOnScreen=null;this.bringToTop=null;this.bringToBottom=null;this.isOnTop=null;this.isOnBottom=null;this.showHeader=null;this.hideHeader=null;this.setModal=null;this.isModal=null;this.close=null;this._adjustByCont=null;this.button=null;this.addUserButton=null;this.removeUserButton=null;g=null});this.attachEvent("_onContentLoaded",function(){this.wins._callMainEvent("onContentLoaded",this._idd)});this.attachEvent("_onContentMouseDown",function(m,a){this.wins.callEvent("_winMouseDown",[a,{id:m,mode:"win"}])});this._callMainEvent=function(m,a){return this.callEvent(m,a)};this.conf.tr={};for(var c in this.wins.conf.tr){this.conf.tr[c]=this.wins.conf.tr[c]}if(this.conf.tr.prop!=false){}if(this._initResize){this._initResize()}window.dhx4._eventable(this.cell);var g=this;this.cell.attachEvent("_setCellSize",function(a,o){var m=g.wins.w[this._winId].conf.w-g.conf.size.w;var n=g.wins.w[this._winId].conf.h-g.conf.size.h;g.setDimension(a+m,o+n)});return this}dhtmlXWindowsCell.prototype=new dhtmlXCellObject();dhtmlXWindowsCell.prototype.setText=function(a){this.wins.w[this._idd].conf.text=a;this.wins.w[this._idd].hdr.childNodes[1].firstChild.innerHTML=a};dhtmlXWindowsCell.prototype.getText=function(){return this.wins.w[this._idd].conf.text};dhtmlXWindowsCell.prototype.allowMove=function(){this.wins.w[this._idd].conf.allow_move=true};dhtmlXWindowsCell.prototype.denyMove=function(){this.wins.w[this._idd].conf.allow_move=false};dhtmlXWindowsCell.prototype.isMovable=function(){return(this.wins.w[this._idd].conf.allow_move==true)};dhtmlXWindowsCell.prototype.allowResize=function(){this.wins.w[this._idd].conf.allow_resize=true;this.wins.w[this._idd].b.minmax.enable()};dhtmlXWindowsCell.prototype.denyResize=function(){this.wins.w[this._idd].conf.allow_resize=false;this.wins.w[this._idd].b.minmax.disable()};dhtmlXWindowsCell.prototype.isResizable=function(){return(this.wins.w[this._idd].conf.allow_resize==true)};dhtmlXWindowsCell.prototype.maximize=function(){this.wins._winMinmax(this._idd,true)};dhtmlXWindowsCell.prototype.minimize=function(){this.wins._winMinmax(this._idd,false)};dhtmlXWindowsCell.prototype.isMaximized=function(){return(this.wins.w[this._idd].conf.maxed==true)};dhtmlXWindowsCell.prototype.setPosition=function(a,c){this.wins._winSetPosition(this._idd,a,c)};dhtmlXWindowsCell.prototype.getPosition=function(){var a=this.wins.w[this._idd];var c=[a.conf.x,a.conf.y];a=null;return c};dhtmlXWindowsCell.prototype.adjustPosition=function(){this.wins._winAdjustPosition(this._idd)};dhtmlXWindowsCell.prototype.park=function(){this.wins._winPark(this._idd,true)};dhtmlXWindowsCell.prototype.isParked=function(){return(this.wins.w[this._idd].conf.parked==true)};dhtmlXWindowsCell.prototype.allowPark=function(){this.wins.w[this._idd].conf.allow_park=true;this.wins.w[this._idd].b.park.enable()};dhtmlXWindowsCell.prototype.denyPark=function(){this.wins.w[this._idd].conf.allow_park=false;this.wins.w[this._idd].b.park.disable()};dhtmlXWindowsCell.prototype.isParkable=function(){return(this.wins.w[this._idd].conf.allow_park==true)};dhtmlXWindowsCell.prototype.show=function(a){this.wins._winShow(this._idd,window.dhx4.s2b(a))};dhtmlXWindowsCell.prototype.hide=function(){this.wins._winHide(this._idd)};dhtmlXWindowsCell.prototype.isHidden=function(){return(this.wins.w[this._idd].conf.visible!=true)};dhtmlXWindowsCell.prototype.stick=function(){this.wins._winStick(this._idd,true)};dhtmlXWindowsCell.prototype.unstick=function(){this.wins._winStick(this._idd,false)};dhtmlXWindowsCell.prototype.isSticked=function(){return(this.wins.w[this._idd].conf.sticked==true)};dhtmlXWindowsCell.prototype.setDimension=function(g,a){var c=this.wins.w[this._idd];if(c.conf.parked){this.wins._winPark(this._idd,false)}if(c.conf.maxed){if(g!=null){c.conf.lastMW=g}if(a!=null){c.conf.lastMH=a}this.wins._winMinmax(this._idd)}else{this.wins._winSetSize(this._idd,g,a,false,true)}c=null};dhtmlXWindowsCell.prototype.getDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.w,a.conf.h];a=null;return c};dhtmlXWindowsCell.prototype.setMinDimension=function(g,a){var c=this.wins.w[this._idd];c.conf.min_w=g;c.conf.min_h=a;this.wins._winSetSize(this._idd,c.conf.w,c.conf.h);c=null};dhtmlXWindowsCell.prototype.getMinDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.min_w,a.conf.min_h];a=null;return c};dhtmlXWindowsCell.prototype.setMaxDimension=function(g,a){var c=this.wins.w[this._idd];c.conf.max_w=g;c.conf.max_h=a;this.wins._winSetSize(this._idd,c.conf.w,c.conf.h);c=null};dhtmlXWindowsCell.prototype.getMaxDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.max_w,a.conf.max_h];a=null;return c};dhtmlXWindowsCell.prototype.keepInViewport=function(a){this.wins.w[this._idd].conf.keep_in_vp=window.dhx4.s2b(a)};dhtmlXWindowsCell.prototype.center=function(){var g=this.wins.vp;var c=this.wins.w[this._idd];var a=Math.round((g.clientWidth-c.conf.w)/2);var j=Math.round((g.clientHeight-c.conf.h)/2);this.wins._winSetPosition(this._idd,a,j);g=c=null};dhtmlXWindowsCell.prototype.centerOnScreen=function(){var c=this.wins.w[this._idd];var m=window.dhx4.screenDim();var l=window.dhx4.absLeft(this.wins.vp);var j=window.dhx4.absTop(this.wins.vp);var g=this.wins.vp.parentNode;while(g!=null){if(g.scrollLeft){l=l-g.scrollLeft}if(g.scrollTop){j=j-g.scrollTop}g=g.parentNode}var a=Math.round((m.right-m.left-c.conf.w)/2);var n=Math.round((m.bottom-m.top-c.conf.h)/2);this.wins._winAdjustPosition(this._idd,a-l,n-j);d=c=null};dhtmlXWindowsCell.prototype.bringToTop=function(){this.wins._winMakeActive(this._idd,true)};dhtmlXWindowsCell.prototype.bringToBottom=function(){var a=(this.wins.w[this._idd].conf.actv?null:this.wins.conf.last_active);window.dhx4.zim.clear(this.wins.w[this._idd].conf.z_id);this.wins.w[this._idd].win.style.zIndex=0;this.wins._winMakeActive(a,true)};dhtmlXWindowsCell.prototype.isOnTop=function(){return(this.wins.w[this._idd].conf.actv==true)};dhtmlXWindowsCell.prototype.isOnBottom=function(){var g={id:null,z:+Infinity};for(var c in this.wins.w){if(this.wins.w[c].conf.visible&&this.wins.w[c].win.style.zIndex<g.z){g.id=c;g.z=this.wins.w[c].win.style.zIndex}}return(g.id==this._idd)};dhtmlXWindowsCell.prototype.showHeader=function(){var a=this.wins.w[this._idd];if(a.conf.header==false){a.hdr.className=String(a.hdr.className).replace(/\s{0,}dhxwin_hdr_hidden/gi,"");a.brd.className=String(a.brd.className).replace(/\s{0,}dhxwin_hdr_hidden/gi,"");this.conf.cells_cont=null;a.conf.brd=null;a.conf.header=true;this.wins._winAdjustCell(this._idd)}a=null};dhtmlXWindowsCell.prototype.hideHeader=function(){var a=this.wins.w[this._idd];if(a.conf.header==true){if(a.conf.parked){this.wins._winPark(this._idd,false)}a.hdr.className+=" dhxwin_hdr_hidden";a.brd.className+=" dhxwin_hdr_hidden";this.conf.cells_cont=null;a.conf.brd=null;a.conf.header=false;this.wins._winAdjustCell(this._idd)}a=null};dhtmlXWindowsCell.prototype.setModal=function(a){this.wins._winSetModal(this._idd,window.dhx4.s2b(a))};dhtmlXWindowsCell.prototype.isModal=function(){return(this.wins.w[this._idd].conf.modal==true)};dhtmlXWindowsCell.prototype._adjustByCont=function(a,c){a+=this.wins.w[this._idd].conf.w-this.conf.size.w;c+=this.wins.w[this._idd].conf.h-this.conf.size.h;this.wins._winSetSize(this._idd,a,c)};dhtmlXWindowsCell.prototype.close=function(){this.wins._winClose(this._idd)};dhtmlXWindowsCell.prototype.setIconCss=function(a){this.wins.w[this._idd].hdr.firstChild.className="dhxwin_icon "+a;this.wins._winAdjustTitle(this._idd)};dhtmlXWindowsCell.prototype.setToFullScreen=function(c){c=window.dhx4.s2b(c);var a=this.wins.w[this._idd];if(a.conf.fs_mode==c){a=null;return}if(this.wins.fsn==null){this.wins.fsn=document.createElement("DIV");this.wins.fsn.className=this.wins.vp.className+" dhxwins_vp_fs";document.body.appendChild(this.wins.fsn)}if(c){this.wins.fsn.appendChild(a.win);this.maximize();this.hideHeader()}else{this.wins.vp.appendChild(a.win);this.minimize();this.showHeader();if(this.wins.fsn.childNodes.length==0){this.wins.fsn.parentNode.removeChild(this.wins.fsn);this.wins.fsn=null}}a.conf.fs_mode=c;a=null};dhtmlXWindowsCell.prototype.button=function(a){if(a=="minmax1"||a=="minmax2"){a="minmax"}return this.wins.w[this._idd].b[a]};dhtmlXWindowsCell.prototype.addUserButton=function(m,l,g){var a=new dhtmlXWindowsButton(this.wins,this._idd,m,g,true);var j=null;var c=this.wins.w[this._idd].hdr.lastChild;if(isNaN(l)){l=0}else{if(l<0){l=0}}if(c.childNodes[l]!=null){j=c.childNodes[l]}if(j!=null){c.insertBefore(a.button,j)}else{c.appendChild(a.button)}this.wins.w[this._idd].b[m]=a;a=j=c=null;this.wins._winAdjustTitle(this._idd)};dhtmlXWindowsCell.prototype.removeUserButton=function(a){if(this.wins.w[this._idd].b[a]==null||this.wins.w[this._idd].b[a].conf.custom!=true){return}this.wins._winRemoveButton(this._idd,a)};window.dhtmlXWindowsButton=function(l,c,a,j,g){this.conf={wins:l,winId:c,name:a,enabled:true,visible:true,custom:true};this.button=document.createElement("DIV");this.button._buttonName=a;this.button.title=j;this.enable=function(){this.conf.enabled=true;this.setCss(this.conf.css)};this.disable=function(){this.conf.enabled=false;this.setCss(this.conf.css)};this.isEnabled=function(){return(this.conf.enabled==true)};this.show=function(){this.button.style.display="";this.conf.visible=true;this.conf.wins._winAdjustTitle(this.conf.winId)};this.hide=function(){this.button.style.display="none";this.conf.visible=false;this.conf.wins._winAdjustTitle(this.conf.winId)};this.isHidden=function(){return(this.conf.visible==false)};this.setCss=function(n){this.conf.css=n;var m=(this.conf.enabled?"":"_dis");this.button.className="dhxwin_button"+m+" dhxwin_button_"+this.conf.css+m};this._doOnClick=function(m){return this.callEvent("onClick",[this.conf.wins.w[this.conf.winId].cell,this])};this.unload=function(m){dhx4._eventable(this,"clear");this.button._buttonName=null;this.button.parentNode.removeChild(this.button);if(this.conf.wins.cm!=null&&this.conf.wins.cm.button[this.conf.winId]!=null&&this.conf.wins.cm.button[this.conf.winId][this.conf.name]!=null){this.conf.wins._detachContextMenu("button",this.conf.winId,this.conf.name)}this.button=null;this.enable=null;this.disable=null;this.isEnabled=null;this.show=null;this.hide=null;this.isHidden=null;this.setCss=null;this.unload=null;if(m!=true){this.conf.wins._winAdjustTitle(this.conf.winId)}this.conf.wins=null;this.conf.winId=null;this.conf=null};this.setCss(a);dhx4._eventable(this);return this};dhtmlXWindows.prototype._winButtonClick=function(g,a,c){if(!this.w[g].b[a].isEnabled()){return true}if(this.w[g].b[a]._doOnClick()!==true){return}if(a=="help"){this._callMainEvent("onHelp",g)}if(a=="park"){this._winPark(g,true)}if(a=="minmax"){this._winMinmax(g)}if(a=="stick"){this._winStick(g);return false}if(a=="close"){this._winClose(g);return false}return true};dhtmlXWindows.prototype._winRemoveButton=function(g,a,c){this.w[g].b[a].unload(c);this.w[g].b[a]=null;delete this.w[g].b[a]};dhtmlXWindows.prototype._dndInitModule=function(){var a=this;this.conf.dnd_tm=null;this.conf.dnd_time=0;if(window.navigator.msPointerEnabled==true){this.conf.dnd_evs={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}}else{this.conf.dnd_evs={start:"touchstart",move:"touchmove",end:"touchend"}}this._dndOnMouseDown=function(j,l){if(a.conf.dblclick_active){return}if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}if(a._callMainEvent("onBeforeMoveStart",l)!==true){return}a.conf.dnd={id:l,x:a._dndPos(j,"X"),y:a._dndPos(j,"Y"),ready:true,css:false,css_touch:false,css_vp:false,tr:null,mode:"def",moved:false,prevent:false};if(a.w[l].conf.keep_in_vp){a.conf.dnd.minX=0;a.conf.dnd.maxX=a.vp.clientWidth-a.w[l].conf.w;a.conf.dnd.minY=0;a.conf.dnd.maxY=a.vp.clientHeight-a.w[l].conf.h}else{a.conf.dnd.minX=-a.w[l].conf.w+a.conf.vp_pos_ofs;a.conf.dnd.maxX=a.vp.clientWidth-a.conf.vp_pos_ofs;a.conf.dnd.minY=0;a.conf.dnd.maxY=a.vp.clientHeight-a.conf.vp_pos_ofs}var c=["MozTransform","WebkitTransform","OTransform","msTransform","transform"];for(var g=0;g<c.length;g++){if(document.documentElement.style[c[g]]!=null&&a.conf.dnd.tr==null){a.conf.dnd.tr=c[g];a.conf.dnd.mode="tr"}}if(a.conf.dnd.mode=="tr"){a.w[l].win.style[a.conf.dnd.tr]="translate(0px,0px)"}if(j.type==a.conf.dnd_evs.start){if(a.conf.dnd.css_touch==false){a.w[l].win.className+=" dhxwin_dnd_touch";a.conf.dnd.css_touch=true}if(a.conf.dnd.css_vp==false){a.vp.className+=" dhxwins_vp_dnd";a.conf.dnd.css_vp=true}}else{a._dndInitEvents()}};this._dndOnMouseMove=function(l){l=l||event;var j=a.conf.dnd;var c=a._dndPos(l,"X")-j.x;var m=a._dndPos(l,"Y")-j.y;if(l.type==a.conf.dnd_evs.move){if(j.moved!=true&&(Math.abs(c)>20||Math.abs(m)>20)){if(a.conf.dnd_tm!=null){window.clearTimeout(a.conf.dnd_tm);a.conf.dnd_tm=null}window.removeEventListener(a.conf.dnd_evs.start,a._dndOnMouseMove,false);return}}if(j.ready!=true){return}var g=a.w[j.id];if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}if(j.css!=true){if(j.css_touch==false){g.win.className+=" dhxwin_dnd"}g.fr_cover.className+=" dhxwin_fr_cover_dnd";j.css=true}if(j.css_vp!=true){a.vp.className+=" dhxwins_vp_dnd";j.css_vp=true}j.newX=g.conf.x+c;j.newY=g.conf.y+m;if(j.mode=="tr"){j.newX=Math.min(Math.max(j.newX,j.minX),j.maxX);c=j.newX-g.conf.x;j.newY=Math.min(Math.max(j.newY,j.minY),j.maxY);m=j.newY-g.conf.y;g.win.style[j.tr]="translate("+c+"px,"+m+"px)"}else{if(j.newX<j.minX||j.newX>j.maxX){j.newX=Math.min(Math.max(j.newX,j.minX),j.maxX)}else{j.x=a._dndPos(l,"X")}if(j.newY<j.minY||j.newY>j.maxY){j.newY=Math.min(Math.max(j.newY,j.minY),j.maxY)}else{j.y=a._dndPos(l,"Y")}a._winSetPosition(j.id,j.newX,j.newY)}j.moved=true;g=j=null};this._dndOnMouseUp=function(j){j=j||event;if(a.conf.dnd!=null){var g=a.conf.dnd;var c=a.w[g.id];if(g.newX!=null){if(g.mode=="tr"){a._winSetPosition(g.id,g.newX,g.newY);c.win.style[g.tr]="translate(0px,0px)"}}if(g.css==true){if(g.css_touch==false){c.win.className=String(c.win.className).replace(/\s{0,}dhxwin_dnd/gi,"")}c.fr_cover.className=String(c.fr_cover.className).replace(/\s{0,}dhxwin_fr_cover_dnd/gi,"")}if(g.css_touch==true){c.win.className=String(c.win.className).replace(/\s{0,}dhxwin_dnd_touch/gi,"")}if(g.css_vp==true){a.vp.className=String(a.vp.className).replace(/\s{0,}dhxwins_vp_dnd/gi,"")}a._dndUnloadEvents();if(g.moved==true){a._callMainEvent("onMoveFinish",g.id)}else{a._callMainEvent("onMoveCancel",g.id)}c=g=a.conf.dnd=null}if(window.dhx4.isIE==true&&j.type==a.conf.dnd_evs.end&&window.navigator.msPointerEnabled==true){document.body.style.msTouchAction="";window.removeEventListener(a.conf.dnd_evs.end,a._dndOnMouseUp,false);window.removeEventListener(a.conf.dnd_evs.move,a._dndOnMouseMove,false);if(a.conf.dnd_tm!=null){window.clearTimeout(a.conf.dnd_tm)}a.conf.dnd_tm=null}};this._dndOnSelectStart=function(c){c=c||event;if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}return false};this._dndInitEvents=function(){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._dndOnMouseMove,false);window.addEventListener("mouseup",this._dndOnMouseUp,false);window.addEventListener("selectstart",this._dndOnSelectStart,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove);document.body.attachEvent("onmouseup",this._dndOnMouseUp);document.body.attachEvent("onselectstart",this._dndOnSelectStart)}};this._dndUnloadEvents=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._dndOnMouseMove,false);window.removeEventListener("mouseup",this._dndOnMouseUp,false);window.removeEventListener("selectstart",this._dndOnSelectStart,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove);document.body.detachEvent("onmouseup",this._dndOnMouseUp);document.body.detachEvent("onselectstart",this._dndOnSelectStart)}};this._dndUnloadModule=function(){this.detachEvent(this.conf.dnd_evid);this.conf.dnd_evid=null;this._dndOnMouseDown=null;this._dndOnMouseMove=null;this._dndOnMouseUp=null;this._dndOnSelectStart=null;this._dndInitEvents=null;this._dndUnloadEvents=null;this._dndInitModule=null;this._dndUnloadModule=null;a=null};this._dndPos=function(g,c){var j=g[this.conf.dnd_ev_prefix+c];if(j==null){j=e.touches[0][this.conf.dnd_ev_prefix+c]}return j};this.conf.dnd_evid=this.attachEvent("_winMouseDown",function(g,c){if(g.type==this.conf.dnd_evs.start){if(c.mode=="hdr"){if(this.w[c.id].conf.maxed&&this.w[c.id].conf.max_w==null&&this.w[c.id].conf.max_h==null){return}this.conf.dnd_ev_prefix="page";this.conf.dnd={x:this._dndPos(g,"X"),y:this._dndPos(g,"Y")};if(this.conf.dnd_time<1){this._dndOnMouseDown(g,c.id)}else{if(this.conf.dnd_tm!=null){window.clearTimeout(this.conf.dnd_tm)}this.conf.dnd_tm=window.setTimeout(function(){a._dndOnMouseDown(g,c.id)},this.conf.dnd_time)}if(window.dhx4.isIE==true&&window.navigator.msPointerEnabled==true){document.body.style.msTouchAction="none";window.addEventListener(this.conf.dnd_evs.end,this._dndOnMouseUp,false)}window.addEventListener(this.conf.dnd_evs.move,this._dndOnMouseMove,false)}return false}if(g.type==this.conf.dnd_evs.end){if(this.conf.dnd_tm!=null){window.clearTimeout(this.conf.dnd_tm);this.conf.dnd_tm=null}this._dndOnMouseUp();window.removeEventListener(this.conf.dnd_evs.move,this._dndOnMouseMove,false);return false}if(g.button>=2){return}this.conf.dnd_ev_prefix="client";if(!(c.mode=="hdr"&&g.type=="mousedown"&&this.w[c.id].conf.allow_move==true)){return}if(this.w[c.id].conf.maxed&&this.w[c.id].conf.max_w==null&&this.w[c.id].conf.max_h==null){return}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}this._dndOnMouseDown(g,c.id);return false})};dhtmlXWindowsCell.prototype._initResize=function(){var a=this;var c=navigator.userAgent;this.conf.resize={b_width:6,c_type:(c.indexOf("MSIE 10.0")>0||c.indexOf("MSIE 9.0")>0||c.indexOf("MSIE 8.0")>0||c.indexOf("MSIE 7.0")>0||c.indexOf("MSIE 6.0")>0)};this._rOnCellMouseMove=function(n){if(a.wins.conf.resize_actv==true||a.wins.w[a._idd].conf.allow_resize==false||a.conf.progress==true||a.wins.w[a._idd].conf.maxed==true||a.wins.w[a._idd].conf.fs_mode==true){var l=a.wins.w[a._idd].brd;if(l.style.cursor!="default"){l.style.cursor="default"}l=null;return}n=n||event;var v=a.wins.w[a._idd].brd;var g=a.conf.resize;var q=(a.wins.w[a._idd].conf.header==false);var s=n.clientX;var o=n.clientY;var j=window.dhx4.absLeft(v);var u=window.dhx4.absTop(v);var m="";if(s<=j+g.b_width){m="w"}else{if(s>=j+v.offsetWidth-g.b_width){m="e"}}if(o>=u+v.offsetHeight-g.b_width){m="s"+m}else{if(q&&o<=u+g.b_width){m="n"+m}}if(m==""){m=false}if(g.mode!=m){g.mode=m;if(m==false){v.style.cursor="default"}else{v.style.cursor=m+"-resize"}}v=g=null};this._rOnCellMouseDown=function(m){if(a.conf.resize.mode==false){return}if(a.conf.progress==true){return}if(a.wins.w[a._idd].conf.allow_resize==false){return}if(a.wins.w[a._idd].conf.fs_mode==true){return}if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}if(a.wins._callMainEvent("onBeforeResizeStart",a._idd)!==true){return}var g=a.wins.w[a._idd];var l=a.conf.resize;a.wins.conf.resize_actv=true;l.min_w=g.conf.min_w;l.min_h=g.conf.min_h;l.max_w=g.conf.max_w||+Infinity;l.max_h=g.conf.max_h||+Infinity;if(g.cell.dataType=="layout"&&g.cell.dataObj!=null&&typeof(g.cell.dataObj._getWindowMinDimension)=="function"){var j=g.cell.dataObj._getWindowMinDimension(g.cell);l.min_w=Math.max(j.w,l.min_w);l.min_h=Math.max(j.h,l.min_h)}l.vp_l=a.wins.conf.vp_pos_ofs;l.vp_r=a.wins.vp.clientWidth-a.wins.conf.vp_pos_ofs;l.vp_b=a.wins.vp.clientHeight-a.wins.conf.vp_pos_ofs;l.x=m.clientX;l.y=m.clientY;if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._rOnWinMouseMove,false);window.addEventListener("mouseup",a._rOnWinMouseUp,false);window.addEventListener("selectstart",a._rOnSelectStart,false)}else{document.body.attachEvent("onmousemove",a._rOnWinMouseMove);document.body.attachEvent("onmouseup",a._rOnWinMouseUp);document.body.attachEvent("onselectstart",a._rOnSelectStart)}l.resized=false;l.vp_cursor=a.wins.vp.style.cursor;a.wins.vp.style.cursor=l.mode+"-resize";g=l=null};this._rOnWinMouseMove=function(m){m=m||event;var j=a.wins.w[a._idd];var l=a.conf.resize;if(!l.resized){j.fr_cover.className+=" dhxwin_fr_cover_resize";l.resized=true}var g=m.clientX-l.x;var n=m.clientY-l.y;if(l.mode.indexOf("e")>=0){l.rw=Math.min(Math.max(j.conf.w+g,l.min_w),l.max_w);l.rx=null;if(j.conf.x+l.rw<l.vp_l){l.rw=l.vp_l-j.conf.x}else{if(j.conf.x+l.rw>a.wins.vp.clientWidth){l.rw=a.wins.vp.clientWidth-j.conf.x}}}else{if(l.mode.indexOf("w")>=0){l.rw=Math.min(Math.max(j.conf.w-g,l.min_w),l.max_w);l.rx=j.conf.x+j.conf.w-l.rw;if(l.rx<0){l.rw=l.rw+l.rx;l.rx=0}else{if(l.rx>l.vp_r){l.rw=l.rw-l.vp_r;l.rx=l.vp_r}}}}if(l.mode.indexOf("s")>=0){l.rh=Math.min(Math.max(j.conf.h+n,l.min_h),l.max_h);l.ry=null;if(j.conf.y+l.rh>a.wins.vp.clientHeight){l.rh=a.wins.vp.clientHeight-j.conf.y}}else{if(l.mode.indexOf("n")>=0){l.rh=Math.min(Math.max(j.conf.h-n,l.min_h),l.max_h);l.ry=j.conf.y+j.conf.h-l.rh;if(l.ry<0){l.rh=l.rh+l.ry;l.ry=0}else{if(l.ry>l.vp_b){l.rh=l.rh-l.vp_b;l.ry=l.vp_b}}}}a._rAdjustSizer();j=l=null};this._rOnWinMouseUp=function(){var j=a.conf.resize;var g=a.wins.w[a._idd];a.wins.conf.resize_actv=false;a.wins.vp.style.cursor=j.vp_cursor;g.fr_cover.className=String(g.fr_cover.className).replace(/\s{0,}dhxwin_fr_cover_resize/gi,"");if(j.resized){a.wins._winSetSize(a._idd,j.rw,j.rh);if(j.rx==null){j.rx=g.conf.x}if(j.ry==null){j.ry=g.conf.y}if(j.rx!=g.conf.x||j.ry!=g.conf.y){a.wins._winSetPosition(a._idd,j.rx,j.ry)}}if(j.obj!=null){j.obj.parentNode.removeChild(j.obj);j.obj=null}if(j.objFR!=null){j.objFR.parentNode.removeChild(j.objFR);j.objFR=null}if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._rOnWinMouseMove,false);window.removeEventListener("mouseup",a._rOnWinMouseUp,false);window.removeEventListener("selectstart",a._rOnSelectStart,false)}else{document.body.detachEvent("onmousemove",a._rOnWinMouseMove);document.body.detachEvent("onmouseup",a._rOnWinMouseUp);document.body.detachEvent("onselectstart",a._rOnSelectStart)}if(j.resized==true){if(a.dataType=="layout"&&a.dataObj!=null){a.dataObj.callEvent("onResize",[])}a.wins._callMainEvent("onResizeFinish",a._idd)}else{a.wins._callMainEvent("onResizeCancel",a._idd)}j.mode="";g=j=null};this._rOnSelectStart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false};this._rInitSizer=function(){var j=a.conf.resize;var g=a.wins.w[a._idd];j.obj=document.createElement("DIV");j.obj.className="dhxwin_resize";j.obj.style.zIndex=g.win.style.zIndex;j.obj.style.cursor=j.mode+"-resize";a.wins.vp.appendChild(j.obj);if(a.wins.conf.fr_cover==true){j.objFR=document.createElement("IFRAME");j.objFR.className="dhxwin_resize_fr_cover";j.objFR.style.zIndex=j.obj.style.zIndex;a.wins.vp.insertBefore(j.objFR,j.obj)}j.rx=g.conf.x;j.ry=g.conf.y;j.rw=g.conf.w;j.rh=g.conf.h;j=null};this._rAdjustSizer=function(){var g=a.conf.resize;if(!g.obj){this._rInitSizer()}g.obj.style.width=g.rw+"px";g.obj.style.height=g.rh+"px";if(g.rx!=null){g.obj.style.left=g.rx+"px"}if(g.ry!=null){g.obj.style.top=g.ry+"px"}if(g.objFR!=null){g.objFR.style.width=g.obj.style.width;g.objFR.style.height=g.obj.style.height;if(g.rx!=null){g.objFR.style.left=g.obj.style.left}if(g.ry!=null){g.objFR.style.top=g.obj.style.top}}g=null};if(typeof(window.addEventListener)=="function"){this.wins.w[this._idd].brd.addEventListener("mousemove",this._rOnCellMouseMove,false);this.wins.w[this._idd].brd.addEventListener("mousedown",this._rOnCellMouseDown,false)}else{this.wins.w[this._idd].brd.attachEvent("onmousemove",this._rOnCellMouseMove);this.wins.w[this._idd].brd.attachEvent("onmousedown",this._rOnCellMouseDown)}this._unloadResize=function(){if(typeof(window.addEventListener)=="function"){this.wins.w[this._idd].brd.removeEventListener("mousemove",this._rOnCellMouseMove,false);this.wins.w[this._idd].brd.removeEventListener("mousedown",this._rOnCellMouseDown,false)}else{this.wins.w[this._idd].brd.detachEvent("onmousemove",this._rOnCellMouseMove);this.wins.w[this._idd].brd.detachEvent("onmousedown",this._rOnCellMouseDown)}this._initResize=null;this._rOnCellMouseMove=null;this._rOnCellMouseDown=null;this._rOnWinMouseMove=null;this._rOnWinMouseUp=null;this._rOnSelectStart=null;this._rInitSizer=null;this._rAdjustSizer=null;this._unloadResize=null;this.conf.resize=null;a=null}};dhtmlXWindows.prototype.attachContextMenu=function(a){return this._renderContextMenu("icon",null,null,a)};dhtmlXWindows.prototype.getContextMenu=function(){if(this.cm!=null&&this.cm.global!=null){return this.cm.global}return null};dhtmlXWindows.prototype.detachContextMenu=function(){this._detachContextMenu("icon",null,null)};dhtmlXWindowsCell.prototype.attachContextMenu=function(a){return this.wins._renderContextMenu("icon",this._idd,null,a)};dhtmlXWindowsCell.prototype.getContextMenu=function(){if(this.wins.cm!=null&&this.wins.cm.icon[this._idd]!=null){return this.wins.cm.icon[this._idd]}return null};dhtmlXWindowsCell.prototype.detachContextMenu=function(){this.wins._detachContextMenu("icon",this._idd,null)};dhtmlXWindowsButton.prototype.attachContextMenu=function(a){return this.conf.wins._renderContextMenu("button",this.conf.winId,this.conf.name,a)};dhtmlXWindowsButton.prototype.getContextMenu=function(){if(this.conf.wins.cm==null||this.conf.wins.cm.button[this.conf.winId]==null){return null}if(this.conf.wins.cm.button[this.conf.winId][this.conf.name]!=null){return this.conf.wins.cm.button[this.conf.winId][this.conf.name]}return null};dhtmlXWindowsButton.prototype.detachContextMenu=function(){this.conf.wins._detachContextMenu("button",this.conf.winId,this.conf.name)};dhtmlXWindows.prototype._renderContextMenu=function(n,m,g,c){var j=this;var a=false;if(this.cm==null){this.cm={global:null,icon:{},button:{}};a=true}if(m==null){if(this.cm.global!=null){return}}else{if(n=="icon"){if(this.cm.icon[m]!=null){return}}else{if(n=="button"){if(this.cm.button[m]!=null&&this.cm.button[m][g]!=null){return}}}}if(c==null){c={}}c.parent=null;c.context=true;var l=new dhtmlXMenuObject(c);l.setAutoHideMode(false);l.attachEvent("onShow",function(){this.conf.wins_menu_open=true});l.attachEvent("onHide",function(){this.conf.wins_menu_open=false;j.conf.opened_menu=null});if(m==null){this.cm.global=l}else{if(n=="icon"){this.cm.icon[m]=l}else{if(n=="button"){if(this.cm.button[m]==null){this.cm.button[m]={}}this.cm.button[m][g]=l}}}if(a){this._showContextMenu=function(s,r){if(s.button>=2){return}if(r.mode=="icon"&&r.id!=null&&r.press_type=="mousedown"){var u=this.cm.icon[r.id]||this.cm.global;if(u==null){return}s.cancelBubble=true;var q=this.w[r.id].hdr.firstChild;if(u.conf.wins_menu_open&&this.conf.opened_menu==r.id){u.hideContextMenu()}else{this._hideContextMenu();u.showContextMenu(window.dhx4.absLeft(q),window.dhx4.absTop(q)+q.offsetHeight);this.conf.opened_menu=r.id}u=q=null}if(r.mode=="button"&&r.id!=null&&r.press_type=="mousedown"){if(this.cm.button[r.id]==null||this.cm.button[r.id][r.button_name]==null){return}s.cancelBubble=true;this.conf.button_last=null;var u=this.cm.button[r.id][r.button_name];var o=this.w[r.id].b[r.button_name].button;if(u.conf.wins_menu_open&&this.conf.opened_menu==r.id){u.hideContextMenu()}else{this._hideContextMenu();u.showContextMenu(window.dhx4.absLeft(o),window.dhx4.absTop(o)+o.offsetHeight);this.conf.opened_menu=r.id}u=o=null}};this._hideContextMenu=function(u){if(u!=null){u=u||event;if(u.type=="keydown"&&u.keyCode!=27){return}var s=u.target||u.srcElement;var q=true;while(s!=null&&q==true){if(s.className!=null&&s.className.search(/SubLevelArea_Polygon/)>=0){q=false}else{s=s.parentNode}}}if(q||u==null){if(j.cm.global!=null){j.cm.global.hideContextMenu()}for(var r in j.cm.icon){if(j.cm.icon[r]!=null){j.cm.icon[r].hideContextMenu()}}for(var r in j.cm.button){for(var o in j.cm.button[r]){if(j.cm.button[r][o]!=null){j.cm.button[r][o].hideContextMenu()}}}}};this._detachContextMenu=function(r,q,o){if(this.cm==null){return}if(q==null){if(this.cm.global!=null){this.cm.global.unload();this.cm.global=null}}else{if(r=="icon"){if(this.cm.icon[q]!=null){this.cm.icon[q].unload();this.cm.icon[q]=null}}else{if(r=="button"){if(this.cm.button[q]!=null&&this.cm.button[q][o]!=null){this.cm.button[q][o].unload();this.cm.button[q][o]=null}}}}};this.attachEvent("_winMouseDown",this._showContextMenu);if(typeof(window.addEventListener)=="function"){window.addEventListener("mousedown",this._hideContextMenu,false);window.addEventListener("keydown",this._hideContextMenu,false)}else{document.body.attachEvent("onmousedown",this._hideContextMenu);document.body.attachEvent("onkeydown",this._hideContextMenu)}this._unloadContextMenu=function(){this._detachContextMenu("icon",null,null);this.cm=null;if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._hideContextMenu,false);window.removeEventListener("keydown",this._hideContextMenu,false)}else{document.body.detachEvent("onmousedown",this._hideContextMenu);document.body.detachEvent("onkeydown",this._hideContextMenu)}j=null}}return l};if(!window.dhtmlx){window.dhtmlx={}}(function(){var r=null;function u(A,x){var y=A.callback;s(false);A.box.parentNode.removeChild(A.box);r=A.box=null;if(y){y(x)}}function a(y){if(r){y=y||event;var x=y.which||event.keyCode;if(dhtmlx.message.keyboard){if(x==13||x==32){u(r,true)}if(x==27){u(r,false)}}if(y.preventDefault){y.preventDefault()}return !(y.cancelBubble=true)}}if(document.attachEvent){document.attachEvent("onkeydown",a)}else{document.addEventListener("keydown",a,true)}function s(y){if(!s.cover){s.cover=document.createElement("DIV");s.cover.onkeydown=a;s.cover.className="dhx_modal_cover";document.body.appendChild(s.cover)}var x=document.body.scrollHeight;s.cover.style.display=y?"inline-block":"none"}function m(y,x){return"<div class='dhtmlx_popup_button' result='"+x+"' ><div>"+y+"</div></div>"}function g(y){if(!v.area){v.area=document.createElement("DIV");v.area.className="dhtmlx_message_area";v.area.style[v.position]="5px";document.body.appendChild(v.area)}v.hide(y.id);var x=document.createElement("DIV");x.innerHTML="<div>"+y.text+"</div>";x.className="dhtmlx-info dhtmlx-"+y.type;x.onclick=function(){if(y){v.hide(y.id)}y=null};if(v.position=="bottom"&&v.area.firstChild){v.area.insertBefore(x,v.area.firstChild)}else{v.area.appendChild(x)}if(y.expire>0){v.timers[y.id]=window.setTimeout(function(){v.hide(y.id)},y.expire)}v.pull[y.id]=x;x=null;return y.id}function n(y,C,F){var E=document.createElement("DIV");E.className=" dhtmlx_modal_box dhtmlx-"+y.type;E.setAttribute("dhxbox",1);var x="";if(y.width){E.style.width=y.width}if(y.height){E.style.height=y.height}if(y.title){x+='<div class="dhtmlx_popup_title">'+y.title+"</div>"}x+='<div class="dhtmlx_popup_text"><span>'+(y.content?"":y.text)+'</span></div><div  class="dhtmlx_popup_controls">';if(C){x+=m(y.ok||"OK",true)}if(F){x+=m(y.cancel||"Cancel",false)}if(y.buttons){for(var A=0;A<y.buttons.length;A++){x+=m(y.buttons[A],A)}}x+="</div>";E.innerHTML=x;if(y.content){var D=y.content;if(typeof D=="string"){D=document.getElementById(D)}if(D.style.display=="none"){D.style.display=""}E.childNodes[y.title?1:0].appendChild(D)}E.onclick=function(J){J=J||event;var I=J.target||J.srcElement;if(!I.className){I=I.parentNode}if(I.className=="dhtmlx_popup_button"){var H=I.getAttribute("result");H=(H=="true")||(H=="false"?false:H);u(y,H)}};y.box=E;if(C||F){r=y}return E}function w(C,D,F){var E=C.tagName?C:n(C,D,F);if(!C.hidden){s(true)}document.body.appendChild(E);var A=C.left||Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-E.offsetWidth)/2));var H=C.top||Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-E.offsetHeight)/2));if(C.position=="top"){E.style.top="-3px"}else{E.style.top=H+"px"}E.style.left=A+"px";E.onkeydown=a;E.focus();if(C.hidden){dhtmlx.modalbox.hide(E)}return E}function q(x){return w(x,true,false)}function c(x){return w(x,true,true)}function l(x){return w(x)}function o(y,x,A){if(typeof y!="object"){if(typeof x=="function"){A=x;x=""}y={text:y,type:x,callback:A}}return y}function j(A,y,x,C){if(typeof A!="object"){A={text:A,type:y,expire:x,id:C}}A.id=A.id||v.uid();A.expire=A.expire||v.expire;return A}dhtmlx.alert=function(){var x=o.apply(this,arguments);x.type=x.type||"confirm";return q(x)};dhtmlx.confirm=function(){var x=o.apply(this,arguments);x.type=x.type||"alert";return c(x)};dhtmlx.modalbox=function(){var x=o.apply(this,arguments);x.type=x.type||"alert";return l(x)};dhtmlx.modalbox.hide=function(x){while(x&&x.getAttribute&&!x.getAttribute("dhxbox")){x=x.parentNode}if(x){x.parentNode.removeChild(x);s(false);r=null}};var v=dhtmlx.message=function(C,A,y,D){C=j.apply(this,arguments);C.type=C.type||"info";var x=C.type.split("-")[0];switch(x){case"alert":return q(C);case"confirm":return c(C);case"modalbox":return l(C);default:return g(C);break}};v.seed=(new Date()).valueOf();v.uid=function(){return v.seed++};v.expire=4000;v.keyboard=true;v.position="top";v.pull={};v.timers={};v.hideAll=function(){for(var x in v.pull){v.hide(x)}};v.hide=function(y){var x=v.pull[y];if(x&&x.parentNode){window.setTimeout(function(){x.parentNode.removeChild(x);x=null},2000);x.className+=" hidden";if(v.timers[y]){window.clearTimeout(v.timers[y])}delete v.pull[y]}}})();if(!window.dhx){dhx={}}dhx.assert=function(c,a){if(!c){dhx.assert_error(a)}};dhx.assert_error=function(message){dhx.log("error",message);if(dhx.message&&typeof message=="string"){dhx.message({type:"debug",text:message,expire:-1})}if(dhx.debug!==false){eval("debugger;")}};dhx.assert_core_ready=function(){if(window.dhx_on_core_ready){dhx_on_core_ready()}};dhx.version="3.0";dhx.codebase="./";dhx.name="Core";dhx.clone=function(c){var a=dhx.clone._function;a.prototype=c;return new a()};dhx.clone._function=function(){};dhx.extend=function(g,c,a){dhx.assert(g,"Invalid mixing target");dhx.assert(c,"Invalid mixing source");if(g._dhx_proto_wait){dhx.PowerArray.insertAt.call(g._dhx_proto_wait,c,1);return g}for(var j in c){if(!g[j]||a){g[j]=c[j]}}if(c.defaults){dhx.extend(g.defaults,c.defaults)}if(c.$init){c.$init.call(g)}return g};dhx.copy=function(a){dhx.assert(a,"Invalid mixing target");if(arguments.length>1){var c=arguments[0];a=arguments[1]}else{var c=(dhx.isArray(a)?[]:{})}for(var g in a){if(a[g]&&typeof a[g]=="object"&&!dhx.isDate(a[g])){c[g]=(dhx.isArray(a[g])?[]:{});dhx.copy(c[g],a[g])}else{c[g]=a[g]}}return c};dhx.single=function(g){var a=null;var c=function(j){if(!a){a=new g({})}if(a._reinit){a._reinit.apply(a,arguments)}return a};return c};dhx.protoUI=function(){if(dhx.debug_proto){dhx.log("UI registered: "+arguments[0].name)}var g=arguments;var a=g[0].name;var c=function(l){if(!c){return dhx.ui[a].prototype}var n=c._dhx_proto_wait;if(n){var m=[n[0]];for(var j=1;j<n.length;j++){m[j]=n[j];if(m[j]._dhx_proto_wait){m[j]=m[j].call(dhx,m[j].name)}if(m[j].prototype&&m[j].prototype.name){dhx.ui[m[j].prototype.name]=m[j]}}dhx.ui[a]=dhx.proto.apply(dhx,m);if(c._dhx_type_wait){for(var j=0;j<c._dhx_type_wait.length;j++){dhx.Type(dhx.ui[a],c._dhx_type_wait[j])}}c=n=null}if(this!=dhx){return new dhx.ui[a](l)}else{return dhx.ui[a]}};c._dhx_proto_wait=Array.prototype.slice.call(arguments,0);return dhx.ui[a]=c};dhx.proto=function(){if(dhx.debug_proto){dhx.log("Proto chain:"+arguments[0].name+"["+arguments.length+"]")}var m=arguments;var l=m[0];var c=!!l.$init;var o=[];dhx.assert(l,"Invalid mixing target");for(var j=m.length-1;j>0;j--){dhx.assert(m[j],"Invalid mixing source");if(typeof m[j]=="function"){m[j]=m[j].prototype}if(m[j].$init){o.push(m[j].$init)}if(m[j].defaults){var g=m[j].defaults;if(!l.defaults){l.defaults={}}for(var a in g){if(dhx.isUndefined(l.defaults[a])){l.defaults[a]=g[a]}}}if(m[j].type&&l.type){for(var a in m[j].type){if(!l.type[a]){l.type[a]=m[j].type[a]}}}for(var n in m[j]){if(!l[n]){l[n]=m[j][n]}}}if(c){o.push(l.$init)}l.$init=function(){for(var r=0;r<o.length;r++){o[r].apply(this,arguments)}};var q=function(r){this.$ready=[];dhx.assert(this.$init,"object without init method");this.$init(r);if(this._parseSettings){this._parseSettings(r,this.defaults)}for(var s=0;s<this.$ready.length;s++){this.$ready[s].call(this)}};q.prototype=l;l=m=null;return q};dhx.bind=function(c,a){return function(){return c.apply(a,arguments)}};dhx.require=function(c,o,n){if(typeof c!="string"){var m=c.length||0;var l=o;if(!m){for(var a in c){m++}o=function(){m--;if(m===0){l.apply(this,arguments)}};for(var a in c){dhx.require(a,o,n)}}else{o=function(){if(m){m--;dhx.require(c[c.length-m-1],o,n)}else{return l.apply(this,arguments)}};o()}return}if(dhx._modules[c]!==true){if(c.substr(-4)==".css"){var j=dhx.html.create("LINK",{type:"text/css",rel:"stylesheet",href:dhx.codebase+c});document.head.appendChild(j);if(o){o.call(n||window)}return}var g=arguments[4];if(!o){dhx.exec(dhx.ajax().sync().get(dhx.codebase+c).responseText);dhx._modules[c]=true}else{if(!dhx._modules[c]){dhx._modules[c]=[[o,n]];dhx.ajax(dhx.codebase+c,function(s){dhx.exec(s);var r=dhx._modules[c];dhx._modules[c]=true;for(var q=0;q<r.length;q++){r[q][0].call(r[q][1]||window,!q)}})}else{dhx._modules[c].push([o,n])}}}};dhx._modules={};dhx.exec=function(code){if(window.execScript){window.execScript(code)}else{window.eval(code)}};dhx.wrap=function(c,a){if(!c){return a}return function(){var g=c.apply(this,arguments);a.apply(this,arguments);return g}};dhx.isUndefined=function(c){return typeof c=="undefined"};dhx.delay=function(j,c,g,a){return window.setTimeout(function(){var l=j.apply(c,(g||[]));j=c=g=null;return l},a||1)};dhx.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}this._seed++;return this._seed};dhx.toNode=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};dhx.toArray=function(a){return dhx.extend((a||[]),dhx.PowerArray,true)};dhx.toFunctor=function(str){return(typeof(str)=="string")?eval(str):str};dhx.isArray=function(a){return Array.isArray?Array.isArray(a):(Object.prototype.toString.call(a)==="[object Array]")};dhx.isDate=function(a){return a instanceof Date};dhx._events={};dhx.event=function(j,g,a,c){j=dhx.toNode(j);var l=dhx.uid();if(c){a=dhx.bind(a,c)}dhx._events[l]=[j,g,a];if(j.addEventListener){j.addEventListener(g,a,false)}else{if(j.attachEvent){j.attachEvent("on"+g,a)}}return l};dhx.eventRemove=function(c){if(!c){return}dhx.assert(this._events[c],"Removing non-existing event");var a=dhx._events[c];if(a[0].removeEventListener){a[0].removeEventListener(a[1],a[2],false)}else{if(a[0].detachEvent){a[0].detachEvent("on"+a[1],a[2])}}delete this._events[c]};dhx.log=function(c,g,a){if(arguments.length==1){g=c;c="log"}if(window.console&&console.log){c=c.toLowerCase();if(window.console[c]){window.console[c](g||"unknown error")}else{window.console.log(c+": "+g)}if(a){window.console.log(a)}}};dhx.log_full_time=function(a){dhx._start_time_log=new Date();dhx.log("Timing start ["+a+"]");window.setTimeout(function(){var c=new Date();dhx.log("Timing end ["+a+"]:"+(c.valueOf()-dhx._start_time_log.valueOf())/1000+"s")},1)};dhx.log_time=function(a){var g="_start_time_log"+a;if(!dhx[g]){dhx[g]=new Date();dhx.log("Info","Timing start ["+a+"]")}else{var c=new Date();dhx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhx[g].valueOf())/1000+"s");dhx[g]=null}};dhx.debug_code=function(a){a.call(dhx)};dhx.EventSystem={$init:function(){if(!this._evs_events){this._evs_events={};this._evs_handlers={};this._evs_map={}}},blockEvent:function(){this._evs_events._block=true},unblockEvent:function(){this._evs_events._block=false},mapEvent:function(a){dhx.extend(this._evs_map,a,true)},on_setter:function(a){if(a){for(var c in a){if(typeof a[c]=="function"){this.attachEvent(c,a[c])}}}},callEvent:function(g,l){if(this._evs_events._block){return true}g=g.toLowerCase();var j=this._evs_events[g.toLowerCase()];var a=true;if(dhx.debug){dhx.log("info","["+this.name+"] event:"+g,l)}if(j){for(var c=0;c<j.length;c++){if(j[c].apply(this,(l||[]))===false){a=false}}}if(this._evs_map[g]&&!this._evs_map[g].callEvent(g,l)){a=false}return a},attachEvent:function(c,a,j){dhx.assert(a,"Invalid event handler for "+c);c=c.toLowerCase();j=j||dhx.uid();a=dhx.toFunctor(a);var g=this._evs_events[c]||dhx.toArray();g.push(a);this._evs_events[c]=g;this._evs_handlers[j]={f:a,t:c};return j},detachEvent:function(j){if(!this._evs_handlers[j]){return}var c=this._evs_handlers[j].t;var a=this._evs_handlers[j].f;var g=this._evs_events[c];g.remove(a);delete this._evs_handlers[j]},hasEvent:function(a){a=a.toLowerCase();return this._evs_events[a]?true:false}};dhx.extend(dhx,dhx.EventSystem);dhx.PowerArray={removeAt:function(c,a){if(c>=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,g){if(!g&&g!==0){this.push(c)}else{var a=this.splice(g,(this.length-g));this[g]=c;this.push.apply(this,a)}},find:function(c){for(var a=0;a<this.length;a++){if(c==this[a]){return a}}return -1},each:function(a,g){for(var c=0;c<this.length;c++){a.call((g||this),this[c])}},map:function(a,g){for(var c=0;c<this.length;c++){this[c]=a.call((g||this),this[c])}return this},filter:function(a,g){for(var c=0;c<this.length;c++){if(!a.call((g||this),this[c])){this.splice(c,1);c--}}return this}};dhx.env={};(function(){if(navigator.userAgent.indexOf("Mobile")!=-1){dhx.env.mobile=true}if(dhx.env.mobile||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("Android")!=-1){dhx.env.touch=true}if(navigator.userAgent.indexOf("Opera")!=-1){dhx.env.isOpera=true}else{dhx.env.isIE=!!document.all;dhx.env.isFF=!document.all;dhx.env.isWebKit=(navigator.userAgent.indexOf("KHTML")!=-1);dhx.env.isSafari=dhx.env.isWebKit&&(navigator.userAgent.indexOf("Mac")!=-1)}if(navigator.userAgent.toLowerCase().indexOf("android")!=-1){dhx.env.isAndroid=true}dhx.env.transform=false;dhx.env.transition=false;var g={};g.names=["transform","transition"];g.transform=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];g.transition=["transition","WebkitTransition","MozTransition","OTransition","msTransition"];var o=document.createElement("DIV");for(var m=0;m<g.names.length;m++){var l=g[g.names[m]];for(var c=0;c<l.length;c++){if(typeof o.style[l[c]]!="undefined"){dhx.env[g.names[m]]=l[c];break}}}o.style[dhx.env.transform]="translate3d(0,0,0)";dhx.env.translate=(o.style[dhx.env.transform])?"translate3d":"translate";var n="";var a=false;if(dhx.env.isOpera){n="-o-";a="O"}if(dhx.env.isFF){n="-Moz-"}if(dhx.env.isWebKit){n="-webkit-"}if(dhx.env.isIE){n="-ms-"}dhx.env.transformCSSPrefix=n;dhx.env.transformPrefix=a||(dhx.env.transformCSSPrefix.replace(/-/gi,""));dhx.env.transitionEnd=((dhx.env.transformCSSPrefix=="-Moz-")?"transitionend":(dhx.env.transformPrefix+"TransitionEnd"))})();dhx.env.svg=(function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")})();dhx.html={_native_on_selectstart:0,denySelect:function(){if(!dhx._native_on_selectstart){dhx._native_on_selectstart=document.onselectstart}document.onselectstart=dhx.html.stopEvent},allowSelect:function(){if(dhx._native_on_selectstart!==0){document.onselectstart=dhx._native_on_selectstart||null}dhx._native_on_selectstart=0},index:function(c){var a=0;while(c=c.previousSibling){a++}return a},_style_cache:{},createCss:function(g){var j="";for(var c in g){j+=c+":"+g[c]+";"}var a=this._style_cache[j];if(!a){a="s"+dhx.uid();this.addStyle("."+a+"{"+j+"}");this._style_cache[j]=a}return a},addStyle:function(c){var a=document.createElement("style");a.setAttribute("type","text/css");a.setAttribute("media","screen");if(a.styleSheet){a.styleSheet.cssText=c}else{a.appendChild(document.createTextNode(c))}document.getElementsByTagName("head")[0].appendChild(a)},create:function(c,a,g){a=a||{};var j=document.createElement(c);for(var l in a){j.setAttribute(l,a[l])}if(a.style){j.style.cssText=a.style}if(a["class"]){j.className=a["class"]}if(g){j.innerHTML=g}return j},getValue:function(a){a=dhx.toNode(a);if(!a){return""}return dhx.isUndefined(a.value)?a.innerHTML:a.value},remove:function(c){if(c instanceof Array){for(var a=0;a<c.length;a++){this.remove(c[a])}}else{if(c&&c.parentNode){c.parentNode.removeChild(c)}}},insertBefore:function(c,g,a){if(!c){return}if(g&&g.parentNode){g.parentNode.insertBefore(c,g)}else{a.appendChild(c)}},locate:function(c,j){if(c.tagName){var a=c}else{c=c||event;var a=c.target||c.srcElement}while(a){if(a.getAttribute){var g=a.getAttribute(j);if(g){return g}}a=a.parentNode}return null},offset:function(j){if(j.getBoundingClientRect){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{y:Math.round(r),x:Math.round(g)}}else{var r=0,g=0;while(j){r=r+parseInt(j.offsetTop,10);g=g+parseInt(j.offsetLeft,10);j=j.offsetParent}return{y:r,x:g}}},posRelative:function(a){a=a||event;if(!dhx.isUndefined(a.offsetX)){return{x:a.offsetX,y:a.offsetY}}else{return{x:a.layerX,y:a.layerY}}},pos:function(a){a=a||event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}var c=((dhx.env.isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:a.clientX+c.scrollLeft-c.clientLeft,y:a.clientY+c.scrollTop-c.clientTop}},preventEvent:function(a){if(a&&a.preventDefault){a.preventDefault()}return dhx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=true;return false},addCss:function(c,a){c.className+=" "+a},removeCss:function(c,a){c.className=c.className.replace(RegExp(" "+a,"g"),"")}};dhx.ready=function(a){if(this._ready){a.call()}else{this._ready_code.push(a)}};dhx._ready_code=[];(function(){var a=document.getElementsByTagName("SCRIPT");dhx.assert(a.length,"Can't locate codebase");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhx.codebase=a.slice(0,a.length).join("/")+"/"}dhx.event(window,"load",function(){dhx4.callEvent("onReady",[]);dhx.delay(function(){dhx._ready=true;for(var c=0;c<dhx._ready_code.length;c++){dhx._ready_code[c].call()}dhx._ready_code=[]})})})();dhx.locale=dhx.locale||{};dhx.assert_core_ready();dhx.ready(function(){dhx.event(document.body,"click",function(a){dhx4.callEvent("onClick",[a||event])})});(function(){var g={};var c=new RegExp("(\\r\\n|\\n)","g");var a=new RegExp('(\\")',"g");dhx.Template=function(l){if(typeof l=="function"){return l}if(g[l]){return g[l]}l=(l||"").toString();if(l.indexOf("->")!=-1){l=l.split("->");switch(l[0]){case"html":l=dhx.html.getValue(l[1]);break;case"http":l=new dhx.ajax().sync().get(l[1],{uid:dhx.uid()}).responseText;break;default:break}}l=(l||"").toString();l=l.replace(c,"\\n");l=l.replace(a,'\\"');l=l.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');l=l.replace(/\{common\.([^}\(]*)\}/g,"\"+(common.$1||'')+\"");l=l.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"');l=l.replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"');l=l.replace("{obj}",'"+obj+"');l=l.replace(/#([^#'";, ]+)#/gi,'"+(obj.$1)+"');try{g[l]=Function("obj","common",'return "'+l+'";')}catch(j){dhx.assert_error("Invalid template:"+l)}return g[l]};dhx.Template.empty=function(){return""};dhx.Template.bind=function(j){return dhx.bind(dhx.Template(j),this)};dhx.Type=function(o,n){if(o._dhx_proto_wait){if(!o._dhx_type_wait){o._dhx_type_wait=[]}o._dhx_type_wait.push(n);return}if(typeof o=="function"){o=o.prototype}if(!o.types){o.types={"default":o.type};o.type.name="default"}var j=n.name;var m=o.type;if(j){m=o.types[j]=dhx.clone(n.baseType?o.types[n.baseType]:o.type)}for(var l in n){if(l.indexOf("template")===0){m[l]=dhx.Template(n[l])}else{m[l]=n[l]}}return j}})();dhx.Settings={$init:function(){this._settings=this.config={}},define:function(c,a){if(typeof c=="object"){return this._parseSeetingColl(c)}return this._define(c,a)},_define:function(c,a){var g=this[c+"_setter"];return this._settings[c]=g?g.call(this,a,c):a},_parseSeetingColl:function(g){if(g){for(var c in g){this._define(c,g[c])}}},_parseSettings:function(g,a){var c={};if(a){c=dhx.extend(c,a)}if(typeof g=="object"&&!g.tagName){dhx.extend(c,g,true)}this._parseSeetingColl(c)},_mergeSettings:function(a,g){for(var c in g){switch(typeof a[c]){case"object":a[c]=this._mergeSettings((a[c]||{}),g[c]);break;case"undefined":a[c]=g[c];break;default:break}}return a},debug_freid_c_id:true,debug_freid_a_name:true};dhx.ajax=function(a,c,g){if(arguments.length!==0){var j=new dhx.ajax();if(g){j.master=g}return j.get(a,null,c)}if(!this.getXHR){return new dhx.ajax()}return this};dhx.ajax.count=0;dhx.ajax.prototype={master:null,getXHR:function(){if(dhx.env.isIE){return new ActiveXObject("Microsoft.xmlHTTP")}else{return new XMLHttpRequest()}},send:function(l,q,n){var c=this.getXHR();if(!dhx.isArray(n)){n=[n]}if(typeof q=="object"){var m=[];for(var g in q){var o=q[g];if(o===null||o===dhx.undefined){o=""}m.push(g+"="+encodeURIComponent(o))}q=m.join("&")}if(q&&this.request==="GET"){l=l+(l.indexOf("?")!=-1?"&":"?")+q;q=null}c.open(this.request,l,!this._sync);if(this.request==="POST"){c.setRequestHeader("Content-type","application/x-www-form-urlencoded")}var j=this;c.onreadystatechange=function(){if(!c.readyState||c.readyState==4){if(dhx.debug_time){dhx.log_full_time("data_loading")}dhx.ajax.count++;if(n&&j){for(var a=0;a<n.length;a++){if(n[a]){var r=(n[a].success||n[a]);if(c.status>=400||(!c.status&&!c.responseText)){r=n[a].error}if(r){r.call((j.master||j),c.responseText,c.responseXML,c)}}}}if(j){j.master=null}n=j=null}};c.send(q||null);return c},get:function(a,g,c){if(arguments.length==2){c=g;g=null}this.request="GET";return this.send(a,g,c)},post:function(a,g,c){this.request="POST";return this.send(a,g,c)},put:function(a,g,c){this.request="PUT";return this.send(a,g,c)},del:function(a,g,c){this.request="DELETE";return this.send(a,g,c)},sync:function(){this._sync=true;return this},bind:function(a){this.master=a;return this}};dhx.send=function(g,c,n,m){var j=dhx.html.create("FORM",{target:(m||"_self"),action:g,method:(n||"POST")},"");for(var a in c){var l=dhx.html.create("INPUT",{type:"hidden",name:a,value:c[a]},"");j.appendChild(l)}j.style.display="none";document.body.appendChild(j);j.submit();document.body.removeChild(j)};dhx.AtomDataLoader={$init:function(a){this.data={};if(a){this._settings.datatype=a.datatype||"json";this.$ready.push(this._load_when_ready)}},_load_when_ready:function(){this._ready_for_data=true;if(this._settings.url){this.url_setter(this._settings.url)}if(this._settings.data){this.data_setter(this._settings.data)}},url_setter:function(a){if(!this._ready_for_data){return a}this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data){return a}this.parse(a,this._settings.datatype);return true},debug_freid_c_datatype:true,debug_freid_c_dataFeed:true,load:function(a,c){if(a.$proxy){a.load(this,typeof c=="string"?c:"json");return}this.callEvent("onXLS",[]);if(typeof c=="string"){this.data.driver=dhx.DataDriver[c];c=arguments[2]}else{if(!this.data.driver){this.data.driver=dhx.DataDriver.json}}var g=[{success:this._onLoad,error:this._onLoadError}];if(c){if(dhx.isArray(c)){g.push.apply(g,c)}else{g.push(c)}}return dhx.ajax(a,g,this)},parse:function(c,a){this.callEvent("onXLS",[]);this.data.driver=dhx.DataDriver[a||"json"];this._onLoad(c,null)},_onLoad:function(n,c,a,g){var l=this.data.driver;var j=l.toObject(n,c);if(j){var m=l.getRecords(j)[0];this.data=(l?l.getDetails(m):n)}else{this._onLoadError(n,c,a)}this.callEvent("onXLE",[])},_onLoadError:function(g,a,c){this.callEvent("onXLE",[]);this.callEvent("onLoadError",arguments);dhx4.callEvent("onLoadError",[g,a,c,this])},_check_data_feed:function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.callEvent("onXLS",[]);dhx.ajax(a,function(m,j,g){this._ignore_feed=true;var l=dhx.DataDriver.toObject(m,j);if(l){this.setValues(l.getDetails(l.getRecords()[0]))}else{this._onLoadError(m,j,g)}this._ignore_feed=false;this.callEvent("onXLE",[])},this);return false}};dhx.DataDriver={};dhx.DataDriver.json={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){try{eval("dhx.temp="+data)}catch(e){dhx.assert_error(e);return null}data=dhx.temp}if(data.data){var t=data.data.config={};for(var key in data){if(key!="data"){t[key]=data[key]}}data=data.data}return data},getRecords:function(a){if(a&&!dhx.isArray(a)){return[a]}return a},getDetails:function(a){if(typeof a=="string"){return{id:dhx.uid(),value:a}}return a},getInfo:function(c){var a=c.config;if(!a){return{}}return{_size:(a.total_count||0),_from:(a.pos||0),_parent:(a.parent||0),_config:(a.config),_key:(a.dhx_security)}},child:"data"};dhx.DataDriver.html={toObject:function(c){if(typeof c=="string"){var a=null;if(c.indexOf("<")==-1){a=dhx.toNode(c)}if(!a){a=document.createElement("DIV");a.innerHTML=c}return a.getElementsByTagName(this.tag)}return c},getRecords:function(c){var g=[];for(var a=0;a<c.childNodes.length;a++){var j=c.childNodes[a];if(j.nodeType==1){g.push(j)}}return g},getDetails:function(a){return dhx.DataDriver.xml.tagToObject(a)},getInfo:function(a){return{_size:0,_from:0}},tag:"LI"};dhx.DataDriver.jsarray={toObject:function(data){if(typeof data=="string"){eval("dhx.temp="+data);return dhx.temp}return data},getRecords:function(a){return a},getDetails:function(g){var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}}};dhx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(g){g=this.stringToArray(g);var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}},stringToArray:function(c){c=c.split(this.cell);for(var a=0;a<c.length;a++){c[a]=c[a].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"")}return c},row:"\n",cell:","};dhx.DataDriver.xml={_isValidXML:function(a){if(!a||!a.documentElement){return null}if(a.getElementsByTagName("parsererror").length){return null}return a},toObject:function(g,a){if(this._isValidXML(c)){return c}if(typeof g=="string"){var c=this.fromString(g.replace(/^[\s]+/,""))}else{c=g}if(this._isValidXML(c)){return c}return null},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(c){var a=this.xpath(c,this.config);if(a.length){a=this.assignTypes(this.tagToObject(a[0],{}))}else{a=null}return{_size:(c.documentElement.getAttribute("total_count")||0),_from:(c.documentElement.getAttribute("pos")||0),_parent:(c.documentElement.getAttribute("parent")||0),_config:a,_key:(c.documentElement.getAttribute("dhx_security")||null)}},xpath:function(j,q){if(window.XPathResult){var g=j;if(j.nodeName.indexOf("document")==-1){j=j.ownerDocument}var n=[];var c=j.evaluate(q,g,null,XPathResult.ANY_TYPE,null);var o=c.iterateNext();while(o){n.push(o);o=c.iterateNext()}return n}else{var m=true;try{if(typeof(j.selectNodes)=="undefined"){m=false}}catch(l){}if(m){return j.selectNodes(q)}else{var a=q.split("/").pop();return j.getElementsByTagName(a)}}},assignTypes:function(c){for(var a in c){var g=c[a];if(typeof g=="object"){this.assignTypes(g)}else{if(typeof g=="string"){if(g===""){continue}if(g=="true"){c[a]=true}else{if(g=="false"){c[a]=false}else{if(g==g*1){c[a]=c[a]*1}}}}}}return c},tagToObject:function(g,q){q=q||{};var l=false;var j=g.attributes;if(j&&j.length){for(var n=0;n<j.length;n++){q[j[n].name]=j[n].value}l=true}var c=g.childNodes;var o={};for(var n=0;n<c.length;n++){if(c[n].nodeType==1){var m=c[n].tagName;if(typeof q[m]!="undefined"){if(!dhx.isArray(q[m])){q[m]=[q[m]]}q[m].push(this.tagToObject(c[n],{}))}else{q[c[n].tagName]=this.tagToObject(c[n],{})}l=true}}if(!l){return this.nodeValue(g)}q.value=q.value||this.nodeValue(g);return q},nodeValue:function(a){if(a.firstChild){return a.firstChild.data}return""},fromString:function(g){try{if(window.DOMParser){return(new DOMParser()).parseFromString(g,"text/xml")}if(window.ActiveXObject){var a=new ActiveXObject("Microsoft.xmlDOM");a.loadXML(g);return a}}catch(c){dhx.assert_error(c);return null}dhx.assert_error("Load from xml string is not supported")}};dhx.DataLoader=dhx.proto({$init:function(a){a=a||"";this._ajax_queue=dhx.toArray();this.data=new dhx.DataStore();this.data.attachEvent("onClearAll",dhx.bind(this._call_onclearall,this));this.data.attachEvent("onServerConfig",dhx.bind(this._call_on_config,this));this.data.feed=this._feed},_feed:function(g,a,c){if(this._load_count){return this._load_count=[g,a,c]}else{this._load_count=true}this._feed_last=[g,a];this._feed_common.call(this,g,a,c)},_feed_common:function(j,c,g){var a=this.data.url;if(j<0){j=0}this.load(a+((a.indexOf("?")==-1)?"?":"&")+(this.dataCount()?("continue=true&"):"")+"start="+j+"&count="+c,[this._feed_callback,g])},_feed_callback:function(){var a=this._load_count;var c=this._feed_last;this._load_count=false;if(typeof a=="object"&&(a[0]!=c[0]||a[1]!=c[1])){this.data.feed.apply(this,a)}},load:function(a,c){var g=dhx.AtomDataLoader.load.apply(this,arguments);this._ajax_queue.push(g);if(!this.data.url){this.data.url=a}},loadNext:function(g,l,j,c,a){if(this._settings.datathrottle&&!a){if(this._throttle_request){window.clearTimeout(this._throttle_request)}this._throttle_request=dhx.delay(function(){this.loadNext(g,l,j,c,true)},this,0,this._settings.datathrottle);return}if(!l&&l!==0){l=this.dataCount()}this.data.url=this.data.url||c;if(this.callEvent("onDataRequest",[l,g,j,c])&&this.data.url){this.data.feed.call(this,l,g,j)}},_maybe_loading_already:function(c,g){var a=this._feed_last;if(this._load_count&&a){if(a[0]<=g&&(a[1]+a[0]>=c+g)){return true}}return false},_onLoad:function(j,c,a){this._ajax_queue.remove(a);var g=this.data.driver.toObject(j,c);if(g){this.data._parse(g)}else{return this._onLoadError(j,c,a)}this._call_onready();this.callEvent("onXLE",[])},removeMissed_setter:function(a){return this.data._removeMissed=a},scheme_setter:function(a){this.data.scheme(a)},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhx.bind(function(n,m){if(this._settings.dataFeed){var l={};if(!n&&!m){return}if(typeof n=="function"){if(!m){return}n(m,l)}else{l={text:m}}this.clearAll();var c=this._settings.dataFeed;var j=[];if(typeof c=="function"){return c.call(this,m,l)}for(var g in l){j.push("dhx_filter["+g+"]="+encodeURIComponent(l[g]))}this.load(c+(c.indexOf("?")<0?"?":"&")+j.join("&"),this._settings.datatype);return false}},this));return a},debug_freid_c_ready:true,debug_freid_c_datathrottle:true,_call_onready:function(){if(this._settings.ready&&!this._ready_was_used){var a=dhx.toFunctor(this._settings.ready);if(a){dhx.delay(a,this,arguments)}this._ready_was_used=true}},_call_onclearall:function(){for(var a=0;a<this._ajax_queue.length;a++){this._ajax_queue[a].abort()}this._ajax_queue=dhx.toArray()},_call_on_config:function(a){this._parseSeetingColl(a)}},dhx.AtomDataLoader);dhx.DataStore=function(){this.name="DataStore";dhx.extend(this,dhx.EventSystem);this.setDriver("json");this.pull={};this.order=dhx.toArray();this._marks={}};dhx.DataStore.prototype={setDriver:function(a){dhx.assert(dhx.DataDriver[a],"incorrect DataDriver");this.driver=dhx.DataDriver[a]},_parse:function(g,a){this.callEvent("onParse",[this.driver,g]);if(this._filter_order){this.filter()}var j=this.driver.getInfo(g);if(j._key){dhx.securityKey=j._key}if(j._config){this.callEvent("onServerConfig",[j._config])}var c=this.driver.getRecords(g);this._inner_parse(j,c);if(this._scheme_group&&this._group_processing){this._group_processing(this._scheme_group)}if(this._scheme_sort){this.blockEvent();this.sort(this._scheme_sort);this.unblockEvent()}this.callEvent("onStoreLoad",[this.driver,g]);this.refresh()},_inner_parse:function(c,o){var r=(c._from||0)*1;var n=true;var q=false;if(r===0&&this.order[0]){if(this._removeMissed){q={};for(var l=0;l<this.order.length;l++){q[this.order[l]]=true}}n=false;r=this.order.length}var g=0;for(var l=0;l<o.length;l++){var s=this.driver.getDetails(o[l]);var a=this.id(s);if(!this.pull[a]){this.order[g+r]=a;g++}else{if(n&&this.order[g+r]){g++}}if(this.pull[a]){dhx.extend(this.pull[a],s,true);if(this._scheme_update){this._scheme_update(this.pull[a])}if(q){delete q[a]}}else{this.pull[a]=s;if(this._scheme_init){this._scheme_init(s)}}}if(q){this.blockEvent();for(var m in q){this.remove(m)}this.unblockEvent()}if(!this.order[c._size-1]){this.order[c._size-1]=dhx.undefined}},id:function(a){return a.id||(a.id=dhx.uid())},changeId:function(c,a){if(this.pull[c]){this.pull[a]=this.pull[c]}this.pull[a].id=a;this.order[this.order.find(c)]=a;if(this._filter_order){this._filter_order[this._filter_order.find(c)]=a}if(this._marks[c]){this._marks[a]=this._marks[c];delete this._marks[c]}this.callEvent("onIdChange",[c,a]);if(this._render_change_id){this._render_change_id(c,a)}delete this.pull[c]},item:function(a){return this.pull[a]},update:function(c,a){if(dhx.isUndefined(a)){a=this.item(c)}if(this._scheme_update){this._scheme_update(a)}if(this.callEvent("onBeforeUpdate",[c,a])===false){return false}this.pull[c]=a;this.callEvent("onStoreUpdated",[c,a,"update"])},refresh:function(a){if(this._skip_refresh){return}if(a){this.callEvent("onStoreUpdated",[a,this.pull[a],"paint"])}else{this.callEvent("onStoreUpdated",[null,null,null])}},silent:function(c,a){this._skip_refresh=true;c.call(a||this);this._skip_refresh=false},getRange:function(j,g){if(j){j=this.indexById(j)}else{j=(this.$min||this.startOffset)||0}if(g){g=this.indexById(g)}else{g=Math.min(((this.$max||this.endOffset)||Infinity),(this.dataCount()-1));if(g<0){g=0}}if(j>g){var c=g;g=j;j=c}return this.getIndexRange(j,g)},getIndexRange:function(j,g){g=Math.min((g||Infinity),this.dataCount()-1);var a=dhx.toArray();for(var c=(j||0);c<=g;c++){a.push(this.item(this.order[c]))}return a},dataCount:function(){return this.order.length},exists:function(a){return !!(this.pull[a])},move:function(a,j){dhx.assert(a>=0&&j>=0,"DataStore::move","Incorrect indexes");var g=this.idByIndex(a);var c=this.item(g);this.order.removeAt(a);this.order.insertAt(g,Math.min(this.order.length,j));this.callEvent("onStoreUpdated",[g,c,"move"])},scheme:function(a){this._scheme={};this._scheme_init=a.$init;this._scheme_update=a.$update;this._scheme_serialize=a.$serialize;this._scheme_group=a.$group;this._scheme_sort=a.$sort;for(var c in a){if(c.substr(0,1)!="$"){this._scheme[c]=a[c]}}},sync:function(j,g,a){if(typeof j=="string"){j=$$("source")}if(typeof g!="function"){a=g;g=null}if(dhx.debug_bind){this.debug_sync_master=j;dhx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}this._backbone_source=false;if(j.name!="DataStore"){if(j.data&&j.data.name=="DataStore"){j=j.data}else{this._backbone_source=true}}var c=dhx.bind(function(o,l,n){if(this._backbone_source){if(!o){return}if(o.indexOf("change")===0){if(o=="change"){this.pull[l.id]=l.attributes;this.refresh(l.id);return}else{return}}if(o=="reset"){n=l}this.order=[];this.pull={};this._filter_order=null;for(var m=0;m<n.models.length;m++){var q=n.models[m].id;this.order.push(q);this.pull[q]=n.models[m].attributes}}else{this._filter_order=null;this.order=dhx.toArray([].concat(j.order));this.pull=j.pull}if(g){this.silent(g)}if(this._on_sync){this._on_sync()}if(dhx.debug_bind){dhx.log("[sync:request] "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id+" <= "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id)}this.callEvent("onSyncApply",[]);if(!a){this.refresh()}else{a=false}},this);if(this._backbone_source){j.bind("all",c)}else{this._sync_events=[j.attachEvent("onStoreUpdated",c),j.attachEvent("onIdChange",dhx.bind(function(l,m){this.changeId(l,m)},this))]}c()},add:function(m,c){if(this._scheme){for(var g in this._scheme){if(dhx.isUndefined(m[g])){m[g]=this._scheme[g]}}}if(this._scheme_init){this._scheme_init(m)}var n=this.id(m);var a=arguments[2]||this.order;var l=a.length;if(dhx.isUndefined(c)||c<0){c=l}if(c>l){dhx.log("Warning","DataStore:add","Index of out of bounds");c=Math.min(a.length,c)}if(this.callEvent("onBeforeAdd",[n,m,c])===false){return false}dhx.assert(!this.exists(n),"Not unique ID");this.pull[n]=m;a.insertAt(n,c);if(this._filter_order){var j=this._filter_order.length;if(!c&&this.order.length){j=0}this._filter_order.insertAt(n,j)}this.callEvent("onAfterAdd",[n,c]);this.callEvent("onStoreUpdated",[n,m,"add"]);return n},remove:function(g){if(dhx.isArray(g)){for(var a=0;a<g.length;a++){this.remove(g[a])}return}if(this.callEvent("onBeforeDelete",[g])===false){return false}dhx.assert(this.exists(g),"Not existing ID in remove command"+g);var c=this.item(g);this.order.remove(g);if(this._filter_order){this._filter_order.remove(g)}delete this.pull[g];if(this._marks[g]){delete this._marks[g]}this.callEvent("onAfterDelete",[g]);this.callEvent("onStoreUpdated",[g,c,"delete"])},clearAll:function(){this.pull={};this.order=dhx.toArray();this._filter_order=this.url=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){if(a>=this.order.length||a<0){dhx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);if(!this.pull[c]){dhx.log("Warning","DataStore::indexById Non-existing ID: "+c)}return a},next:function(c,a){return this.order[this.indexById(c)+(a||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(c,a){return this.order[this.indexById(c)-(a||1)]},sort:function(l,c,a){var g=l;if(typeof l=="function"){g={as:l,dir:c}}else{if(typeof l=="string"){g={by:l.replace(/#/g,""),dir:c,as:a}}}var j=[g.by,g.dir,g.as];if(!this.callEvent("onBeforeSort",j)){return}this._sort_core(g);this.refresh();this.callEvent("onAfterSort",j)},_sort_core:function(a){if(this.order.length){var g=this._sort._create(a);var c=this.getRange(this.first(),this.last());c.sort(g);this.order=c.map(function(j){dhx.assert(j,"Client sorting can't be used with dynamic loading");return this.id(j)},this)}},_filter_reset:function(a){if(this._filter_order&&!a){this.order=this._filter_order;delete this._filter_order}},_filter_core:function(g,l,c){var j=dhx.toArray();for(var a=0;a<this.order.length;a++){var m=this.order[a];if(g(this.item(m),l)){j.push(m)}}if(!c||!this._filter_order){this._filter_order=this.order}this.order=j},filter:function(j,g,a){if(!this.callEvent("onBeforeFilter",[j,g])){return}this._filter_reset(a);if(!this.order.length){return}if(j){var c=j;g=g||"";if(typeof j=="string"){j=j.replace(/#/g,"");if(typeof g=="function"){c=function(l){return g(l[j])}}else{g=g.toString().toLowerCase();c=function(m,l){dhx.assert(m,"Client side filtering can't be used with dynamic loading");return(m[j]||"").toString().toLowerCase().indexOf(l)!=-1}}}this._filter_core(c,g,a,this._filterMode)}this.refresh();this.callEvent("onAfterFilter",[])},each:function(g,c){for(var a=0;a<this.order.length;a++){g.call((c||this),this.item(this.order[a]))}},_methodPush:function(a,c){return function(){return a[c].apply(a,arguments)}},addMark:function(l,j,a,c){var g=this._marks[l]||{};this._marks[l]=g;if(!g[j]){g[j]=c||true;if(a){this.item(l).$css=(this.item(l).$css||"")+" "+j;this.refresh(l)}}return g[j]},removeMark:function(l,j,a){var g=this._marks[l];if(g&&g[j]){delete g[j]}if(a){var c=this.item(l).$css;if(c){this.item(l).$css=c.replace(j,"");this.refresh(l)}}},hasMark:function(g,c){var a=this._marks[g];return(a&&a[c])},provideApi:function(j,c){this.debug_bind_master=j;if(c){this.mapEvent({onbeforesort:j,onaftersort:j,onbeforeadd:j,onafteradd:j,onbeforedelete:j,onafterdelete:j,onbeforeupdate:j})}var g=["sort","add","remove","exists","idByIndex","indexById","item","update","refresh","dataCount","filter","next","previous","clearAll","first","last","serialize","sync","addMark","removeMark","hasMark"];for(var a=0;a<g.length;a++){j[g[a]]=this._methodPush(this,g[a])}},serialize:function(){var j=this.order;var a=[];for(var c=0;c<j.length;c++){var g=this.pull[j[c]];if(this._scheme_serialize){g=this._scheme_serialize(g);if(g===false){continue}}a.push(g)}return a},_sort:{_create:function(a){return this._dir(a.dir,this._by(a.by,a.as))},_as:{date:function(g,c){g=g-0;c=c-0;return g>c?1:(g<c?-1:0)},"int":function(g,c){g=g*1;c=c*1;return g>c?1:(g<c?-1:0)},string_strict:function(g,c){g=g.toString();c=c.toString();return g>c?1:(g<c?-1:0)},string:function(g,c){if(!c){return 1}if(!g){return -1}g=g.toString().toLowerCase();c=c.toString().toLowerCase();return g>c?1:(g<c?-1:0)}},_by:function(c,a){if(!c){return a}if(typeof a!="function"){a=this._as[a||"string"]}dhx.assert(a,"Invalid sorting method");return function(j,g){return a(j[c],g[c])}},_dir:function(c,a){if(c=="asc"||!c){return a}return function(j,g){return a(j,g)*-1}}}};dhx.BaseBind={debug_freid_ignore:{id:true},bind:function(l,j,g){if(typeof l=="string"){l=dhx.ui.get(l)}if(l._initBindSource){l._initBindSource()}if(this._initBindSource){this._initBindSource()}if(!l.getBindData){dhx.extend(l,dhx.BindSource)}if(!this._bind_ready){var m=this.render;if(this.filter){var c=this._settings.id;this.data._on_sync=function(){l._bind_updated[c]=false}}this.render=function(){if(this._in_bind_processing){return}this._in_bind_processing=true;var n=this.callEvent("onBindRequest");this._in_bind_processing=false;return m.apply(this,((n===false)?arguments:[]))};if(this.getValue||this.getValues){this.save=function(){if(this.validate&&!this.validate()){return}l.setBindData((this.getValue?this.getValue:this.getValues()),this._settings.id)}}this._bind_ready=true}l.addBind(this._settings.id,j,g);if(dhx.debug_bind){dhx.log("[bind] "+this.name+"@"+this._settings.id+" <= "+l.name+"@"+l._settings.id)}var a=this._settings.id;this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return l.getBindData(a)});if(!this._settings.dataFeed&&this.loadNext){this.data.attachEvent("onStoreLoad",function(){l._bind_updated[a]=false})}if(this.isVisible(this._settings.id)){this.refresh()}},unbind:function(a){return this._unbind(a)},_unbind:function(g){g.removeBind(this._settings.id);var c=(this._sync_events||(this.data?this.data._sync_events:0));if(c&&g.data){for(var a=0;a<c.length;a++){g.data.detachEvent(c[a])}}}};dhx.BindSource={$init:function(){this._bind_hash={};this._bind_updated={};this._ignore_binds={};this._bind_specific_rules(this)},saveBatch:function(a){this._do_not_update_binds=true;a.call(this);this._do_not_update_binds=false;this._update_binds()},setBindData:function(c,a){if(a){this._ignore_binds[a]=true}if(dhx.debug_bind){dhx.log("[bind:save] "+this.name+"@"+this._settings.id+" <= @"+a)}if(this.setValue){this.setValue(c)}else{if(this.setValues){this.setValues(c)}else{var g=this.getCursor();if(g){c=dhx.extend(this.item(g),c,true);this.update(g,c)}}}this.callEvent("onBindUpdate",[c,a]);if(this.save){this.save()}if(a){this._ignore_binds[a]=false}},getBindData:function(a,g){if(this._bind_updated[a]){return false}var c=dhx.ui.get(a);if(c.isVisible(c._settings.id)){this._bind_updated[a]=true;if(dhx.debug_bind){dhx.log("[bind:request] "+this.name+"@"+this._settings.id+" => "+c.name+"@"+c._settings.id)}this._bind_update(c,this._bind_hash[a][0],this._bind_hash[a][1]);if(g&&c.filter){c.refresh()}}},addBind:function(a,g,c){this._bind_hash[a]=[g,c]},removeBind:function(a){delete this._bind_hash[a];delete this._bind_updated[a];delete this._ignore_binds[a]},_bind_specific_rules:function(a){if(a.filter){dhx.extend(this,dhx.CollectionBind)}else{if(a.setValue){dhx.extend(this,dhx.ValueBind)}else{dhx.extend(this,dhx.RecordBind)}}},_update_binds:function(){if(!this._do_not_update_binds){for(var a in this._bind_hash){if(this._ignore_binds[a]){continue}this._bind_updated[a]=false;this.getBindData(a,true)}}},_bind_update_common:function(g,c,a){if(g.setValue){g.setValue(a?a[c]:a)}else{if(!g.filter){if(!a&&g.clear){g.clear()}else{if(g._check_data_feed(a)){g.setValues(dhx.clone(a))}}}else{g.data.silent(function(){this.filter(c,a)})}}g.callEvent("onBindApply",[a,c,this])}};dhx.DataValue=dhx.proto({name:"DataValue",isVisible:function(){return true},$init:function(a){this.data=""||a;var c=(a&&a.id)?a.id:dhx.uid();this._settings={id:c};dhx.ui.views[c]=this},setValue:function(a){this.data=a;this.callEvent("onChange",[a])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);dhx.DataRecord=dhx.proto({name:"DataRecord",isVisible:function(){return true},$init:function(a){this.data=a||{};var c=(a&&a.id)?a.id:dhx.uid();this._settings={id:c};dhx.ui.views[c]=this},getValues:function(){return this.data},setValues:function(a){this.data=a;this.callEvent("onChange",[a])},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind,dhx.AtomDataLoader,dhx.Settings);dhx.DataCollection=dhx.proto({name:"DataCollection",isVisible:function(){if(!this.data.order.length&&!this.data._filter_order&&!this._settings.dataFeed){return false}return true},$init:function(a){this.data.provideApi(this,true);var c=(a&&a.id)?a.id:dhx.uid();this._settings.id=c;dhx.ui.views[c]=this;this.data.attachEvent("onStoreLoad",dhx.bind(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},dhx.DataLoader,dhx.EventSystem,dhx.BaseBind,dhx.Settings);dhx.ValueBind={$init:function(){this.attachEvent("onChange",this._update_binds)},_bind_update:function(l,j,g){var c=this.getValue()||"";if(g){c=g(c)}if(l.setValue){l.setValue(c)}else{if(!l.filter){var a={};a[j]=c;if(l._check_data_feed(c)){l.setValues(a)}}else{l.data.silent(function(){this.filter(j,c)})}}l.callEvent("onBindApply",[c,j,this])}};dhx.RecordBind={$init:function(){this.attachEvent("onChange",this._update_binds)},_bind_update:function(g,c){var a=this.getValues()||null;this._bind_update_common(g,c,a)}};dhx.CollectionBind={$init:function(){this._cursor=null;this.attachEvent("onSelectChange",function(c){var a=this.getSelected();this.setCursor(a?(a.id||a):null)});this.attachEvent("onAfterCursorChange",this._update_binds);this.data.attachEvent("onStoreUpdated",dhx.bind(function(g,a,c){if(g&&g==this.getCursor()&&c!="paint"){this._update_binds()}},this));this.data.attachEvent("onClearAll",dhx.bind(function(){this._cursor=null},this));this.data.attachEvent("onIdChange",dhx.bind(function(c,a){if(this._cursor==c){this._cursor=a}},this))},setCursor:function(a){if(a==this._cursor||(a!==null&&!this.item(a))){return}this.callEvent("onBeforeCursorChange",[this._cursor]);this._cursor=a;this.callEvent("onAfterCursorChange",[a])},getCursor:function(){return this._cursor},_bind_update:function(g,c){var a=this.item(this.getCursor())||this._settings.defaultData||null;this._bind_update_common(g,c,a)}};if(!dhx.ui){dhx.ui={}}if(!dhx.ui.views){dhx.ui.views={};dhx.ui.get=function(a){if(a._settings){return a}return dhx.ui.views[a]}}dhtmlXDataStore=function(c){var g=new dhx.DataCollection(c);var a="_dp_init";g[a]=function(l){var j="_methods";l[j]=["dummy","dummy","changeId","dummy"];this.data._old_names={add:"inserted",update:"updated","delete":"deleted"};this.data.attachEvent("onStoreUpdated",function(o,m,n){if(o&&!l._silent){l.setUpdated(o,true,this._old_names[n])}});j="_getRowData";l[j]=function(r,m){var o=this.obj.data.item(r);var q={id:r};q[this.action_param]=this.obj.getUserData(r);if(o){for(var n in o){q[n]=o[n]}}return q};this.changeId=function(n,m){this.data.changeId(n,m);l._silent=true;this.data.callEvent("onStoreUpdated",[m,this.item(m),"update"]);l._silent=false};j="_clearUpdateFlag";l[j]=function(){};this._userdata={}};g.dummy=function(){};g.setUserData=function(m,j,l){this._userdata[m]=l};g.getUserData=function(l,j){return this._userdata[l]};g.dataFeed=function(j){this.define("dataFeed",j)};dhx.extend(g,dhx.BindSource);return g};if(window.dhtmlXDataView){dhtmlXDataView.prototype._initBindSource=function(){this.isVisible=function(){if(!this.data.order.length&&!this.data._filter_order&&!this._settings.dataFeed){return false}return true};var a="_settings";this._settings=this._settings||this[a];if(!this._settings.id){this._settings.id=dhx.uid()}this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this._settings.id]=this}}if(window.dhtmlXChart){dhtmlXChart.prototype._initBindSource=function(){this.isVisible=function(){if(!this.data.order.length&&!this.data._filtered_state&&!this._settings.dataFeed){return false}return true};var a="_settings";this._settings=this._settings||this[a];if(!this._settings.id){this._settings.id=dhx.uid()}this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this._settings.id]=this}}dhx.BaseBind.unsync=function(a){return dhx.BaseBind._unbind.call(this,a)};dhx.BaseBind.unbind=function(a){return dhx.BaseBind._unbind.call(this,a)};dhx.BaseBind.legacyBind=function(){return dhx.BaseBind.bind.apply(this,arguments)};dhx.BaseBind.legacySync=function(a,c){if(this._initBindSource){this._initBindSource()}if(a._initBindSource){a._initBindSource()}this.attachEvent("onAfterEditStop",function(g){this.save(g);return true});this.attachEvent("onDataRequest",function(l,j){for(var g=l;g<l+j;g++){if(!a.data.order[g]){a.loadNext(j,l);return false}}});this.save=function(m){if(!m){m=this.getCursor()}var l=this.item(m);var g=a.item(m);for(var j in l){if(j.indexOf("$")!==0){g[j]=l[j]}}a.refresh(m)};if(a&&a.name=="DataCollection"){return a.data.sync.apply(this.data,arguments)}else{return this.data.sync.apply(this.data,arguments)}};if(window.dhtmlXForm){dhtmlXForm.prototype.bind=function(a){dhx.BaseBind.bind.apply(this,arguments);a.getBindData(this._settings.id)};dhtmlXForm.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXForm.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this}};dhtmlXForm.prototype._check_data_feed=function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.load(a);return false};dhtmlXForm.prototype.setValues=dhtmlXForm.prototype.setFormData;dhtmlXForm.prototype.getValues=function(){return this.getFormData(false,true)};dhtmlXForm.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXForm.prototype.refresh=dhtmlXForm.prototype.isVisible=function(a){return true}}if(window.scheduler){if(!window.Scheduler){window.Scheduler={}}Scheduler.$syncFactory=function(a){a.sync=function(g,l){if(this._initBindSource){this._initBindSource()}if(g._initBindSource){g._initBindSource()}var j="_process_loading";var c=function(r){a.clearAll();var m=g.data.order;var q=g.data.pull;var n=[];for(var o=0;o<m.length;o++){if(l&&l.copy){n[o]=dhx.clone(q[m[o]])}else{n[o]=q[m[o]]}}a[j](n);a.callEvent("onSyncApply",[])};this.save=function(o){if(!o){o=this.getCursor()}var n=this.item(o);var m=g.item(o);if(this.callEvent("onStoreSave",[o,n,m])){dhx.extend(g.item(o),n,true);g.update(o)}};this.item=function(m){return this.getEvent(m)};this._sync_events=[g.data.attachEvent("onStoreUpdated",function(o,m,n){c.call(this)}),g.data.attachEvent("onIdChange",function(n,m){combo.changeOptionId(n,m)})];this.attachEvent("onEventChanged",function(m){this.save(m)});this.attachEvent("onEventAdded",function(n,m){if(!g.data.pull[n]){g.add(m)}});this.attachEvent("onEventDeleted",function(m){if(g.data.pull[m]){g.remove(m)}});c()};a.unsync=function(c){dhx.BaseBind._unbind.call(this,c)};a._initBindSource=function(){if(!this._settings){this._settings={id:dhx.uid()}}}};Scheduler.$syncFactory(window.scheduler)}if(window.dhtmlXCombo){dhtmlXCombo.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXCombo.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXCombo.unsync=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXCombo.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXCombo.prototype.sync=function(c,j){if(this._initBindSource){this._initBindSource()}if(c._initBindSource){c._initBindSource()}var g=this;var a=function(l){g.clearAll();g.addOption(this.serialize());g.callEvent("onSyncApply",[])};this._sync_events=[c.data.attachEvent("onStoreUpdated",function(n,l,m){a.call(this)}),c.data.attachEvent("onIdChange",function(m,l){g.changeOptionId(m,l)})];a.call(c)};dhtmlXCombo.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhx4._eventable(this.data);this.attachEvent("onChange",function(){this.callEvent("onSelectChange",[this.getSelectedValue()])});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}};dhtmlXCombo.prototype.item=function(a){return this.getOption(a)};dhtmlXCombo.prototype.getSelected=function(){return this.getSelectedValue()};dhtmlXCombo.prototype.isVisible=function(){if(!this.optionsArr.length&&!this._settings.dataFeed){return false}return true};dhtmlXCombo.prototype.refresh=function(){this.render(true)}}if(window.dhtmlXGridObject){dhtmlXGridObject.prototype.bind=function(a,g,c){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXGridObject.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXGridObject.prototype.unsync=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXGridObject.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXGridObject.prototype.sync=function(a,q){if(this._initBindSource){this._initBindSource()}if(a._initBindSource){a._initBindSource()}var c=this;var o="_parsing";var g="_parser";var m="_locator";var j="_process_store_row";var n="_get_store_data";this.save=function(r){if(!r){r=this.getCursor()}dhx.extend(a.item(r),this.item(r),true);a.update(r)};var l=function(x){var u=c.getCursor?c.getCursor():null;var w=0;if(c._legacy_ignore_next){w=c._legacy_ignore_next;c._legacy_ignore_next=false}else{c.clearAll()}var s=this.dataCount();if(s){c[o]=true;for(var r=w;r<s;r++){var v=this.order[r];if(!v){continue}if(w&&c.rowsBuffer[r]){continue}c.rowsBuffer[r]={idd:v,data:this.pull[v]};c.rowsBuffer[r][g]=c[j];c.rowsBuffer[r][m]=c[n];c.rowsAr[v]=this.pull[v]}if(!c.rowsBuffer[s-1]){c.rowsBuffer[s-1]=dhtmlx.undefined;c.xmlFileUrl=c.xmlFileUrl||this.url}if(c.pagingOn){c.changePage()}else{if(c._srnd&&c._fillers){c._update_srnd_view()}else{c.render_dataset();c.callEvent("onXLE",[])}}c[o]=false}if(u&&c.setCursor){c.setCursor(c.rowsAr[u]?u:null)}c.callEvent("onSyncApply",[])};this._sync_events=[a.data.attachEvent("onStoreUpdated",function(u,r,s){if(s=="delete"){c.deleteRow(u);c.data.callEvent("onStoreUpdated",[u,r,s])}else{if(s=="update"){c.callEvent("onSyncUpdate",[r,s]);c.update(u,r);c.data.callEvent("onStoreUpdated",[u,r,s])}else{if(s=="add"){c.callEvent("onSyncUpdate",[r,s]);c.add(u,r,this.indexById(u));c.data.callEvent("onStoreUpdated",[u,r,s])}else{l.call(this)}}}}),a.data.attachEvent("onStoreLoad",function(s,r){c.xmlFileUrl=a.data.url;c._legacy_ignore_next=s.getInfo(r)._from}),a.data.attachEvent("onIdChange",function(s,r){c.changeRowId(s,r)})];c.attachEvent("onDynXLS",function(u,s){for(var r=u;r<u+s;r++){if(!a.data.order[r]){a.loadNext(s,u);return false}}c._legacy_ignore_next=u;l.call(a.data)});l.call(a.data);c.attachEvent("onEditCell",function(r,w,u,s,v){if(r==2&&s!=v){this.save(w)}return true});c.attachEvent("onClearAll",function(){var r="_f_rowsBuffer";this[r]=null});if(q&&q.sort){c.attachEvent("onBeforeSorting",function(u,s,r){if(s=="connector"){return false}var v=this.getColumnId(u);a.sort("#"+v+"#",(r=="asc"?"asc":"desc"),(s=="int"?s:"string"));c.setSortImgState(true,u,r);return false})}if(q&&q.filter){c.attachEvent("onFilterStart",function(u,r){var s="_con_f_used";if(c[s]&&c[s].length){return false}a.data.silent(function(){a.filter();for(var v=0;v<u.length;v++){if(r[v]==""){continue}var w=c.getColumnId(u[v]);a.filter("#"+w+"#",r[v],v!=0)}});a.refresh();return false});c.collectValues=function(r){var s=this.getColumnId(r);return(function(w){var u=[];var v={};this.data.each(function(y){var x=y[w];if(!v[x]){v[x]=true;u.push(x)}});u.sort();return u}).call(a,s)}}if(q&&q.select){c.attachEvent("onRowSelect",function(r){a.setCursor(r)})}c.clearAndLoad=function(r){a.clearAll();a.load(r)}};dhtmlXGridObject.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(g){g.call(this)},this)};dhx4._eventable(this.data);var a="_cCount";for(var c=0;c<this[a];c++){if(!this.columnIds[c]){this.columnIds[c]="cell"+c}}this.attachEvent("onSelectStateChanged",function(g){this.callEvent("onSelectChange",[g])});this.attachEvent("onSelectionCleared",function(){this.callEvent("onSelectChange",[null])});this.attachEvent("onEditCell",function(g,j){if(g===2&&this.getCursor){if(j&&j==this.getCursor()){this._update_binds()}}return true});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}};dhtmlXGridObject.prototype.item=function(m){if(m===null){return null}var l=this.getRowById(m);if(!l){return null}var a="_attrs";var j=dhx.copy(l[a]);j.id=m;var g=this.getColumnsNum();for(var c=0;c<g;c++){j[this.columnIds[c]]=this.cells(m,c).getValue()}return j};dhtmlXGridObject.prototype.update=function(m,l){for(var j=0;j<this.columnIds.length;j++){var g=this.columnIds[j];if(!dhx.isUndefined(l[g])){this.cells(m,j).setValue(l[g])}}var c="_attrs";var a=this.getRowById(m)[c];for(var g in l){a[g]=l[g]}this.callEvent("onBindUpdate",[m])};dhtmlXGridObject.prototype.add=function(n,m,g){var a=[];for(var l=0;l<this.columnIds.length;l++){var j=this.columnIds[l];a[l]=dhx.isUndefined(m[j])?"":m[j]}this.addRow(n,a,g);var c="_attrs";this.getRowById(n)[c]=dhx.copy(m)};dhtmlXGridObject.prototype.getSelected=function(){return this.getSelectedRowId()};dhtmlXGridObject.prototype.isVisible=function(){var a="_f_rowsBuffer";if(!this.rowsBuffer.length&&!this[a]&&!this._settings.dataFeed){return false}return true};dhtmlXGridObject.prototype.refresh=function(){this.render_dataset()};dhtmlXGridObject.prototype.filter=function(m,l){if(this._settings.dataFeed){var j={};if(!m&&!l){return}if(typeof m=="function"){if(!l){return}m(l,j)}else{if(dhx.isUndefined(m)){j=l}else{j[m]=l}}this.clearAll();var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,l,j)}var g=[];for(var c in j){g.push("dhx_filter["+c+"]="+encodeURIComponent(j[c]))}this.load(a+(a.indexOf("?")<0?"?":"&")+g.join("&"));return false}if(l===null){return this.filterBy(0,function(){return false})}this.filterBy(0,function(n,o){return m.call(this,o,l)})}}if(window.dhtmlXTreeObject){dhtmlXTreeObject.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXTreeObject.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXTreeObject.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXTreeObject.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhx4._eventable(this.data);this.attachEvent("onSelect",function(a){this.callEvent("onSelectChange",[a])});this.attachEvent("onEdit",function(a,c){if(a===2){if(c&&c==this.getCursor()){this._update_binds()}}return true})}};dhtmlXTreeObject.prototype.item=function(a){if(a===null){return null}return{id:a,text:this.getItemText(a)}};dhtmlXTreeObject.prototype.getSelected=function(){return this.getSelectedItemId()};dhtmlXTreeObject.prototype.isVisible=function(){return true};dhtmlXTreeObject.prototype.refresh=function(){};dhtmlXTreeObject.prototype.filter=function(m,l){if(this._settings.dataFeed){var j={};if(!m&&!l){return}if(typeof m=="function"){if(!l){return}m(l,j)}else{if(dhx.isUndefined(m)){j=l}else{j[m]=l}}this.deleteChildItems(0);var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,[(data.id||data),data])}var g=[];for(var c in j){g.push("dhx_filter["+c+"]="+encodeURIComponent(j[c]))}this.loadXML(a+(a.indexOf("?")<0?"?":"&")+g.join("&"));return false}};dhtmlXTreeObject.prototype.update=function(c,a){if(!dhx.isUndefined(a.text)){this.setItemText(c,a.text)}}}function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=true;this.updateMode="cell";this._tMode="GET";this._headers=null;this._payload=null;this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"};this.enableUTFencoding(true);dhx4._eventable(this);return this}dataProcessor.prototype={setTransactionMode:function(c,a){if(typeof c=="object"){this._tMode=c.mode||this._tMode;this._headers=this._headers||c.headers;this._payload=this._payload||c.payload}else{this._tMode=c;this._tSend=a}if(this._tMode=="REST"){this._tSend=false;this._endnm=true}},escape:function(a){if(this._utf){return encodeURIComponent(a)}else{return escape(a)}},enableUTFencoding:function(a){this._utf=dhx4.s2b(a)},setDataColumns:function(a){this._columns=(typeof a=="string")?a.split(","):a},getSyncState:function(){return !this.updatedRows.length},enableDataNames:function(a){this._endnm=dhx4.s2b(a)},enablePartialDataSend:function(a){this._changed=dhx4.s2b(a)},setUpdateMode:function(c,a){this.autoUpdate=(c=="cell");this.updateMode=c;this.dnd=a},ignore:function(c,a){this._silent_mode=true;c.call(a||window);this._silent_mode=false},setUpdated:function(j,g,l){if(this._silent_mode){return}var c=this.findRow(j);l=l||"updated";var a=this.obj.getUserData(j,this.action_param);if(a&&l=="updated"){l=a}if(g){this.set_invalid(j,false);this.updatedRows[c]=j;this.obj.setUserData(j,this.action_param,l);if(this._in_progress[j]){this._in_progress[j]="wait"}}else{if(!this.is_invalid(j)){this.updatedRows.splice(c,1);this.obj.setUserData(j,this.action_param,"")}}if(!g){this._clearUpdateFlag(j)}this.markRow(j,g,l);if(g&&this.autoUpdate){this.sendData(j)}},_clearUpdateFlag:function(a){},markRow:function(m,g,l){var j="";var c=this.is_invalid(m);if(c){j=this.styles[c];g=true}if(this.callEvent("onRowMark",[m,g,l,c])){j=this.styles[g?l:"clear"]+j;this.obj[this._methods[0]](m,j);if(c&&c.details){j+=this.styles[c+"_cell"];for(var a=0;a<c.details.length;a++){if(c.details[a]){this.obj[this._methods[1]](m,a,j)}}}}},getState:function(a){return this.obj.getUserData(a,this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(g,c,a){if(a){c={value:c,details:a,toString:function(){return this.value.toString()}}}this._invalid[g]=c},checkBeforeUpdate:function(a){return true},sendData:function(a){if(this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)){return}if(this.obj.editStop){this.obj.editStop()}if(typeof a=="undefined"||this._tSend){return this.sendAllData()}if(this._in_progress[a]){return false}this.messages=[];if(this.getState(a)!=="deleted"){if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidationError",[a,this.messages])){return false}}this._beforeSendData(this._getRowData(a),a)},_beforeSendData:function(a,c){if(!this.callEvent("onBeforeUpdate",[c,this.getState(c),a])){return false}this._sendData(a,c)},serialize:function(j,l){if(typeof j=="string"){return j}if(typeof l!="undefined"){return this.serialize_one(j,"")}else{var a=[];var g=[];for(var c in j){if(j.hasOwnProperty(c)){a.push(this.serialize_one(j[c],c+this.post_delim));g.push(c)}}a.push("ids="+this.escape(g.join(",")));if(dhtmlx.security_key){a.push("dhx_security="+dhtmlx.security_key)}return a.join("&")}},serialize_one:function(j,c){if(typeof j=="string"){return j}var a=[];for(var g in j){if(j.hasOwnProperty(g)){if((g=="id"||g==this.action_param)&&this._tMode=="REST"){continue}a.push(this.escape((c||"")+g)+"="+this.escape(j[g]))}}return a.join("&")},_sendData:function(l,m){if(!l){return}if(!this.callEvent("onBeforeDataSending",m?[m,this.getState(m),l]:[null,null,l])){return false}if(m){this._in_progress[m]=(new Date()).valueOf()}var r=this;var q=function(u){var w=[];if(m){w.push(m)}else{if(l){for(var v in l){w.push(v)}}}return r.afterUpdate(r,u,w)};var c=this.serverProcessor+(this._user?(dhtmlx.url(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");if(this._tMode=="GET"){dhx4.ajax.get(c+((c.indexOf("?")!=-1)?"&":"?")+this.serialize(l,m),q)}else{if(this._tMode=="POST"){dhx4.ajax.post(c,this.serialize(l,m),q)}else{if(this._tMode=="REST"){var g=this.getState(m);var j=c.replace(/(\&|\?)editing\=true/,"");var n=j.split("?");if(n[1]){n[1]="?"+n[1]}var o="";var a="post";if(g=="inserted"){o=this.serialize(l,m)}else{if(g=="deleted"){a="DELETE";j=n[0]+m+n[1]}else{a="PUT";o=this.serialize(l,m);j=n[0]+m+n[1]}}if(this._payload){for(var s in this._payload){j=j+(j.indexOf("?")===-1?"?":"&")+this.escape(s)+"="+this.escape(this._payload[s])}}dhx4.ajax.query({url:j,method:a,headers:this._headers,data:o,callback:q})}}}this._waitMode++},sendAllData:function(){if(!this.updatedRows.length){return}this.messages=[];var c=true;for(var a=0;a<this.updatedRows.length;a++){if(this.getState(this.updatedRows[a])!=="deleted"){c&=this.checkBeforeUpdate(this.updatedRows[a])}}if(!c&&!this.callEvent("onValidationError",["",this.messages])){return false}if(this._tSend){this._sendData(this._getAllData())}else{for(var a=0;a<this.updatedRows.length;a++){if(!this._in_progress[this.updatedRows[a]]){if(this.is_invalid(this.updatedRows[a])){continue}this._beforeSendData(this._getRowData(this.updatedRows[a]),this.updatedRows[a]);if(this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)){return}}}}},_getAllData:function(j){var c={};var a=false;for(var g=0;g<this.updatedRows.length;g++){var l=this.updatedRows[g];if(this._in_progress[l]||this.is_invalid(l)){continue}if(!this.callEvent("onBeforeUpdate",[l,this.getState(l),this._getRowData(l)])){continue}c[l]=this._getRowData(l,l+this.post_delim);a=true;this._in_progress[l]=(new Date()).valueOf()}return a?c:null},setVerificator:function(c,a){this.mandatoryFields[c]=a||(function(g){return(g!=="")})},clearVerificator:function(a){this.mandatoryFields[a]=false},findRow:function(c){var a=0;for(a=0;a<this.updatedRows.length;a++){if(c==this.updatedRows[a]){break}}return a},defineAction:function(a,c){if(!this._uActions){this._uActions=[]}this._uActions[a]=c},afterUpdateCallback:function(c,n,m,l){var a=c;var j=(m!="error"&&m!="invalid");if(!j){this.set_invalid(c,m)}if((this._uActions)&&(this._uActions[m])&&(!this._uActions[m](l))){return(delete this._in_progress[a])}if(this._in_progress[a]!="wait"){this.setUpdated(c,false)}var g=c;switch(m){case"inserted":case"insert":if(n!=c){this.obj[this._methods[2]](c,n);c=n}break;case"delete":case"deleted":this.obj.setUserData(c,this.action_param,"true_deleted");this.obj[this._methods[3]](c);delete this._in_progress[a];return this.callEvent("onAfterUpdate",[c,m,n,l]);break}if(this._in_progress[a]!="wait"){if(j){this.obj.setUserData(c,this.action_param,"")}delete this._in_progress[a]}else{delete this._in_progress[a];this.setUpdated(n,true,this.obj.getUserData(c,this.action_param))}this.callEvent("onAfterUpdate",[g,m,n,l])},afterUpdate:function(o,n,a){if(window.JSON){try{var u=JSON.parse(n.xmlDoc.responseText);var j=u.action||this.getState(a)||"updated";var c=u.sid||a[0];var g=u.tid||a[0];o.afterUpdateCallback(c,g,j,u);o.finalizeUpdate();return}catch(q){}}var s=dhx4.ajax.xmltop("data",n.xmlDoc);if(!s||s.tagName=="DIV"){return this.cleanUpdate(a)}var r=dhx4.ajax.xpath("//data/action",s);if(!r.length){return this.cleanUpdate(a)}for(var m=0;m<r.length;m++){var l=r[m];var j=l.getAttribute("type");var c=l.getAttribute("sid");var g=l.getAttribute("tid");o.afterUpdateCallback(c,g,j,l)}o.finalizeUpdate()},cleanUpdate:function(c){if(c){for(var a=0;a<c.length;a++){delete this._in_progress[c[a]]}}},finalizeUpdate:function(){if(this._waitMode){this._waitMode--}if((this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length){this.sendData()}this.callEvent("onAfterUpdateFinish",[]);if(!this.updatedRows.length){this.callEvent("onFullSync",[])}},init:function(a){this.obj=a;if(this.obj._dp_init){this.obj._dp_init(this)}},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(a){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(g,c){g=g||2000;this._user=c||(new Date()).valueOf();this._need_update=false;this._loader=null;this._update_busy=false;this.attachEvent("onAfterUpdate",function(j,m,n,l){this.afterAutoUpdate(j,m,n,l)});this.attachEvent("onFullSync",function(){this.fullSync()});var a=this;window.setInterval(function(){a.loadUpdate()},g)},afterAutoUpdate:function(a,g,j,c){if(g=="collision"){this._need_update=true;return false}else{return true}},fullSync:function(){if(this._need_update==true){this._need_update=false;this.loadUpdate()}return true},getUpdates:function(a,c){if(this._update_busy){return false}else{this._update_busy=true}this._loader=this._loader||new dtmlXMLLoaderObject(true);this._loader.async=true;this._loader.waitCall=c;this._loader.loadXML(a)},_v:function(a){if(a.firstChild){return a.firstChild.nodeValue}return""},_a:function(a){var g=[];for(var c=0;c<a.length;c++){g[c]=this._v(a[c])}return g},loadUpdate:function(){var c=this;var a=this.obj.getUserData(0,"version");var g=this.serverProcessor+dhtmlx.url(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+a].join("&");g=g.replace("editing=true&","");this.getUpdates(g,function(){var m=c._loader.doXPath("//userdata");c.obj.setUserData(0,"version",c._v(m[0]));var j=c._loader.doXPath("//update");if(j.length){c._silent_mode=true;for(var n=0;n<j.length;n++){var l=j[n].getAttribute("status");var q=j[n].getAttribute("id");var o=j[n].getAttribute("parent");switch(l){case"inserted":c.callEvent("insertCallback",[j[n],q,o]);break;case"updated":c.callEvent("updateCallback",[j[n],q,o]);break;case"deleted":c.callEvent("deleteCallback",[j[n],q,o]);break}}c._silent_mode=false}c._update_busy=false;c=null})}};if(window.dataProcessor&&!dataProcessor.prototype.init_original){dataProcessor.prototype.init_original=dataProcessor.prototype.init;dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",true);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"}};
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/jquery-1.11.1.min.js b/portal/static/unbound_reservation_static/js/jquery-1.11.1.min.js
new file mode 100644 (file)
index 0000000..ab28a24
--- /dev/null
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
+if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
+},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/portal/static/unbound_reservation_static/js/main.js b/portal/static/unbound_reservation_static/js/main.js
new file mode 100644 (file)
index 0000000..398c6d0
--- /dev/null
@@ -0,0 +1,424 @@
+jQuery(function ($) {
+    
+    var x = 100000000; 
+    var count = 0;
+    var gid;
+       var nodename;
+    var me = this;
+    var conexion_selecionada = null;
+    var objeto_selecionado = null;
+    var windows;
+    var arrow_style = "Straight";
+
+       $( "#sortable-element li" ).draggable({
+        appendTo: "body",
+        helper: function() {
+            return $("<ul class='sortable-element'></ul>").append( $(this).clone() );
+        }
+    });
+
+    $( "#editor" ).droppable({
+        accept: "#sortable-element li",
+        drop: function(event,ui){
+            var nodetype;
+            var input;
+                       
+            var type = $(ui.draggable).attr('attr-type');
+            var clase = 'diagrama';
+            count++;
+
+            switch(type){
+                case "actor":
+                    clase = 'actor';
+                                       nodetype=false;
+                break;
+                               case "wireless":
+                    clase = 'wireless';
+                                       nodetype=true;
+                break;
+                               case "openflow":
+                    //clase = 'openflow';
+                                       nodetype=false;
+                break;
+                default:
+                    clase = 'diagrama';
+                                       nodetype=false;
+                break;
+            }
+//objeto_selecionado = this;
+               nodeid(0,0,count);
+        console.log(count);
+               getItemsList(count,nodetype);
+               console.log(count);
+            input = "<span> Node-"+count+"</span>"+
+                    "<div class='connect'></div>";
+          
+            $(" <div style='"+posicion_drop(ui)+"' name='"+clase+"' id='"+count+"' class='objeto "+clase+"'></div> ").append(input).appendTo(this);
+            workflow();
+        }
+    });
+
+
+    $("body").on('dblclick','.objeto span',function(){
+        var texto = prompt("Title");
+               //var text2 = prompt("Title2");
+        $(this).html(texto);
+    });
+           $("body").on('click','#editor',function(){
+               
+        $("#menu").hide();
+    });
+/*$(document).bind("contextmenu", function(event) { 
+    event.preventDefault();
+    $("<div class='custom-menu'>Custom menu</div>")
+        .appendTo("body")
+        .css({top: event.pageY + "px", left: event.pageX + "px"});
+}).bind("click", function(event) {
+    $("div.custom-menu").hide();
+});
+*/
+       // Trigger action when the contexmenu is about to be shown
+$("body").on("contextmenu",'.objeto', function (event) {
+    objeto_selecionado = this;
+    // Avoid the real one
+    event.preventDefault();
+    gid=this.id;
+       nodename=this.getAttribute("name");
+       
+       readItemsList(this.id);
+    // Show contextmenu
+       if (nodename=="wireless") {
+    $("#cssmenu").finish().toggle(100).
+       css({
+        top: event.pageY-150 + "px",
+        left: event.pageX-450 + "px"
+    });
+       } else {
+               $("#cssmenu_").finish().toggle(100).
+               css({
+        top: event.pageY-150 + "px",
+        left: event.pageX-450 + "px"
+    });
+       }
+    
+    // In the right position (the mouse)
+       
+    
+});
+
+
+// If the document is clicked somewhere
+$("body").bind("mousedown",'.objeto', function (e) {
+    
+    // If the clicked element is not the menu
+    if (!$(e.target).parents("#cssmenu").length > 0) {
+        
+        // Hide it
+        $("#cssmenu").hide(100);
+    }
+           if (!$(e.target).parents("#cssmenu_").length > 0) {
+        
+        // Hide it
+        $("#cssmenu_").hide(100);
+    }
+});
+
+
+// If the menu element is clicked
+$("#cssmenu li").click(function(){
+    
+    // This is the triggered action name
+    switch($(this).attr("data-action")) {
+        
+        // A case for each action. Your actions here
+        case "first": getItemsList(gid,true,""); break;
+        case "second": getItemsList(gid,true,"omf:netmode"); break;
+        case "third": getItemsList(gid,true,"omf:nitos.outdoor"); break;
+               //case "forth": getItemsList(gid,true,"wilab2.ilabt.iminds.be"); break;
+               case "fifth": getItemsList(gid,false,"ple"); break;
+    }
+  
+    // Hide it AFTER the action was triggered
+    $("#cssmenu").hide(100);
+  });
+       $("#cssmenu_ li").click(function(){
+    
+    // This is the triggered action name
+    switch($(this).attr("data-action")) {
+        
+
+               case "fifth": getItemsList(gid,false,"ple"); break;
+    }
+  
+    // Hide it AFTER the action was triggered
+    $("#cssmenu_").hide(100);
+  });
+ $("body").on('dblclick','.objeto',function(){
+ //$("#menu").hide();
+ $( "#menu" ).offset({ top: -10, left: -10 });
+ //console.log(this.name);
+ console.log(this.offsetTop);
+ var t = this.offsetTop;
+var l = this.offsetLeft;
+ //var x = $(this.name).position();
+//console.log(x.top);
+$( "#menu" ).offset({ top: t, left: l });
+    $menu.menu();
+       $("#menu").show();
+
+ });
+    $("body").on('click','.objeto',function(){
+               
+        objeto_selecionado = this;
+               nodeid(0,0,this.id);
+        console.log(this.id);
+               getItemsList(this.id);
+               console.log(this);
+               
+               
+    });
+
+    
+    workflow = function(){
+        
+        jsPlumb.importDefaults({
+            Endpoint : ["Dot", {radius:2}],
+            HoverPaintStyle : {strokeStyle:"#1e8151", lineWidth:0 },
+            
+        });       
+
+        windows = jsPlumb.getSelector('.objeto');
+        
+        jsPlumb.makeSource(windows, {
+
+            filter:".connect",               
+            anchor:"Continuous",
+            connector:[ arrow_style, { curviness:63 } ],
+            connectorStyle:{ 
+                strokeStyle:"#5c96bc", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4
+            },
+                       connectorOverlays:[ 
+      [ "Label", { label:"", id:"label" } ]
+    ],
+            isTarget:true,
+            dropOptions : targetDropOptions
+            
+        }); 
+
+        jsPlumb.makeTarget(windows, {
+            dropOptions:{ hoverClass:"dragHover" },
+            anchor: "Continuous"             
+        });
+
+
+        var targetDropOptions = {
+            tolerance:'touch',
+            hoverClass:'dropHover',
+            activeClass:'dragActive'
+        };
+        
+        
+        me.arrastrable();
+
+
+        jsPlumb.bind("click", function(conn, originalEvent) {
+            conexion_selecionada = conn;
+            console.log(this);
+            me.menu_arrow();
+        });
+    }
+
+
+    posicion_drop = function(ui){
+        var top = parseInt(ui.position['top'], 10) - 250;
+        var left = parseInt(ui.position['left'], 10) - 560;
+        var style = 'position:absolute;top:' + top + 'px;left:' + left + 'px;'
+        return style;
+    }
+
+    
+    
+    $(document).keyup(function(e){
+        if(e.keyCode == 46){
+            if(conexion_selecionada != null){
+                jsPlumb.detach(conexion_selecionada);
+                conexion_selecionada = null;
+                               $("#menu").hide();
+            }
+
+            if(objeto_selecionado != null){
+                jsPlumb.remove(objeto_selecionado);
+                               resetForm('',objeto_selecionado.id);
+                               console.log(objeto_selecionado.id);
+                objeto_selecionado = null;
+            }
+        }
+
+        console.log(jsPlumb.getSelector('.objeto'));
+    }) 
+
+
+    //Menu de opciones en la conexión (flecha,unión)
+    me.menu_arrow = function(){
+        $.contextMenu({
+            selector: '._jsPlumb_connector ',
+            trigger: 'left',
+            callback: function(key, options) {
+                var m = key;
+                me.menu_accion(key);
+            },
+            items: {
+                
+                "fold1":{
+                    "name": "Conector", 
+                    "items": {
+                        "flecha":   {"name": "Recto"},
+                        "diagrama": {"name": "Diagrama"},
+                        "ondular":  {"name": "Ondular"},
+                        "cursiva":  {"name": "Cursiva"},
+                    }
+                },
+                "fold1a": {
+                    "name": "Estilo", 
+                    "items": {
+                        "solido":       {"name": "Solido"},
+                        "discontinua":  {"name": "Discontinua"}
+                    }
+                },
+                "sep1": "---------",
+                "Eliminar":{"name": "Eliminar", "icon": "delete"},
+            }
+        });
+    }
+
+
+    me.menu_accion = function(accion){
+        console.log(conexion_selecionada);
+        if(accion == "Eliminar"){
+            jsPlumb.detach(conexion_selecionada, {
+                fireEvent: false, 
+                forceDetach: false 
+            })
+        }
+
+        if(accion == "flecha"){
+            conexion_selecionada.setConnector("Straight");
+        }
+
+        if(accion == "diagrama"){
+            conexion_selecionada.setConnector("Flowchart");
+        }
+
+        if(accion == "ondular"){
+            conexion_selecionada.setConnector("Bezier");
+        }
+
+        if(accion == "cursiva"){
+            conexion_selecionada.setConnector("StateMachine");
+        }
+
+        if(accion == "discontinua"){
+            conexion_selecionada.setPaintStyle({ 
+                strokeStyle:"#000", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4,
+                dashstyle: "4 2"
+            });
+        }
+
+        if(accion == "solido"){
+            conexion_selecionada.setPaintStyle({ 
+                strokeStyle:"#000", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4
+            });
+        }
+
+    }
+        
+    me.arrastrable = function(){
+        jsPlumb.draggable($(".objeto"), {
+               
+          containment:"editor"
+        });
+    }
+
+var data = {
+        menu: [{
+            name: 'Select Node',
+            link: '0',
+            sub: null
+        }, {
+            name: 'Testbed',
+            link: '1',
+            sub: [{
+                name: 'ANY',
+                link: '0-0',
+                sub: null
+            }, {
+                name: 'Netmode',
+                link: '0-1',
+                sub: null
+            }, {
+                name: 'Nitos',
+                link: '0-2',
+                sub: null
+            }, {
+                name: 'Wilabt',
+                link: '0-3',
+                sub: null
+            }]
+        }, {
+            name: 'Configuration',
+            link: '2',
+            sub: [{
+                name: 'IP',
+                link: '2-0',
+                sub: null
+            }, {
+                name: 'Image',
+                link: '2-1',
+                sub: null
+            }, {
+                name: 'Boot',
+                link: '2-3',
+                sub: null
+            }]
+        }]
+    };
+       
+    var getMenuItem = function (itemData) {
+       console.log(itemData);
+        var item = $("<li>")
+            .append(
+        $("<a>", {
+            href: '#' + itemData.link,
+            html: itemData.name
+        }));
+        if (itemData.sub) {
+            var subList = $("<ul>");
+            $.each(itemData.sub, function () {
+                subList.append(getMenuItem(this));
+            });
+            item.append(subList);
+        }
+        return item;
+    };
+    
+    var $menu = $("#menu");
+    $.each(data.menu, function () {
+        $menu.append(
+            getMenuItem(this)
+        );
+               
+               
+    });
+       
+       
+       $("#menu").hide();
+});
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/main_.js b/portal/static/unbound_reservation_static/js/main_.js
new file mode 100644 (file)
index 0000000..0b62c58
--- /dev/null
@@ -0,0 +1,392 @@
+jQuery(function ($) {
+    
+    var x = 100000000; 
+    var count = 0;
+
+    var me = this;
+    var conexion_selecionada = null;
+    var objeto_selecionado = null;
+    var windows;
+    var arrow_style = "Straight";
+
+       $( "#sortable-element li" ).draggable({
+        appendTo: "body",
+        helper: function() {
+            return $("<ul class='sortable-element'></ul>").append( $(this).clone() );
+        }
+    });
+
+    $( "#editor" ).droppable({
+        accept: "#sortable-element li",
+        drop: function(event,ui){
+            var nodetype;
+            var input;
+            var type = $(ui.draggable).attr('attr-type');
+            var clase = 'diagrama';
+            count++;
+
+            switch(type){
+                case "actor":
+                    clase = 'actor';
+                                       nodetype=false;
+                break;
+                               case "wireless":
+                    clase = 'wireless';
+                                       nodetype=true;
+                break;
+                               case "openflow":
+                    clase = 'openflow';
+                                       nodetype=false;
+                break;
+                default:
+                    clase = 'diagrama';
+                                       nodetype=false;
+                break;
+            }
+//objeto_selecionado = this;
+               nodeid(0,0,count);
+        console.log(count);
+               getItemsList(count,nodetype);
+               console.log(count);
+            input = "<span> Node-"+count+"</span>"+
+                    "<div class='connect'></div>";
+          
+            $(" <div style='"+posicion_drop(ui)+"' id='"+count+"' class='objeto "+clase+"'></div> ").append(input).appendTo(this);
+            workflow();
+        }
+    });
+
+
+    $("body").on('dblclick','.objeto span',function(){
+        var texto = prompt("Title");
+               //var text2 = prompt("Title2");
+        $(this).html(texto);
+    });
+           $("body").on('click','#editor',function(){
+               
+        $("#menu").hide();
+    });
+/*$(document).bind("contextmenu", function(event) { 
+    event.preventDefault();
+    $("<div class='custom-menu'>Custom menu</div>")
+        .appendTo("body")
+        .css({top: event.pageY + "px", left: event.pageX + "px"});
+}).bind("click", function(event) {
+    $("div.custom-menu").hide();
+});
+*/
+       // Trigger action when the contexmenu is about to be shown
+$("body").on("contextmenu",'.objeto', function (event) {
+    
+    // Avoid the real one
+    event.preventDefault();
+    
+    // Show contextmenu
+    $(".custom-menu").finish().toggle(100).
+    
+    // In the right position (the mouse)
+       
+    css({
+        top: event.pageY-150 + "px",
+        left: event.pageX-450 + "px"
+    });
+});
+
+
+// If the document is clicked somewhere
+$("body").bind("mousedown",'.objeto', function (e) {
+    
+    // If the clicked element is not the menu
+    if (!$(e.target).parents(".custom-menu").length > 0) {
+        
+        // Hide it
+        $(".custom-menu").hide(100);
+    }
+});
+
+
+// If the menu element is clicked
+$(".custom-menu li").click(function(){
+    
+    // This is the triggered action name
+    switch($(this).attr("data-action")) {
+        
+        // A case for each action. Your actions here
+        case "first": alert("first"); break;
+        case "second": alert("second"); break;
+        case "third": alert("third"); break;
+    }
+  
+    // Hide it AFTER the action was triggered
+    $(".custom-menu").hide(100);
+  });
+       
+ $("body").on('dblclick','.objeto',function(){
+ //$("#menu").hide();
+ $( "#menu" ).offset({ top: -10, left: -10 });
+ //console.log(this.name);
+ console.log(this.offsetTop);
+ var t = this.offsetTop;
+var l = this.offsetLeft;
+ //var x = $(this.name).position();
+//console.log(x.top);
+$( "#menu" ).offset({ top: t, left: l });
+    $menu.menu();
+       $("#menu").show();
+
+ });
+    $("body").on('click','.objeto',function(){
+               
+        objeto_selecionado = this;
+               nodeid(0,0,this.id);
+        console.log(this.id);
+               getItemsList(this.id);
+               console.log(this);
+               
+               
+    });
+
+    
+    workflow = function(){
+        
+        jsPlumb.importDefaults({
+            Endpoint : ["Dot", {radius:2}],
+            HoverPaintStyle : {strokeStyle:"#1e8151", lineWidth:0 },
+            
+        });       
+
+        windows = jsPlumb.getSelector('.objeto');
+        
+        jsPlumb.makeSource(windows, {
+
+            filter:".connect",               
+            anchor:"Continuous",
+            connector:[ arrow_style, { curviness:63 } ],
+            connectorStyle:{ 
+                strokeStyle:"#5c96bc", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4
+            },
+                       connectorOverlays:[ 
+      [ "Label", { label:"", id:"label" } ]
+    ],
+            isTarget:true,
+            dropOptions : targetDropOptions
+            
+        }); 
+
+        jsPlumb.makeTarget(windows, {
+            dropOptions:{ hoverClass:"dragHover" },
+            anchor: "Continuous"             
+        });
+
+
+        var targetDropOptions = {
+            tolerance:'touch',
+            hoverClass:'dropHover',
+            activeClass:'dragActive'
+        };
+        
+        
+        me.arrastrable();
+
+
+        jsPlumb.bind("click", function(conn, originalEvent) {
+            conexion_selecionada = conn;
+            console.log(this);
+            me.menu_arrow();
+        });
+    }
+
+
+    posicion_drop = function(ui){
+        var top = parseInt(ui.position['top'], 10) - 250;
+        var left = parseInt(ui.position['left'], 10) - 560;
+        var style = 'position:absolute;top:' + top + 'px;left:' + left + 'px;'
+        return style;
+    }
+
+    
+    
+    $(document).keyup(function(e){
+        if(e.keyCode == 46){
+            if(conexion_selecionada != null){
+                jsPlumb.detach(conexion_selecionada);
+                conexion_selecionada = null;
+                               $("#menu").hide();
+            }
+
+            if(objeto_selecionado != null){
+                jsPlumb.remove(objeto_selecionado);
+                               resetForm('',objeto_selecionado.id);
+                               console.log(objeto_selecionado.id);
+                objeto_selecionado = null;
+            }
+        }
+
+        console.log(jsPlumb.getSelector('.objeto'));
+    }) 
+
+
+    //Menu de opciones en la conexión (flecha,unión)
+    me.menu_arrow = function(){
+        $.contextMenu({
+            selector: '._jsPlumb_connector ',
+            trigger: 'left',
+            callback: function(key, options) {
+                var m = key;
+                me.menu_accion(key);
+            },
+            items: {
+                
+                "fold1":{
+                    "name": "Conector", 
+                    "items": {
+                        "flecha":   {"name": "Recto"},
+                        "diagrama": {"name": "Diagrama"},
+                        "ondular":  {"name": "Ondular"},
+                        "cursiva":  {"name": "Cursiva"},
+                    }
+                },
+                "fold1a": {
+                    "name": "Estilo", 
+                    "items": {
+                        "solido":       {"name": "Solido"},
+                        "discontinua":  {"name": "Discontinua"}
+                    }
+                },
+                "sep1": "---------",
+                "Eliminar":{"name": "Eliminar", "icon": "delete"},
+            }
+        });
+    }
+
+
+    me.menu_accion = function(accion){
+        console.log(conexion_selecionada);
+        if(accion == "Eliminar"){
+            jsPlumb.detach(conexion_selecionada, {
+                fireEvent: false, 
+                forceDetach: false 
+            })
+        }
+
+        if(accion == "flecha"){
+            conexion_selecionada.setConnector("Straight");
+        }
+
+        if(accion == "diagrama"){
+            conexion_selecionada.setConnector("Flowchart");
+        }
+
+        if(accion == "ondular"){
+            conexion_selecionada.setConnector("Bezier");
+        }
+
+        if(accion == "cursiva"){
+            conexion_selecionada.setConnector("StateMachine");
+        }
+
+        if(accion == "discontinua"){
+            conexion_selecionada.setPaintStyle({ 
+                strokeStyle:"#000", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4,
+                dashstyle: "4 2"
+            });
+        }
+
+        if(accion == "solido"){
+            conexion_selecionada.setPaintStyle({ 
+                strokeStyle:"#000", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4
+            });
+        }
+
+    }
+        
+    me.arrastrable = function(){
+        jsPlumb.draggable($(".objeto"), {
+               
+          containment:"editor"
+        });
+    }
+
+var data = {
+        menu: [{
+            name: 'Select Node',
+            link: '0',
+            sub: null
+        }, {
+            name: 'Testbed',
+            link: '1',
+            sub: [{
+                name: 'ANY',
+                link: '0-0',
+                sub: null
+            }, {
+                name: 'Netmode',
+                link: '0-1',
+                sub: null
+            }, {
+                name: 'Nitos',
+                link: '0-2',
+                sub: null
+            }, {
+                name: 'Wilabt',
+                link: '0-3',
+                sub: null
+            }]
+        }, {
+            name: 'Configuration',
+            link: '2',
+            sub: [{
+                name: 'IP',
+                link: '2-0',
+                sub: null
+            }, {
+                name: 'Image',
+                link: '2-1',
+                sub: null
+            }, {
+                name: 'Boot',
+                link: '2-3',
+                sub: null
+            }]
+        }]
+    };
+       
+    var getMenuItem = function (itemData) {
+       console.log(itemData);
+        var item = $("<li>")
+            .append(
+        $("<a>", {
+            href: '#' + itemData.link,
+            html: itemData.name
+        }));
+        if (itemData.sub) {
+            var subList = $("<ul>");
+            $.each(itemData.sub, function () {
+                subList.append(getMenuItem(this));
+            });
+            item.append(subList);
+        }
+        return item;
+    };
+    
+    var $menu = $("#menu");
+    $.each(data.menu, function () {
+        $menu.append(
+            getMenuItem(this)
+        );
+               
+               
+    });
+       
+       
+       $("#menu").hide();
+});
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/main_1.js b/portal/static/unbound_reservation_static/js/main_1.js
new file mode 100644 (file)
index 0000000..400e102
--- /dev/null
@@ -0,0 +1,414 @@
+jQuery(function ($) {
+    
+    var x = 100000000; 
+    var count = 0;
+var gid;
+    var me = this;
+    var conexion_selecionada = null;
+    var objeto_selecionado = null;
+    var windows;
+    var arrow_style = "Straight";
+
+       $( "#sortable-element li" ).draggable({
+        appendTo: "body",
+        helper: function() {
+            return $("<ul class='sortable-element'></ul>").append( $(this).clone() );
+        }
+    });
+
+    $( "#editor" ).droppable({
+        accept: "#sortable-element li",
+        drop: function(event,ui){
+            var nodetype;
+            var input;
+            var type = $(ui.draggable).attr('attr-type');
+            var clase = 'diagrama';
+            count++;
+
+            switch(type){
+                case "actor":
+                    clase = 'actor';
+                                       nodetype=false;
+                break;
+                               case "wireless":
+                    clase = 'wireless';
+                                       nodetype=true;
+                break;
+                               case "openflow":
+                    clase = 'openflow';
+                                       nodetype=false;
+                break;
+                default:
+                    clase = 'diagrama';
+                                       nodetype=false;
+                break;
+            }
+//objeto_selecionado = this;
+               nodeid(0,0,count);
+        console.log(count);
+               getItemsList(count,nodetype);
+               console.log(count);
+               readItemsList(count);
+            input = "<span> Node-"+count+"</span>"+
+                    "<div class='connect'></div>";
+          
+            $(" <div style='"+posicion_drop(ui)+"' id='"+count+"' class='objeto "+clase+"'></div> ").append(input).appendTo(this);
+            workflow();
+        }
+    });
+
+
+    $("body").on('dblclick','.objeto span',function(){
+        var texto = prompt("Title");
+               //var text2 = prompt("Title2");
+        $(this).html(texto);
+    });
+           $("body").on('click','#editor',function(){
+               
+        $("#menu").hide();
+    });
+/*$(document).bind("contextmenu", function(event) { 
+    event.preventDefault();
+    $("<div class='custom-menu'>Custom menu</div>")
+        .appendTo("body")
+        .css({top: event.pageY + "px", left: event.pageX + "px"});
+}).bind("click", function(event) {
+    $("div.custom-menu").hide();
+});
+*/
+       // Trigger action when the contexmenu is about to be shown
+$("body").on("contextmenu",'.objeto', function (event) {
+    objeto_selecionado = this;
+               nodeid(0,0,this.id);
+       readItemsList(this.id);
+               gid=this.id;
+    // Avoid the real one
+    event.preventDefault();
+    
+    // Show contextmenu
+    $("#cssmenu").finish().toggle(100).
+    
+    // In the right position (the mouse)
+       
+    css({
+        top: event.pageY-150 + "px",
+        left: event.pageX-450 + "px"
+    });
+       console.log(this.id);
+       
+});
+
+
+// If the document is clicked somewhere
+$("body").bind("mousedown",'.objeto', function (e) {
+    
+    // If the clicked element is not the menu
+    if (!$(e.target).parents("#cssmenu").length > 0) {
+        
+        // Hide it
+        $("#cssmenu").hide(100);
+    }
+});
+
+
+// If the menu element is clicked
+$("#cssmenu li").click(function(){
+   
+    // This is the triggered action name
+    switch($(this).attr("data-action")) {
+        
+        // A case for each action. Your actions here
+        case "first":document.getElementById('testbet').value="";getItemsList(gid); break;
+        case "second":document.getElementById('testbet').value="omf:netmode";getItemsList(gid); break;
+        case "third": alert("third"); break;
+    }
+  
+    // Hide it AFTER the action was triggered
+    $("#cssmenu").hide(100);
+  });
+       
+ $("body").on('dblclick','.objeto',function(){
+ //$("#menu").hide();
+ $( "#menu" ).offset({ top: -10, left: -10 });
+ //console.log(this.name);
+ console.log(this.offsetTop);
+ var t = this.offsetTop;
+var l = this.offsetLeft;
+ //var x = $(this.name).position();
+//console.log(x.top);
+$( "#menu" ).offset({ top: t, left: l });
+    $menu.menu();
+       $("#menu").show();
+
+ });
+    $("body").on('click','.objeto',function(){
+               $('.objeto').contextMenu(menu);
+        objeto_selecionado = this;
+               nodeid(0,0,this.id);
+       
+               //getItemsList(this.id);
+               console.log(menu);
+               
+               
+    });
+
+    
+    workflow = function(){
+        
+        jsPlumb.importDefaults({
+            Endpoint : ["Dot", {radius:2}],
+            HoverPaintStyle : {strokeStyle:"#1e8151", lineWidth:0 },
+            
+        });       
+
+        windows = jsPlumb.getSelector('.objeto');
+        
+        jsPlumb.makeSource(windows, {
+
+            filter:".connect",               
+            anchor:"Continuous",
+            connector:[ arrow_style, { curviness:63 } ],
+            connectorStyle:{ 
+                strokeStyle:"#5c96bc", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4
+            },
+                       connectorOverlays:[ 
+      [ "Label", { label:"", id:"label" } ]
+    ],
+            isTarget:true,
+            dropOptions : targetDropOptions
+            
+        }); 
+
+        jsPlumb.makeTarget(windows, {
+            dropOptions:{ hoverClass:"dragHover" },
+            anchor: "Continuous"             
+        });
+
+
+        var targetDropOptions = {
+            tolerance:'touch',
+            hoverClass:'dropHover',
+            activeClass:'dragActive'
+        };
+        
+        
+        me.arrastrable();
+
+
+        jsPlumb.bind("click", function(conn, originalEvent) {
+            conexion_selecionada = conn;
+            console.log(this);
+            me.menu_arrow();
+        });
+    }
+
+
+    posicion_drop = function(ui){
+        var top = parseInt(ui.position['top'], 10) - 250;
+        var left = parseInt(ui.position['left'], 10) - 560;
+        var style = 'position:absolute;top:' + top + 'px;left:' + left + 'px;'
+        return style;
+    }
+
+    
+    
+    $(document).keyup(function(e){
+        if(e.keyCode == 46){
+            if(conexion_selecionada != null){
+                jsPlumb.detach(conexion_selecionada);
+                conexion_selecionada = null;
+                               $("#menu").hide();
+            }
+
+            if(objeto_selecionado != null){
+                jsPlumb.remove(objeto_selecionado);
+                               resetForm('',objeto_selecionado.id);
+                               console.log(objeto_selecionado.id);
+                objeto_selecionado = null;
+            }
+        }
+
+        console.log(jsPlumb.getSelector('.objeto'));
+    }) 
+
+
+    //Menu de opciones en la conexión (flecha,unión)
+    me.menu_arrow = function(){
+        $.contextMenu({
+            selector: '._jsPlumb_connector ',
+            trigger: 'left',
+            callback: function(key, options) {
+                var m = key;
+                me.menu_accion(key);
+            },
+            items: {
+                
+                "fold1":{
+                    "name": "Conector", 
+                    "items": {
+                        "flecha":   {"name": "Recto"},
+                        "diagrama": {"name": "Diagrama"},
+                        "ondular":  {"name": "Ondular"},
+                        "cursiva":  {"name": "Cursiva"},
+                    }
+                },
+                "fold1a": {
+                    "name": "Estilo", 
+                    "items": {
+                        "solido":       {"name": "Solido"},
+                        "discontinua":  {"name": "Discontinua"}
+                    }
+                },
+                "sep1": "---------",
+                "Eliminar":{"name": "Eliminar", "icon": "delete"},
+            }
+        });
+    }
+
+
+    me.menu_accion = function(accion){
+        console.log(conexion_selecionada);
+        if(accion == "Eliminar"){
+            jsPlumb.detach(conexion_selecionada, {
+                fireEvent: false, 
+                forceDetach: false 
+            })
+        }
+
+        if(accion == "flecha"){
+            conexion_selecionada.setConnector("Straight");
+        }
+
+        if(accion == "diagrama"){
+            conexion_selecionada.setConnector("Flowchart");
+        }
+
+        if(accion == "ondular"){
+            conexion_selecionada.setConnector("Bezier");
+        }
+
+        if(accion == "cursiva"){
+            conexion_selecionada.setConnector("StateMachine");
+        }
+
+        if(accion == "discontinua"){
+            conexion_selecionada.setPaintStyle({ 
+                strokeStyle:"#000", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4,
+                dashstyle: "4 2"
+            });
+        }
+
+        if(accion == "solido"){
+            conexion_selecionada.setPaintStyle({ 
+                strokeStyle:"#000", 
+                lineWidth:2, 
+                outlineColor:"transparent", 
+                outlineWidth:4
+            });
+        }
+
+    }
+        
+    me.arrastrable = function(){
+        jsPlumb.draggable($(".objeto"), {
+               
+          containment:"editor"
+        });
+    }
+
+var menu = [{
+        name: 'create',
+        img: 'images/create.png',
+        title: 'create button',
+        fun: function () {
+            alert('i am add button')
+        }
+    }, {
+        name: 'update',
+        img: 'images/update.png',
+        title: 'update button',
+        subMenu: [{
+            name: 'merge',
+            title: 'It will merge row',
+            img:'images/merge.png',
+            fun: function () {
+                alert('It will merge row')
+            }
+        }, {
+            name: 'replace',
+            title: 'It will replace row',
+            img:'images/replace.png',
+            subMenu: [{
+                name: 'replace top 100',
+                img:'images/top.png',
+                fun:function(){
+                alert('It will replace top 100 rows');
+                }
+            }, {
+                name: 'replace all',
+                img:'images/all.png',
+                fun:function(){
+                alert('It will replace all rows');
+                }
+            }]
+        }]
+    }, {
+        name: 'delete',
+        img: 'images/delete.png',
+        title: 'create button',
+        subMenu: [{
+            'name': 'soft delete',
+            img:'images/soft_delete.png',
+            fun:function(){
+            alert('You can recover back');
+            }
+        }, {
+            'name': 'hard delete',
+            img:'images/hard_delete.png',
+            fun:function(){
+            alert('It will delete permanently');
+            }
+        }]
+    }];
+     
+//Calling context menu
+       
+    var getMenuItem = function (itemData) {
+       console.log(itemData);
+        var item = $("<li>")
+            .append(
+        $("<a>", {
+            href: '#' + itemData.link,
+            html: itemData.name
+        }));
+        if (itemData.sub) {
+            var subList = $("<ul>");
+            $.each(itemData.sub, function () {
+                subList.append(getMenuItem(this));
+            });
+            item.append(subList);
+        }
+        return item;
+    };
+    
+    var $menu = $("#menu");
+    $.each(data.menu, function () {
+        $menu.append(
+            getMenuItem(this)
+        );
+               
+               
+    });
+       
+       
+       $("#menu").hide();
+});
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/js/menu/images/Thumbs.db b/portal/static/unbound_reservation_static/js/menu/images/Thumbs.db
new file mode 100644 (file)
index 0000000..0877a76
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/Thumbs.db differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/cut.png b/portal/static/unbound_reservation_static/js/menu/images/cut.png
new file mode 100644 (file)
index 0000000..f215d6f
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/cut.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/door.png b/portal/static/unbound_reservation_static/js/menu/images/door.png
new file mode 100644 (file)
index 0000000..369fc46
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/door.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/page_white_add.png b/portal/static/unbound_reservation_static/js/menu/images/page_white_add.png
new file mode 100644 (file)
index 0000000..a70de09
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/page_white_add.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/page_white_copy.png b/portal/static/unbound_reservation_static/js/menu/images/page_white_copy.png
new file mode 100644 (file)
index 0000000..a9f31a2
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/page_white_copy.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/page_white_delete.png b/portal/static/unbound_reservation_static/js/menu/images/page_white_delete.png
new file mode 100644 (file)
index 0000000..af1ecaf
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/page_white_delete.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/page_white_edit.png b/portal/static/unbound_reservation_static/js/menu/images/page_white_edit.png
new file mode 100644 (file)
index 0000000..b93e776
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/page_white_edit.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/images/page_white_paste.png b/portal/static/unbound_reservation_static/js/menu/images/page_white_paste.png
new file mode 100644 (file)
index 0000000..5b2cbb3
Binary files /dev/null and b/portal/static/unbound_reservation_static/js/menu/images/page_white_paste.png differ
diff --git a/portal/static/unbound_reservation_static/js/menu/jquery.contextMenu.css b/portal/static/unbound_reservation_static/js/menu/jquery.contextMenu.css
new file mode 100644 (file)
index 0000000..ee58116
--- /dev/null
@@ -0,0 +1,142 @@
+/*!
+ * jQuery contextMenu - Plugin for simple contextMenu handling
+ *
+ * Version: git-master
+ *
+ * Authors: Rodney Rehm, Addy Osmani (patches for FF)
+ * Web: http://medialize.github.com/jQuery-contextMenu/
+ *
+ * Licensed under
+ *   MIT License http://www.opensource.org/licenses/mit-license
+ *   GPL v3 http://opensource.org/licenses/GPL-3.0
+ *
+ */
+
+.context-menu-list {
+    margin:0; 
+    padding:0;
+    
+    min-width: 120px;
+    max-width: 250px;
+    display: inline-block;
+    position: absolute;
+    list-style-type: none;
+    
+    border: 1px solid #DDD;
+    background: #EEE;
+    
+    -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+       -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+        -ms-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+         -o-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+    
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    font-size: 11px;
+}
+
+.context-menu-item {
+    padding: 2px 2px 2px 24px;
+    background-color: #EEE;
+    position: relative;
+    -webkit-user-select: none;
+       -moz-user-select: -moz-none;
+        -ms-user-select: none;
+            user-select: none;
+}
+
+.context-menu-separator {
+    padding-bottom:0;
+    border-bottom: 1px solid #DDD;
+}
+
+.context-menu-item > label > input,
+.context-menu-item > label > textarea {
+    -webkit-user-select: text;
+       -moz-user-select: text;
+        -ms-user-select: text;
+            user-select: text;
+}
+
+.context-menu-item.hover {
+    cursor: pointer;
+    background-color: #39F;
+}
+
+.context-menu-item.disabled {
+    color: #666;
+}
+
+.context-menu-input.hover,
+.context-menu-item.disabled.hover {
+    cursor: default;
+    background-color: #EEE;
+}
+
+.context-menu-submenu:after {
+    content: ">";
+    color: #666;
+    position: absolute;
+    top: 0;
+    right: 3px;
+    z-index: 1;
+}
+
+/* icons
+    #protip:
+    In case you want to use sprites for icons (which I would suggest you do) have a look at
+    http://css-tricks.com/13224-pseudo-spriting/ to get an idea of how to implement 
+    .context-menu-item.icon:before {}
+ */
+.context-menu-item.icon { min-height: 18px; background-repeat: no-repeat; background-position: 4px 2px; }
+.context-menu-item.icon-edit { background-image: url(images/page_white_edit.png); }
+.context-menu-item.icon-cut { background-image: url(images/cut.png); }
+.context-menu-item.icon-copy { background-image: url(images/page_white_copy.png); }
+.context-menu-item.icon-paste { background-image: url(images/page_white_paste.png); }
+.context-menu-item.icon-delete { background-image: url(images/page_white_delete.png); }
+.context-menu-item.icon-add { background-image: url(images/page_white_add.png); }
+.context-menu-item.icon-quit { background-image: url(images/door.png); }
+
+/* vertically align inside labels */
+.context-menu-input > label > * { vertical-align: top; }
+
+/* position checkboxes and radios as icons */
+.context-menu-input > label > input[type="checkbox"],
+.context-menu-input > label > input[type="radio"] {
+    margin-left: -17px;
+}
+.context-menu-input > label > span {
+    margin-left: 5px;
+}
+
+.context-menu-input > label,
+.context-menu-input > label > input[type="text"],
+.context-menu-input > label > textarea,
+.context-menu-input > label > select {
+    display: block;
+    width: 100%;
+    
+    -webkit-box-sizing: border-box;
+       -moz-box-sizing: border-box;
+        -ms-box-sizing: border-box;
+         -o-box-sizing: border-box;
+            box-sizing: border-box;
+}
+
+.context-menu-input > label > textarea {
+    height: 100px;
+}
+.context-menu-item > .context-menu-list {
+    display: none;
+    /* re-positioned by js */
+    right: -5px;
+    top: 5px;
+}
+
+.context-menu-item.hover > .context-menu-list {
+    display: block;
+}
+
+.context-menu-accesskey {
+    text-decoration: underline;
+}
diff --git a/portal/static/unbound_reservation_static/js/menu/jquery.contextMenu.js b/portal/static/unbound_reservation_static/js/menu/jquery.contextMenu.js
new file mode 100644 (file)
index 0000000..103a585
--- /dev/null
@@ -0,0 +1,1686 @@
+/*!
+ * jQuery contextMenu - Plugin for simple contextMenu handling
+ *
+ * Version: git-master
+ *
+ * Authors: Rodney Rehm, Addy Osmani (patches for FF)
+ * Web: http://medialize.github.com/jQuery-contextMenu/
+ *
+ * Licensed under
+ *   MIT License http://www.opensource.org/licenses/mit-license
+ *   GPL v3 http://opensource.org/licenses/GPL-3.0
+ *
+ */
+
+(function($, undefined){
+    
+    // TODO: -
+        // ARIA stuff: menuitem, menuitemcheckbox und menuitemradio
+        // create <menu> structure if $.support[htmlCommand || htmlMenuitem] and !opt.disableNative
+
+// determine html5 compatibility
+$.support.htmlMenuitem = ('HTMLMenuItemElement' in window);
+$.support.htmlCommand = ('HTMLCommandElement' in window);
+$.support.eventSelectstart = ("onselectstart" in document.documentElement);
+/* // should the need arise, test for css user-select
+$.support.cssUserSelect = (function(){
+    var t = false,
+        e = document.createElement('div');
+    
+    $.each('Moz|Webkit|Khtml|O|ms|Icab|'.split('|'), function(i, prefix) {
+        var propCC = prefix + (prefix ? 'U' : 'u') + 'serSelect',
+            prop = (prefix ? ('-' + prefix.toLowerCase() + '-') : '') + 'user-select';
+            
+        e.style.cssText = prop + ': text;';
+        if (e.style[propCC] == 'text') {
+            t = true;
+            return false;
+        }
+        
+        return true;
+    });
+    
+    return t;
+})();
+*/
+
+if (!$.ui || !$.ui.widget) {
+    // duck punch $.cleanData like jQueryUI does to get that remove event
+    // https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L16-24
+    var _cleanData = $.cleanData;
+    $.cleanData = function( elems ) {
+        for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+            try {
+                $( elem ).triggerHandler( "remove" );
+                // http://bugs.jquery.com/ticket/8235
+            } catch( e ) {}
+        }
+        _cleanData( elems );
+    };
+}
+
+var // currently active contextMenu trigger
+    $currentTrigger = null,
+    // is contextMenu initialized with at least one menu?
+    initialized = false,
+    // window handle
+    $win = $(window),
+    // number of registered menus
+    counter = 0,
+    // mapping selector to namespace
+    namespaces = {},
+    // mapping namespace to options
+    menus = {},
+    // custom command type handlers
+    types = {},
+    // default values
+    defaults = {
+        // selector of contextMenu trigger
+        selector: null,
+        // where to append the menu to
+        appendTo: null,
+        // method to trigger context menu ["right", "left", "hover"]
+        trigger: "right",
+        // hide menu when mouse leaves trigger / menu elements
+        autoHide: false,
+        // ms to wait before showing a hover-triggered context menu
+        delay: 200,
+        // flag denoting if a second trigger should simply move (true) or rebuild (false) an open menu
+        // as long as the trigger happened on one of the trigger-element's child nodes
+        reposition: true,
+        // determine position to show menu at
+        determinePosition: function($menu) {
+            // position to the lower middle of the trigger element
+            if ($.ui && $.ui.position) {
+                // .position() is provided as a jQuery UI utility
+                // (...and it won't work on hidden elements)
+                $menu.css('display', 'block').position({
+                    my: "center top",
+                    at: "center bottom",
+                    of: this,
+                    offset: "0 5",
+                    collision: "fit"
+                }).css('display', 'none');
+            } else {
+                // determine contextMenu position
+                var offset = this.offset();
+                offset.top += this.outerHeight();
+                offset.left += this.outerWidth() / 2 - $menu.outerWidth() / 2;
+                $menu.css(offset);
+            }
+        },
+        // position menu
+        position: function(opt, x, y) {
+            var $this = this,
+                offset;
+            // determine contextMenu position
+            if (!x && !y) {
+                opt.determinePosition.call(this, opt.$menu);
+                return;
+            } else if (x === "maintain" && y === "maintain") {
+                // x and y must not be changed (after re-show on command click)
+                offset = opt.$menu.position();
+            } else {
+                // x and y are given (by mouse event)
+                offset = {top: y, left: x};
+            }
+            
+            // correct offset if viewport demands it
+            var bottom = $win.scrollTop() + $win.height(),
+                right = $win.scrollLeft() + $win.width(),
+                height = opt.$menu.height(),
+                width = opt.$menu.width();
+            
+            if (offset.top + height > bottom) {
+                offset.top -= height;
+            }
+            
+            if (offset.left + width > right) {
+                offset.left -= width;
+            }
+            
+            opt.$menu.css(offset);
+        },
+        // position the sub-menu
+        positionSubmenu: function($menu) {
+            if ($.ui && $.ui.position) {
+                // .position() is provided as a jQuery UI utility
+                // (...and it won't work on hidden elements)
+                $menu.css('display', 'block').position({
+                    my: "left top",
+                    at: "right top",
+                    of: this,
+                    collision: "flipfit fit"
+                }).css('display', '');
+            } else {
+                // determine contextMenu position
+                var offset = {
+                    top: 0,
+                    left: this.outerWidth()
+                };
+                $menu.css(offset);
+            }
+        },
+        // offset to add to zIndex
+        zIndex: 1,
+        // show hide animation settings
+        animation: {
+            duration: 50,
+            show: 'slideDown',
+            hide: 'slideUp'
+        },
+        // events
+        events: {
+            show: $.noop,
+            hide: $.noop
+        },
+        // default callback
+        callback: null,
+        // list of contextMenu items
+        items: {}
+    },
+    // mouse position for hover activation
+    hoveract = {
+        timer: null,
+        pageX: null,
+        pageY: null
+    },
+    // determine zIndex
+    zindex = function($t) {
+        var zin = 0,
+            $tt = $t;
+
+        while (true) {
+            zin = Math.max(zin, parseInt($tt.css('z-index'), 10) || 0);
+            $tt = $tt.parent();
+            if (!$tt || !$tt.length || "html body".indexOf($tt.prop('nodeName').toLowerCase()) > -1 ) {
+                break;
+            }
+        }
+        
+        return zin;
+    },
+    // event handlers
+    handle = {
+        // abort anything
+        abortevent: function(e){
+            e.preventDefault();
+            e.stopImmediatePropagation();
+        },
+        
+        // contextmenu show dispatcher
+        contextmenu: function(e) {
+            var $this = $(this);
+            
+            // disable actual context-menu
+            e.preventDefault();
+            e.stopImmediatePropagation();
+            
+            // abort native-triggered events unless we're triggering on right click
+            if (e.data.trigger != 'right' && e.originalEvent) {
+                return;
+            }
+            
+            // abort event if menu is visible for this trigger
+            if ($this.hasClass('context-menu-active')) {
+                return;
+            }
+            
+            if (!$this.hasClass('context-menu-disabled')) {
+                // theoretically need to fire a show event at <menu>
+                // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus
+                // var evt = jQuery.Event("show", { data: data, pageX: e.pageX, pageY: e.pageY, relatedTarget: this });
+                // e.data.$menu.trigger(evt);
+                
+                $currentTrigger = $this;
+                if (e.data.build) {
+                    var built = e.data.build($currentTrigger, e);
+                    // abort if build() returned false
+                    if (built === false) {
+                        return;
+                    }
+                    
+                    // dynamically build menu on invocation
+                    e.data = $.extend(true, {}, defaults, e.data, built || {});
+
+                    // abort if there are no items to display
+                    if (!e.data.items || $.isEmptyObject(e.data.items)) {
+                        // Note: jQuery captures and ignores errors from event handlers
+                        if (window.console) {
+                            (console.error || console.log)("No items specified to show in contextMenu");
+                        }
+                        
+                        throw new Error('No Items specified');
+                    }
+                    
+                    // backreference for custom command type creation
+                    e.data.$trigger = $currentTrigger;
+                    
+                    op.create(e.data);
+                }
+                // show menu
+                op.show.call($this, e.data, e.pageX, e.pageY);
+            }
+        },
+        // contextMenu left-click trigger
+        click: function(e) {
+            e.preventDefault();
+            e.stopImmediatePropagation();
+            $(this).trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
+        },
+        // contextMenu right-click trigger
+        mousedown: function(e) {
+            // register mouse down
+            var $this = $(this);
+            
+            // hide any previous menus
+            if ($currentTrigger && $currentTrigger.length && !$currentTrigger.is($this)) {
+                $currentTrigger.data('contextMenu').$menu.trigger('contextmenu:hide');
+            }
+            
+            // activate on right click
+            if (e.button == 2) {
+                $currentTrigger = $this.data('contextMenuActive', true);
+            }
+        },
+        // contextMenu right-click trigger
+        mouseup: function(e) {
+            // show menu
+            var $this = $(this);
+            if ($this.data('contextMenuActive') && $currentTrigger && $currentTrigger.length && $currentTrigger.is($this) && !$this.hasClass('context-menu-disabled')) {
+                e.preventDefault();
+                e.stopImmediatePropagation();
+                $currentTrigger = $this;
+                $this.trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
+            }
+            
+            $this.removeData('contextMenuActive');
+        },
+        // contextMenu hover trigger
+        mouseenter: function(e) {
+            var $this = $(this),
+                $related = $(e.relatedTarget),
+                $document = $(document);
+            
+            // abort if we're coming from a menu
+            if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
+                return;
+            }
+            
+            // abort if a menu is shown
+            if ($currentTrigger && $currentTrigger.length) {
+                return;
+            }
+            
+            hoveract.pageX = e.pageX;
+            hoveract.pageY = e.pageY;
+            hoveract.data = e.data;
+            $document.on('mousemove.contextMenuShow', handle.mousemove);
+            hoveract.timer = setTimeout(function() {
+                hoveract.timer = null;
+                $document.off('mousemove.contextMenuShow');
+                $currentTrigger = $this;
+                $this.trigger($.Event("contextmenu", { data: hoveract.data, pageX: hoveract.pageX, pageY: hoveract.pageY }));
+            }, e.data.delay );
+        },
+        // contextMenu hover trigger
+        mousemove: function(e) {
+            hoveract.pageX = e.pageX;
+            hoveract.pageY = e.pageY;
+        },
+        // contextMenu hover trigger
+        mouseleave: function(e) {
+            // abort if we're leaving for a menu
+            var $related = $(e.relatedTarget);
+            if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
+                return;
+            }
+            
+            try {
+                clearTimeout(hoveract.timer);
+            } catch(e) {}
+            
+            hoveract.timer = null;
+        },
+        
+        // click on layer to hide contextMenu
+        layerClick: function(e) {
+            var $this = $(this),
+                root = $this.data('contextMenuRoot'),
+                mouseup = false,
+                button = e.button,
+                x = e.pageX,
+                y = e.pageY,
+                target, 
+                offset,
+                selectors;
+                
+            e.preventDefault();
+            e.stopImmediatePropagation();
+            
+            setTimeout(function() {
+                var $window, hideshow, possibleTarget;
+                var triggerAction = ((root.trigger == 'left' && button === 0) || (root.trigger == 'right' && button === 2));
+                
+                // find the element that would've been clicked, wasn't the layer in the way
+                if (document.elementFromPoint) {
+                    root.$layer.hide();
+                    target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop());
+                    root.$layer.show();
+                }
+                
+                if (root.reposition && triggerAction) {
+                    if (document.elementFromPoint) {
+                        if (root.$trigger.is(target) || root.$trigger.has(target).length) {
+                            root.position.call(root.$trigger, root, x, y);
+                            return;
+                        }
+                    } else {
+                        offset = root.$trigger.offset();
+                        $window = $(window);
+                        // while this looks kinda awful, it's the best way to avoid
+                        // unnecessarily calculating any positions
+                        offset.top += $window.scrollTop();
+                        if (offset.top <= e.pageY) {
+                            offset.left += $window.scrollLeft();
+                            if (offset.left <= e.pageX) {
+                                offset.bottom = offset.top + root.$trigger.outerHeight();
+                                if (offset.bottom >= e.pageY) {
+                                    offset.right = offset.left + root.$trigger.outerWidth();
+                                    if (offset.right >= e.pageX) {
+                                        // reposition
+                                        root.position.call(root.$trigger, root, x, y);
+                                        return;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                
+                if (target && triggerAction) {
+                    root.$trigger.one('contextmenu:hidden', function() {
+                        $(target).contextMenu({x: x, y: y});
+                    });
+                }
+
+                root.$menu.trigger('contextmenu:hide');
+            }, 50);
+        },
+        // key handled :hover
+        keyStop: function(e, opt) {
+            if (!opt.isInput) {
+                e.preventDefault();
+            }
+            
+            e.stopPropagation();
+        },
+        key: function(e) {
+            var opt = $currentTrigger.data('contextMenu') || {};
+
+            switch (e.keyCode) {
+                case 9:
+                case 38: // up
+                    handle.keyStop(e, opt);
+                    // if keyCode is [38 (up)] or [9 (tab) with shift]
+                    if (opt.isInput) {
+                        if (e.keyCode == 9 && e.shiftKey) {
+                            e.preventDefault();
+                            opt.$selected && opt.$selected.find('input, textarea, select').blur();
+                            opt.$menu.trigger('prevcommand');
+                            return;
+                        } else if (e.keyCode == 38 && opt.$selected.find('input, textarea, select').prop('type') == 'checkbox') {
+                            // checkboxes don't capture this key
+                            e.preventDefault();
+                            return;
+                        }
+                    } else if (e.keyCode != 9 || e.shiftKey) {
+                        opt.$menu.trigger('prevcommand');
+                        return;
+                    }
+                    // omitting break;
+                    
+                // case 9: // tab - reached through omitted break;
+                case 40: // down
+                    handle.keyStop(e, opt);
+                    if (opt.isInput) {
+                        if (e.keyCode == 9) {
+                            e.preventDefault();
+                            opt.$selected && opt.$selected.find('input, textarea, select').blur();
+                            opt.$menu.trigger('nextcommand');
+                            return;
+                        } else if (e.keyCode == 40 && opt.$selected.find('input, textarea, select').prop('type') == 'checkbox') {
+                            // checkboxes don't capture this key
+                            e.preventDefault();
+                            return;
+                        }
+                    } else {
+                        opt.$menu.trigger('nextcommand');
+                        return;
+                    }
+                    break;
+                
+                case 37: // left
+                    handle.keyStop(e, opt);
+                    if (opt.isInput || !opt.$selected || !opt.$selected.length) {
+                        break;
+                    }
+                
+                    if (!opt.$selected.parent().hasClass('context-menu-root')) {
+                        var $parent = opt.$selected.parent().parent();
+                        opt.$selected.trigger('contextmenu:blur');
+                        opt.$selected = $parent;
+                        return;
+                    }
+                    break;
+                    
+                case 39: // right
+                    handle.keyStop(e, opt);
+                    if (opt.isInput || !opt.$selected || !opt.$selected.length) {
+                        break;
+                    }
+                    
+                    var itemdata = opt.$selected.data('contextMenu') || {};
+                    if (itemdata.$menu && opt.$selected.hasClass('context-menu-submenu')) {
+                        opt.$selected = null;
+                        itemdata.$selected = null;
+                        itemdata.$menu.trigger('nextcommand');
+                        return;
+                    }
+                    break;
+                
+                case 35: // end
+                case 36: // home
+                    if (opt.$selected && opt.$selected.find('input, textarea, select').length) {
+                        return;
+                    } else {
+                        (opt.$selected && opt.$selected.parent() || opt.$menu)
+                            .children(':not(.disabled, .not-selectable)')[e.keyCode == 36 ? 'first' : 'last']()
+                            .trigger('contextmenu:focus');
+                        e.preventDefault();
+                        return;
+                    }
+                    break;
+                    
+                case 13: // enter
+                    handle.keyStop(e, opt);
+                    if (opt.isInput) {
+                        if (opt.$selected && !opt.$selected.is('textarea, select')) {
+                            e.preventDefault();
+                            return;
+                        }
+                        break;
+                    }
+                    opt.$selected && opt.$selected.trigger('mouseup');
+                    return;
+                    
+                case 32: // space
+                case 33: // page up
+                case 34: // page down
+                    // prevent browser from scrolling down while menu is visible
+                    handle.keyStop(e, opt);
+                    return;
+                    
+                case 27: // esc
+                    handle.keyStop(e, opt);
+                    opt.$menu.trigger('contextmenu:hide');
+                    return;
+                    
+                default: // 0-9, a-z
+                    var k = (String.fromCharCode(e.keyCode)).toUpperCase();
+                    if (opt.accesskeys[k]) {
+                        // according to the specs accesskeys must be invoked immediately
+                        opt.accesskeys[k].$node.trigger(opt.accesskeys[k].$menu
+                            ? 'contextmenu:focus'
+                            : 'mouseup'
+                        );
+                        return;
+                    }
+                    break;
+            }
+            // pass event to selected item, 
+            // stop propagation to avoid endless recursion
+            e.stopPropagation();
+            opt.$selected && opt.$selected.trigger(e);
+        },
+
+        // select previous possible command in menu
+        prevItem: function(e) {
+            e.stopPropagation();
+            var opt = $(this).data('contextMenu') || {};
+
+            // obtain currently selected menu
+            if (opt.$selected) {
+                var $s = opt.$selected;
+                opt = opt.$selected.parent().data('contextMenu') || {};
+                opt.$selected = $s;
+            }
+            
+            var $children = opt.$menu.children(),
+                $prev = !opt.$selected || !opt.$selected.prev().length ? $children.last() : opt.$selected.prev(),
+                $round = $prev;
+            
+            // skip disabled
+            while ($prev.hasClass('disabled') || $prev.hasClass('not-selectable')) {
+                if ($prev.prev().length) {
+                    $prev = $prev.prev();
+                } else {
+                    $prev = $children.last();
+                }
+                if ($prev.is($round)) {
+                    // break endless loop
+                    return;
+                }
+            }
+            
+            // leave current
+            if (opt.$selected) {
+                handle.itemMouseleave.call(opt.$selected.get(0), e);
+            }
+            
+            // activate next
+            handle.itemMouseenter.call($prev.get(0), e);
+            
+            // focus input
+            var $input = $prev.find('input, textarea, select');
+            if ($input.length) {
+                $input.focus();
+            }
+        },
+        // select next possible command in menu
+        nextItem: function(e) {
+            e.stopPropagation();
+            var opt = $(this).data('contextMenu') || {};
+
+            // obtain currently selected menu
+            if (opt.$selected) {
+                var $s = opt.$selected;
+                opt = opt.$selected.parent().data('contextMenu') || {};
+                opt.$selected = $s;
+            }
+
+            var $children = opt.$menu.children(),
+                $next = !opt.$selected || !opt.$selected.next().length ? $children.first() : opt.$selected.next(),
+                $round = $next;
+
+            // skip disabled
+            while ($next.hasClass('disabled') || $next.hasClass('not-selectable')) {
+                if ($next.next().length) {
+                    $next = $next.next();
+                } else {
+                    $next = $children.first();
+                }
+                if ($next.is($round)) {
+                    // break endless loop
+                    return;
+                }
+            }
+            
+            // leave current
+            if (opt.$selected) {
+                handle.itemMouseleave.call(opt.$selected.get(0), e);
+            }
+            
+            // activate next
+            handle.itemMouseenter.call($next.get(0), e);
+            
+            // focus input
+            var $input = $next.find('input, textarea, select');
+            if ($input.length) {
+                $input.focus();
+            }
+        },
+        
+        // flag that we're inside an input so the key handler can act accordingly
+        focusInput: function(e) {
+            var $this = $(this).closest('.context-menu-item'),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot;
+
+            root.$selected = opt.$selected = $this;
+            root.isInput = opt.isInput = true;
+        },
+        // flag that we're inside an input so the key handler can act accordingly
+        blurInput: function(e) {
+            var $this = $(this).closest('.context-menu-item'),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot;
+
+            root.isInput = opt.isInput = false;
+        },
+        
+        // :hover on menu
+        menuMouseenter: function(e) {
+            var root = $(this).data().contextMenuRoot;
+            root.hovering = true;
+        },
+        // :hover on menu
+        menuMouseleave: function(e) {
+            var root = $(this).data().contextMenuRoot;
+            if (root.$layer && root.$layer.is(e.relatedTarget)) {
+                root.hovering = false;
+            }
+        },
+        
+        // :hover done manually so key handling is possible
+        itemMouseenter: function(e) {
+            var $this = $(this),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot;
+            
+            root.hovering = true;
+
+            // abort if we're re-entering
+            if (e && root.$layer && root.$layer.is(e.relatedTarget)) {
+                e.preventDefault();
+                e.stopImmediatePropagation();
+            }
+
+            // make sure only one item is selected
+            (opt.$menu ? opt : root).$menu
+                .children('.hover').trigger('contextmenu:blur');
+
+            if ($this.hasClass('disabled') || $this.hasClass('not-selectable')) {
+                opt.$selected = null;
+                return;
+            }
+            
+            $this.trigger('contextmenu:focus');
+        },
+        // :hover done manually so key handling is possible
+        itemMouseleave: function(e) {
+            var $this = $(this),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot;
+
+            if (root !== opt && root.$layer && root.$layer.is(e.relatedTarget)) {
+                root.$selected && root.$selected.trigger('contextmenu:blur');
+                e.preventDefault();
+                e.stopImmediatePropagation();
+                root.$selected = opt.$selected = opt.$node;
+                return;
+            }
+            
+            $this.trigger('contextmenu:blur');
+        },
+        // contextMenu item click
+        itemClick: function(e) {
+            var $this = $(this),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot,
+                key = data.contextMenuKey,
+                callback;
+
+            // abort if the key is unknown or disabled or is a menu
+            if (!opt.items[key] || $this.is('.disabled, .context-menu-submenu, .context-menu-separator, .not-selectable')) {
+                return;
+            }
+
+            e.preventDefault();
+            e.stopImmediatePropagation();
+
+            if ($.isFunction(root.callbacks[key]) && Object.prototype.hasOwnProperty.call(root.callbacks, key)) {
+                // item-specific callback
+                callback = root.callbacks[key];
+            } else if ($.isFunction(root.callback)) {
+                // default callback
+                callback = root.callback;                
+            } else {
+                // no callback, no action
+                return;
+            }
+
+            // hide menu if callback doesn't stop that
+            if (callback.call(root.$trigger, key, root) !== false) {
+                root.$menu.trigger('contextmenu:hide');
+            } else if (root.$menu.parent().length) {
+                op.update.call(root.$trigger, root);
+            }
+        },
+        // ignore click events on input elements
+        inputClick: function(e) {
+            e.stopImmediatePropagation();
+        },
+        
+        // hide <menu>
+        hideMenu: function(e, data) {
+            var root = $(this).data('contextMenuRoot');
+            op.hide.call(root.$trigger, root, data && data.force);
+        },
+        // focus <command>
+        focusItem: function(e) {
+            e.stopPropagation();
+            var $this = $(this),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot;
+
+            $this.addClass('hover')
+                .siblings('.hover').trigger('contextmenu:blur');
+            
+            // remember selected
+            opt.$selected = root.$selected = $this;
+            
+            // position sub-menu - do after show so dumb $.ui.position can keep up
+            if (opt.$node) {
+                root.positionSubmenu.call(opt.$node, opt.$menu);
+            }
+        },
+        // blur <command>
+        blurItem: function(e) {
+            e.stopPropagation();
+            var $this = $(this),
+                data = $this.data(),
+                opt = data.contextMenu,
+                root = data.contextMenuRoot;
+            
+            $this.removeClass('hover');
+            opt.$selected = null;
+        }
+    },
+    // operations
+    op = {
+        show: function(opt, x, y) {
+            var $trigger = $(this),
+                offset,
+                css = {};
+
+            // hide any open menus
+            $('#context-menu-layer').trigger('mousedown');
+
+            // backreference for callbacks
+            opt.$trigger = $trigger;
+
+            // show event
+            if (opt.events.show.call($trigger, opt) === false) {
+                $currentTrigger = null;
+                return;
+            }
+
+            // create or update context menu
+            op.update.call($trigger, opt);
+            
+            // position menu
+            opt.position.call($trigger, opt, x, y);
+
+            // make sure we're in front
+            if (opt.zIndex) {
+                css.zIndex = zindex($trigger) + opt.zIndex;
+            }
+            
+            // add layer
+            op.layer.call(opt.$menu, opt, css.zIndex);
+            
+            // adjust sub-menu zIndexes
+            opt.$menu.find('ul').css('zIndex', css.zIndex + 1);
+            
+            // position and show context menu
+            opt.$menu.css( css )[opt.animation.show](opt.animation.duration, function() {
+                $trigger.trigger('contextmenu:visible');
+            });
+            // make options available and set state
+            $trigger
+                .data('contextMenu', opt)
+                .addClass("context-menu-active");
+            
+            // register key handler
+            $(document).off('keydown.contextMenu').on('keydown.contextMenu', handle.key);
+            // register autoHide handler
+            if (opt.autoHide) {
+                // mouse position handler
+                $(document).on('mousemove.contextMenuAutoHide', function(e) {
+                    // need to capture the offset on mousemove,
+                    // since the page might've been scrolled since activation
+                    var pos = $trigger.offset();
+                    pos.right = pos.left + $trigger.outerWidth();
+                    pos.bottom = pos.top + $trigger.outerHeight();
+                    
+                    if (opt.$layer && !opt.hovering && (!(e.pageX >= pos.left && e.pageX <= pos.right) || !(e.pageY >= pos.top && e.pageY <= pos.bottom))) {
+                        // if mouse in menu...
+                        opt.$menu.trigger('contextmenu:hide');
+                    }
+                });
+            }
+        },
+        hide: function(opt, force) {
+            var $trigger = $(this);
+            if (!opt) {
+                opt = $trigger.data('contextMenu') || {};
+            }
+            
+            // hide event
+            if (!force && opt.events && opt.events.hide.call($trigger, opt) === false) {
+                return;
+            }
+            
+            // remove options and revert state
+            $trigger
+                .removeData('contextMenu')
+                .removeClass("context-menu-active");
+            
+            if (opt.$layer) {
+                // keep layer for a bit so the contextmenu event can be aborted properly by opera
+                setTimeout((function($layer) {
+                    return function(){
+                        $layer.remove();
+                    };
+                })(opt.$layer), 10);
+                
+                try {
+                    delete opt.$layer;
+                } catch(e) {
+                    opt.$layer = null;
+                }
+            }
+            
+            // remove handle
+            $currentTrigger = null;
+            // remove selected
+            opt.$menu.find('.hover').trigger('contextmenu:blur');
+            opt.$selected = null;
+            // unregister key and mouse handlers
+            //$(document).off('.contextMenuAutoHide keydown.contextMenu'); // http://bugs.jquery.com/ticket/10705
+            $(document).off('.contextMenuAutoHide').off('keydown.contextMenu');
+            // hide menu
+            opt.$menu && opt.$menu[opt.animation.hide](opt.animation.duration, function (){
+                // tear down dynamically built menu after animation is completed.
+                if (opt.build) {
+                    opt.$menu.remove();
+                    $.each(opt, function(key, value) {
+                        switch (key) {
+                            case 'ns':
+                            case 'selector':
+                            case 'build':
+                            case 'trigger':
+                                return true;
+
+                            default:
+                                opt[key] = undefined;
+                                try {
+                                    delete opt[key];
+                                } catch (e) {}
+                                return true;
+                        }
+                    });
+                }
+                
+                setTimeout(function() {
+                    $trigger.trigger('contextmenu:hidden');
+                }, 10);
+            });
+        },
+        create: function(opt, root) {
+            if (root === undefined) {
+                root = opt;
+            }
+            // create contextMenu
+            opt.$menu = $('<ul class="context-menu-list"></ul>').addClass(opt.className || "").data({
+                'contextMenu': opt,
+                'contextMenuRoot': root
+            });
+            
+            $.each(['callbacks', 'commands', 'inputs'], function(i,k){
+                opt[k] = {};
+                if (!root[k]) {
+                    root[k] = {};
+                }
+            });
+            
+            root.accesskeys || (root.accesskeys = {});
+            
+            // create contextMenu items
+            $.each(opt.items, function(key, item){
+                var $t = $('<li class="context-menu-item"></li>').addClass(item.className || ""),
+                    $label = null,
+                    $input = null;
+                
+                // iOS needs to see a click-event bound to an element to actually
+                // have the TouchEvents infrastructure trigger the click event
+                $t.on('click', $.noop);
+                
+                item.$node = $t.data({
+                    'contextMenu': opt,
+                    'contextMenuRoot': root,
+                    'contextMenuKey': key
+                });
+                
+                // register accesskey
+                // NOTE: the accesskey attribute should be applicable to any element, but Safari5 and Chrome13 still can't do that
+                if (item.accesskey) {
+                    var aks = splitAccesskey(item.accesskey);
+                    for (var i=0, ak; ak = aks[i]; i++) {
+                        if (!root.accesskeys[ak]) {
+                            root.accesskeys[ak] = item;
+                            item._name = item.name.replace(new RegExp('(' + ak + ')', 'i'), '<span class="context-menu-accesskey">$1</span>');
+                            break;
+                        }
+                    }
+                }
+                
+                if (typeof item == "string") {
+                    $t.addClass('context-menu-separator not-selectable');
+                } else if (item.type && types[item.type]) {
+                    // run custom type handler
+                    types[item.type].call($t, item, opt, root);
+                    // register commands
+                    $.each([opt, root], function(i,k){
+                        k.commands[key] = item;
+                        if ($.isFunction(item.callback)) {
+                            k.callbacks[key] = item.callback;
+                        }
+                    });
+                } else {
+                    // add label for input
+                    if (item.type == 'html') {
+                        $t.addClass('context-menu-html not-selectable');
+                    } else if (item.type) {
+                        $label = $('<label></label>').appendTo($t);
+                        $('<span></span>').html(item._name || item.name).appendTo($label);
+                        $t.addClass('context-menu-input');
+                        opt.hasTypes = true;
+                        $.each([opt, root], function(i,k){
+                            k.commands[key] = item;
+                            k.inputs[key] = item;
+                        });
+                    } else if (item.items) {
+                        item.type = 'sub';
+                    }
+                
+                    switch (item.type) {
+                        case 'text':
+                            $input = $('<input type="text" value="1" name="" value="">')
+                                .attr('name', 'context-menu-input-' + key)
+                                .val(item.value || "")
+                                .appendTo($label);
+                            break;
+                    
+                        case 'textarea':
+                            $input = $('<textarea name=""></textarea>')
+                                .attr('name', 'context-menu-input-' + key)
+                                .val(item.value || "")
+                                .appendTo($label);
+
+                            if (item.height) {
+                                $input.height(item.height);
+                            }
+                            break;
+
+                        case 'checkbox':
+                            $input = $('<input type="checkbox" value="1" name="" value="">')
+                                .attr('name', 'context-menu-input-' + key)
+                                .val(item.value || "")
+                                .prop("checked", !!item.selected)
+                                .prependTo($label);
+                            break;
+
+                        case 'radio':
+                            $input = $('<input type="radio" value="1" name="" value="">')
+                                .attr('name', 'context-menu-input-' + item.radio)
+                                .val(item.value || "")
+                                .prop("checked", !!item.selected)
+                                .prependTo($label);
+                            break;
+                    
+                        case 'select':
+                            $input = $('<select name="">')
+                                .attr('name', 'context-menu-input-' + key)
+                                .appendTo($label);
+                            if (item.options) {
+                                $.each(item.options, function(value, text) {
+                                    $('<option></option>').val(value).text(text).appendTo($input);
+                                });
+                                $input.val(item.selected);
+                            }
+                            break;
+                        
+                        case 'sub':
+                            // FIXME: shouldn't this .html() be a .text()?
+                            $('<span></span>').html(item._name || item.name).appendTo($t);
+                            item.appendTo = item.$node;
+                            op.create(item, root);
+                            $t.data('contextMenu', item).addClass('context-menu-submenu');
+                            item.callback = null;
+                            break;
+                        
+                        case 'html':
+                            $(item.html).appendTo($t);
+                            break;
+                        
+                        default:
+                            $.each([opt, root], function(i,k){
+                                k.commands[key] = item;
+                                if ($.isFunction(item.callback)) {
+                                    k.callbacks[key] = item.callback;
+                                }
+                            });
+                            // FIXME: shouldn't this .html() be a .text()?
+                            $('<span></span>').html(item._name || item.name || "").appendTo($t);
+                            break;
+                    }
+                    
+                    // disable key listener in <input>
+                    if (item.type && item.type != 'sub' && item.type != 'html') {
+                        $input
+                            .on('focus', handle.focusInput)
+                            .on('blur', handle.blurInput);
+                        
+                        if (item.events) {
+                            $input.on(item.events, opt);
+                        }
+                    }
+                
+                    // add icons
+                    if (item.icon) {
+                        $t.addClass("icon icon-" + item.icon);
+                    }
+                }
+                
+                // cache contained elements
+                item.$input = $input;
+                item.$label = $label;
+
+                // attach item to menu
+                $t.appendTo(opt.$menu);
+                
+                // Disable text selection
+                if (!opt.hasTypes && $.support.eventSelectstart) {
+                    // browsers support user-select: none, 
+                    // IE has a special event for text-selection
+                    // browsers supporting neither will not be preventing text-selection
+                    $t.on('selectstart.disableTextSelect', handle.abortevent);
+                }
+            });
+            // attach contextMenu to <body> (to bypass any possible overflow:hidden issues on parents of the trigger element)
+            if (!opt.$node) {
+                opt.$menu.css('display', 'none').addClass('context-menu-root');
+            }
+            opt.$menu.appendTo(opt.appendTo || document.body);
+        },
+        resize: function($menu, nested) {
+            // determine widths of submenus, as CSS won't grow them automatically
+            // position:absolute within position:absolute; min-width:100; max-width:200; results in width: 100;
+            // kinda sucks hard...
+
+            // determine width of absolutely positioned element
+            $menu.css({position: 'absolute', display: 'block'});
+            // don't apply yet, because that would break nested elements' widths
+            // add a pixel to circumvent word-break issue in IE9 - #80
+            $menu.data('width', Math.ceil($menu.width()) + 1);
+            // reset styles so they allow nested elements to grow/shrink naturally
+            $menu.css({
+                position: 'static',
+                minWidth: '0px',
+                maxWidth: '100000px'
+            });
+            // identify width of nested menus
+            $menu.find('> li > ul').each(function() {
+                op.resize($(this), true);
+            });
+            // reset and apply changes in the end because nested
+            // elements' widths wouldn't be calculatable otherwise
+            if (!nested) {
+                $menu.find('ul').andSelf().css({
+                    position: '', 
+                    display: '',
+                    minWidth: '',
+                    maxWidth: ''
+                }).width(function() {
+                    return $(this).data('width');
+                });
+            }
+        },
+        update: function(opt, root) {
+            var $trigger = this;
+            if (root === undefined) {
+                root = opt;
+                op.resize(opt.$menu);
+            }
+            // re-check disabled for each item
+            opt.$menu.children().each(function(){
+                var $item = $(this),
+                    key = $item.data('contextMenuKey'),
+                    item = opt.items[key],
+                    disabled = ($.isFunction(item.disabled) && item.disabled.call($trigger, key, root)) || item.disabled === true;
+
+                // dis- / enable item
+                $item[disabled ? 'addClass' : 'removeClass']('disabled');
+                
+                if (item.type) {
+                    // dis- / enable input elements
+                    $item.find('input, select, textarea').prop('disabled', disabled);
+                    
+                    // update input states
+                    switch (item.type) {
+                        case 'text':
+                        case 'textarea':
+                            item.$input.val(item.value || "");
+                            break;
+                            
+                        case 'checkbox':
+                        case 'radio':
+                            item.$input.val(item.value || "").prop('checked', !!item.selected);
+                            break;
+                            
+                        case 'select':
+                            item.$input.val(item.selected || "");
+                            break;
+                    }
+                }
+                
+                if (item.$menu) {
+                    // update sub-menu
+                    op.update.call($trigger, item, root);
+                }
+            });
+        },
+        layer: function(opt, zIndex) {
+            // add transparent layer for click area
+            // filter and background for Internet Explorer, Issue #23
+            var $layer = opt.$layer = $('<div id="context-menu-layer" style="position:fixed; z-index:' + zIndex + '; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>')
+                .css({height: $win.height(), width: $win.width(), display: 'block'})
+                .data('contextMenuRoot', opt)
+                .insertBefore(this)
+                .on('contextmenu', handle.abortevent)
+                .on('mousedown', handle.layerClick);
+            
+            // IE6 doesn't know position:fixed;
+            if (!$.support.fixedPosition) {
+                $layer.css({
+                    'position' : 'absolute',
+                    'height' : $(document).height()
+                });
+            }
+            
+            return $layer;
+        }
+    };
+
+// split accesskey according to http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#assigned-access-key
+function splitAccesskey(val) {
+    var t = val.split(/\s+/),
+        keys = [];
+        
+    for (var i=0, k; k = t[i]; i++) {
+        k = k[0].toUpperCase(); // first character only
+        // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.
+        // a map to look up already used access keys would be nice
+        keys.push(k);
+    }
+    
+    return keys;
+}
+
+// handle contextMenu triggers
+$.fn.contextMenu = function(operation) {
+    if (operation === undefined) {
+        this.first().trigger('contextmenu');
+    } else if (operation.x && operation.y) {
+        this.first().trigger($.Event("contextmenu", {pageX: operation.x, pageY: operation.y}));
+    } else if (operation === "hide") {
+        var $menu = this.data('contextMenu').$menu;
+        $menu && $menu.trigger('contextmenu:hide');
+    } else if (operation === "destroy") {
+        $.contextMenu("destroy", {context: this});
+    } else if ($.isPlainObject(operation)) {
+        operation.context = this;
+        $.contextMenu("create", operation);
+    } else if (operation) {
+        this.removeClass('context-menu-disabled');
+    } else if (!operation) {
+        this.addClass('context-menu-disabled');
+    }
+    
+    return this;
+};
+
+// manage contextMenu instances
+$.contextMenu = function(operation, options) {
+    if (typeof operation != 'string') {
+        options = operation;
+        operation = 'create';
+    }
+    
+    if (typeof options == 'string') {
+        options = {selector: options};
+    } else if (options === undefined) {
+        options = {};
+    }
+    
+    // merge with default options
+    var o = $.extend(true, {}, defaults, options || {});
+    var $document = $(document);
+    var $context = $document;
+    var _hasContext = false;
+    
+    if (!o.context || !o.context.length) {
+        o.context = document;
+    } else {
+        // you never know what they throw at you...
+        $context = $(o.context).first();
+        o.context = $context.get(0);
+        _hasContext = o.context !== document;
+    }
+    
+    switch (operation) {
+        case 'create':
+            // no selector no joy
+            if (!o.selector) {
+                throw new Error('No selector specified');
+            }
+            // make sure internal classes are not bound to
+            if (o.selector.match(/.context-menu-(list|item|input)($|\s)/)) {
+                throw new Error('Cannot bind to selector "' + o.selector + '" as it contains a reserved className');
+            }
+            if (!o.build && (!o.items || $.isEmptyObject(o.items))) {
+                throw new Error('No Items specified');
+            }
+            counter ++;
+            o.ns = '.contextMenu' + counter;
+            if (!_hasContext) {
+                namespaces[o.selector] = o.ns;
+            }
+            menus[o.ns] = o;
+            
+            // default to right click
+            if (!o.trigger) {
+                o.trigger = 'right';
+            }
+            
+            if (!initialized) {
+                // make sure item click is registered first
+                $document
+                    .on({
+                        'contextmenu:hide.contextMenu': handle.hideMenu,
+                        'prevcommand.contextMenu': handle.prevItem,
+                        'nextcommand.contextMenu': handle.nextItem,
+                        'contextmenu.contextMenu': handle.abortevent,
+                        'mouseenter.contextMenu': handle.menuMouseenter,
+                        'mouseleave.contextMenu': handle.menuMouseleave
+                    }, '.context-menu-list')
+                    .on('mouseup.contextMenu', '.context-menu-input', handle.inputClick)
+                    .on({
+                        'mouseup.contextMenu': handle.itemClick,
+                        'contextmenu:focus.contextMenu': handle.focusItem,
+                        'contextmenu:blur.contextMenu': handle.blurItem,
+                        'contextmenu.contextMenu': handle.abortevent,
+                        'mouseenter.contextMenu': handle.itemMouseenter,
+                        'mouseleave.contextMenu': handle.itemMouseleave
+                    }, '.context-menu-item');
+
+                initialized = true;
+            }
+            
+            // engage native contextmenu event
+            $context
+                .on('contextmenu' + o.ns, o.selector, o, handle.contextmenu);
+            
+            if (_hasContext) {
+                // add remove hook, just in case
+                $context.on('remove' + o.ns, function() {
+                    $(this).contextMenu("destroy");
+                });
+            }
+            
+            switch (o.trigger) {
+                case 'hover':
+                        $context
+                            .on('mouseenter' + o.ns, o.selector, o, handle.mouseenter)
+                            .on('mouseleave' + o.ns, o.selector, o, handle.mouseleave);                    
+                    break;
+                    
+                case 'left':
+                        $context.on('click' + o.ns, o.selector, o, handle.click);
+                    break;
+                /*
+                default:
+                    // http://www.quirksmode.org/dom/events/contextmenu.html
+                    $document
+                        .on('mousedown' + o.ns, o.selector, o, handle.mousedown)
+                        .on('mouseup' + o.ns, o.selector, o, handle.mouseup);
+                    break;
+                */
+            }
+            
+            // create menu
+            if (!o.build) {
+                op.create(o);
+            }
+            break;
+        
+        case 'destroy':
+            var $visibleMenu;
+            if (_hasContext) {
+                // get proper options 
+                var context = o.context;
+                $.each(menus, function(ns, o) {
+                    if (o.context !== context) {
+                        return true;
+                    }
+                    
+                    $visibleMenu = $('.context-menu-list').filter(':visible');
+                    if ($visibleMenu.length && $visibleMenu.data().contextMenuRoot.$trigger.is($(o.context).find(o.selector))) {
+                        $visibleMenu.trigger('contextmenu:hide', {force: true});
+                    }
+
+                    try {
+                        if (menus[o.ns].$menu) {
+                            menus[o.ns].$menu.remove();
+                        }
+
+                        delete menus[o.ns];
+                    } catch(e) {
+                        menus[o.ns] = null;
+                    }
+
+                    $(o.context).off(o.ns);
+                    
+                    return true;
+                });
+            } else if (!o.selector) {
+                $document.off('.contextMenu .contextMenuAutoHide');
+                $.each(menus, function(ns, o) {
+                    $(o.context).off(o.ns);
+                });
+                
+                namespaces = {};
+                menus = {};
+                counter = 0;
+                initialized = false;
+                
+                $('#context-menu-layer, .context-menu-list').remove();
+            } else if (namespaces[o.selector]) {
+                $visibleMenu = $('.context-menu-list').filter(':visible');
+                if ($visibleMenu.length && $visibleMenu.data().contextMenuRoot.$trigger.is(o.selector)) {
+                    $visibleMenu.trigger('contextmenu:hide', {force: true});
+                }
+                
+                try {
+                    if (menus[namespaces[o.selector]].$menu) {
+                        menus[namespaces[o.selector]].$menu.remove();
+                    }
+                    
+                    delete menus[namespaces[o.selector]];
+                } catch(e) {
+                    menus[namespaces[o.selector]] = null;
+                }
+                
+                $document.off(namespaces[o.selector]);
+            }
+            break;
+        
+        case 'html5':
+            // if <command> or <menuitem> are not handled by the browser,
+            // or options was a bool true,
+            // initialize $.contextMenu for them
+            if ((!$.support.htmlCommand && !$.support.htmlMenuitem) || (typeof options == "boolean" && options)) {
+                $('menu[type="context"]').each(function() {
+                    if (this.id) {
+                        $.contextMenu({
+                            selector: '[contextmenu=' + this.id +']',
+                            items: $.contextMenu.fromMenu(this)
+                        });
+                    }
+                }).css('display', 'none');
+            }
+            break;
+        
+        default:
+            throw new Error('Unknown operation "' + operation + '"');
+    }
+    
+    return this;
+};
+
+// import values into <input> commands
+$.contextMenu.setInputValues = function(opt, data) {
+    if (data === undefined) {
+        data = {};
+    }
+    
+    $.each(opt.inputs, function(key, item) {
+        switch (item.type) {
+            case 'text':
+            case 'textarea':
+                item.value = data[key] || "";
+                break;
+
+            case 'checkbox':
+                item.selected = data[key] ? true : false;
+                break;
+                
+            case 'radio':
+                item.selected = (data[item.radio] || "") == item.value ? true : false;
+                break;
+            
+            case 'select':
+                item.selected = data[key] || "";
+                break;
+        }
+    });
+};
+
+// export values from <input> commands
+$.contextMenu.getInputValues = function(opt, data) {
+    if (data === undefined) {
+        data = {};
+    }
+    
+    $.each(opt.inputs, function(key, item) {
+        switch (item.type) {
+            case 'text':
+            case 'textarea':
+            case 'select':
+                data[key] = item.$input.val();
+                break;
+
+            case 'checkbox':
+                data[key] = item.$input.prop('checked');
+                break;
+                
+            case 'radio':
+                if (item.$input.prop('checked')) {
+                    data[item.radio] = item.value;
+                }
+                break;
+        }
+    });
+    
+    return data;
+};
+
+// find <label for="xyz">
+function inputLabel(node) {
+    return (node.id && $('label[for="'+ node.id +'"]').val()) || node.name;
+}
+
+// convert <menu> to items object
+function menuChildren(items, $children, counter) {
+    if (!counter) {
+        counter = 0;
+    }
+    
+    $children.each(function() {
+        var $node = $(this),
+            node = this,
+            nodeName = this.nodeName.toLowerCase(),
+            label,
+            item;
+        
+        // extract <label><input>
+        if (nodeName == 'label' && $node.find('input, textarea, select').length) {
+            label = $node.text();
+            $node = $node.children().first();
+            node = $node.get(0);
+            nodeName = node.nodeName.toLowerCase();
+        }
+        
+        /*
+         * <menu> accepts flow-content as children. that means <embed>, <canvas> and such are valid menu items.
+         * Not being the sadistic kind, $.contextMenu only accepts:
+         * <command>, <menuitem>, <hr>, <span>, <p> <input [text, radio, checkbox]>, <textarea>, <select> and of course <menu>.
+         * Everything else will be imported as an html node, which is not interfaced with contextMenu.
+         */
+        
+        // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#concept-command
+        switch (nodeName) {
+            // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-menu-element
+            case 'menu':
+                item = {name: $node.attr('label'), items: {}};
+                counter = menuChildren(item.items, $node.children(), counter);
+                break;
+            
+            // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-a-element-to-define-a-command
+            case 'a':
+            // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-button-element-to-define-a-command
+            case 'button':
+                item = {
+                    name: $node.text(),
+                    disabled: !!$node.attr('disabled'),
+                    callback: (function(){ return function(){ $node.click(); }; })()
+                };
+                break;
+            
+            // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-command-element-to-define-a-command
+
+            case 'menuitem':
+            case 'command':
+                switch ($node.attr('type')) {
+                    case undefined:
+                    case 'command':
+                    case 'menuitem':
+                        item = {
+                            name: $node.attr('label'),
+                            disabled: !!$node.attr('disabled'),
+                            callback: (function(){ return function(){ $node.click(); }; })()
+                        };
+                        break;
+                        
+                    case 'checkbox':
+                        item = {
+                            type: 'checkbox',
+                            disabled: !!$node.attr('disabled'),
+                            name: $node.attr('label'),
+                            selected: !!$node.attr('checked')
+                        };
+                        break;
+                        
+                    case 'radio':
+                        item = {
+                            type: 'radio',
+                            disabled: !!$node.attr('disabled'),
+                            name: $node.attr('label'),
+                            radio: $node.attr('radiogroup'),
+                            value: $node.attr('id'),
+                            selected: !!$node.attr('checked')
+                        };
+                        break;
+                        
+                    default:
+                        item = undefined;
+                }
+                break;
+            case 'hr':
+                item = '-------';
+                break;
+                
+            case 'input':
+                switch ($node.attr('type')) {
+                    case 'text':
+                        item = {
+                            type: 'text',
+                            name: label || inputLabel(node),
+                            disabled: !!$node.attr('disabled'),
+                            value: $node.val()
+                        };
+                        break;
+                        
+                    case 'checkbox':
+                        item = {
+                            type: 'checkbox',
+                            name: label || inputLabel(node),
+                            disabled: !!$node.attr('disabled'),
+                            selected: !!$node.attr('checked')
+                        };
+                        break;
+                        
+                    case 'radio':
+                        item = {
+                            type: 'radio',
+                            name: label || inputLabel(node),
+                            disabled: !!$node.attr('disabled'),
+                            radio: !!$node.attr('name'),
+                            value: $node.val(),
+                            selected: !!$node.attr('checked')
+                        };
+                        break;
+                    
+                    default:
+                        item = undefined;
+                        break;
+                }
+                break;
+                
+            case 'select':
+                item = {
+                    type: 'select',
+                    name: label || inputLabel(node),
+                    disabled: !!$node.attr('disabled'),
+                    selected: $node.val(),
+                    options: {}
+                };
+                $node.children().each(function(){
+                    item.options[this.value] = $(this).text();
+                });
+                break;
+                
+            case 'textarea':
+                item = {
+                    type: 'textarea',
+                    name: label || inputLabel(node),
+                    disabled: !!$node.attr('disabled'),
+                    value: $node.val()
+                };
+                break;
+            
+            case 'label':
+                break;
+            
+            default:
+                item = {type: 'html', html: $node.clone(true)};
+                break;
+        }
+        
+        if (item) {
+            counter++;
+            items['key' + counter] = item;
+        }
+    });
+    
+    return counter;
+}
+
+// convert html5 menu
+$.contextMenu.fromMenu = function(element) {
+    var $this = $(element),
+        items = {};
+        
+    menuChildren(items, $this.children());
+    
+    return items;
+};
+
+// make defaults accessible
+$.contextMenu.defaults = defaults;
+$.contextMenu.types = types;
+// export internal functions - undocumented, for hacking only!
+$.contextMenu.handle = handle;
+$.contextMenu.op = op;
+$.contextMenu.menus = menus;
+
+})(jQuery);
diff --git a/portal/static/unbound_reservation_static/js/menu/jquery.ui.position.js b/portal/static/unbound_reservation_static/js/menu/jquery.ui.position.js
new file mode 100644 (file)
index 0000000..08ce445
--- /dev/null
@@ -0,0 +1,497 @@
+/*!
+ * jQuery UI Position v1.10.0
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/position/
+ */
+(function( $, undefined ) {
+
+$.ui = $.ui || {};
+
+var cachedScrollbarWidth,
+       max = Math.max,
+       abs = Math.abs,
+       round = Math.round,
+       rhorizontal = /left|center|right/,
+       rvertical = /top|center|bottom/,
+       roffset = /[\+\-]\d+%?/,
+       rposition = /^\w+/,
+       rpercent = /%$/,
+       _position = $.fn.position;
+
+function getOffsets( offsets, width, height ) {
+       return [
+               parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+               parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+       ];
+}
+
+function parseCss( element, property ) {
+       return parseInt( $.css( element, property ), 10 ) || 0;
+}
+
+function getDimensions( elem ) {
+       var raw = elem[0];
+       if ( raw.nodeType === 9 ) {
+               return {
+                       width: elem.width(),
+                       height: elem.height(),
+                       offset: { top: 0, left: 0 }
+               };
+       }
+       if ( $.isWindow( raw ) ) {
+               return {
+                       width: elem.width(),
+                       height: elem.height(),
+                       offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
+               };
+       }
+       if ( raw.preventDefault ) {
+               return {
+                       width: 0,
+                       height: 0,
+                       offset: { top: raw.pageY, left: raw.pageX }
+               };
+       }
+       return {
+               width: elem.outerWidth(),
+               height: elem.outerHeight(),
+               offset: elem.offset()
+       };
+}
+
+$.position = {
+       scrollbarWidth: function() {
+               if ( cachedScrollbarWidth !== undefined ) {
+                       return cachedScrollbarWidth;
+               }
+               var w1, w2,
+                       div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
+                       innerDiv = div.children()[0];
+
+               $( "body" ).append( div );
+               w1 = innerDiv.offsetWidth;
+               div.css( "overflow", "scroll" );
+
+               w2 = innerDiv.offsetWidth;
+
+               if ( w1 === w2 ) {
+                       w2 = div[0].clientWidth;
+               }
+
+               div.remove();
+
+               return (cachedScrollbarWidth = w1 - w2);
+       },
+       getScrollInfo: function( within ) {
+               var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ),
+                       overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ),
+                       hasOverflowX = overflowX === "scroll" ||
+                               ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
+                       hasOverflowY = overflowY === "scroll" ||
+                               ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
+               return {
+                       width: hasOverflowX ? $.position.scrollbarWidth() : 0,
+                       height: hasOverflowY ? $.position.scrollbarWidth() : 0
+               };
+       },
+       getWithinInfo: function( element ) {
+               var withinElement = $( element || window ),
+                       isWindow = $.isWindow( withinElement[0] );
+               return {
+                       element: withinElement,
+                       isWindow: isWindow,
+                       offset: withinElement.offset() || { left: 0, top: 0 },
+                       scrollLeft: withinElement.scrollLeft(),
+                       scrollTop: withinElement.scrollTop(),
+                       width: isWindow ? withinElement.width() : withinElement.outerWidth(),
+                       height: isWindow ? withinElement.height() : withinElement.outerHeight()
+               };
+       }
+};
+
+$.fn.position = function( options ) {
+       if ( !options || !options.of ) {
+               return _position.apply( this, arguments );
+       }
+
+       // make a copy, we don't want to modify arguments
+       options = $.extend( {}, options );
+
+       var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
+               target = $( options.of ),
+               within = $.position.getWithinInfo( options.within ),
+               scrollInfo = $.position.getScrollInfo( within ),
+               collision = ( options.collision || "flip" ).split( " " ),
+               offsets = {};
+
+       dimensions = getDimensions( target );
+       if ( target[0].preventDefault ) {
+               // force left top to allow flipping
+               options.at = "left top";
+       }
+       targetWidth = dimensions.width;
+       targetHeight = dimensions.height;
+       targetOffset = dimensions.offset;
+       // clone to reuse original targetOffset later
+       basePosition = $.extend( {}, targetOffset );
+
+       // force my and at to have valid horizontal and vertical positions
+       // if a value is missing or invalid, it will be converted to center
+       $.each( [ "my", "at" ], function() {
+               var pos = ( options[ this ] || "" ).split( " " ),
+                       horizontalOffset,
+                       verticalOffset;
+
+               if ( pos.length === 1) {
+                       pos = rhorizontal.test( pos[ 0 ] ) ?
+                               pos.concat( [ "center" ] ) :
+                               rvertical.test( pos[ 0 ] ) ?
+                                       [ "center" ].concat( pos ) :
+                                       [ "center", "center" ];
+               }
+               pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+               pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
+
+               // calculate offsets
+               horizontalOffset = roffset.exec( pos[ 0 ] );
+               verticalOffset = roffset.exec( pos[ 1 ] );
+               offsets[ this ] = [
+                       horizontalOffset ? horizontalOffset[ 0 ] : 0,
+                       verticalOffset ? verticalOffset[ 0 ] : 0
+               ];
+
+               // reduce to just the positions without the offsets
+               options[ this ] = [
+                       rposition.exec( pos[ 0 ] )[ 0 ],
+                       rposition.exec( pos[ 1 ] )[ 0 ]
+               ];
+       });
+
+       // normalize collision option
+       if ( collision.length === 1 ) {
+               collision[ 1 ] = collision[ 0 ];
+       }
+
+       if ( options.at[ 0 ] === "right" ) {
+               basePosition.left += targetWidth;
+       } else if ( options.at[ 0 ] === "center" ) {
+               basePosition.left += targetWidth / 2;
+       }
+
+       if ( options.at[ 1 ] === "bottom" ) {
+               basePosition.top += targetHeight;
+       } else if ( options.at[ 1 ] === "center" ) {
+               basePosition.top += targetHeight / 2;
+       }
+
+       atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
+       basePosition.left += atOffset[ 0 ];
+       basePosition.top += atOffset[ 1 ];
+
+       return this.each(function() {
+               var collisionPosition, using,
+                       elem = $( this ),
+                       elemWidth = elem.outerWidth(),
+                       elemHeight = elem.outerHeight(),
+                       marginLeft = parseCss( this, "marginLeft" ),
+                       marginTop = parseCss( this, "marginTop" ),
+                       collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
+                       collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
+                       position = $.extend( {}, basePosition ),
+                       myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
+
+               if ( options.my[ 0 ] === "right" ) {
+                       position.left -= elemWidth;
+               } else if ( options.my[ 0 ] === "center" ) {
+                       position.left -= elemWidth / 2;
+               }
+
+               if ( options.my[ 1 ] === "bottom" ) {
+                       position.top -= elemHeight;
+               } else if ( options.my[ 1 ] === "center" ) {
+                       position.top -= elemHeight / 2;
+               }
+
+               position.left += myOffset[ 0 ];
+               position.top += myOffset[ 1 ];
+
+               // if the browser doesn't support fractions, then round for consistent results
+               if ( !$.support.offsetFractions ) {
+                       position.left = round( position.left );
+                       position.top = round( position.top );
+               }
+
+               collisionPosition = {
+                       marginLeft: marginLeft,
+                       marginTop: marginTop
+               };
+
+               $.each( [ "left", "top" ], function( i, dir ) {
+                       if ( $.ui.position[ collision[ i ] ] ) {
+                               $.ui.position[ collision[ i ] ][ dir ]( position, {
+                                       targetWidth: targetWidth,
+                                       targetHeight: targetHeight,
+                                       elemWidth: elemWidth,
+                                       elemHeight: elemHeight,
+                                       collisionPosition: collisionPosition,
+                                       collisionWidth: collisionWidth,
+                                       collisionHeight: collisionHeight,
+                                       offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
+                                       my: options.my,
+                                       at: options.at,
+                                       within: within,
+                                       elem : elem
+                               });
+                       }
+               });
+
+               if ( options.using ) {
+                       // adds feedback as second argument to using callback, if present
+                       using = function( props ) {
+                               var left = targetOffset.left - position.left,
+                                       right = left + targetWidth - elemWidth,
+                                       top = targetOffset.top - position.top,
+                                       bottom = top + targetHeight - elemHeight,
+                                       feedback = {
+                                               target: {
+                                                       element: target,
+                                                       left: targetOffset.left,
+                                                       top: targetOffset.top,
+                                                       width: targetWidth,
+                                                       height: targetHeight
+                                               },
+                                               element: {
+                                                       element: elem,
+                                                       left: position.left,
+                                                       top: position.top,
+                                                       width: elemWidth,
+                                                       height: elemHeight
+                                               },
+                                               horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
+                                               vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
+                                       };
+                               if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
+                                       feedback.horizontal = "center";
+                               }
+                               if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
+                                       feedback.vertical = "middle";
+                               }
+                               if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
+                                       feedback.important = "horizontal";
+                               } else {
+                                       feedback.important = "vertical";
+                               }
+                               options.using.call( this, props, feedback );
+                       };
+               }
+
+               elem.offset( $.extend( position, { using: using } ) );
+       });
+};
+
+$.ui.position = {
+       fit: {
+               left: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
+                               outerWidth = within.width,
+                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+                               overLeft = withinOffset - collisionPosLeft,
+                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
+                               newOverRight;
+
+                       // element is wider than within
+                       if ( data.collisionWidth > outerWidth ) {
+                               // element is initially over the left side of within
+                               if ( overLeft > 0 && overRight <= 0 ) {
+                                       newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
+                                       position.left += overLeft - newOverRight;
+                               // element is initially over right side of within
+                               } else if ( overRight > 0 && overLeft <= 0 ) {
+                                       position.left = withinOffset;
+                               // element is initially over both left and right sides of within
+                               } else {
+                                       if ( overLeft > overRight ) {
+                                               position.left = withinOffset + outerWidth - data.collisionWidth;
+                                       } else {
+                                               position.left = withinOffset;
+                                       }
+                               }
+                       // too far left -> align with left edge
+                       } else if ( overLeft > 0 ) {
+                               position.left += overLeft;
+                       // too far right -> align with right edge
+                       } else if ( overRight > 0 ) {
+                               position.left -= overRight;
+                       // adjust based on position and margin
+                       } else {
+                               position.left = max( position.left - collisionPosLeft, position.left );
+                       }
+               },
+               top: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
+                               outerHeight = data.within.height,
+                               collisionPosTop = position.top - data.collisionPosition.marginTop,
+                               overTop = withinOffset - collisionPosTop,
+                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
+                               newOverBottom;
+
+                       // element is taller than within
+                       if ( data.collisionHeight > outerHeight ) {
+                               // element is initially over the top of within
+                               if ( overTop > 0 && overBottom <= 0 ) {
+                                       newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
+                                       position.top += overTop - newOverBottom;
+                               // element is initially over bottom of within
+                               } else if ( overBottom > 0 && overTop <= 0 ) {
+                                       position.top = withinOffset;
+                               // element is initially over both top and bottom of within
+                               } else {
+                                       if ( overTop > overBottom ) {
+                                               position.top = withinOffset + outerHeight - data.collisionHeight;
+                                       } else {
+                                               position.top = withinOffset;
+                                       }
+                               }
+                       // too far up -> align with top
+                       } else if ( overTop > 0 ) {
+                               position.top += overTop;
+                       // too far down -> align with bottom edge
+                       } else if ( overBottom > 0 ) {
+                               position.top -= overBottom;
+                       // adjust based on position and margin
+                       } else {
+                               position.top = max( position.top - collisionPosTop, position.top );
+                       }
+               }
+       },
+       flip: {
+               left: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.offset.left + within.scrollLeft,
+                               outerWidth = within.width,
+                               offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
+                               collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+                               overLeft = collisionPosLeft - offsetLeft,
+                               overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
+                               myOffset = data.my[ 0 ] === "left" ?
+                                       -data.elemWidth :
+                                       data.my[ 0 ] === "right" ?
+                                               data.elemWidth :
+                                               0,
+                               atOffset = data.at[ 0 ] === "left" ?
+                                       data.targetWidth :
+                                       data.at[ 0 ] === "right" ?
+                                               -data.targetWidth :
+                                               0,
+                               offset = -2 * data.offset[ 0 ],
+                               newOverRight,
+                               newOverLeft;
+
+                       if ( overLeft < 0 ) {
+                               newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
+                               if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
+                                       position.left += myOffset + atOffset + offset;
+                               }
+                       }
+                       else if ( overRight > 0 ) {
+                               newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
+                               if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
+                                       position.left += myOffset + atOffset + offset;
+                               }
+                       }
+               },
+               top: function( position, data ) {
+                       var within = data.within,
+                               withinOffset = within.offset.top + within.scrollTop,
+                               outerHeight = within.height,
+                               offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
+                               collisionPosTop = position.top - data.collisionPosition.marginTop,
+                               overTop = collisionPosTop - offsetTop,
+                               overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
+                               top = data.my[ 1 ] === "top",
+                               myOffset = top ?
+                                       -data.elemHeight :
+                                       data.my[ 1 ] === "bottom" ?
+                                               data.elemHeight :
+                                               0,
+                               atOffset = data.at[ 1 ] === "top" ?
+                                       data.targetHeight :
+                                       data.at[ 1 ] === "bottom" ?
+                                               -data.targetHeight :
+                                               0,
+                               offset = -2 * data.offset[ 1 ],
+                               newOverTop,
+                               newOverBottom;
+                       if ( overTop < 0 ) {
+                               newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
+                               if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
+                                       position.top += myOffset + atOffset + offset;
+                               }
+                       }
+                       else if ( overBottom > 0 ) {
+                               newOverTop = position.top -  data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
+                               if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
+                                       position.top += myOffset + atOffset + offset;
+                               }
+                       }
+               }
+       },
+       flipfit: {
+               left: function() {
+                       $.ui.position.flip.left.apply( this, arguments );
+                       $.ui.position.fit.left.apply( this, arguments );
+               },
+               top: function() {
+                       $.ui.position.flip.top.apply( this, arguments );
+                       $.ui.position.fit.top.apply( this, arguments );
+               }
+       }
+};
+
+// fraction support test
+(function () {
+       var testElement, testElementParent, testElementStyle, offsetLeft, i,
+               body = document.getElementsByTagName( "body" )[ 0 ],
+               div = document.createElement( "div" );
+
+       //Create a "fake body" for testing based on method used in jQuery.support
+       testElement = document.createElement( body ? "div" : "body" );
+       testElementStyle = {
+               visibility: "hidden",
+               width: 0,
+               height: 0,
+               border: 0,
+               margin: 0,
+               background: "none"
+       };
+       if ( body ) {
+               $.extend( testElementStyle, {
+                       position: "absolute",
+                       left: "-1000px",
+                       top: "-1000px"
+               });
+       }
+       for ( i in testElementStyle ) {
+               testElement.style[ i ] = testElementStyle[ i ];
+       }
+       testElement.appendChild( div );
+       testElementParent = body || document.documentElement;
+       testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+       div.style.cssText = "position: absolute; left: 10.7432222px;";
+
+       offsetLeft = $( div ).offset().left;
+       $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
+
+       testElement.innerHTML = "";
+       testElementParent.removeChild( testElement );
+})();
+
+}( jQuery ) );
diff --git a/portal/static/unbound_reservation_static/js/node-network.js b/portal/static/unbound_reservation_static/js/node-network.js
new file mode 100644 (file)
index 0000000..f472462
--- /dev/null
@@ -0,0 +1,492 @@
+/* ---------------------------------------------------------------------------
+   (c) Telef�nica I+D, 2013
+   Author: Paulo Villegas
+
+   This script is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   -------------------------------------------------------------------------- */
+
+
+// For MSIE < 9, forget it
+function D3notok() {
+  document.getElementById('sidepanel').style.visibility = 'hidden';
+  var nocontent = document.getElementById('nocontent');
+  nocontent.style.visibility = 'visible';
+  nocontent.style.pointerEvents = 'all';
+  var t = document.getElementsByTagName('body');
+  var body = document.getElementsByTagName('body')[0];
+  body.style.backgroundImage = "url('movie-network-screenshot-d.png')";
+  body.style.backgroundRepeat = "no-repeat";
+}
+
+// -------------------------------------------------------------------
+// A number of forward declarations. These variables need to be defined since 
+// they are attached to static code in HTML. But we cannot define them yet
+// since they need D3.js stuff. So we put placeholders.
+
+
+// Highlight a movie in the graph. It is a closure within the d3.json() call.
+var selectNode = undefined;
+
+// Change status of a panel from visible to hidden or viceversa
+var toggleDiv = undefined;
+
+// Clear all help boxes and select a movie in network and in movie details panel
+var clearAndSelect = undefined;
+
+
+// The call to set a zoom value -- currently unused
+// (zoom is set via standard mouse-based zooming)
+var zoomCall = undefined;
+
+
+// -------------------------------------------------------------------
+
+// Do the stuff -- to be called after D3.js has loaded
+function D3ok(Network) {
+
+
+$("#graph").empty();
+d3.select("#graph").remove("svg:svg");
+
+  // Some constants
+  var WIDTH = 790,
+      HEIGHT = 957 
+      SHOW_THRESHOLD = 2.5;
+
+  // Variables keeping graph state
+  var activeMovie = undefined;
+  var currentOffset = { x : 0, y : 0 };
+  var currentZoom = 1.0;
+
+  // The D3.js scales
+  var xScale = d3.scale.linear()
+    .domain([0, WIDTH])
+    .range([0, WIDTH]);
+  var yScale = d3.scale.linear()
+    .domain([0, HEIGHT])
+    .range([0, HEIGHT]);
+  var zoomScale = d3.scale.linear()
+    .domain([1,6])
+    .range([1,6])
+    .clamp(true);
+
+/* .......................................................................... */
+
+  // The D3.js force-directed layout
+  var force = d3.layout.force()
+    .charge(-320)
+    .size( [WIDTH, HEIGHT] )
+    .linkStrength( function(d,idx) { return d.weight; } );
+
+  // Add to the page the SVG element that will contain the movie network
+  var svg = d3.select("#netcanvas").append("svg:svg")
+    .attr('xmlns','http://www.w3.org/2000/svg')
+    .attr("width", WIDTH)
+    .attr("height", HEIGHT)
+    .attr("id","graph")
+    .attr("viewBox", "0 0 " + WIDTH + " " + HEIGHT )
+    .attr("preserveAspectRatio", "xMidYMid meet");
+
+  // Movie panel: the div into which the movie details info will be written
+  nodeInfoDiv = d3.select("#nodeInfo");
+
+  /* ....................................................................... */
+
+  // Get the current size & offset of the browser's viewport window
+  function getViewportSize( w ) {
+    var w = w || window;
+    if( w.innerWidth != null ) 
+      return { w: w.innerWidth, 
+              h: w.innerHeight,
+              x : w.pageXOffset,
+              y : w.pageYOffset };
+    var d = w.document;
+    if( document.compatMode == "CSS1Compat" )
+      return { w: d.documentElement.clientWidth,
+              h: d.documentElement.clientHeight,
+              x: d.documentElement.scrollLeft,
+              y: d.documentElement.scrollTop };
+    else
+      return { w: d.body.clientWidth, 
+              h: d.body.clientHeight,
+              x: d.body.scrollLeft,
+              y: d.body.scrollTop};
+  }
+
+
+
+  function getQStringParameterByName(name) {
+    var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
+    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
+  }
+
+
+  /* Change status of a panel from visible to hidden or viceversa
+     id: identifier of the div to change
+     status: 'on' or 'off'. If not specified, the panel will toggle status
+  */
+  toggleDiv = function( id, status ) {
+    d = d3.select('div#'+id);
+    if( status === undefined )
+      status = d.attr('class') == 'panel_on' ? 'off' : 'on';
+    d.attr( 'class', 'panel_' + status );
+    return false;
+  }
+
+
+  /* Clear all help boxes and select a movie in the network and in the 
+     movie details panel
+  */
+  clearAndSelect = function (id) {
+    toggleDiv('faq','off'); 
+    toggleDiv('help','off'); 
+    selectNode(id,true);       // we use here the selectNode() closure
+  }
+
+
+  /* Compose the content for the panel with movie details.
+     Parameters: the node data, and the array containing all nodes
+  */
+  function getnodeInfo( n, nodeArray ) {
+       
+//     $.each(n, function(key, element) {
+//    alert('key: ' + key + '\n' + 'value: ' + element);
+//});
+    info = '<div id="cover">';
+    if( n.cover )
+      info += '<img class="cover" height="300" src="' + n.cover + '" title="' + n.label + '"/>';
+    else
+      info += '<div class=t style="float: right">' + n.title + '</div>';
+    info +=
+    '<img src="../static/unbound_reservation_static/img/close.png" class="action" style="top: 0px;" title="close panel" onClick="toggleDiv(\'nodeInfo\');"/>' +
+    '<img src="../static/unbound_reservation_static/img/target-32.png" class="action" style="top: 280px;" title="center graph on node" onclick="selectNode('+n.index+',true);"/>';
+
+    info += '<br/></div><div style="clear: both;">'
+    if( n.ip_version )
+      info += '<div class=f><span class=l>IP version</span>: <span class=g>' 
+           + n.ip_version + '</span></div>';
+    if( n.select_type )
+      info += '<div class=f><span class=l>Node Type</span>: <span class=d>' 
+           + n.select_type + '</span></div>';
+    if( n.request_type )
+      info += '<div class=f><span class=l>Request Type</span>: <span class=c>' 
+           + n.request_type + '</span></div>';
+    if( n.select_comm_proto )
+      info += '<div class=f><span class=l>Image</span>: ' + n.select_image 
+           + '<span class=l style="margin-left:1em;">Communication Protocol</span>: ' 
+           + n.select_comm_proto + '</div>';
+    if( n.links ) {
+      info += '<div class=f><span class=l>Related to</span>: ';
+      n.links.forEach( function(idx) {
+       info += '[<a href="javascript:void(0);" onclick="selectNode('  
+            + idx + ',true);">' + nodeArray[idx].label + '</a>]'
+      });
+      info += '</div>';
+    }
+    return info;
+  }
+
+
+  // *************************************************************************
+
+//////////  d3.json(
+//////////    'movie-network-25-7-3.json',
+//////////    function(data) {
+       var data=Network;
+    // Declare the variables pointing to the node & link arrays
+    var nodeArray = data.nodes;
+    var linkArray = data.links;
+    //alert(linkArray);
+       //alert(nodeArray);
+    minLinkWeight = 
+      Math.min.apply( null, linkArray.map( function(n) {return n.weight;} ) );
+    maxLinkWeight = 
+      Math.max.apply( null, linkArray.map( function(n) {return n.weight;} ) );
+
+    // Add the node & link arrays to the layout, and start it
+    force
+      .nodes(nodeArray)
+      .links(linkArray)
+      .start();
+
+    // A couple of scales for node radius & edge width
+    var node_size = d3.scale.linear()
+      .domain([5,10])  // we know score is in this domain
+      .range([1,16])
+      .clamp(true);
+    var edge_width = d3.scale.pow().exponent(8)
+      .domain( [minLinkWeight,maxLinkWeight] )
+      .range([1,3])
+      .clamp(true);
+
+    /* Add drag & zoom behaviours */
+    svg.call( d3.behavior.drag()
+             .on("drag",dragmove) );
+    svg.call( d3.behavior.zoom()
+             .x(xScale)
+             .y(yScale)
+             .scaleExtent([1, 6])
+             .on("zoom", doZoom) );
+
+    // ------- Create the elements of the layout (links and nodes) ------
+
+    var networkGraph = svg.append('svg:g').attr('class','grpParent');
+
+    // links: simple lines
+    var graphLinks = networkGraph.append('svg:g').attr('class','grp gLinks')
+      .selectAll("line")
+      .data(linkArray, function(d) {return d.source.id+'-'+d.target.id;} )
+      .enter().append("line")
+      .style('stroke-width', function(d) { return edge_width(d.weight);} )
+      .attr("class", "link");
+
+    // nodes: an SVG circle
+    var graphNodes = networkGraph.append('svg:g').attr('class','grp gNodes')
+      .selectAll("circle")
+      .data( nodeArray, function(d){return d.label} )
+      .enter().append("svg:circle")
+      .attr('id', function(d) { return "c" + d.index; } )
+      .attr('class', function(d) { return 'node level'+d.level;} )
+      .attr('r', function(d) { return node_size(d.score); } )
+      .attr('pointer-events', 'all')
+      //.on("click", function(d) { highlightGraphNode(d,true,this); } )    
+      .on("click", function(d) { showMoviePanel(d); } )
+      .on("mouseover", function(d) { highlightGraphNode(d,true,this);  } )
+      .on("mouseout",  function(d) { highlightGraphNode(d,false,this); } );
+
+    // labels: a group with two SVG text: a title and a shadow (as background)
+    var graphLabels = networkGraph.append('svg:g').attr('class','grp gLabel')
+      .selectAll("g.label")
+      .data( nodeArray, function(d){return d.label} )
+      .enter().append("svg:g")
+      .attr('id', function(d) { return "l" + d.index; } )
+      .attr('class','label');
+   
+    shadows = graphLabels.append('svg:text')
+      .attr('x','-2em')
+      .attr('y','-.3em')
+      .attr('pointer-events', 'none') // they go to the circle beneath
+      .attr('id', function(d) { return "lb" + d.index; } )
+      .attr('class','nshadow')
+      .text( function(d) { return d.label; } );
+
+    labels = graphLabels.append('svg:text')
+      .attr('x','-2em')
+      .attr('y','-.3em')
+      .attr('pointer-events', 'none') // they go to the circle beneath
+      .attr('id', function(d) { return "lf" + d.index; } )
+      .attr('class','nlabel')
+      .text( function(d) { return d.label; } );
+
+
+    /* --------------------------------------------------------------------- */
+    /* Select/unselect a node in the network graph.
+       Parameters are: 
+       - node: data for the node to be changed,  
+       - on: true/false to show/hide the node
+    */
+    function highlightGraphNode( node, on )
+    {
+      //if( d3.event.shiftKey ) on = false; // for debugging
+
+      // If we are to activate a movie, and there's already one active,
+      // first switch that one off
+      if( on && activeMovie !== undefined ) {
+       highlightGraphNode( nodeArray[activeMovie], false );
+      }
+
+      // locate the SVG nodes: circle & label group
+      circle = d3.select( '#c' + node.index );
+      label  = d3.select( '#l' + node.index );
+
+      // activate/deactivate the node itself
+      circle
+       .classed( 'main', on );
+      label
+       .classed( 'on', on || currentZoom >= SHOW_THRESHOLD );
+      label.selectAll('text')
+       .classed( 'main', on );
+
+      // activate all siblings
+      Object(node.links).forEach( function(id) {
+       d3.select("#c"+id).classed( 'sibling', on );
+       label = d3.select('#l'+id);
+       label.classed( 'on', on || currentZoom >= SHOW_THRESHOLD );
+       label.selectAll('text.nlabel')
+         .classed( 'sibling', on );
+      } );
+
+      // set the value for the current active movie
+      activeMovie = on ? node.index : undefined;
+    }
+
+
+    /* --------------------------------------------------------------------- */
+    /* Show the details panel for a movie AND highlight its node in 
+       the graph. Also called from outside the d3.json context.
+       Parameters:
+       - new_idx: index of the movie to show
+       - doMoveTo: boolean to indicate if the graph should be centered
+         on the movie
+    */
+    selectNode = function( new_idx, doMoveTo ) {
+               
+      // do we want to center the graph on the node?
+      doMoveTo = doMoveTo || false;
+      if( doMoveTo ) {
+       s = getViewportSize();
+       width  = s.w<WIDTH ? s.w : WIDTH;
+       height = s.h<HEIGHT ? s.h : HEIGHT;
+       offset = { x : s.x + width/2  - nodeArray[new_idx].x*currentZoom,
+                  y : s.y + height/2 - nodeArray[new_idx].y*currentZoom };
+       repositionGraph( offset, undefined, 'move' );
+      }
+      // Now highlight the graph node and show its movie panel
+      highlightGraphNode( nodeArray[new_idx], true );
+      showMoviePanel( nodeArray[new_idx] );
+    }
+
+
+    /* --------------------------------------------------------------------- */
+    /* Show the movie details panel for a given node
+     */
+    function showMoviePanel( node ) {
+      // Fill it and display the panel
+      nodeInfoDiv
+       .html( getnodeInfo(node,nodeArray) )
+       .attr("class","panel_on");
+    }
+
+           
+    /* --------------------------------------------------------------------- */
+    /* Move all graph elements to its new positions. Triggered:
+       - on node repositioning (as result of a force-directed iteration)
+       - on translations (user is panning)
+       - on zoom changes (user is zooming)
+       - on explicit node highlight (user clicks in a movie panel link)
+       Set also the values keeping track of current offset & zoom values
+    */
+    function repositionGraph( off, z, mode ) {
+
+      // do we want to do a transition?
+      var doTr = (mode == 'move');
+
+      // drag: translate to new offset
+      if( off !== undefined &&
+         (off.x != currentOffset.x || off.y != currentOffset.y ) ) {
+       g = d3.select('g.grpParent')
+       
+       if( doTr )
+         g = g.transition().duration(500);
+       g.attr("transform", function(d) { return "translate("+
+                                         off.x+","+off.y+")" } );
+       currentOffset.x = off.x;
+       currentOffset.y = off.y;
+      }
+
+      // zoom: get new value of zoom
+      if( z === undefined ) {
+       if( mode != 'tick' )
+         return;       // no zoom, no tick, we don't need to go further
+       z = currentZoom;
+      }
+      else
+       currentZoom = z;
+
+      // move edges
+      e = doTr ? graphLinks.transition().select_comm_proto(500) : graphLinks;
+      e
+       .attr("x1", function(d) { return z*(d.source.x); })
+        .attr("y1", function(d) { return z*(d.source.y); })
+        .attr("x2", function(d) { return z*(d.target.x); })
+        .attr("y2", function(d) { return z*(d.target.y); });
+
+      // move nodes
+      n = doTr ? graphNodes.transition().select_comm_proto(500) : graphNodes;
+      n
+       .attr("transform", function(d) { return "translate("
+                                        +z*d.x+","+z*d.y+")" } );
+      // move labels
+      l = doTr ? graphLabels.transition().select_comm_proto(500) : graphLabels;
+      l
+       .attr("transform", function(d) { return "translate("
+                                        +z*d.x+","+z*d.y+")" } );
+    }
+           
+
+    /* --------------------------------------------------------------------- */
+    /* Perform drag
+     */
+    function dragmove(d) {
+      offset = { x : currentOffset.x + d3.event.dx,
+                y : currentOffset.y + d3.event.dy };
+      repositionGraph( offset, undefined, 'drag' );
+    }
+
+
+    /* --------------------------------------------------------------------- */
+    /* Perform zoom. We do "semantic zoom", not geometric zoom
+     * (i.e. nodes do not change size, but get spread out or stretched
+     * together as zoom changes)
+     */
+    function doZoom( increment ) {
+      newZoom = increment === undefined ? d3.event.scale 
+                                       : zoomScale(currentZoom+increment);
+      if( currentZoom == newZoom )
+       return; // no zoom change
+
+      // See if we cross the 'show' threshold in either direction
+      if( currentZoom<SHOW_THRESHOLD && newZoom>=SHOW_THRESHOLD )
+       svg.selectAll("g.label").classed('on',true);
+      else if( currentZoom>=SHOW_THRESHOLD && newZoom<SHOW_THRESHOLD )
+       svg.selectAll("g.label").classed('on',false);
+
+      // See what is the current graph window size
+      s = getViewportSize();
+      width  = s.w<WIDTH  ? s.w : WIDTH;
+      height = s.h<HEIGHT ? s.h : HEIGHT;
+
+      // Compute the new offset, so that the graph center does not move
+      zoomRatio = newZoom/currentZoom;
+      newOffset = { x : currentOffset.x*zoomRatio + width/2*(1-zoomRatio),
+                   y : currentOffset.y*zoomRatio + height/2*(1-zoomRatio) };
+
+      // Reposition the graph
+      repositionGraph( newOffset, newZoom, "zoom" );
+    }
+
+    zoomCall = doZoom; // unused, so far
+
+    /* --------------------------------------------------------------------- */
+
+    /* process events from the force-directed graph */
+    force.on("tick", function() {
+      repositionGraph(undefined,undefined,'tick');
+    });
+
+    /* A small hack to start the graph with a movie pre-selected */
+    mid = getQStringParameterByName('id')
+    if( mid != null )
+      clearAndSelect( mid );
+  ///////////}
+  
+  //////////////////////////////////////////);
+
+} // end of D3ok()
+
+  function testme( data2 ) {
+       alert(data2);
+       
+       }
+
diff --git a/portal/static/unbound_reservation_static/js/script.js b/portal/static/unbound_reservation_static/js/script.js
new file mode 100644 (file)
index 0000000..814cb40
--- /dev/null
@@ -0,0 +1,22 @@
+( function( $ ) {
+$( document ).ready(function() {
+$('#cssmenu > ul > li > a').click(function() {\r
+  $('#cssmenu li').removeClass('active');\r
+  $(this).closest('li').addClass('active');    \r
+  var checkElement = $(this).next();\r
+  if((checkElement.is('ul')) && (checkElement.is(':visible'))) {\r
+    $(this).closest('li').removeClass('active');\r
+    checkElement.slideUp('normal');\r
+  }\r
+  if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {\r
+    $('#cssmenu ul ul:visible').slideUp('normal');\r
+    checkElement.slideDown('normal');\r
+  }\r
+  if($(this).closest('li').find('ul').children().length == 0) {\r
+    return true;\r
+  } else {\r
+    return false;      \r
+  }            \r
+});
+});
+} )( jQuery );
diff --git a/portal/static/unbound_reservation_static/lib/dhtmlx.js b/portal/static/unbound_reservation_static/lib/dhtmlx.js
new file mode 100644 (file)
index 0000000..4a2cef1
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Product Name: dhtmlxSuite 
+Version: 4.2 
+Edition: Standard 
+License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
+Copyright UAB Dinamenta http://www.dhtmlx.com
+*/
+
+if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.2",skin:null,skinDetect:function(a){return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[this.readFromCss(a+"_skin_detect")]||null},readFromCss:function(g,j){var c=document.createElement("DIV");c.className=g;if(document.body.firstChild!=null){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c[j||"offsetWidth"];c.parentNode.removeChild(c);c=null;return a},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var g=this.first();for(var c in this.data){g=Math.max(g,this.data[c])}return g},reserve:function(a){this.data[a]=this.last()+this.step;return this.data[a]},clear:function(a){if(this.data[a]!=null){this.data[a]=null;delete this.data[a]}}},s2b:function(a){if(typeof(a)=="string"){a=a.toLowerCase()}return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},s2j:function(s){var obj=null;dhx4.temp=null;try{eval("dhx4.temp="+s)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null;return obj},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).top},_aOfs:function(a){var g=0,c=0;while(a){g=g+parseInt(a.offsetTop);c=c+parseInt(a.offsetLeft);a=a.offsetParent}return{top:g,left:c}},_aOfsRect:function(j){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{top:Math.round(r),left:Math.round(g)}},getOffset:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfs(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(j){if(this._isObj(j)){var g={};for(var c in j){if(typeof(j[c])=="object"&&j[c]!=null){g[c]=this._copyObj(j[c])}else{g[c]=j[c]}}}else{var g=[];for(var c=0;c<j.length;c++){if(typeof(j[c])=="object"&&j[c]!=null){g[c]=this._copyObj(j[c])}else{g[c]=j[c]}}}return g},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=0);var c={};c.left=document.body.scrollLeft;c.right=c.left+(window.innerWidth||document.body.clientWidth);c.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);c.bottom=c.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return c},selectTextRange:function(j,m,c){j=(typeof(j)=="string"?document.getElementById(j):j);var a=j.value.length;m=Math.max(Math.min(m,a),0);c=Math.min(c,a);if(j.setSelectionRange){try{j.setSelectionRange(m,c)}catch(l){}}else{if(j.createTextRange){var g=j.createTextRange();g.moveStart("character",m);g.moveEnd("character",c-a);try{g.select()}catch(l){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var g={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var c in g){if(this.transData.transProp==false&&document.documentElement.style[c]!=null){this.transData.transProp=c;this.transData.transEv=g[c]}}g=null}return this.transData},_xmlNodeValue:function(a){var g="";for(var c=0;c<a.childNodes.length;c++){g+=(a.childNodes[c].nodeValue!=null?a.childNodes[c].nodeValue.toString().replace(/^[\n\r\s]{0,}/,"").replace(/[\n\r\s]{0,}$/,""):"")}return g}};window.dhx4.isIE=(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE6=(window.XMLHttpRequest==null&&navigator.userAgent.indexOf("MSIE")>=0);window.dhx4.isIE7=(navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0);window.dhx4.isIE8=(navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}if(typeof(window.dhx4.template)=="undefined"){window.dhx4.trim=function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")};window.dhx4.template=function(c,g,a){return c.replace(/#([a-z0-9_-]{1,})(\|([^#]*))?#/gi,function(){var n=arguments[1];var m=window.dhx4.trim(arguments[3]);var o=null;var l=[g[n]];if(m.length>0){m=m.split(":");var j=[];for(var r=0;r<m.length;r++){if(r>0&&j[j.length-1].match(/\\$/)!=null){j[j.length-1]=j[j.length-1].replace(/\\$/,"")+":"+m[r]}else{j.push(m[r])}}o=j[0];for(var r=1;r<j.length;r++){l.push(j[r])}}if(typeof(o)=="string"&&typeof(window.dhx4.template[o])=="function"){return window.dhx4.template[o].apply(window.dhx4.template,l)}if(n.length>0&&typeof(g[n])!="undefined"){if(a==true){return window.dhx4.trim(g[n])}return String(g[n])}return""})};window.dhx4.template.date=function(a,c){if(a!=null){if(a instanceof Date){return window.dhx4.date2str(a,c)}else{a=a.toString();if(a.match(/^\d*$/)!=null){return window.dhx4.date2str(new Date(parseInt(a)),c)}return a}}return""};window.dhx4.template.maxlength=function(c,a){return String(c).substr(0,a)};window.dhx4.template.number_format=function(j,l,g,a){var c=window.dhx4.template._parseFmt(l,g,a);if(c==false){return j}return window.dhx4.template._getFmtValue(j,c)};window.dhx4.template.lowercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toLowerCase()};window.dhx4.template.uppercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toUpperCase()};window.dhx4.template._parseFmt=function(n,g,a){var j=n.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(j==null||j.length!=4){return false}var c={i_len:false,i_sep:(typeof(g)=="string"?g:","),d_len:false,d_sep:(typeof(a)=="string"?a:"."),s_bef:(typeof(j[1])=="string"?j[1]:""),s_aft:(typeof(j[3])=="string"?j[3]:"")};var m=j[2].split(".");if(m[1]!=null){c.d_len=m[1].length}var l=m[0].split(",");if(l.length>1){c.i_len=l[l.length-1].length}return c};window.dhx4.template._getFmtValue=function(value,fmt){var r=String(value).match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(r!=null&&r.length==5){var v0="";if(r[1]!=null){v0+=r[1]}v0+=fmt.s_bef;if(fmt.i_len!==false){var i=0;var v1="";for(var q=r[2].length-1;q>=0;q--){v1=""+r[2].charAt(q)+v1;if(++i==fmt.i_len&&q>0){v1=fmt.i_sep+v1;i=0}}v0+=v1}else{v0+=r[2]}if(fmt.d_len!==false){if(r[4]==null){r[4]=""}while(r[4].length<fmt.d_len){r[4]+="0"}eval("dhx4.temp = new RegExp(/\\d{"+fmt.d_len+"}/);");var t1=(r[4]).match(dhx4.temp);if(t1!=null){v0+=fmt.d_sep+t1}dhx4.temp=t1=null}v0+=fmt.s_aft;return v0}return value}}if(typeof(window.dhx4.dateLang)=="undefined"){window.dhx4.dateLang="en";window.dhx4.dateStrings={en:{monthFullName:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShortName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayFullName:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShortName:["Su","Mo","Tu","We","Th","Fr","Sa"]}};window.dhx4.dateFormat={en:"%Y-%m-%d"};window.dhx4.date2str=function(m,j,a){if(j==null||typeof(j)=="undefnied"){j=window.dhx4.dateFormat[window.dhx4.dateLang]}if(a==null||typeof(a)=="undefnied"){a=window.dhx4.dateStrings[window.dhx4.dateLang]}if(m instanceof Date){var l=function(n){return(String(n).length==1?"0"+String(n):n)};var c=function(o){switch(o){case"%d":return l(m.getDate());case"%j":return m.getDate();case"%D":return a.dayShortName[m.getDay()];case"%l":return a.dayFullName[m.getDay()];case"%m":return l(m.getMonth()+1);case"%n":return m.getMonth()+1;case"%M":return a.monthShortName[m.getMonth()];case"%F":return a.monthFullName[m.getMonth()];case"%y":return l(m.getYear()%100);case"%Y":return m.getFullYear();case"%g":return(m.getHours()+11)%12+1;case"%h":return l((m.getHours()+11)%12+1);case"%G":return m.getHours();case"%H":return l(m.getHours());case"%i":return l(m.getMinutes());case"%s":return l(m.getSeconds());case"%a":return(m.getHours()>11?"pm":"am");case"%A":return(m.getHours()>11?"PM":"AM");case"%%":return"%";case"%u":return m.getMilliseconds();case"%P":if(window.dhx4.temp_calendar!=null&&window.dhx4.temp_calendar.tz!=null){return window.dhx4.temp_calendar.tz}var r=m.getTimezoneOffset();var q=Math.abs(Math.floor(r/60));var n=Math.abs(r)-q*60;return(r>0?"-":"+")+l(q)+":"+l(n);default:return o}};var g=String(j||window.dhx4.dateFormat).replace(/%[a-zA-Z]/g,c)}return(g||String(m))};window.dhx4.str2date=function(l,A,E){if(A==null||typeof(A)=="undefnied"){A=window.dhx4.dateFormat[window.dhx4.dateLang]}if(E==null||typeof(E)=="undefnied"){E=window.dhx4.dateStrings[window.dhx4.dateLang]}A=A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var D=[];var o=[];A=A.replace(/%[a-z]/gi,function(q){switch(q){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":o.push(q);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":o.push(q);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":o.push(q);return"(\\d{1,2})";case"%Y":o.push(q);return"(\\d{4})";case"%a":o.push(q);return"([am|pm])";case"%A":o.push(q);return"([AM|PM])";case"%u":o.push(q);return"(\\d{1,6})";case"%P":o.push(q);return"([+-]\\d{1,2}:\\d{1,2})"}return q});var F=new RegExp(A,"i");var s=l.match(F);if(s==null||s.length-1!=o.length){return"Invalid Date"}for(var c=1;c<s.length;c++){D.push(s[c])}var g={"%y":1,"%Y":1,"%n":2,"%m":2,"%M":2,"%F":2,"%d":3,"%j":3,"%a":4,"%A":4,"%H":5,"%G":5,"%h":5,"%g":5,"%i":6,"%s":7,"%u":7,"%P":7};var u={};var n={};for(var c=0;c<o.length;c++){if(typeof(g[o[c]])!="undefined"){var j=g[o[c]];if(!u[j]){u[j]=[];n[j]=[]}u[j].push(D[c]);n[j].push(o[c])}}D=[];o=[];for(var c=1;c<=7;c++){if(u[c]!=null){for(var y=0;y<u[c].length;y++){D.push(u[c][y]);o.push(n[c][y])}}}var a=new Date();a.setDate(1);a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);var x=function(w,r){for(var v=0;v<r.length;v++){if(r[v].toLowerCase()==w){return v}}return -1};for(var c=0;c<D.length;c++){switch(o[c]){case"%d":case"%j":case"%n":case"%m":case"%Y":case"%H":case"%G":case"%i":case"%s":case"%u":if(!isNaN(D[c])){a[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds","%u":"setMilliseconds"}[o[c]]](Number(D[c])+(o[c]=="%m"||o[c]=="%n"?-1:0))}break;case"%M":case"%F":var m=x(D[c].toLowerCase(),E[{"%M":"monthShortName","%F":"monthFullName"}[o[c]]]);if(m>=0){a.setMonth(m)}break;case"%y":if(!isNaN(D[c])){var C=Number(D[c]);a.setFullYear(C+(C>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(D[c])){var C=Number(D[c]);if(C<=12&&C>=0){a.setHours(C+(x("pm",D)>=0?(C==12?0:12):(C==12?-12:0)))}}break;case"%P":if(window.dhx4.temp_calendar!=null){window.dhx4.temp_calendar.tz=D[c]}break}}return a}}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"get",parse:function(a){if(typeof a!=="string"){return a}a=a.replace(/^[\s]+/,"");if(window.DOMParser&&!dhx4.isIE){var c=(new window.DOMParser()).parseFromString(a,"text/xml")}else{if(window.ActiveXObject!==window.undefined){var c=new window.ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(a)}}return c},xmltop:function(a,j,g){if(typeof j.status=="undefined"||j.status<400){xml=(!j.responseXML)?dhx4.ajax.parse(j.responseText||j):(j.responseXML||j);if(xml&&xml.documentElement!==null){try{if(!xml.getElementsByTagName("parsererror").length){return xml.getElementsByTagName(a)[0]}}catch(c){}}}if(g!==-1){dhx4.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],g])}return document.createElement("DIV")},xpath:function(g,a){if(!a.nodeName){a=a.responseXML||a}if(dhx4.isIE){try{return a.selectNodes(g)||[]}catch(l){return[]}}else{var j=[];var m;var c=(a.ownerDocument||a).evaluate(g,a,null,XPathResult.ANY_TYPE,null);while(m=c.iterateNext()){j.push(m)}return j}},query:function(a){dhx4.ajax._call((a.method||"GET"),a.url,a.data||"",(a.async||true),a.callback,null,a.headers)},get:function(a,c){return this._call("GET",a,null,true,c)},getSync:function(a){return this._call("GET",a,null,false)},put:function(c,a,g){return this._call("PUT",c,a,true,g)},del:function(c,a,g){return this._call("DELETE",c,a,true,g)},post:function(c,a,g){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){g=a;a=""}else{a=String(a)}}return this._call("POST",c,a,true,g)},postSync:function(c,a){a=(a==null?"":String(a));return this._call("POST",c,a,false)},getLong:function(a,c){this._call("GET",a,null,true,c,{url:a})},postLong:function(c,a,g){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){g=a;a=""}this._call("POST",c,a,true,g,{url:c,postData:a})},_call:function(a,c,g,l,n,r,j){var q=(window.XMLHttpRequest&&!dhx4.isIE?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var m=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(l==true){q.onreadystatechange=function(){if((q.readyState==4)||(m==true&&q.readyState==3)){if(q.status!=200||q.responseText==""){if(!dhx4.callEvent("onAjaxError",[q])){return}}window.setTimeout(function(){if(typeof(n)=="function"){n.apply(window,[{xmlDoc:q,filePath:c,async:l}])}if(r!=null){if(typeof(r.postData)!="undefined"){dhx4.ajax.postLong(r.url,r.postData,n)}else{dhx4.ajax.getLong(r.url,n)}}n=null;q=null},1)}}}if(a=="GET"&&this.cache!=true){c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"}q.open(a,c,l);if(j!=null){for(var o in j){q.setRequestHeader(o,j[o])}}else{if(a=="POST"||a=="PUT"||a=="DELETE"){q.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(a=="GET"){g=null}}}q.setRequestHeader("X-Requested-With","XMLHttpRequest");q.send(g);return{xmlDoc:q,filePath:c,async:l}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(n,g,m,l,o){if(o=="clear"){for(var c in n._dhxdataload){n._dhxdataload[c]=null;delete n._dhxdataload[c]}n._loadData=null;n._dhxdataload=null;n.load=null;n.loadStruct=null;n=null;return}n._dhxdataload={initObj:g,xmlToJson:m,xmlRootTag:l,onBeforeXLS:null};n._loadData=function(v,w,x){if(arguments.length==2){x=w;w=null}var u=null;if(arguments.length==3){x=arguments[2]}if(typeof(v)=="string"){var s=v.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var C=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(C.test(s.replace(/^<\?xml[^\?]*\?>\s*/,""))){u=dhx4.ajax.parse(v);if(u!=null){u=this[this._dhxdataload.xmlToJson].apply(this,[u])}}if(u==null&&(s.match(/^\{.*\}$/)!=null||s.match(/^\[.*\]$/)!=null)){u=dhx4.s2j(s)}if(u==null){this.callEvent("onXLS",[]);var r=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var s=this._dhxdataload.onBeforeXLS.apply(this,[v]);if(s!=null&&typeof(s)=="object"){if(s.url!=null){v=s.url}if(s.params!=null){for(var y in s.params){r.push(y+"="+encodeURIComponent(s.params[y]))}}}}var A=this;var q=function(a){var D=null;if((a.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(a.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){D=A[A._dhxdataload.xmlToJson].apply(A,[a.xmlDoc.responseXML])}else{D=dhx4.s2j(a.xmlDoc.responseText)}if(D!=null){A[A._dhxdataload.initObj].apply(A,[D,v])}A.callEvent("onXLE",[]);if(x!=null){if(typeof(x)=="function"){x.apply(A,[])}else{if(typeof(window[x])=="function"){window[x].apply(A,[])}}}q=x=null;D=a=A=null};r=r.join("&")+(typeof(w)=="string"?"&"+w:"");if(dhx4.ajax.method=="post"){dhx4.ajax.post(v,r,q)}else{if(dhx4.ajax.method=="get"){dhx4.ajax.get(v+(r.length>0?(v.indexOf("?")>0?"&":"?")+r:""),q)}}return}}else{if(typeof(v.documentElement)=="object"||(typeof(v.tagName)!="undefined"&&typeof(v.getElementsByTagName)!="undefined"&&v.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){u=this[this._dhxdataload.xmlToJson].apply(this,[v])}else{u=window.dhx4._copyObj(v)}}if(u!=null){this[this._dhxdataload.initObj].apply(this,[u])}if(x!=null){if(typeof(x)=="function"){x.apply(this,[])}else{if(typeof(window[x])=="function"){window[x].apply(this,[])}}x=null}};if(o!=null){var j={struct:"loadStruct",data:"load"};for(var c in o){if(o[c]==true){n[j[c]]=function(){return this._loadData.apply(this,arguments)}}}}n=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,c){if(c=="clear"){a.detachAllEvents();a.dhxevs=null;a.attachEvent=null;a.detachEvent=null;a.checkEvent=null;a.callEvent=null;a.detachAllEvents=null;a=null;return}a.dhxevs={data:{}};a.attachEvent=function(g,l){g=String(g).toLowerCase();if(!this.dhxevs.data[g]){this.dhxevs.data[g]={}}var j=window.dhx4.newId();this.dhxevs.data[g][j]=l;return j};a.detachEvent=function(m){for(var j in this.dhxevs.data){var l=0;for(var g in this.dhxevs.data[j]){if(g==m){this.dhxevs.data[j][g]=null;delete this.dhxevs.data[j][g]}else{l++}}if(l==0){this.dhxevs.data[j]=null;delete this.dhxevs.data[j]}}};a.checkEvent=function(g){g=String(g).toLowerCase();return(this.dhxevs.data[g]!=null)};a.callEvent=function(j,m){j=String(j).toLowerCase();if(this.dhxevs.data[j]==null){return true}var l=true;for(var g in this.dhxevs.data[j]){l=this.dhxevs.data[j][g].apply(this,m)&&l}return l};a.detachAllEvents=function(){for(var j in this.dhxevs.data){for(var g in this.dhxevs.data[j]){this.dhxevs.data[j][g]=null;delete this.dhxevs.data[j][g]}this.dhxevs.data[j]=null;delete this.dhxevs.data[j]}};a=null};dhx4._eventable(dhx4)}if(!window.dhtmlxValidation){dhtmlxValidation=function(){};dhtmlxValidation.prototype={isEmpty:function(a){return a==""},isNotEmpty:function(a){return(a instanceof Array?a.length>0:!a=="")},isValidBoolean:function(a){return !!a.toString().match(/^(0|1|true|false)$/)},isValidEmail:function(a){return !!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,4})$)/i)},isValidInteger:function(a){return !!a.toString().match(/(^-?\d+$)/)},isValidNumeric:function(a){return !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},isValidAplhaNumeric:function(a){return !!a.toString().match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(c){var a=c.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return a&&!!(a[1]<=9999&&a[2]<=12&&a[3]<=31&&a[4]<=59&&a[5]<=59&&a[6]<=59)||false},isValidDate:function(a){var c=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return c&&!!(c[1]<=9999&&c[2]<=12&&c[3]<=31)||false},isValidTime:function(c){var a=c.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return a&&!!(a[1]<=24&&a[2]<=59&&a[3]<=59)||false},isValidIPv4:function(a){var c=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return c&&!!(c[1]<=255&&c[2]<=255&&c[3]<=255&&c[4]<=255)||false},isValidCurrency:function(a){return a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/)&&true||false},isValidSSN:function(a){return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&true||false},isValidSIN:function(a){return a.toString().match(/^\d{9}$/)&&true||false}};dhtmlxValidation=new dhtmlxValidation()}if(typeof(window.dhtmlx)=="undefined"){window.dhtmlx={extend:function(g,c){for(var j in c){if(!g[j]){g[j]=c[j]}}return g},extend_api:function(a,j,g){var c=window[a];if(!c){return}window[a]=function(n){if(n&&typeof n=="object"&&!n.tagName){var m=c.apply(this,(j._init?j._init(n):arguments));for(var l in dhtmlx){if(j[l]){this[j[l]](dhtmlx[l])}}for(var l in n){if(j[l]){this[j[l]](n[l])}else{if(l.indexOf("on")===0){this.attachEvent(l,n[l])}}}}else{var m=c.apply(this,arguments)}if(j._patch){j._patch(this)}return m||this};window[a].prototype=c.prototype;if(g){dhtmlx.extend(window[a].prototype,g)}},url:function(a){if(a.indexOf("?")!=-1){return"&"}else{return"?"}}}}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop){return window.dhtmlDragAndDrop}this.lastLanding=0;this.dragNode=0;this.dragStartNode=0;this.dragStartObject=0;this.tempDOMU=null;this.tempDOMM=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,c){a.onmousedown=this.preCreateDragCopy;a.dragStarter=c;this.addDragLanding(a,c)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,c){a.dragLanding=c};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if((a||window.event)&&(a||event).button==2){return}if(window.dhtmlDragAndDrop.waitDrag){window.dhtmlDragAndDrop.waitDrag=0;document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;return false}if(window.dhtmlDragAndDrop.dragNode){window.dhtmlDragAndDrop.stopDrag(a)}window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=new Date().valueOf();if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlDragAndDropObject.prototype.callDrag=function(g){if(!g){g=window.event}dragger=window.dhtmlDragAndDrop;if((new Date()).valueOf()-dragger.downtime<100){return}if(!dragger.dragNode){if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,g);if(!dragger.dragNode){return dragger.stopDrag()}dragger.dragNode.onselectstart=function(){return false};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else{return dragger.stopDrag(g,true)}}if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var a=dragger.gldragNode;if(dragger.gldragNode.old){a=dragger.gldragNode.old}a.parentNode.removeChild(a);var c=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var l=document.createElement("Div");l.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=l.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=g.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=g.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!g.srcElement){var j=g.target}else{j=g.srcElement}dragger.checkLanding(j,g)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(l){if(window.name){var g=parent.frames[window.name].frameElement.offsetParent;var j=0;var c=0;while(g){j+=g.offsetLeft;c+=g.offsetTop;g=g.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);j+=a.split("_")[0]*1;c+=a.split("_")[1]*1}if(l){return j+"_"+c}else{this.fx=j}this.fy=c}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(c,a){if((c)&&(c.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=c;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,a.clientX,a.clientY,a);this.lastLanding_scr=(_isIE?a.srcElement:a.target)}else{if((c)&&(c.tagName!="BODY")){this.checkLanding(c.parentNode,a)}else{if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding,a.clientX,a.clientY,a)}this.lastLanding=0;if(this._onNotFound){this._onNotFound()}}}};dhtmlDragAndDropObject.prototype.stopDrag=function(c,g){dragger=window.dhtmlDragAndDrop;if(!g){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:c.target))}}dragger.lastLanding=null;if((dragger.dragNode)&&(dragger.dragNode.parentNode==document.body)){dragger.dragNode.parentNode.removeChild(dragger.dragNode)}dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(g){if(g){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=g)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window)}}catch(c){}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=g)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}}catch(c){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(g,j){if(g){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=g.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=g.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=g.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=g.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(j))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=g)){parent.dhtmlDragAndDrop.initFrameRoute(window)}}catch(c){}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=g)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.initFrameRoute(window,((!g||j)?1:0))}}catch(c){}}};_isFF=false;_isIE=false;_isOpera=false;_isKHTML=false;_isMacOS=false;_isChrome=false;_FFrv=false;_KHTMLrv=false;_OperaRv=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){_isChrome=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;_FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if((navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat"){_isIE=8}}else{if(navigator.appName=="Netscape"&&navigator.userAgent.indexOf("Trident")!=-1){_isIE=8}else{_isFF=true;_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}}if(typeof(window.dhtmlxEvent)=="undefined"){function dhtmlxEvent(c,g,a){if(c.addEventListener){c.addEventListener(g,a,false)}else{if(c.attachEvent){c.attachEvent("on"+g,a)}}}}if(dhtmlxEvent.touchDelay==null){dhtmlxEvent.touchDelay=2000}if(typeof(dhtmlxEvent.initTouch)=="undefined"){dhtmlxEvent.initTouch=function(){var j;var l;var c,a;dhtmlxEvent(document.body,"touchstart",function(m){l=m.touches[0].target;c=m.touches[0].clientX;a=m.touches[0].clientY;j=window.setTimeout(g,dhtmlxEvent.touchDelay)});function g(){if(l){var m=document.createEvent("HTMLEvents");m.initEvent("dblclick",true,true);l.dispatchEvent(m);j=l=null}}dhtmlxEvent(document.body,"touchmove",function(m){if(j){if(Math.abs(m.touches[0].clientX-c)>50||Math.abs(m.touches[0].clientY-a)>50){window.clearTimeout(j);j=l=false}}});dhtmlxEvent(document.body,"touchend",function(m){if(j){window.clearTimeout(j);j=l=false}});dhtmlxEvent.initTouch=function(){}}}if(!window.dhtmlx){dhtmlx={}}dhtmlx.assert=function(c,a){if(!c){dhtmlx.error(a)}};dhtmlx.assert_enabled=function(){return false};dhtmlx.assert_event=function(m,g){if(!m._event_check){m._event_check={};m._event_check_size={}}for(var c in g){m._event_check[c.toLowerCase()]=g[c];var l=-1;for(var j in g[c]){l++}m._event_check_size[c.toLowerCase()]=l}};dhtmlx.assert_method_info=function(l,c,j,m){var a=[];for(var g=0;g<m.length;g++){a.push(m[g][0]+" : "+m[g][1]+"\n   "+m[g][2].describe()+(m[g][3]?"; optional":""))}return l.name+"."+c+"\n"+j+"\n Arguments:\n - "+a.join("\n - ")};dhtmlx.assert_method=function(g,a){for(var c in a){dhtmlx.assert_method_process(g,c,a[c].descr,a[c].args,(a[c].min||99),a[c].skip)}};dhtmlx.assert_method_process=function(m,c,l,n,g,j){var a=m[c];if(!j){m[c]=function(){if(arguments.length!=n.length&&arguments.length<g){dhtmlx.log("warn","Incorrect count of parameters\n"+m[c].describe()+"\n\nExpecting "+n.length+" but have only "+arguments.length)}else{for(var o=0;o<n.length;o++){if(!n[o][3]&&!n[o][2](arguments[o])){dhtmlx.log("warn","Incorrect method call\n"+m[c].describe()+"\n\nActual value of "+(o+1)+" parameter: {"+(typeof arguments[o])+"} "+arguments[o])}}}return a.apply(this,arguments)}}m[c].describe=function(){return dhtmlx.assert_method_info(m,c,l,n)}};dhtmlx.assert_event_call=function(g,c,a){if(g._event_check){if(!g._event_check[c]){dhtmlx.log("warn","Not expected event call :"+c)}else{if(dhtmlx.isNotDefined(a)){dhtmlx.log("warn","Event without parameters :"+c)}else{if(g._event_check_size[c]!=a.length){dhtmlx.log("warn","Incorrect event call, expected "+g._event_check_size[c]+" parameter(s), but have "+a.length+" parameter(s), for "+c+" event")}}}}};dhtmlx.assert_event_attach=function(c,a){if(c._event_check&&!c._event_check[a]){dhtmlx.log("warn","Unknown event name: "+a)}};dhtmlx.assert_property=function(c,a){if(!c._settings_check){c._settings_check={}}dhtmlx.extend(c._settings_check,a)};dhtmlx.assert_check=function(g,c){if(typeof g=="object"){for(var a in g){dhtmlx.assert_settings(a,g[a],c)}}};dhtmlx.assert_settings=function(o,l,j){j=j||this._settings_check;if(j){if(!j[o]){return dhtmlx.log("warn","Unknown propery: "+o)}var n="";var c="";var a=false;for(var g=0;g<j[o].length;g++){var m=j[o][g];if(typeof m=="string"){continue}if(typeof m=="function"){a=a||m(l)}else{if(typeof m=="object"&&typeof m[1]=="function"){a=a||m[1](l);if(a&&m[2]){dhtmlx.assert_check(l,m[2])}}}if(a){break}}if(!a){dhtmlx.log("warn","Invalid configuration\n"+dhtmlx.assert_info(o,j)+"\nActual value: {"+(typeof l)+"} "+l)}}};dhtmlx.assert_info=function(c,m){var a=m[c];var l="";var j=[];for(var g=0;g<a.length;g++){if(typeof rule=="string"){l=a[g]}else{if(a[g].describe){j.push(a[g].describe())}else{if(a[g][1]&&a[g][1].describe){j.push(a[g][1].describe())}}}}return"Property: "+c+", "+l+" \nExpected value: \n - "+j.join("\n - ")};if(dhtmlx.assert_enabled()){dhtmlx.assert_rule_color=function(a){if(typeof a!="string"){return false}if(a.indexOf("#")!==0){return false}if(a.substr(1).replace(/[0-9A-F]/gi,"")!==""){return false}return true};dhtmlx.assert_rule_color.describe=function(){return"{String} Value must start from # and contain hexadecimal code of color"};dhtmlx.assert_rule_template=function(a){if(typeof a=="function"){return true}if(typeof a=="string"){return true}return false};dhtmlx.assert_rule_template.describe=function(){return"{Function},{String} Value must be a function which accepts data object and return text string, or a sting with optional template markers"};dhtmlx.assert_rule_boolean=function(a){if(typeof a=="boolean"){return true}return false};dhtmlx.assert_rule_boolean.describe=function(){return"{Boolean} true or false"};dhtmlx.assert_rule_object=function(a,c){if(typeof a=="object"){return true}return false};dhtmlx.assert_rule_object.describe=function(){return"{Object} Configuration object"};dhtmlx.assert_rule_string=function(a){if(typeof a=="string"){return true}return false};dhtmlx.assert_rule_string.describe=function(){return"{String} Plain string"};dhtmlx.assert_rule_htmlpt=function(a){return !!dhtmlx.toNode(a)};dhtmlx.assert_rule_htmlpt.describe=function(){return"{Object},{String} HTML node or ID of HTML Node"};dhtmlx.assert_rule_notdocumented=function(a){return false};dhtmlx.assert_rule_notdocumented.describe=function(){return"This options wasn't documented"};dhtmlx.assert_rule_key=function(c){var a=function(g){return c[g]};a.describe=function(){var j=[];for(var g in c){j.push(g)}return"{String} can take one of next values: "+j.join(", ")};return a};dhtmlx.assert_rule_dimension=function(a){if(a*1==a&&!isNaN(a)&&a>=0){return true}return false};dhtmlx.assert_rule_dimension.describe=function(){return"{Integer} value must be a positive number"};dhtmlx.assert_rule_number=function(a){if(typeof a=="number"){return true}return false};dhtmlx.assert_rule_number.describe=function(){return"{Integer} value must be a number"};dhtmlx.assert_rule_function=function(a){if(typeof a=="function"){return true}return false};dhtmlx.assert_rule_function.describe=function(){return"{Function} value must be a custom function"};dhtmlx.assert_rule_any=function(a){return true};dhtmlx.assert_rule_any.describe=function(){return"Any value"};dhtmlx.assert_rule_mix=function(g,c){var j=function(a){if(g(a)||c(a)){return true}return false};j.describe=function(){return g.describe()};return j}}dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.copy=function(c){var a=dhtmlx.copy._function;a.prototype=c;return new a()};dhtmlx.copy._function=function(){};dhtmlx.extend=function(c,a){for(var g in a){c[g]=a[g]}if(dhtmlx.assert_enabled()&&a._assert){c._assert();c._assert=null}dhtmlx.assert(c,"Invalid nesting target");dhtmlx.assert(a,"Invalid nesting source");if(a._init){c._init()}return c};dhtmlx.proto_extend=function(){var m=arguments;var g=m[0];var c=[];for(var l=m.length-1;l>0;l--){if(typeof m[l]=="function"){m[l]=m[l].prototype}for(var j in m[l]){if(j=="_init"){c.push(m[l][j])}else{if(!g[j]){g[j]=m[l][j]}}}}if(m[0]._init){c.push(m[0]._init)}g._init=function(){for(var n=0;n<c.length;n++){c[n].apply(this,arguments)}};g.base=m[1];var a=function(n){this._init(n);if(this._parseSettings){this._parseSettings(n,this.defaults)}};a.prototype=g;g=m=null;return a};dhtmlx.bind=function(c,a){return function(){return c.apply(a,arguments)}};dhtmlx.require=function(a){if(!dhtmlx._modules[a]){dhtmlx.assert(dhtmlx.ajax,"load module is required");dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx._modules[a]=true}};dhtmlx._modules={};dhtmlx.exec=function(code){if(window.execScript){window.execScript(code)}else{window.eval(code)}};dhtmlx.methodPush=function(a,g,c){return function(){var j=false;j=a[g].apply(a,arguments);return j}};dhtmlx.isNotDefined=function(c){return typeof c=="undefined"};dhtmlx.delay=function(j,c,g,a){setTimeout(function(){var l=j.apply(c,g);j=c=g=null;return l},a||1)};dhtmlx.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}this._seed++;return this._seed};dhtmlx.toNode=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};dhtmlx.toArray=function(a){return dhtmlx.extend((a||[]),dhtmlx.PowerArray)};dhtmlx.toFunctor=function(str){return(typeof(str)=="string")?eval(str):str};dhtmlx._events={};dhtmlx.event=function(j,g,a,c){j=dhtmlx.toNode(j);var l=dhtmlx.uid();dhtmlx._events[l]=[j,g,a];if(c){a=dhtmlx.bind(a,c)}if(j.addEventListener){j.addEventListener(g,a,false)}else{if(j.attachEvent){j.attachEvent("on"+g,a)}}return l};dhtmlx.eventRemove=function(c){if(!c){return}dhtmlx.assert(this._events[c],"Removing non-existing event");var a=dhtmlx._events[c];if(a[0].removeEventListener){a[0].removeEventListener(a[1],a[2],false)}else{if(a[0].detachEvent){a[0].detachEvent("on"+a[1],a[2])}}delete this._events[c]};dhtmlx.log=function(c,g,a){if(window.console&&console.log){c=c.toLowerCase();if(window.console[c]){window.console[c](g||"unknown error")}else{window.console.log(c+": "+g)}if(a){window.console.log(a)}}};dhtmlx.log_full_time=function(a){dhtmlx._start_time_log=new Date();dhtmlx.log("Info","Timing start ["+a+"]");window.setTimeout(function(){var c=new Date();dhtmlx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhtmlx._start_time_log.valueOf())/1000+"s")},1)};dhtmlx.log_time=function(a){var g="_start_time_log"+a;if(!dhtmlx[g]){dhtmlx[g]=new Date();dhtmlx.log("Info","Timing start ["+a+"]")}else{var c=new Date();dhtmlx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhtmlx[g].valueOf())/1000+"s");dhtmlx[g]=null}};dhtmlx.error=function(c,a){dhtmlx.log("error",c,a)};dhtmlx.EventSystem={_init:function(){this._events={};this._handlers={};this._map={}},block:function(){this._events._block=true},unblock:function(){this._events._block=false},mapEvent:function(a){dhtmlx.extend(this._map,a)},callEvent:function(g,l){if(this._events._block){return true}g=g.toLowerCase();dhtmlx.assert_event_call(this,g,l);var j=this._events[g.toLowerCase()];var a=true;if(dhtmlx.debug){dhtmlx.log("info","["+this.name+"] event:"+g,l)}if(j){for(var c=0;c<j.length;c++){if(j[c].apply(this,(l||[]))===false){a=false}}}if(this._map[g]&&!this._map[g].callEvent(g,l)){a=false}return a},attachEvent:function(c,a,j){c=c.toLowerCase();dhtmlx.assert_event_attach(this,c);j=j||dhtmlx.uid();a=dhtmlx.toFunctor(a);var g=this._events[c]||dhtmlx.toArray();g.push(a);this._events[c]=g;this._handlers[j]={f:a,t:c};return j},detachEvent:function(j){if(this._handlers[j]){var c=this._handlers[j].t;var a=this._handlers[j].f;var g=this._events[c];g.remove(a);delete this._handlers[j]}}};dhtmlx.PowerArray={removeAt:function(c,a){if(c>=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,g){if(!g&&g!==0){this.push(c)}else{var a=this.splice(g,(this.length-g));this[g]=c;this.push.apply(this,a)}},find:function(a){for(i=0;i<this.length;i++){if(a==this[i]){return i}}return -1},each:function(a,g){for(var c=0;c<this.length;c++){a.call((g||this),this[c])}},map:function(a,g){for(var c=0;c<this.length;c++){this[c]=a.call((g||this),this[c])}return this}};dhtmlx.env={};if(navigator.userAgent.indexOf("Opera")!=-1){dhtmlx._isOpera=true}else{dhtmlx._isIE=!!document.all;dhtmlx._isFF=!document.all;dhtmlx._isWebKit=(navigator.userAgent.indexOf("KHTML")!=-1);if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"){dhtmlx._isIE=8}if(navigator.appVersion.indexOf("MSIE 9.0")!=-1&&document.compatMode!="BackCompat"){dhtmlx._isIE=9}}dhtmlx.env={};(function(){dhtmlx.env.transform=false;dhtmlx.env.transition=false;var a={};a.names=["transform","transition"];a.transform=["transform","WebkitTransform","MozTransform","oTransform","msTransform"];a.transition=["transition","WebkitTransition","MozTransition","oTransition"];var j=document.createElement("DIV");var g;for(var c=0;c<a.names.length;c++){while(p=a[a.names[c]].pop()){if(typeof j.style[p]!="undefined"){dhtmlx.env[a.names[c]]=true}}}})();dhtmlx.env.transform_prefix=(function(){var a;if(dhtmlx._isOpera){a="-o-"}else{a="";if(dhtmlx._isFF){a="-moz-"}if(dhtmlx._isWebKit){a="-webkit-"}}return a})();dhtmlx.env.svg=(function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")})();dhtmlx.zIndex={drag:10000};dhtmlx.html={create:function(c,a,g){a=a||{};var j=document.createElement(c);for(var l in a){j.setAttribute(l,a[l])}if(a.style){j.style.cssText=a.style}if(a["class"]){j.className=a["class"]}if(g){j.innerHTML=g}return j},getValue:function(a){a=dhtmlx.toNode(a);if(!a){return""}return dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(c){if(c instanceof Array){for(var a=0;a<c.length;a++){this.remove(c[a])}}else{if(c&&c.parentNode){c.parentNode.removeChild(c)}}},insertBefore:function(c,g,a){if(!c){return}if(g){g.parentNode.insertBefore(c,g)}else{a.appendChild(c)}},locate:function(c,j){c=c||event;var a=c.target||c.srcElement;while(a){if(a.getAttribute){var g=a.getAttribute(j);if(g){return g}}a=a.parentNode}return null},offset:function(j){if(j.getBoundingClientRect){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{y:Math.round(r),x:Math.round(g)}}else{var r=0,g=0;while(j){r=r+parseInt(j.offsetTop,10);g=g+parseInt(j.offsetLeft,10);j=j.offsetParent}return{y:r,x:g}}},pos:function(a){a=a||event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}var c=((dhtmlx._isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:a.clientX+c.scrollLeft-c.clientLeft,y:a.clientY+c.scrollTop-c.clientTop}},preventEvent:function(a){if(a&&a.preventDefault){a.preventDefault()}dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=true;return false},addCss:function(c,a){c.className+=" "+a},removeCss:function(c,a){c.className=c.className.replace(RegExp(a,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");dhtmlx.assert(a.length,"Can't locate codebase");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"}})();if(!dhtmlx.ui){dhtmlx.ui={}}dhtmlx.Destruction={_init:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this._htmlmap=null;this._htmlrows=null;if(this._html){document.body.appendChild(this._html)}this._html=null;if(this._obj){this._obj.innerHTML="";this._obj._htmlmap=null}this._obj=this._dataobj=null;this.data=null;this._events=this._handlers={};if(this.render){this.render=function(){}}}};dhtmlx.destructors=[];dhtmlx.event(window,"unload",function(){if(dhtmlx.destructors){for(var g=0;g<dhtmlx.destructors.length;g++){dhtmlx.destructors[g].destructor()}dhtmlx.destructors=[]}for(var c in dhtmlx._events){var j=dhtmlx._events[c];if(j[0].removeEventListener){j[0].removeEventListener(j[1],j[2],false)}else{if(j[0].detachEvent){j[0].detachEvent("on"+j[1],j[2])}}delete dhtmlx._events[c]}});dhtmlx.ajax=function(a,c,g){if(arguments.length!==0){var j=new dhtmlx.ajax();if(g){j.master=g}j.get(a,null,c)}if(!this.getXHR){return new dhtmlx.ajax()}return this};dhtmlx.ajax.prototype={getXHR:function(){if(dhtmlx._isIE){return new ActiveXObject("Microsoft.xmlHTTP")}else{return new XMLHttpRequest()}},send:function(l,q,n){var c=this.getXHR();if(typeof n=="function"){n=[n]}if(typeof q=="object"){var m=[];for(var g in q){var o=q[g];if(o===null||o===dhtmlx.undefined){o=""}m.push(g+"="+encodeURIComponent(o))}q=m.join("&")}if(q&&!this.post){l=l+(l.indexOf("?")!=-1?"&":"?")+q;q=null}c.open(this.post?"POST":"GET",l,!this._sync);if(this.post){c.setRequestHeader("Content-type","application/x-www-form-urlencoded")}var j=this;c.onreadystatechange=function(){if(!c.readyState||c.readyState==4){if(n&&j){for(var a=0;a<n.length;a++){if(n[a]){n[a].call((j.master||j),c.responseText,c.responseXML,c)}}}j.master=null;n=j=null}};c.send(q||null);return c},get:function(a,g,c){this.post=false;return this.send(a,g,c)},post:function(a,g,c){this.post=true;return this.send(a,g,c)},sync:function(){this._sync=true;return this}};dhtmlx.AtomDataLoader={_init:function(a){this.data={};if(a){this._settings.datatype=a.datatype||"json";this._after_init.push(this._load_when_ready)}},_load_when_ready:function(){this._ready_for_data=true;if(this._settings.url){this.url_setter(this._settings.url)}if(this._settings.data){this.data_setter(this._settings.data)}},url_setter:function(a){if(!this._ready_for_data){return a}this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data){return a}this.parse(a,this._settings.datatype);return true},load:function(a,c){this.callEvent("onXLS",[]);if(typeof c=="string"){this.data.driver=dhtmlx.DataDriver[c];c=arguments[2]}else{this.data.driver=dhtmlx.DataDriver.xml}dhtmlx.ajax(a,[this._onLoad,c],this)},parse:function(c,a){this.callEvent("onXLS",[]);this.data.driver=dhtmlx.DataDriver[a||"xml"];this._onLoad(c,null)},_onLoad:function(l,c,a){var g=this.data.driver;var j=g.getRecords(g.toObject(l,c))[0];this.data=(g?g.getDetails(j):l);this.callEvent("onXLE",[])},_check_data_feed:function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.callEvent("onXLS",[]);dhtmlx.ajax(a,function(j,g){this._ignore_feed=true;this.setValues(dhtmlx.DataDriver.json.toObject(j)[0]);this._ignore_feed=false;this.callEvent("onXLE",[])},this);return false}};dhtmlx.DataDriver={};dhtmlx.DataDriver.json={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){eval("dhtmlx.temp="+data);return dhtmlx.temp}return data},getRecords:function(a){if(a&&!(a instanceof Array)){return[a]}return a},getDetails:function(a){return a},getInfo:function(a){return{_size:(a.total_count||0),_from:(a.pos||0),_key:(a.dhx_security)}}};dhtmlx.DataDriver.json_ext={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){var temp;eval("temp="+data);dhtmlx.temp=[];var header=temp.header;for(var i=0;i<temp.data.length;i++){var item={};for(var j=0;j<header.length;j++){if(typeof(temp.data[i][j])!="undefined"){item[header[j]]=temp.data[i][j]}}dhtmlx.temp.push(item)}return dhtmlx.temp}return data},getRecords:function(a){if(a&&!(a instanceof Array)){return[a]}return a},getDetails:function(a){return a},getInfo:function(a){return{_size:(a.total_count||0),_from:(a.pos||0)}}};dhtmlx.DataDriver.html={toObject:function(c){if(typeof c=="string"){var a=null;if(c.indexOf("<")==-1){a=dhtmlx.toNode(c)}if(!a){a=document.createElement("DIV");a.innerHTML=c}return a.getElementsByTagName(this.tag)}return c},getRecords:function(a){if(a.tagName){return a.childNodes}return a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(a){return{_size:0,_from:0}},tag:"LI"};dhtmlx.DataDriver.jsarray={toObject:function(data){if(typeof data=="string"){eval("dhtmlx.temp="+data);return dhtmlx.temp}return data},getRecords:function(a){return a},getDetails:function(g){var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}}};dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(g){g=this.stringToArray(g);var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}},stringToArray:function(c){c=c.split(this.cell);for(var a=0;a<c.length;a++){c[a]=c[a].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"")}return c},row:"\n",cell:","};dhtmlx.DataDriver.xml={toObject:function(c,a){if(a&&(a=this.checkResponse(c,a))){return a}if(typeof c=="string"){return this.fromString(c)}return c},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){return{_size:(a.documentElement.getAttribute("total_count")||0),_from:(a.documentElement.getAttribute("pos")||0),_key:(a.documentElement.getAttribute("dhx_security"))}},xpath:function(j,q){if(window.XPathResult){var g=j;if(j.nodeName.indexOf("document")==-1){j=j.ownerDocument}var n=[];var c=j.evaluate(q,g,null,XPathResult.ANY_TYPE,null);var o=c.iterateNext();while(o){n.push(o);o=c.iterateNext()}return n}else{var m=true;try{if(typeof(j.selectNodes)=="undefined"){m=false}}catch(l){}if(m){return j.selectNodes(q)}else{var a=q.split("/").pop();return j.getElementsByTagName(a)}}},tagToObject:function(g,q){q=q||{};var l=false;var j=g.attributes;if(j&&j.length){for(var n=0;n<j.length;n++){q[j[n].name]=j[n].value}l=true}var c=g.childNodes;var o={};for(var n=0;n<c.length;n++){if(c[n].nodeType==1){var m=c[n].tagName;if(typeof q[m]!="undefined"){if(!(q[m] instanceof Array)){q[m]=[q[m]]}q[m].push(this.tagToObject(c[n],{}))}else{q[c[n].tagName]=this.tagToObject(c[n],{})}l=true}}if(!l){return this.nodeValue(g)}q.value=this.nodeValue(g);return q},nodeValue:function(a){if(a.firstChild){return a.firstChild.wholeText||a.firstChild.data}return""},fromString:function(c){if(window.DOMParser&&!dhtmlx._isIE){return(new DOMParser()).parseFromString(c,"text/xml")}if(window.ActiveXObject){var a=new ActiveXObject("Microsoft.xmlDOM");a.loadXML(c);return a}dhtmlx.error("Load from xml string is not supported")},checkResponse:function(j,g){if(g&&(g.firstChild&&g.firstChild.tagName!="parsererror")){return g}var c=this.fromString(j.replace(/^[\s]+/,""));if(c){return c}dhtmlx.error("xml can't be parsed",j)}};dhtmlx.DataLoader={_init:function(a){a=a||"";this.name="DataStore";this.data=(a.datastore)||(new dhtmlx.DataStore());this._readyHandler=this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._call_onready,this))},load:function(a,c){dhtmlx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed){this.data.feed=function(j,g){if(this._load_count){return this._load_count=[j,g]}else{this._load_count=true}this.load(a+((a.indexOf("?")==-1)?"?":"&")+"posStart="+j+"&count="+g,function(){var l=this._load_count;this._load_count=false;if(typeof l=="object"){this.data.feed.apply(this,l)}})}}},_onLoad:function(g,c,a){this.data._parse(this.data.driver.toObject(g,c));this.callEvent("onXLE",[]);if(this._readyHandler){this.data.detachEvent(this._readyHandler);this._readyHandler=null}},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhtmlx.bind(function(n,m){if(this._settings.dataFeed){var l={};if(!n&&!l){return}if(typeof n=="function"){if(!m){return}n(m,l)}else{l={text:m}}this.clearAll();var c=this._settings.dataFeed;if(typeof c=="function"){return c.call(this,m,l)}var j=[];for(var g in l){j.push("dhx_filter["+g+"]="+encodeURIComponent(l[g]))}this.load(c+(c.indexOf("?")<0?"?":"&")+j.join("&"),this._settings.datatype);return false}},this));return a},_call_onready:function(){if(this._settings.ready){var a=dhtmlx.toFunctor(this._settings.ready);if(a&&a.call){a.apply(this,arguments)}}}};dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};dhtmlx.DataStore.prototype={setDriver:function(a){dhtmlx.assert(dhtmlx.DataDriver[a],"incorrect DataDriver");this.driver=dhtmlx.DataDriver[a]},_parse:function(m){this.callEvent("onParse",[this.driver,m]);if(this._filter_order){this.filter()}var n=this.driver.getInfo(m);if(n._key){dhtmlx.security_key=n._key}var l=this.driver.getRecords(m);var q=(n._from||0)*1;if(q===0&&this.order[0]){q=this.order.length}var c=0;for(var g=0;g<l.length;g++){var a=this.driver.getDetails(l[g]);var o=this.id(a);if(!this.pull[o]){this.order[c+q]=o;c++}this.pull[o]=a;if(this.extraParser){this.extraParser(a)}if(this._scheme){if(this._scheme.$init){this._scheme.$update(a)}else{if(this._scheme.$update){this._scheme.$update(a)}}}}for(var g=0;g<n._size;g++){if(!this.order[g]){var o=dhtmlx.uid();var a={id:o,$template:"loading"};this.pull[o]=a;this.order[g]=o}}this.callEvent("onStoreLoad",[this.driver,m]);this.refresh()},id:function(a){return a.id||(a.id=dhtmlx.uid())},changeId:function(c,a){dhtmlx.assert(this.pull[c],"Can't change id, for non existing item: "+c);this.pull[a]=this.pull[c];this.pull[a].id=a;this.order[this.order.find(c)]=a;if(this._filter_order){this._filter_order[this._filter_order.find(c)]=a}this.callEvent("onIdChange",[c,a]);if(this._render_change_id){this._render_change_id(c,a)}},get:function(a){return this.item(a)},set:function(c,a){return this.update(c,a)},item:function(a){return this.pull[a]},update:function(c,a){if(this._scheme&&this._scheme.$update){this._scheme.$update(a)}if(this.callEvent("onBeforeUpdate",[c,a])===false){return false}this.pull[c]=a;this.refresh(c)},refresh:function(a){if(this._skip_refresh){return}if(a){this.callEvent("onStoreUpdated",[a,this.pull[a],"update"])}else{this.callEvent("onStoreUpdated",[null,null,null])}},silent:function(a){this._skip_refresh=true;a.call(this);this._skip_refresh=false},getRange:function(j,g){if(j){j=this.indexById(j)}else{j=this.startOffset||0}if(g){g=this.indexById(g)}else{g=Math.min((this.endOffset||Infinity),(this.dataCount()-1));if(g<0){g=0}}if(j>g){var c=g;g=j;j=c}return this.getIndexRange(j,g)},getIndexRange:function(j,g){g=Math.min((g||Infinity),this.dataCount()-1);var a=dhtmlx.toArray();for(var c=(j||0);c<=g;c++){a.push(this.item(this.order[c]))}return a},dataCount:function(){return this.order.length},exists:function(a){return !!(this.pull[a])},move:function(a,j){if(a<0||j<0){dhtmlx.error("DataStore::move","Incorrect indexes");return}var g=this.idByIndex(a);var c=this.item(g);this.order.removeAt(a);this.order.insertAt(g,Math.min(this.order.length,j));this.callEvent("onStoreUpdated",[g,c,"move"])},scheme:function(a){this._scheme=a},sync:function(l,j,a){if(typeof j!="function"){a=j;j=null}if(dhtmlx.debug_bind){this.debug_sync_master=l;dhtmlx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}var g=l;if(l.name!="DataStore"){l=l.data}var c=dhtmlx.bind(function(o,m,n){if(n!="update"||j){o=null}if(!o){this.order=dhtmlx.toArray([].concat(l.order));this._filter_order=null;this.pull=l.pull;if(j){this.silent(j)}if(this._on_sync){this._on_sync()}}if(dhtmlx.debug_bind){dhtmlx.log("[sync:request] "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id+" <= "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id)}if(!a){this.refresh(o)}else{a=false}},this);l.attachEvent("onStoreUpdated",c);this.feed=function(n,m){g.loadNext(m,n)};c()},add:function(l,a){if(this._scheme){l=l||{};for(var c in this._scheme){l[c]=l[c]||this._scheme[c]}if(this._scheme){if(this._scheme.$init){this._scheme.$update(l)}else{if(this._scheme.$update){this._scheme.$update(l)}}}}var m=this.id(l);var j=this.dataCount();if(dhtmlx.isNotDefined(a)||a<0){a=j}if(a>j){dhtmlx.log("Warning","DataStore:add","Index of out of bounds");a=Math.min(this.order.length,a)}if(this.callEvent("onBeforeAdd",[m,l,a])===false){return false}if(this.exists(m)){return dhtmlx.error("Not unique ID")}this.pull[m]=l;this.order.insertAt(m,a);if(this._filter_order){var g=this._filter_order.length;if(!a&&this.order.length){g=0}this._filter_order.insertAt(m,g)}this.callEvent("onafterAdd",[m,a]);this.callEvent("onStoreUpdated",[m,l,"add"]);return m},remove:function(g){if(g instanceof Array){for(var a=0;a<g.length;a++){this.remove(g[a])}return}if(this.callEvent("onBeforeDelete",[g])===false){return false}if(!this.exists(g)){return dhtmlx.error("Not existing ID",g)}var c=this.item(g);this.order.remove(g);if(this._filter_order){this._filter_order.remove(g)}delete this.pull[g];this.callEvent("onafterdelete",[g]);this.callEvent("onStoreUpdated",[g,c,"delete"])},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this.feed=null;this._filter_order=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){if(a>=this.order.length||a<0){dhtmlx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);return a},next:function(c,a){return this.order[this.indexById(c)+(a||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(c,a){return this.order[this.indexById(c)-(a||1)]},sort:function(m,c,a){var g=m;if(typeof m=="function"){g={as:m,dir:c}}else{if(typeof m=="string"){g={by:m,dir:c,as:a}}}var l=[g.by,g.dir,g.as];if(!this.callEvent("onbeforesort",l)){return}if(this.order.length){var n=dhtmlx.sort.create(g);var j=this.getRange(this.first(),this.last());j.sort(n);this.order=j.map(function(o){return this.id(o)},this)}this.refresh();this.callEvent("onaftersort",l)},filter:function(l,j){if(!this.callEvent("onBeforeFilter",[l,j])){return}if(this._filter_order){this.order=this._filter_order;delete this._filter_order}if(!this.order.length){return}if(l){var c=l;j=j||"";if(typeof l=="string"){l=dhtmlx.Template.fromHTML(l);j=j.toString().toLowerCase();c=function(o,n){return l(o).toLowerCase().indexOf(n)!=-1}}var g=dhtmlx.toArray();for(var a=0;a<this.order.length;a++){var m=this.order[a];if(c(this.item(m),j)){g.push(m)}}this._filter_order=this.order;this.order=g}this.refresh();this.callEvent("onAfterFilter",[])},each:function(g,c){for(var a=0;a<this.order.length;a++){g.call((c||this),this.item(this.order[a]))}},provideApi:function(j,c){this.debug_bind_master=j;if(c){this.mapEvent({onbeforesort:j,onaftersort:j,onbeforeadd:j,onafteradd:j,onbeforedelete:j,onafterdelete:j,onbeforeupdate:j})}var g=["get","set","sort","add","remove","exists","idByIndex","indexById","item","update","refresh","dataCount","filter","next","previous","clearAll","first","last","serialize"];for(var a=0;a<g.length;a++){j[g[a]]=dhtmlx.methodPush(this,g[a])}if(dhtmlx.assert_enabled()){this.assert_event(j)}},serialize:function(){var g=this.order;var a=[];for(var c=0;c<g.length;c++){a.push(this.pull[g[c]])}return a}};dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(g,c){g=g*1;c=c*1;return g>c?1:(g<c?-1:0)},string_strict:function(g,c){g=g.toString();c=c.toString();return g>c?1:(g<c?-1:0)},string:function(g,c){g=g.toString().toLowerCase();c=c.toString().toLowerCase();return g>c?1:(g<c?-1:0)}},by:function(c,a){if(!c){return a}if(typeof a!="function"){a=dhtmlx.sort.as[a||"string"]}c=dhtmlx.Template.fromHTML(c);return function(j,g){return a(c(j),c(g))}},dir:function(c,a){if(c=="asc"){return a}return function(j,g){return a(j,g)*-1}}};dhtmlx.KeyEvents={_init:function(){dhtmlx.event(this._obj,"keypress",this._onKeyPress,this)},_onKeyPress:function(c){c=c||event;var a=c.which||c.keyCode;this.callEvent((this._edit_id?"onEditKeyPress":"onKeyPress"),[a,c.ctrlKey,c.shiftKey,c])}};dhtmlx.MouseEvents={_init:function(){if(this.on_click){dhtmlx.event(this._obj,"click",this._onClick,this);dhtmlx.event(this._obj,"contextmenu",this._onContext,this)}if(this.on_dblclick){dhtmlx.event(this._obj,"dblclick",this._onDblClick,this)}if(this.on_mouse_move){dhtmlx.event(this._obj,"mousemove",this._onMouse,this);dhtmlx.event(this._obj,(dhtmlx._isIE?"mouseleave":"mouseout"),this._onMouse,this)}},_onClick:function(a){return this._mouseEvent(a,this.on_click,"ItemClick")},_onDblClick:function(a){return this._mouseEvent(a,this.on_dblclick,"ItemDblClick")},_onContext:function(a){var c=dhtmlx.html.locate(a,this._id);if(c&&!this.callEvent("onBeforeContextMenu",[c,a])){return dhtmlx.html.preventEvent(a)}},_onMouse:function(a){if(dhtmlx._isIE){a=document.createEventObject(event)}if(this._mouse_move_timer){window.clearTimeout(this._mouse_move_timer)}this.callEvent("onMouseMoving",[a]);this._mouse_move_timer=window.setTimeout(dhtmlx.bind(function(){if(a.type=="mousemove"){this._onMouseMove(a)}else{this._onMouseOut(a)}},this),500)},_onMouseMove:function(a){if(!this._mouseEvent(a,this.on_mouse_move,"MouseMove")){this.callEvent("onMouseOut",[a||event])}},_onMouseOut:function(a){this.callEvent("onMouseOut",[a||event])},_mouseEvent:function(m,l,c){m=m||event;var a=m.target||m.srcElement;var g="";var n=null;var j=false;while(a&&a.parentNode){if(!j&&a.getAttribute){n=a.getAttribute(this._id);if(n){if(a.getAttribute("userdata")){this.callEvent("onLocateData",[n,a])}if(!this.callEvent("on"+c,[n,m,a])){return}j=true}}g=a.className;if(g){g=g.split(" ");g=g[0]||g[1];if(l[g]){return l[g].call(this,m,n||dhtmlx.html.locate(m,this._id),a)}}a=a.parentNode}return j}};dhtmlx.Settings={_init:function(){this._settings=this.config={}},define:function(c,a){if(typeof c=="object"){return this._parseSeetingColl(c)}return this._define(c,a)},_define:function(c,a){dhtmlx.assert_settings.call(this,c,a);var g=this[c+"_setter"];return this._settings[c]=g?g.call(this,a):a},_parseSeetingColl:function(g){if(g){for(var c in g){this._define(c,g[c])}}},_parseSettings:function(g,a){var c=dhtmlx.extend({},a);if(typeof g=="object"&&!g.tagName){dhtmlx.extend(c,g)}this._parseSeetingColl(c)},_mergeSettings:function(a,g){for(var c in g){switch(typeof a[c]){case"object":a[c]=this._mergeSettings((a[c]||{}),g[c]);break;case"undefined":a[c]=g[c];break;default:break}}return a},_parseContainer:function(c,a,g){if(typeof c=="object"&&!c.tagName){c=c.container}this._obj=this.$view=dhtmlx.toNode(c);if(!this._obj&&g){this._obj=g(c)}dhtmlx.assert(this._obj,"Incorrect html container");this._obj.className+=" "+a;this._obj.onselectstart=function(){return false};this._dataobj=this._obj},_set_type:function(a){if(typeof a=="object"){return this.type_setter(a)}dhtmlx.assert(this.types,"RenderStack :: Types are not defined");dhtmlx.assert(this.types[a],"RenderStack :: Inccorect type name",a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){if(a){dhtmlx.extend(this.type,a)}this.type._item_start=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type._item_end=this.template_item_end(this.type);this.render()},type_setter:function(a){this._set_type(typeof a=="object"?dhtmlx.Type.add(this,a):a);return a},template_setter:function(a){return this.type_setter({template:a})},css_setter:function(a){this._obj.className+=" "+a;return a}};dhtmlx.Template={_cache:{},empty:function(){return""},setter:function(a){return dhtmlx.Template.fromHTML(a)},obj_setter:function(c){var a=dhtmlx.Template.setter(c);var g=this;return function(){return a.apply(g,arguments)}},fromHTML:function(a){if(typeof a=="function"){return a}if(this._cache[a]){return this._cache[a]}a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this._cache[a]=Function("obj","common",a)}};dhtmlx.Type={add:function(g,c){if(!g.types&&g.prototype.types){g=g.prototype}if(dhtmlx.assert_enabled()){this.assert_event(c)}var a=c.name||"default";this._template(c);this._template(c,"edit");this._template(c,"loading");g.types[a]=dhtmlx.extend(dhtmlx.extend({},(g.types[a]||this._default)),c);return a},_default:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},_template:function(g,a){a="template"+(a?("_"+a):"");var c=g[a];if(c&&(typeof c=="string")){if(c.indexOf("->")!=-1){c=c.split("->");switch(c[0]){case"html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case"http":c=new dhtmlx.ajax().sync().get(c[1],{uid:(new Date()).valueOf()}).responseText;break;default:break}}g[a]=dhtmlx.Template.fromHTML(c)}}};dhtmlx.SingleRender={_init:function(){},_toHTML:function(a){return this.type._item_start(a,this.type)+this.type.template(a,this.type)+this.type._item_end},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data){this._dataobj.innerHTML=this._toHTML(this.data)}if(this.callEvent){this.callEvent("onAfterRender",[])}}}};dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}if(typeof a=="string"){a={template:a}}dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this._parseSettings(a,{type:"default",dy:0,dx:20});this._dataobj=this._obj=document.createElement("DIV");this._obj.className="dhx_tooltip";dhtmlx.html.insertBefore(this._obj,document.body.firstChild)};dhtmlx.ui.Tooltip.prototype={show:function(a,c){if(this._disabled){return}if(this.data!=a){this.data=a;this.render(a)}this._obj.style.top=c.y+this._settings.dy+"px";this._obj.style.left=c.x+this._settings.dx+"px";this._obj.style.display="block"},hide:function(){this.data=null;this._obj.style.display="none"},disable:function(){this._disabled=true},enable:function(){this._disabled=false},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};dhtmlx.AutoTooltip={tooltip_setter:function(c){var a=new dhtmlx.ui.Tooltip(c);this.attachEvent("onMouseMove",function(j,g){a.show(this.get(j),dhtmlx.html.pos(g))});this.attachEvent("onMouseOut",function(j,g){a.hide()});this.attachEvent("onMouseMoving",function(j,g){a.hide()});return a}};dhtmlx.compat=function(a,c){if(dhtmlx.compat[a]){dhtmlx.compat[a](c)}};if(!dhtmlx.attaches){dhtmlx.attaches={}}dhtmlx.attaches.attachAbstract=function(c,a){var l=document.createElement("DIV");l.id="CustomObject_"+dhtmlx.uid();l.style.width="100%";l.style.height="100%";l.cmp="grid";document.body.appendChild(l);this.attachObject(l.id);a.container=l.id;var j=this.vs[this.av];j.grid=new window[c](a);j.gridId=l.id;j.gridObj=l;j.grid.setSizes=function(){if(this.resize){this.resize()}else{this.render()}};var g="_viewRestore";return this.vs[this[g]()].grid};dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};function dhtmlXCellObject(g,a){this.cell=document.createElement("DIV");this.cell.className="dhx_cell"+(a||"");this._idd=g;this._isCell=true;this.conf={borders:true,idx:{},css:a||"",idx_data:{cont:"dhx_cell_cont",pr1:"dhx_cell_progress_bar",pr2:"dhx_cell_progress_img",menu:"dhx_cell_menu",toolbar:"dhx_cell_toolbar",ribbon:"dhx_cell_ribbon",sb:"dhx_cell_statusbar",cover:"dhx_cell_cover"},ofs_nodes:{t:{},b:{}}};this.dataNodes={};this.views={};var c=document.createElement("DIV");c.className="dhx_cell_cont"+this.conf.css;this.cell.appendChild(c);c=null;this._updateIdx=function(){for(var j in this.conf.idx){this.conf.idx[j]=null;delete this.conf.idx[j]}for(var n=0;n<this.cell.childNodes.length;n++){var l=this.cell.childNodes[n].className;for(var j in this.conf.idx_data){var m=new RegExp(this.conf.idx_data[j]);if(l.match(m)!=null){this.conf.idx[j]=n}}}this.callEvent("_onIdxUpdated",[])};this._adjustAttached=function(){for(var j in this.dataNodes){if(this.dataNodes[j]!=null&&typeof(this.dataNodes[j].setSizes)=="function"){this.dataNodes[j].setSizes()}}if(this.dataObj!=null&&typeof(this.dataObj.setSizes)=="function"){if(this.dataType=="layout"&&typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof window.dhtmlXLayoutCell&&this.dataObj._getMainInst()!=this.layout._getMainInst()){this.dataObj.setSizes();return}this.dataObj.setSizes.apply(this.dataObj,arguments)}};this._setSize=function(u,r,v,n,o,q,l,m){if(this.conf.size==null){this.conf.size={}}if(m==null){m={}}var A={left:"x",top:"y",width:"w",height:"h"};this.conf.size.x=u;this.conf.size.y=r;this.conf.size.w=Math.max(v,0);this.conf.size.h=Math.max(n,0);for(var s in A){var j=(m[s]||s);this.cell.style[j]=this.conf.size[A[s]]+"px"}this.callEvent("_onSetSize",[]);if(q!==true){this._adjustCont(o,l)}else{this._adjustAttached(o)}this._adjustProgress()};this._adjustCont=function(q,n){var o=this.cell.childNodes[this.conf.idx.cont];var m=0;for(var j in this.conf.ofs_nodes.t){var l=this.conf.ofs_nodes.t[j];m+=(l=="func"?this[j]():(l==true?this.cell.childNodes[this.conf.idx[j]].offsetHeight:0))}var r=0;for(var j in this.conf.ofs_nodes.b){var l=this.conf.ofs_nodes.b[j];r+=(l=="func"?this[j]():(l==true?this.cell.childNodes[this.conf.idx[j]].offsetHeight:0))}o.style.left="0px";o.style.top=m+"px";if(!this.conf.cells_cont){this.conf.cells_cont={};o.style.width=this.cell.offsetWidth+"px";o.style.height=Math.max(this.cell.offsetHeight-m-r,0)+"px";this.conf.cells_cont.w=parseInt(o.style.width)-o.offsetWidth;this.conf.cells_cont.h=parseInt(o.style.height)-o.offsetHeight}o.style.left="0px";o.style.top=m+"px";o.style.width=Math.max(this.cell.offsetWidth+this.conf.cells_cont.w,0)+"px";o.style.height=Math.max(this.conf.size.h-m-r+this.conf.cells_cont.h,0)+"px";o=null;this._adjustAttached(q);if(n=="expand"&&this.dataType=="editor"&&this.dataObj!=null){this.dataObj._prepareContent(true)}};this._mtbUpdBorder=function(){var l=["menu","toolbar","ribbon"];for(var n=0;n<l.length;n++){if(this.conf.idx[l[n]]!=null){var o=this.cell.childNodes[this.conf.idx[l[n]]];var m="dhx_cell_"+l[n]+"_no_borders";var j="dhx_cell_"+l[n]+"_def";o.className=o.className.replace(new RegExp(this.conf.borders?m:j),this.conf.borders?j:m);o=null}}};this._resetSizeState=function(){this.conf.cells_cont=null};this.conf.view="def";this.conf.views_loaded={};this.conf.views_loaded[this.conf.view]=true;this._viewSave=function(m){this.views[m]={borders:this.conf.borders,ofs_nodes:{t:{},b:{}},url_data:this.conf.url_data,dataType:this.dataType,dataObj:this.dataObj,cellCont:[],dataNodes:{},dataNodesCont:{}};var n=this.cell.childNodes[this.conf.idx.cont];while(n.childNodes.length>0){this.views[m].cellCont.push(n.firstChild);n.removeChild(n.firstChild)}n=null;this.dataType=null;this.dataObj=null;this.conf.url_data=null;for(var l in this.dataNodes){for(var j in this.conf.ofs_nodes){if(typeof(this.conf.ofs_nodes[j][l])!="undefined"){this.views[m].ofs_nodes[j][l]=this.conf.ofs_nodes[j][l];this.conf.ofs_nodes[j][l]=null;delete this.conf.ofs_nodes[j][l]}}this.views[m].dataNodesCont[l]=this.cell.childNodes[this.conf.idx[l]];this.cell.removeChild(this.cell.childNodes[this.conf.idx[l]]);this.views[m].dataNodes[l]=this.dataNodes[l];this.dataNodes[l]=null;delete this.dataNodes[l];this._updateIdx()}this.callEvent("_onViewSave",[m])};this._viewRestore=function(m){if(this.views[m]==null){return}this.dataObj=this.views[m].dataObj;this.dataType=this.views[m].dataType;this.conf.url_data=this.views[m].url_data;for(var n=0;n<this.views[m].cellCont.length;n++){this.cell.childNodes[this.conf.idx.cont].appendChild(this.views[m].cellCont[n])}for(var l in this.views[m].dataNodes){this.dataNodes[l]=this.views[m].dataNodes[l];if(l=="menu"){this.cell.insertBefore(this.views[m].dataNodesCont[l],this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont])}if(l=="toolbar"){this.cell.insertBefore(this.views[m].dataNodesCont[l],this.cell.childNodes[this.conf.idx.cont])}if(l=="sb"){this.cell.appendChild(this.views[m].dataNodesCont[l])}this._updateIdx()}for(var l in this.views[m].ofs_nodes){for(var j in this.views[m].ofs_nodes[l]){this.conf.ofs_nodes[l][j]=this.views[m].ofs_nodes[l][j]}}if(this.conf.borders!=this.views[m].borders){this[this.views[m].borders?"_showBorders":"_hideBorders"](true)}if(this.dataType=="url"&&this.conf.url_data!=null&&this.conf.url_data.ajax==false&&this.conf.url_data.post_data!=null){this.reloadURL()}this.callEvent("_onViewRestore",[m]);this._viewDelete(m)};this._viewDelete=function(m){if(this.views[m]==null){return}this.views[m].borders=null;for(var l in this.views[m].ofs_nodes){for(var j in this.views[m].ofs_nodes[l]){this.views[m].ofs_nodes[l][j]=null}this.views[m].ofs_nodes[l]=null}this.views[m].dataType=null;this.views[m].dataObj=null;this.views[m].url_data=null;for(var n=0;n<this.views[m].cellCont.length;n++){this.views[m].cellCont[n]=null}this.views[m].cellCont=null;for(var l in this.views[m].dataNodes){this.views[m].dataNodes[l]=null;this.views[m].dataNodesCont[l]=null}this.views[m].dataNodes=this.views[m].dataNodesCont=null;this.views[m]=null;delete this.views[m]};window.dhx4._eventable(this);this._updateIdx();return this}dhtmlXCellObject.prototype.showView=function(a){if(this.conf.view==a){return false}this._viewSave(this.conf.view);this._viewRestore(a);this._updateIdx();this._adjustCont();this.conf.view=a;var c=(typeof(this.conf.views_loaded[this.conf.view])=="undefined");this.conf.views_loaded[this.conf.view]=true;return c};dhtmlXCellObject.prototype.getViewName=function(){return this.conf.view};dhtmlXCellObject.prototype.unloadView=function(j){if(j==this.conf.view){var l=this.conf.unloading;this.conf.unloading=true;if(typeof(this.detachMenu)=="function"){this.detachMenu()}if(typeof(this.detachToolbar)=="function"){this.detachToolbar()}if(typeof(this.detachRibbon)=="function"){this.detachRibbon()}this.detachStatusBar();this._detachObject(null,true);this.conf.unloading=l;if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(this.views[j]==null){return}var g=this.views[j];for(var c in g.dataNodes){if(typeof(g.dataNodes[c].unload)=="function"){g.dataNodes[c].unload()}g.dataNodes[c]=null;g.dataNodesCont[c]=null}if(g.dataType=="url"){if(g.cellCont!=null&&g.cellCont[0]!="null"){this._detachURLEvents(g.cellCont[0])}}else{if(g.dataObj!=null){if(typeof(g.dataObj.unload)=="function"){g.dataObj.unload()}else{if(typeof(g.dataObj.destructor)=="function"){g.dataObj.destructor()}}g.dataObj=null}}g=null;this._viewDelete(j);if(typeof(this.conf.views_loaded[j])!="undefined"){delete this.conf.views_loaded[j]}};dhtmlXCellObject.prototype.getId=function(){return this._idd};dhtmlXCellObject.prototype.progressOn=function(){if(this.conf.progress==true){return}this.conf.progress=true;var c=document.createElement("DIV");c.className=this.conf.idx_data.pr1;var a=document.createElement("DIV");a.className=this.conf.idx_data.pr2;if(this.conf.idx.cover!=null){this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cover])}else{this.cell.appendChild(a)}this.cell.insertBefore(c,a);c=a=null;this._updateIdx();this._adjustProgress()};dhtmlXCellObject.prototype.progressOff=function(){if(this.conf.progress!=true){return}this.cell.childNodes[this.conf.idx.pr2].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr2]);this.cell.childNodes[this.conf.idx.pr1].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr1]);this.conf.progress=false;this._updateIdx()};dhtmlXCellObject.prototype._adjustProgress=function(){if(this.conf.idx.pr1==null){return}if(!this.conf.pr){this.conf.pr={}}var c=this.cell.childNodes[this.conf.idx.pr1];var a=this.cell.childNodes[this.conf.idx.pr2];if(!this.conf.pr.ofs){a.style.width=c.offsetWidth+"px";a.style.height=c.offsetHeight+"px";this.conf.pr.ofs={w:a.offsetWidth-a.clientWidth,h:a.offsetHeight-a.clientHeight}}a.style.width=c.offsetWidth-this.conf.pr.ofs.w+"px";a.style.height=c.offsetHeight-this.conf.pr.ofs.h+"px";c=a=null};dhtmlXCellObject.prototype._showCellCover=function(){if(this.conf.cover==true){return}this.conf.cover=true;var a=document.createElement("DIV");a.className=this.conf.idx_data.cover;this.cell.appendChild(a);a=null;this._updateIdx()};dhtmlXCellObject.prototype._hideCellCover=function(){if(this.conf.cover!=true){return}this.cell.removeChild(this.cell.childNodes[this.conf.idx.cover]);this._updateIdx();this.conf.cover=false};dhtmlXCellObject.prototype._showBorders=function(a){if(this.conf.borders){return}this.conf.borders=true;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css;this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[true]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._hideBorders=function(a){if(!this.conf.borders){return}this.conf.borders=false;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css+" dhx_cell_cont_no_borders";this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[false]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._getWidth=function(){return this.cell.offsetWidth};dhtmlXCellObject.prototype._getHeight=function(){return this.cell.offsetHeight};dhtmlXCellObject.prototype.showInnerScroll=function(){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto"};dhtmlXCellObject.prototype._unload=function(){this.conf.unloading=true;this.callEvent("_onCellUnload",[]);this.progressOff();this.unloadView(this.conf.view);this.dataNodes=null;this.cell.parentNode.removeChild(this.cell);this.cell=null;window.dhx4._eventable(this,"clear");for(var c in this.views){this.unloadView(c)}this.conf=null;for(var c in this){this[c]=null}};dhtmlXCellObject.prototype.attachObject=function(j,g){if(window.dhx4.s2b(g)&&!(typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof window.dhtmlXWindowsCell))){g=false}if(typeof(j)=="string"){j=document.getElementById(j)}if(j.parentNode==this.cell.childNodes[this.conf.idx.cont]){j=null;return}if(g){j.style.display="";var a=j.offsetWidth;var c=j.offsetHeight}this._attachObject(j);this.dataType="obj";j.style.display="";j=null;if(g){this._adjustByCont(a,c)}};dhtmlXCellObject.prototype.appendObject=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(a.parentNode==this.cell.childNodes[this.conf.idx.cont]){a=null;return}if(!this.conf.append_mode){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto";this.conf.append_mode=true}this._attachObject(a,null,null,true);this.dataType="obj";a.style.display="";a=null};dhtmlXCellObject.prototype.detachObject=function(c,a){this._detachObject(null,c,a)};dhtmlXCellObject.prototype.getAttachedStatusBar=function(){return this.dataNodes.sb};dhtmlXCellObject.prototype.getAttachedObject=function(){return this.dataObj};dhtmlXCellObject.prototype.attachURL=function(c,r,g){if(g==true){g={}}var j=(typeof(g)!="undefined"&&g!=false&&g!=null);if(!this.conf.url_data){this.conf.url_data={}}this.conf.url_data.url=c;this.conf.url_data.ajax=(r==true);this.conf.url_data.post_data=(g==true?{}:(g||null));if(r==true){var q=this;if(j){var l="";for(var o in g){l+="&"+encodeURIComponent(o)+"="+encodeURIComponent(g[o])}dhx4.ajax.post(c,l,function(a){q.attachHTMLString("<div style='position:relative;width:100%;height:100%;overflow:auto;'>"+a.xmlDoc.responseText+"</div>");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}else{dhx4.ajax.get(c,function(a){q.attachHTMLString("<div style='position:relative;width:100%;height:100%;overflow:auto;'>"+a.xmlDoc.responseText+"</div>");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}}else{if(this.dataType=="url"){var m=this.getFrame()}else{var m=document.createElement("IFRAME");m.frameBorder=0;m.border=0;m.style.width="100%";m.style.height="100%";m.style.position="relative";this._attachObject(m);this.dataType="url";this._attachURLEvents()}if(j){var n=(typeof(this.conf.url_data.post_ifr)=="undefined");this.conf.url_data.post_ifr=true;if(n){this._attachURLEvents()}m.src="about:blank"}else{m.src=c+(window.dhx4.ajax.cache!=true?(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime():"")}m=null}m=null};dhtmlXCellObject.prototype.reloadURL=function(){if(!(this.dataType=="url"||this.dataType=="url-ajax")){return}if(this.conf.url_data==null){return}this.attachURL(this.conf.url_data.url,this.conf.url_data.ajax,this.conf.url_data.post_data)};dhtmlXCellObject.prototype.attachHTMLString=function(str){this._attachObject(null,null,str);var z=str.match(/<script[^>]*>[^\f]*?<\/script>/g)||[];for(var i=0;i<z.length;i++){var s=z[i].replace(/<([\/]{0,1})script[^>]*>/gi,"");if(s){if(window.execScript){window.execScript(s)}else{window.eval(s)}}}};dhtmlXCellObject.prototype.attachScheduler=function(a,n,c,j){j=j||window.scheduler;var l=false;if(c){var m=document.getElementById(c);if(m){l=true}}if(!l){var g=c||'<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>';var m=document.createElement("DIV");m.id="dhxSchedObj_"+new Date().getTime();m.style.width="100%";m.style.height="100%";m.style.position="relative";m.style.overflow="hidden";m.className="dhx_cal_container";m.innerHTML='<div class="dhx_cal_navline"><div class="dhx_cal_prev_button">&nbsp;</div><div class="dhx_cal_next_button">&nbsp;</div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div>'+g+'</div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>'}this._attachObject(m);this.dataType="scheduler";this.dataObj=j;this.dataObj.setSizes=function(){this.update_view()};j.init(m.id,a,n);m=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachMap=function(a){var c=document.createElement("DIV");c.id="GMapsObj_"+this._genStr(12);c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(!a){a={center:new google.maps.LatLng(40.719837,-73.992348),zoom:11,mapTypeId:google.maps.MapTypeId.ROADMAP}}this.dataType="maps";this.dataObj=new google.maps.Map(c,a);this.dataObj.setSizes=function(){google.maps.event.trigger(this,"resize")};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype._createNode_sb=function(n,j,m,a,l){if(typeof(l)!="undefined"){n=l}else{var c=j||{};var o=(typeof(c.text)=="string"&&c.text.length>0?c.text:"&nbsp;");var g=(typeof(c.height)=="number"?c.height:false);var n=document.createElement("DIV");n.className="dhx_cell_statusbar_def";n.innerHTML="<div class='"+(c.paging==true?"dhx_cell_statusbar_paging":"dhx_cell_statusbar_text")+"'>"+o+"</div>";if(g!=false){n.firstChild.style.height=n.firstChild.style.lineHeight=g+"px"}}if(this.conf.idx.pr1!=null){this.cell.insertBefore(n,this.cell.childNodes[this.conf.idx.pr1])}else{this.cell.appendChild(n)}this.conf.ofs_nodes.b.sb=true;this._updateIdx();this._adjustCont(this._idd);return n};dhtmlXCellObject.prototype.attachStatusBar=function(a){if(this.dataNodes.sb){return}if(a!=null&&window.dhx4.s2b(a.paging)==true){a.height=null}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){this.cell.childNodes[this.conf.idx.cont].className+=" dhx_cell_statusbar_attached"}this.dataNodes.sb=this._attachObject("sb",a);this.dataNodes.sb.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sb.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sb.onselectstart=function(c){return false};return this.dataNodes.sb};dhtmlXCellObject.prototype.detachStatusBar=function(){if(!this.dataNodes.sb){return}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){this.cell.childNodes[this.conf.idx.cont].className=this.cell.childNodes[this.conf.idx.cont].className.replace(/\s{0,}dhx_cell_statusbar_attached/,"")}this.dataNodes.sb.setText=this.dataNodes.sb.getText=this.dataNodes.sb.onselectstart=null;this.dataNodes.sb=null;delete this.dataNodes.sb;this._detachObject("sb")};dhtmlXCellObject.prototype.showStatusBar=function(){this._mtbShowHide("sb","")};dhtmlXCellObject.prototype.hideStatusBar=function(){this._mtbShowHide("sb","none")};dhtmlXCellObject.prototype._mtbShowHide=function(c,a){if(!this.dataNodes[c]){return}this.cell.childNodes[this.conf.idx[c]].style.display=a;this._adjustCont()};dhtmlXCellObject.prototype.getFrame=dhtmlXCellObject.prototype._getFrame=function(){if(this.dataType!="url"){return null}return this.cell.childNodes[this.conf.idx.cont].firstChild};dhtmlXCellObject.prototype._genStr=function(){if(!this._genStrId){this._genStrId=new Date().getTime()}return this._genStrId++};dhtmlXCellObject.prototype._attachURLEvents=function(){if(this.dataType!="url"){return}var g=this;var c=this._idd;var a=this.cell.childNodes[this.conf.idx.cont].firstChild;if(typeof(this._doOnFrameMouseDown)!="function"){this._doOnFrameMouseDown=function(j){g.callEvent("_onContentMouseDown",[c,j||event])}}if(typeof(window.addEventListener)=="function"){a.onload=function(){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.addEventListener("mousedown",g._doOnFrameMouseDown,false)}}catch(j){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(j){}}}else{a.onreadystatechange=function(j){if(this.readyState=="complete"){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.attachEvent("onmousedown",g._doOnFrameMouseDown)}}catch(l){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(l){}}}}};dhtmlXCellObject.prototype._doOnFrameContentLoaded=function(){if(this.conf.url_data.post_ifr==true){var m=this.getFrame().contentWindow.document;var l=m.createElement("FORM");l.method="POST";l.action=this.conf.url_data.url;m.body.appendChild(l);var g={};if(window.dhx4.ajax.cache!=true){g["dhxr"+new Date().getTime()]="1"}for(var c in this.conf.url_data.post_data){g[c]=this.conf.url_data.post_data[c]}for(var c in g){var j=m.createElement("INPUT");j.type="hidden";j.name=c;j.value=g[c];l.appendChild(j);j=null}this.conf.url_data.post_ifr=false;l.submit()}else{this.callEvent("_onContentLoaded",[this._idd])}};dhtmlXCellObject.prototype._detachURLEvents=function(a){if(a==null){if(this.dataType!="url"){return}a=this.cell.childNodes[this.conf.idx.cont].firstChild}if(typeof(window.addEventListener)=="function"){a.onload=null;try{a.contentWindow.document.body.removeEventListener("mousedown",this._doOnFrameMouseDown,false)}catch(c){}}else{a.onreadystatechange=null;try{a.contentWindow.document.body.detachEvent("onmousedown",this._doOnFrameMouseDown)}catch(c){}}a=null};dhtmlXCellObject.prototype._attachObject=function(l,c,j,a,g){if(typeof(l)=="string"&&{menu:1,toolbar:1,ribbon:1,sb:1}[l]==1){return this["_createNode_"+l].apply(this,arguments)}if(a!=true){this._detachObject(null,true,null)}if(typeof(j)=="string"){this.cell.childNodes[this.conf.idx.cont].innerHTML=j}else{this.cell.childNodes[this.conf.idx.cont].appendChild(l)}l=null};dhtmlXCellObject.prototype._detachObject=function(l,c,a){this.callEvent("_onBeforeContentDetach",[]);if(l=="menu"||l=="toolbar"||l=="ribbon"||l=="sb"){var j=this.cell.childNodes[this.conf.idx[l]];j.parentNode.removeChild(j);j=null;this.conf.ofs_nodes[l=="sb"?"b":"t"][l]=false;this._updateIdx();if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(c==true){a=false}else{if(typeof(a)=="undefined"){a=document.body}else{if(typeof(a)=="string"){a=document.getElementById(a)}}}if(a===false){if(this.dataType=="url"){this._detachURLEvents()}else{if(this.dataObj!=null){if(typeof(this.dataObj.unload)=="function"){this.dataObj.unload()}else{if(typeof(this.dataObj.destructor)=="function"){this.dataObj.destructor()}}}}}var j=this.cell.childNodes[this.conf.idx.cont];while(j.childNodes.length>0){if(a===false){j.removeChild(j.lastChild)}else{j.firstChild.style.display="none";a.appendChild(j.firstChild)}}if(this.conf.append_mode){j.style.overflow="";this.conf.append_mode=false}var g=(this.dataType=="tabbar");this.dataObj=null;this.dataType=null;a=j=null;if(this.conf.unloading!=true&&g){this.showHeader(true);this._showBorders()}};dhtmlXCellObject.prototype._attachFromCell=function(c){this.detachObject(true);var j="layout";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){j="window"}if(typeof(window.dhtmlXWindowsCell)!="undefined"&&c instanceof window.dhtmlXWindowsCell&&c.wins.w[c._idd].conf.parked){c.wins._winCellSetOpacity(c._idd,"open",false)}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&c instanceof window.dhtmlXAccordionCell&&c.conf.opened==false){c._cellSetOpacity("open",false)}for(var g in c.dataNodes){this._attachObject(g,null,null,null,c.cell.childNodes[c.conf.idx[g]]);this.dataNodes[g]=c.dataNodes[g];c.dataNodes[g]=null;c.conf.ofs_nodes[g=="sb"?"b":"t"][g]=false;c._updateIdx()}this._mtbUpdBorder();if(c.dataType!=null&&c.dataObj!=null){this.dataType=c.dataType;this.dataObj=c.dataObj;while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}c.dataType=null;c.dataObj=null;if(this.dataType=="grid"){if(j=="window"&&this.conf.skin=="dhx_skyblue"){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}}}else{while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}}this.conf.view=c.conf.view;c.conf.view="def";for(var g in c.views){this.views[g]=c.views[g];c.views[g]=null;delete c.views[g]}c._updateIdx();c._adjustCont();this._updateIdx();this._adjustCont();if(c.conf.progress==true){c.progressOff();this.progressOn()}else{this.progressOff()}if(j=="window"&&this.wins.w[this._idd].conf.parked){this.wins._winCellSetOpacity(this._idd,"close",false)}};function dhtmlXCellTop(j,c){if(arguments.length==0||typeof(j)=="undefined"){return}var a=this;this.dataNodes={};this.conf.ofs={t:0,b:0,l:0,r:0};this.conf.ofs_nodes={t:{},b:{}};this.conf.progress=false;this.conf.fs_mode=false;this.conf.fs_tm=null;this.conf.fs_resize=false;if(j==document.body){this.conf.fs_mode=true;this.base=j;if(this.base==document.body){var g={dhx_skyblue:{t:2,b:2,l:2,r:2},dhx_web:{t:8,b:8,l:8,r:8},dhx_terrace:{t:9,b:9,l:8,r:8}};this.conf.ofs=(g[this.conf.skin]!=null?g[this.conf.skin]:g.dhx_skyblue)}}else{this.base=(typeof(j)=="string"?document.getElementById(j):j)}this.base.className+=" "+this.conf.css+"_base_"+this.conf.skin;this.cont=document.createElement("DIV");this.cont.className=this.conf.css+"_cont";this.base.appendChild(this.cont);if(c!=null){this.setOffsets(c,false)}else{if(this.base._ofs!=null){this.setOffsets(this.base._ofs,false);this.base._ofs=null;try{delete this.base._ofs}catch(l){}}}this._adjustCont=function(){var o=this.conf.ofs.t;for(var n in this.conf.ofs_nodes.t){o+=(this.conf.ofs_nodes.t[n]==true?this.dataNodes[n].offsetHeight:0)}var m=this.conf.ofs.b;for(var n in this.conf.ofs_nodes.b){m+=(this.conf.ofs_nodes.b[n]==true?this.dataNodes[n].offsetHeight:0)}this.cont.style.left=this.conf.ofs.l+"px";this.cont.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.cont.style.top=o+"px";this.cont.style.height=this.base.offsetHeight-o-m+"px"};this._setBaseSkin=function(m){this.base.className=this.base.className.replace(new RegExp(this.conf.css+"_base_"+this.conf.skin,"gi"),this.conf.css+"_base_"+m)};this._initFSResize=function(){if(this.conf.fs_resize==true){return}this._doOnResizeStart=function(){window.clearTimeout(a.conf.fs_tm);a.conf.fs_tm=window.setTimeout(a._doOnResizeEnd,200)};this._doOnResizeEnd=function(){a.setSizes()};if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResizeStart,false)}else{window.attachEvent("onresize",this._doOnResizeStart)}this.conf.fs_resize=true};if(this.conf.fs_mode==true){this._initFSResize()}this._unloadTop=function(){this._mtbUnload();this.detachHeader();this.detachFooter();if(this.conf.fs_mode==true){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResizeStart,false)}else{window.detachEvent("onresize",this._doOnResizeStart)}}this.base.removeChild(this.cont);var m=new RegExp("s{0,}"+this.conf.css+"_base_"+this.conf.skin,"gi");this.base.className=this.base.className.replace(m,"");this.cont=this.base=null;a=null};j=null}dhtmlXCellTop.prototype.setOffsets=function(m,l){var j=false;for(var c in m){var g=c.charAt(0);if(typeof(this.conf.ofs[g])!="undefined"&&!isNaN(m[c])){this.conf.ofs[g]=parseInt(m[c]);j=true}}if(l!==false&&typeof(this.setSizes)=="function"&&j==true){this.setSizes()}};dhtmlXCellTop.prototype.attachMenu=function(a){if(this.dataNodes.menu!=null){return}this.dataNodes.menuObj=document.createElement("DIV");this.dataNodes.menuObj.className="dhxcelltop_menu";this.base.insertBefore(this.dataNodes.menuObj,this.dataNodes.toolbarObj||this.dataNodes.ribbonObj||this.cont);if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.menuObj;this.dataNodes.menu=new dhtmlXMenuObject(a);this.dataNodes.menuEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.menuObj.style.display=="none"){return}this.dataNodes.menuObj.style.left=this.conf.ofs.l+"px";this.dataNodes.menuObj.style.marginTop=(this.dataNodes.haObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.menuObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.t.menuObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.menu};dhtmlXCellTop.prototype.detachMenu=function(){if(this.dataNodes.menu==null){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;this.dataNodes.menuObj.parentNode.removeChild(this.dataNodes.menuObj);this.dataNodes.menuObj=null;this.detachEvent(this.dataNodes.menuEv);this.dataNodes.menuEv=null;delete this.dataNodes.menu;delete this.dataNodes.menuObj;delete this.dataNodes.menuEv;this.conf.ofs_nodes.t.menuObj=false;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.toolbarObj=document.createElement("DIV");this.dataNodes.toolbarObj.className="dhxcelltop_toolbar";this.base.insertBefore(this.dataNodes.toolbarObj,this.cont);this.dataNodes.toolbarObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.toolbarObj.firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this.dataNodes.toolbarEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.toolbarObj.style.display=="none"){return}this.dataNodes.toolbarObj.style.left=this.conf.ofs.l+"px";this.dataNodes.toolbarObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.toolbarObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell.setSizes()});this.conf.ofs_nodes.t.toolbarObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.toolbar};dhtmlXCellTop.prototype.detachToolbar=function(){if(this.dataNodes.toolbar==null){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;this.dataNodes.toolbarObj.parentNode.removeChild(this.dataNodes.toolbarObj);this.dataNodes.toolbarObj=null;this.detachEvent(this.dataNodes.toolbarEv);this.dataNodes.toolbarEv=null;this.conf.ofs_nodes.t.toolbarObj=false;delete this.dataNodes.toolbar;delete this.dataNodes.toolbarObj;delete this.dataNodes.toolbarEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.ribbonObj=document.createElement("DIV");this.dataNodes.ribbonObj.className="dhxcelltop_ribbon";this.base.insertBefore(this.dataNodes.ribbonObj,this.cont);this.dataNodes.ribbonObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.ribbonObj.firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);this.dataNodes.ribbonEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.ribbonObj.style.display=="none"){return}this.dataNodes.ribbonObj.style.left=this.conf.ofs.l+"px";this.dataNodes.ribbonObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.ribbonObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.dataNodes.ribbon.setSizes()});this.conf.ofs_nodes.t.ribbonObj=true;var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c.setSizes()});this.setSizes();a.parnt=null;a=null;return this.dataNodes.ribbon};dhtmlXCellTop.prototype.detachRibbon=function(){if(this.dataNodes.ribbon==null){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;this.dataNodes.ribbonObj.parentNode.removeChild(this.dataNodes.ribbonObj);this.dataNodes.ribbonObj=null;this.detachEvent(this.dataNodes.ribbonEv);this.dataNodes.ribbonEv=null;this.conf.ofs_nodes.t.ribbonObj=false;delete this.dataNodes.ribbon;delete this.dataNodes.ribbonObj;delete this.dataNodes.ribbonEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachStatusBar=function(a){if(this.dataNodes.sbObj){return}if(typeof(a)=="undefined"){a={}}this.dataNodes.sbObj=document.createElement("DIV");this.dataNodes.sbObj.className="dhxcelltop_statusbar";if(this.cont.nextSibling!=null){this.base.insertBefore(this.dataNodes.sbObj,this.cont.nextSibling)}else{this.base.appendChild(this.dataNodes.sbObj)}this.dataNodes.sbObj.innerHTML="<div class='dhxcont_statusbar'>"+(typeof(a.text)=="string"&&a.text.length>0?a.text:"&nbsp;")+"</div>";if(typeof(a.height)=="number"){this.dataNodes.sbObj.firstChild.style.height=this.dataNodes.sbObj.firstChild.style.lineHeight=a.height+"px"}this.dataNodes.sbObj.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sbObj.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sbObj.onselectstart=function(c){return false};this.dataNodes.sbEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.sbObj.style.display=="none"){return}this.dataNodes.sbObj.style.left=this.conf.ofs.l+"px";this.dataNodes.sbObj.style.bottom=(this.dataNodes.faObj!=null?this.dataNodes.faObj.offsetHeight:0)+this.conf.ofs.t+"px";this.dataNodes.sbObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.b.sbObj=true;this.setSizes();return this.dataNodes.sbObj};dhtmlXCellTop.prototype.detachStatusBar=function(){if(!this.dataNodes.sbObj){return}this.dataNodes.sbObj.setText=this.dataNodes.sbObj.getText=this.dataNodes.sbObj.onselectstart=null;this.dataNodes.sbObj.parentNode.removeChild(this.dataNodes.sbObj);this.dataNodes.sbObj=null;this.detachEvent(this.dataNodes.sbEv);this.dataNodes.sbEv=null;this.conf.ofs_nodes.b.sbObj=false;delete this.dataNodes.sb;delete this.dataNodes.sbObj;delete this.dataNodes.sbEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.showMenu=function(){this._mtbShowHide("menuObj","")};dhtmlXCellTop.prototype.hideMenu=function(){this._mtbShowHide("menuObj","none")};dhtmlXCellTop.prototype.showToolbar=function(){this._mtbShowHide("toolbarObj","")};dhtmlXCellTop.prototype.hideToolbar=function(){this._mtbShowHide("toolbarObj","none")};dhtmlXCellTop.prototype.showRibbon=function(){this._mtbShowHide("ribbonObj","")};dhtmlXCellTop.prototype.hideRibbon=function(){this._mtbShowHide("ribbonObj","none")};dhtmlXCellTop.prototype.showStatusBar=function(){this._mtbShowHide("sbObj","")};dhtmlXCellTop.prototype.hideStatusBar=function(){this._mtbShowHide("sbObj","none")};dhtmlXCellTop.prototype._mtbShowHide=function(c,a){if(this.dataNodes[c]==null){return}this.dataNodes[c].style.display=a;this.setSizes()};dhtmlXCellTop.prototype._mtbUnload=function(c,a){this.detachMenu();this.detachToolbar();this.detachStatusBar();this.detachRibbon()};dhtmlXCellTop.prototype.getAttachedMenu=function(){return this.dataNodes.menu};dhtmlXCellTop.prototype.getAttachedToolbar=function(){return this.dataNodes.toolbar};dhtmlXCellTop.prototype.getAttachedRibbon=function(){return this.dataNodes.ribbon};dhtmlXCellTop.prototype.getAttachedStatusBar=function(){return this.dataNodes.sbObj};dhtmlXCellTop.prototype.progressOn=function(){if(this.conf.progress){return}this.conf.progress=true;var c=document.createElement("DIV");c.className="dhxcelltop_progress";this.base.appendChild(c);var a=document.createElement("DIV");a.className="dhxcelltop_progress_img";this.base.appendChild(a);c=a=null};dhtmlXCellTop.prototype.progressOff=function(){if(!this.conf.progress){return}var j={dhxcelltop_progress:true,dhxcelltop_progress_img:true};for(var g=0;g<this.base.childNodes.length;g++){if(typeof(this.base.childNodes[g].className)!="undefined"&&j[this.base.childNodes[g].className]==true){j[this.base.childNodes[g].className]=this.base.childNodes[g]}}for(var c in j){if(j[c]!=true){this.base.removeChild(j[c])}j[c]=null}this.conf.progress=false;j=null};dhtmlXCellTop.prototype.attachHeader=function(c,a){if(this.dataNodes.haObj!=null){return}if(typeof(c)!="object"){c=document.getElementById(c)}this.dataNodes.haObj=document.createElement("DIV");this.dataNodes.haObj.className="dhxcelltop_hdr";this.dataNodes.haObj.style.height=(a||c.offsetHeight)+"px";this.base.insertBefore(this.dataNodes.haObj,this.dataNodes.menuObj||this.dataNodes.toolbarObj||this.cont);this.dataNodes.haObj.appendChild(c);c.style.visibility="visible";c=null;this.dataNodes.haEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.haObj.style.left=this.conf.ofs.l+"px";this.dataNodes.haObj.style.marginTop=this.conf.ofs.t+"px";this.dataNodes.haObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.t.haObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachHeader=function(){if(!this.dataNodes.haObj){return}while(this.dataNodes.haObj.childNodes.length>0){this.dataNodes.haObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.haObj.lastChild)}this.dataNodes.haObj.parentNode.removeChild(this.dataNodes.haObj);this.dataNodes.haObj=null;this.detachEvent(this.dataNodes.haEv);this.dataNodes.haEv=null;this.conf.ofs_nodes.t.haObj=false;delete this.dataNodes.haEv;delete this.dataNodes.haObj;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachFooter=function(g,a){if(this.dataNodes.faObj!=null){return}if(typeof(g)!="object"){g=document.getElementById(g)}this.dataNodes.faObj=document.createElement("DIV");this.dataNodes.faObj.className="dhxcelltop_ftr";this.dataNodes.faObj.style.height=(a||g.offsetHeight)+"px";var c=(this.dataNodes.sbObj||this.cont);if(this.base.lastChild==c){this.base.appendChild(this.dataNodes.faObj)}else{this.base.insertBefore(this.dataNodes.faObj,c.nextSibling)}this.dataNodes.faEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.faObj.style.left=this.conf.ofs.l+"px";this.dataNodes.faObj.style.bottom=this.conf.ofs.b+"px";this.dataNodes.faObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.faObj.appendChild(g);g.style.visibility="visible";c=g=null;this.conf.ofs_nodes.b.faObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachFooter=function(){if(!this.dataNodes.faObj){return}while(this.dataNodes.faObj.childNodes.length>0){this.dataNodes.faObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.faObj.lastChild)}this.dataNodes.faObj.parentNode.removeChild(this.dataNodes.faObj);this.dataNodes.faObj=null;this.detachEvent(this.dataNodes.faEv);this.dataNodes.faEv=null;this.conf.ofs_nodes.b.faObj=false;delete this.dataNodes.faEv;delete this.dataNodes.faObj;if(!this.conf.unloading){this.setSizes()}};function dhtmlXCalendarObject(m,u){this.i={};var g=null;if(typeof(m)=="string"){var j=document.getElementById(m)}else{var j=m}if(j&&typeof(j)=="object"&&j.tagName&&String(j.tagName).toLowerCase()!="input"){g=j}j=null;if(typeof(m)!="object"||!m.length){m=[m]}for(var c=0;c<m.length;c++){if(typeof(m[c])=="string"){m[c]=(document.getElementById(m[c])||null)}if(m[c]!=null&&m[c].tagName&&String(m[c].tagName).toLowerCase()=="input"){this.i[window.dhx4.newId()]={input:m[c]}}else{if(!(m[c] instanceof Array)&&m[c] instanceof Object&&(m[c].input!=null||m[c].button!=null)){if(m[c].input!=null&&typeof(m[c].input)=="string"){m[c].input=document.getElementById(m[c].input)}if(m[c].button!=null&&typeof(m[c].button)=="string"){m[c].button=document.getElementById(m[c].button)}this.i[window.dhx4.newId()]=m[c]}}m[c]=null}this.conf={skin:(u||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhtmlxcalendar")||"dhx_skyblue"),zi:window.dhx4.newId(),touch:!window.dhx4.isIE,ws_first:true};this.setSkin=function(q,a){if(this.conf.skin==q&&!a){return}this.conf.skin=q;this.base.className="dhtmlxcalendar_"+this.conf.skin;this._ifrSize()};this.base=document.createElement("DIV");this.base.style.display="none";this.base.appendChild(document.createElement("DIV"));if(g!=null){this._hasParent=true;g.appendChild(this.base);g=null}else{document.body.appendChild(this.base)}this.setParent=function(a){if(this._hasParent){if(typeof(a)=="object"){a.appendChild(this.base)}else{if(typeof(a)=="string"){document.getElementById(a).appendChild(this.base)}}}};this.setSkin(this.conf.skin,true);this.base.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}a.cancelBubble=true};this.base.onmousedown=function(){return false};if(this.conf.touch){this.base.ontouchstart=this.base.onclick}this.loadUserLanguage=function(y){if(!this.langData[y]){return}this.lang=y;this.setWeekStartDay(this.langData[this.lang].weekstart);this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");if(this.msCont){var x=0;for(var v=0;v<this.msCont.childNodes.length;v++){for(var a=0;a<this.msCont.childNodes[v].childNodes.length;a++){this.msCont.childNodes[v].childNodes[a].innerHTML=this.langData[this.lang].monthesSNames[x++]}}}};this.contMonth=document.createElement("DIV");this.contMonth.className="dhtmlxcalendar_month_cont";this.contMonth.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.firstChild.appendChild(this.contMonth);var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contMonth.appendChild(n);var s=document.createElement("LI");s.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";s.innerHTML="<div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left\";'></div><span></span><div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right\";'></div>";n.appendChild(s);var l=this;s.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}var q=(w.target||w.srcElement);if(q.className&&q.className.indexOf("dhtmlxcalendar_month_arrow")===0){l._hideSelector();var v=(q.parentNode.firstChild==q?-1:1);var a=new Date(l._activeMonth);l._drawMonth(new Date(l._activeMonth.getFullYear(),l._activeMonth.getMonth()+v,1,0,0,0,0));l._evOnArrowClick([a,new Date(l._activeMonth)]);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_month"){w.cancelBubble=true;l._showSelector("month",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_month",true);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_year"){w.cancelBubble=true;l._showSelector("year",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_year",true);return}l._hideSelector()};if(this.conf.touch==true){s.ontouchstart=s.onclick}this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.firstChild.appendChild(this.contDays);this.setWeekStartDay=function(a){if(a==0){a=7}this._wStart=Math.min(Math.max((isNaN(a)?1:a),1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var y=document.createElement("UL");y.className="dhtmlxcalendar_line";this.contDays.appendChild(y)}else{var y=this.contDays.firstChild}var v=this._wStart;var x=this.langData[this.lang].daysSNames;x.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var A=0;A<8;A++){if(y.childNodes[A]==null){var a=document.createElement("LI");y.appendChild(a)}else{var a=y.childNodes[A]}if(A==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="<div class='dhtmlxcalendar_label'>"+(this.langData[this.lang].weekname||"w")+"</div>"}else{a.className="dhtmlxcalendar_cell"+(v>=6?" dhtmlxcalendar_day_weekday_cell":"")+(A==1?"_first":"");a.innerHTML=x[v];if(++v>7){v=1}}}if(this._activeMonth!=null){this._drawMonth(this._activeMonth)}};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.firstChild.appendChild(this.contDates);this.contDates.onclick=function(y){y=y||event;if(y.type=="touchstart"&&y.preventDefault!=null){y.preventDefault()}var q=(y.target||y.srcElement);if(q.parentNode!=null&&q.parentNode._date!=null){q=q.parentNode}if(q._date!=null&&!q._css_dis){var w=l._activeDate.getHours();var v=l._activeDate.getMinutes();var x=q._date;if(l.checkEvent("onBeforeChange")){if(!l.callEvent("onBeforeChange",[new Date(q._date.getFullYear(),q._date.getMonth(),q._date.getDate(),w,v)])){return}}if(l._activeDateCell!=null){l._activeDateCell._css_date=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w)}var a=(l._activeDate.getFullYear()+"_"+l._activeDate.getMonth()!=x.getFullYear()+"_"+x.getMonth());l._nullDate=false;l._activeDate=new Date(x.getFullYear(),x.getMonth(),x.getDate(),w,v);l._activeDateCell=q;l._activeDateCell._css_date=true;l._activeDateCell._css_hover=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w);if(a){l._drawMonth(l._activeDate)}if(l._activeInp&&l.i[l._activeInp]&&l.i[l._activeInp].input!=null){l.i[l._activeInp].input.value=l._dateToStr(new Date(l._activeDate.getTime()))}if(!l._hasParent){if(y.type=="touchstart"){window.setTimeout(function(){l._hide()},400)}else{l._hide()}}l._evOnClick([new Date(l._activeDate.getTime())])}};if(this.conf.touch==true){this.contDates.ontouchstart=this.contDates.onclick}this.contDates.onmouseover=function(q){q=q||event;var a=(q.target||q.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(l._lastHover==a||a._css_hover){return}a._css_hover=true;l._updateCellStyle(a._q,a._w);l._lastHover=a;l._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),q]);a=null}};this.contDates.onmouseout=function(a){l._clearDayHover(a||event)};this._lastHover=null;this._clearDayHover=function(a){if(!this._lastHover){return}this._lastHover._css_hover=false;this._updateCellStyle(this._lastHover._q,this._lastHover._w);l._evOnMouseOut([new Date(this._lastHover._date.getFullYear(),this._lastHover._date.getMonth(),this._lastHover._date.getDate(),0,0,0,0),a]);this._lastHover=null};for(var c=0;c<6;c++){var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contDates.appendChild(n);for(var r=0;r<=7;r++){var s=document.createElement("LI");if(r==0){s.className="dhtmlxcalendar_cell_wn"}else{s.className="dhtmlxcalendar_cell"}n.appendChild(s)}}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.base.firstChild.appendChild(this.contTime);this.showTime=function(){this.contTime.style.display="";this._ifrSize()};this.hideTime=function(){this.contTime.style.display="none";this._ifrSize()};var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contTime.appendChild(n);var s=document.createElement("LI");s.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";s.innerHTML="<div class='dhtmlxcalendar_time_img'></div><span class='dhtmlxcalendar_label_hours'></span><span class='dhtmlxcalendar_label_colon'> : </span><span class='dhtmlxcalendar_label_minutes'></span>";n.appendChild(s);s.onclick=function(v){v=v||event;if(v.type=="touchstart"&&v.preventDefault!=null){v.preventDefault()}var a=(v.target||v.srcElement);if(a.tagName!=null&&a.tagName.toLowerCase()=="span"&&a._par==true&&a.parentNode!=null){a=a.parentNode}if(a.className&&a.className=="dhtmlxcalendar_label_hours"){v.cancelBubble=true;var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){v.cancelBubble=true;if(l._minutesInterval==1){var w=l.getFormatedDate("%i");a.innerHTML="<span class='dhtmlxcalendar_selected_date'>"+w.charAt(0)+"</span>"+w.charAt(1);a.firstChild._par=true;l._selectorMode=1}var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_minutes",true);return}l._hideSelector()};if(this.conf.touch==true){s.ontouchstart=s.onclick}this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(q){window.dhx4.temp_calendar={tz:null};this._nullDate=(typeof(q)=="undefined"||q===""||!q);if(!(q instanceof Date)){q=this._strToDate(String(q||""));if(q=="Invalid Date"){q=new Date()}else{this.conf.tz=window.dhx4.temp_calendar.tz}window.dhx4.temp_calendar=null}if(this.conf.tz==null){this.conf.tz=window.dhx4.date2str(q,"%P")}var a=q.getTime();if(this._isOutOfRange(a)){return}this._activeDate=new Date(a);this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleHours();this._updateVisibleMinutes()};this.getDate=function(v){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(v){window.dhx4.temp_calendar={tz:this.conf.tz};var q=this._dateToStr(a);window.dhx4.temp_calendar=null;return q}return a};this._drawMonth=function(H){if(!(H instanceof Date)){return}if(isNaN(H.getFullYear())){H=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(H.getFullYear(),H.getMonth(),1,0,0,0,0);this._activeDateCell=null;var E=new Date(this._activeMonth.getTime());var x=E.getDay();var K=x-this._wStart;if(K<0){K=K+7}E.setDate(E.getDate()-K);var N=H.getMonth();var O=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var C=0;for(var v=0;v<6;v++){var F=this._wStart;for(var M=0;M<=7;M++){if(M==0){var L=this.getWeekNumber(new Date(E.getFullYear(),E.getMonth(),E.getDate()+C,0,0,0,0));if(L>=52&&this.conf.ws_first==true&&this._activeMonth.getMonth()==0){var A=this.getWeekNumber(new Date(E.getFullYear(),E.getMonth(),E.getDate()+C+7,0,0,0,0));if(A<L&&A>1){L=1}}this.contDates.childNodes[v].childNodes[M].innerHTML="<div class='dhtmlxcalendar_label'>"+L+"</div>"}else{var a=new Date(E.getFullYear(),E.getMonth(),E.getDate()+C,0,0,0,0);if(a.getHours()!=0){var D=(a.getHours()>12?24-a.getHours():a.getHours());a.setTime(a.getTime()+60*60*1000*D)}var J=a.getDay();var y=a.getTime();var I="dhtmlxcalendar_label";if(this._tipData[y]!=null){if(this._tipData[y].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[v].childNodes[M].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[v].childNodes[M].setAttribute("title",this._tipData[y].text)}if(this._tipData[y].showIcon){I+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[v].childNodes[M].removeAttribute("title")}this.contDates.childNodes[v].childNodes[M].innerHTML="<div class='"+I+"'>"+a.getDate()+"</div>";this.contDates.childNodes[v].childNodes[M]._date=new Date(y);this.contDates.childNodes[v].childNodes[M]._q=v;this.contDates.childNodes[v].childNodes[M]._w=M;this.contDates.childNodes[v].childNodes[M]._css_month=(a.getMonth()==N);this.contDates.childNodes[v].childNodes[M]._css_date=(!this._nullDate&&y==O);this.contDates.childNodes[v].childNodes[M]._css_weekend=(F>=6);this.contDates.childNodes[v].childNodes[M]._css_dis=this._isOutOfRange(y);this.contDates.childNodes[v].childNodes[M]._css_holiday=(this._holidays[y]==true);this._updateCellStyle(v,M);if(y==O){this._activeDateCell=this.contDates.childNodes[v].childNodes[M]}if(++F>7){F=1}C++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(H)};this._updateCellStyle=function(y,a){var x=this.contDates.childNodes[y].childNodes[a];var v="dhtmlxcalendar_cell dhtmlxcalendar_cell";v+=(x._css_month?"_month":"");v+=(x._css_date?"_date":"");v+=(x._css_weekend?"_weekend":"");v+=(x._css_holiday?"_holiday":"");v+=(x._css_dis?"_dis":"");v+=(x._css_hover&&!x._css_dis?"_hover":"");x.className=v;x=null};this._minutesInterval=5;this._initSelector=function(E,y){if(!this._selCover){this._selCover=document.createElement("DIV");this._selCover.className="dhtmlxcalendar_selector_cover";this.base.firstChild.appendChild(this._selCover)}if(!this._sel){this._sel=document.createElement("DIV");this._sel.className="dhtmlxcalendar_selector_obj";this.base.firstChild.appendChild(this._sel);this._sel.appendChild(document.createElement("TABLE"));this._sel.firstChild.className="dhtmlxcalendar_selector_table";this._sel.firstChild.cellSpacing=0;this._sel.firstChild.cellPadding=0;this._sel.firstChild.border=0;this._sel.firstChild.appendChild(document.createElement("TBODY"));this._sel.firstChild.firstChild.appendChild(document.createElement("TR"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.childNodes[0].className="dhtmlxcalendar_selector_cell_left";this._sel.firstChild.firstChild.firstChild.childNodes[1].className="dhtmlxcalendar_selector_cell_middle";this._sel.firstChild.firstChild.firstChild.childNodes[2].className="dhtmlxcalendar_selector_cell_right";this._sel.firstChild.firstChild.firstChild.childNodes[0].innerHTML="&nbsp;";this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML="&nbsp;";this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_left"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"};this._sel.onmouseover=function(w){w=w||event;var q=(w.target||w.srcElement);if(q._cell===true){if(l._selHover!=q){l._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";l._selHover=q}}};this._sel.onmouseout=function(){l._clearSelHover()};this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;l._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;l._scrollYears(1)};if(this.conf.touch==true){this._sel.firstChild.firstChild.firstChild.childNodes[0].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick;this._sel.firstChild.firstChild.firstChild.childNodes[2].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick}this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[E]==true){return}if(E=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.innerHTML=this.langData[this.lang].monthesSNames[v];H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._month=v;H._cell=true;this._msCells[v++]=H}}this.msCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){l._hideSelector();l._updateActiveMonth();l._drawMonth(new Date(l._activeMonth.getFullYear(),q._month,1,0,0,0,0));l._doOnSelectorChange()}};if(this.conf.touch==true){this.msCont.ontouchstart=this.msCont.onclick}}if(E=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.className="dhtmlxcalendar_selector_cell";H._cell=true;D.appendChild(H)}}this.ysCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){l._hideSelector();l._drawMonth(new Date(q._year,l._activeMonth.getMonth(),1,0,0,0,0));l._doOnSelectorChange()}};if(this.conf.touch==true){this.ysCont.ontouchstart=this.ysCont.onclick}}if(E=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(D);for(var F=0;F<6;F++){var H=document.createElement("LI");H.innerHTML=this._fixLength(v,2);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._hours=v;H._cell=true;this._hsCells[v++]=H}}this.hsCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){l._hideSelector();l._activeDate.setHours(q._hours);l._updateActiveHours();l._updateVisibleHours();l._doOnSelectorChange();l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())])}};if(this.conf.touch==true){this.hsCont.ontouchstart=this.hsCont.onclick}}if(E=="minutes"){var C=4;var x=3;var A=2;if(this._minutesInterval==1){if(this._selectorMode==1){C=2;x=3;A=1}else{C=2;x=5;A=1;y+="5"}}if(this._minutesInterval==10){C=2}if(this._minutesInterval==15){C=1;x=4;y+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var v=0;for(var a=0;a<C;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(D);for(var F=0;F<x;F++){var H=document.createElement("LI");H.innerHTML=(A>1?this._fixLength(v,A):v);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._minutes=v;H._cell=true;this._rsCells[v]=H;v+=this._minutesInterval}}this.rsCont.onclick=function(I){I=I||event;if(I.type=="touchstart"&&I.preventDefault!=null){I.preventDefault()}I.cancelBubble=true;var w=(I.target||I.srcElement);if(w._minutes!=null){if(l._minutesInterval==1){var q=l.getFormatedDate("%i");if(l._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}l._activeDate.setMinutes(Number(q));l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())]);l._hideSelector();if(l._selectorMode==1){l._updateVisibleMinutes(true);l._selectorMode=2;l._showSelector("minutes",l._sel._x,l._sel._y,"selector_minutes",true);l._updateActiveMinutes();return}else{l._selectorMode=1}}else{l._hideSelector();l._activeDate.setMinutes(w._minutes);l._updateActiveMinutes();l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())])}l._updateVisibleMinutes();l._doOnSelectorChange()}};if(this.conf.touch==true){this.rsCont.ontouchstart=this.rsCont.onclick}}this._sel._ta[E]=true};this._showSelector=function(A,q,C,w,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&A==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){q+=12}if(!this._sel||!this._sel._ta[A]){this._initSelector(A,w)}if(A!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=q;this._sel._y=C;this._sel.style.visibility="hidden";this._sel.style.display="";this._selCover.style.width=this.base.offsetWidth-2+"px";this._selCover.style.top=this.contMonth.offsetHeight+"px";this._selCover.style.height=this.contDates.offsetHeight+this.contDays.offsetHeight-1+"px";this._selCover.style.display="";this._sel._t=A;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+w;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(A=="year"?"":"none");var v=Math.max(0,q-Math.round(this._sel.offsetWidth/2));if(v+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){v=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=v+"px";if(A=="hours"||A=="minutes"){this._sel.style.top=C-this._sel.offsetHeight+"px"}else{this._sel.style.top=C+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(A)};this._doOnSelectorShow=function(a){if(a=="month"){this._updateActiveMonth()}if(a=="year"){this._updateYearsList(this._activeMonth)}if(a=="hours"){this._updateActiveHours()}if(a=="minutes"){this._updateActiveMinutes()}};this._hideSelector=function(a){if(!this._sel){return}this._sel.style.display="none";this._sel.style.visible="hidden";this._selCover.style.display="none";if(this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i");this._unloadSelector("minutes")}};this._isSelectorVisible=function(){if(!this._sel){return false}return(this._sel.style.display!="none")};this._doOnSelectorChange=function(a){this.callEvent("onChange",[new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),this._activeDate.getMinutes(),this._activeDate.getSeconds()),a===true])};this._clearSelHover=function(){if(!this._selHover){return}this._selHover.className=String(this._selHover.className.replace(/dhtmlxcalendar_selector_cell_hover/gi,""));this._selHover=null};this._unloadSelector=function(v){if(!this._sel){return}if(!this._sel._ta[v]){return}if(v=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var q in this._msCells){this._msCells[q]._cell=null;this._msCells[q]._month=null;this._msCells[q].parentNode.removeChild(this._msCells[q]);this._msCells[q]=null}this._msCells=null;while(this.msCont.childNodes.length>0){this.msCont.removeChild(this.msCont.lastChild)}this.msCont.parentNode.removeChild(this.msCont);this.msCont=null}if(v=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var q in this._ysCells){this._ysCells[q]._cell=null;this._ysCells[q]._year=null;this._ysCells[q].parentNode.removeChild(this._ysCells[q]);this._ysCells[q]=null}this._ysCells=null;while(this.ysCont.childNodes.length>0){this.ysCont.removeChild(this.ysCont.lastChild)}this.ysCont.parentNode.removeChild(this.ysCont);this.ysCont=null}if(v=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var q in this._hsCells){this._hsCells[q]._cell=null;this._hsCells[q]._hours=null;this._hsCells[q].parentNode.removeChild(this._hsCells[q]);this._hsCells[q]=null}this._hsCells=null;while(this.hsCont.childNodes.length>0){this.hsCont.removeChild(this.hsCont.lastChild)}this.hsCont.parentNode.removeChild(this.hsCont);this.hsCont=null}if(v=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var q in this._rsCells){this._rsCells[q]._cell=null;this._rsCells[q]._minutes=null;this._rsCells[q].parentNode.removeChild(this._rsCells[q]);this._rsCells[q]=null}this._rsCells=null;while(this.rsCont.childNodes.length>0){this.rsCont.removeChild(this.rsCont.lastChild)}this.rsCont.parentNode.removeChild(this.rsCont);this.rsCont=null}this._sel._ta[v]=null};this.setMinutesInterval=function(a){if(!(a==1||a==5||a==10||a==15)){return}this._minutesInterval=a;this._unloadSelector("minutes")};this._updateActiveMonth=function(){if(typeof(this._msActive)!="undefined"&&typeof(this._msCells[this._msActive])!="undefined"){this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell"}this._msActive=this._activeMonth.getMonth();this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateActiveYear=function(){var a=this._activeMonth.getFullYear();if(this._ysCells[a]){this._ysCells[a].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateYearsList=function(C){for(var x in this._ysCells){this._ysCells[x]=null;delete this._ysCells[x]}var y=12*Math.floor(C.getFullYear()/12);for(var A=0;A<4;A++){for(var v=0;v<3;v++){this.ysCont.childNodes[A].childNodes[v].innerHTML=y;this.ysCont.childNodes[A].childNodes[v]._year=y;this.ysCont.childNodes[A].childNodes[v].className="dhtmlxcalendar_selector_cell";this._ysCells[y++]=this.ysCont.childNodes[A].childNodes[v]}}this._updateActiveYear()};this._scrollYears=function(a){var v=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var q=new Date(v,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(q)};this._updateActiveHours=function(){if(typeof(this._hsActive)!="undefined"&&typeof(this._hsCells[this._hsActive])!="undefined"){this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell"}this._hsActive=this._activeDate.getHours();this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleHours=function(){this.contTime.firstChild.firstChild.childNodes[1].innerHTML=this._fixLength(this._activeDate.getHours(),2)};this._updateActiveMinutes=function(){if(this._rsActive!=null&&typeof(this._rsActive)!="undefined"&&typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell"}if(this._minutesInterval==1){this._rsActive=(this.getFormatedDate("%i").toString()).charAt(this._selectorMode==1?0:1)}else{this._rsActive=this._activeDate.getMinutes()}if(typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateVisibleMinutes=function(q){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(q==true){a=a.charAt(0)+"<span class='dhtmlxcalendar_selected_date'>"+a.charAt(1)+"</span>"}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(q==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,q){while(String(a).length<q){a="0"+String(a)}return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(x){var w={};if(this._strToDate!=null){for(var q in this.i){if(this.i[q].input!=null&&this.i[q].input.value.length>0){var y=this._strToDate(this.i[q].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(y instanceof Date){w[q]=y}}}}this._dateFormat=x;var v=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var A=a.replace(/%/,"");switch(A){case"n":case"h":case"j":case"g":case"G":return"\\d{1,2}";case"m":case"d":case"H":case"i":case"s":case"y":return"\\d{2}";case"Y":return"\\d{4}";case"M":return"("+l.langData[l.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+l.langData[l.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM";case"u":return"\\d{1,6}";case"P":return"[\\+\\-]\\d{1,2}\\:\\d{1,2}"}return a});this._dateFormatRE=new RegExp(v,"i");for(var q in w){this.i[q].input.value=this._dateToStr(w[q])}w=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._updateDateStr=function(q){if(!this._dateFormatRE||!q.match(this._dateFormatRE)){return}if(q==this.getFormatedDate()){return}var a=this._strToDate(q);if(!(a instanceof Date)){return}if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this._nullDate=false;this._activeDate=a;this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleMinutes();this._updateVisibleHours();if(this._sel&&this._isSelectorVisible()){this._doOnSelectorShow(this._sel._t)}this._doOnSelectorChange(true)};this.showMonth=function(a){if(typeof(a)=="string"){a=this._strToDate(a)}if(!(a instanceof Date)){return}this._drawMonth(a)};this.setFormatedDate=function(x,y,q,w){var v=this._strToDate(y,x);if(w){return v}this.setDate(v)};this.getFormatedDate=function(q,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,q)};this.getWeekNumber=function(y){if(typeof(y)=="string"){y=this._strToDate(y)}if(!(y instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var H=this._wStart;var x=H+7;var F=4;var v=new Date(y.getFullYear(),0,1,0,0,0,0);var w=v.getDay();if(w==0){w=7}if(F<H){F+=7;w+=7}var D=0;if(w>=H&&w<=F){}else{D=1}var C=w-H;var E=new Date(y.getFullYear(),0,1-C+D*7,0,0,0,0);var J=604800000;var q=new Date(y.getFullYear(),y.getMonth(),y.getDate()+1,0,0,0,0);var I=Math.ceil((q.getTime()-E.getTime())/J);if(I==0){var A=new Date(y.getFullYear(),y.getMonth(),y.getDate(),0,0,0,0);var a=A.getDay()-this._wStart;if(a<0){a=a+7}A.setDate(A.getDate()-a);I=this.getWeekNumber(A)}return I};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(v){if(!v&&this._hasParent){this._show();return}if(typeof(v)=="object"&&typeof(v._dhtmlxcalendar_uid)!="undefined"&&this.i[v._dhtmlxcalendar_uid]==v){this._show(v._dhtmlxcalendar_uid);return}if(typeof(v)=="undefined"){for(var q in this.i){if(!v){v=q}}}if(!v){return}this._show(v)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,q){this._px=null;this._py=null;if(a=="right"||a=="bottom"){this.pos=a}else{this.pos="int";if(typeof(a)!="undefined"&&!isNaN(a)){this.base.style.left=a+"px";this._px=a}if(typeof(q)!="undefined"&&!isNaN(q)){this.base.style.top=q+"px";this._py=q}this._ifrSize()}};this._show=function(A,a){if(a===true&&this._activeInp==A&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!A){if(this._px&&this._py){this.base.style.left=this._px+"px";this.base.style.top=this._py+"px"}else{this.base.style.left="0px";this.base.style.top="0px"}}else{if(this.base.className.indexOf("dhtmlxcalendar_in_input")==-1){this.base.className+=" dhtmlxcalendar_in_input"}var w=(this.i[A].input||this.i[A].button);var q=(navigator.appVersion.indexOf("MSIE")!=-1);var x=Math.max((q?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var v=x+(q?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);if(this.pos=="right"){this.base.style.left=this._getLeft(w)+w.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(w),v-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var y=this._getTop(w)+w.offsetHeight+1;if(y+this.base.offsetHeight>v){y=this._getTop(w)-this.base.offsetHeight}this.base.style.left=this._getLeft(w)+"px";this.base.style.top=y+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=A;w=null}this._hideSelector();this.base.style.visibility="visible";this.base.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this._ifrSize();if(this._ifr){this._ifr.style.display=""}this.callEvent("onShow",[])};this._hide=function(){this._hideSelector();this.base.style.display="none";window.dhx4.zim.clear(this.conf.zi);if(this.base.className.indexOf("dhtmlxcalendar_in_input")>=0){this.base.className=this.base.className.replace(/\s{0,}dhtmlxcalendar_in_input/gi,"")}this._activeInp=null;if(this._ifr){this._ifr.style.display="none"}this.callEvent("onHide",[])};this._isVisible=function(){return(this.base.style.display!="none")};this._getLeft=function(a){return this._posGetOffset(a).left};this._getTop=function(a){return this._posGetOffset(a).top};this._posGetOffsetSum=function(a){var v=0,q=0;while(a){v=v+parseInt(a.offsetTop);q=q+parseInt(a.offsetLeft);a=a.offsetParent}return{top:v,left:q}};this._posGetOffsetRect=function(w){var A=w.getBoundingClientRect();var C=document.body;var q=document.documentElement;var a=window.pageYOffset||q.scrollTop||C.scrollTop;var x=window.pageXOffset||q.scrollLeft||C.scrollLeft;var y=q.clientTop||C.clientTop||0;var D=q.clientLeft||C.clientLeft||0;var E=A.top+a-y;var v=A.left+x-D;return{top:Math.round(E),left:Math.round(v)}};this._posGetOffset=function(a){return this[a.getBoundingClientRect?"_posGetOffsetRect":"_posGetOffsetSum"](a)};this._rangeActive=false;this._rangeFrom=null;this._rangeTo=null;this._rangeSet={};this.setInsensitiveDays=function(w){var a=this._extractDates(w);for(var v=0;v<a.length;v++){this._rangeSet[new Date(a[v].getFullYear(),a[v].getMonth(),a[v].getDate(),0,0,0,0).getTime()]=true}this._drawMonth(this._activeMonth)};this.clearInsensitiveDays=function(){this._clearRangeSet();this._drawMonth(this._activeMonth)};this._holidays={};this.setHolidays=function(v){if(v==null){this._clearHolidays()}else{if(v!=null){var a=this._extractDates(v);for(var w=0;w<a.length;w++){this._holidays[new Date(a[w].getFullYear(),a[w].getMonth(),a[w].getDate(),0,0,0,0).getTime()]=true}}}this._drawMonth(this._activeMonth)};this._extractDates=function(x){if(typeof(x)=="string"||x instanceof Date){x=[x]}var v=[];for(var y=0;y<x.length;y++){if(typeof(x[y])=="string"){var A=x[y].split(",");for(var a=0;a<A.length;a++){v.push(this._strToDate(A[a]))}}else{if(x[y] instanceof Date){v.push(x[y])}}}return v};this._clearRange=function(){this._rangeActive=false;this._rangeType=null;this._rangeFrom=null;this._rangeTo=null};this._clearRangeSet=function(){for(var q in this._rangeSet){this._rangeSet[q]=null;delete this._rangeSet[q]}};this._clearHolidays=function(){for(var q in this._holidays){this._holidays[q]=null;delete this._holidays[q]}};this._isOutOfRange=function(q){if(this._rangeSet[q]==true){return true}if(this._rangeActive){if(this._rangeType=="in"&&(q<this._rangeFrom||q>this._rangeTo)){return true}if(this._rangeType=="out"&&(q>=this._rangeFrom&&q<=this._rangeTo)){return true}if(this._rangeType=="from"&&q<this._rangeFrom){return true}if(this._rangeType=="to"&&q>this._rangeTo){return true}}var a=new Date(q);if(this._rangeWeek){if(this._rangeWeekData[a.getDay()]===true){return true}}if(this._rangeMonth){if(this._rangeMonthData[a.getDate()]===true){return true}}if(this._rangeYear){if(this._rangeYearData[a.getMonth()+"_"+a.getDate()]===true){return true}}return false};this.clearSensitiveRange=function(){this._clearRange();this._drawMonth(this._activeMonth)};this.setSensitiveRange=function(w,v,a){var q=false;if(w!=null&&v!=null){if(!(w instanceof Date)){w=this._strToDate(w)}if(!(v instanceof Date)){v=this._strToDate(v)}if(w.getTime()>v.getTime()){return}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";q=true}if(!q&&w!=null&&v==null){if(!(w instanceof Date)){w=this._strToDate(w)}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";q=true}if(!q&&w==null&&v!=null){if(!(v instanceof Date)){v=this._strToDate(v)}this._rangeFrom=null;this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";q=true}if(q){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(q,a){if(q!=null&&a!=null){if(!(q instanceof Date)){q=this._strToDate(q)}if(!(a instanceof Date)){a=this._strToDate(a)}if(q.getTime()>a.getTime()){return}this._rangeFrom=new Date(q.getFullYear(),q.getMonth(),q.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="out";this._drawMonth(this._activeMonth);return}if(q!=null&&a==null){this.setSensitiveRange(null,q,true);return}if(q==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(A,y){if(A=="week"){if(typeof(y)!="object"&&typeof(y.length)=="undefined"){y=[y]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var v in this._rangeWeekData){this._rangeWeekData[v]=false;delete this._rangeWeekData[v]}for(var x=0;x<y.length;x++){this._rangeWeekData[y[x]]=true;if(y[x]==7){this._rangeWeekData[0]=true}}this._rangeWeek=true}if(A=="month"){if(typeof(y)!="object"&&typeof(y.length)=="undefined"){y=[y]}if(!this._rangeMonthData){this._rangeMonthData={}}for(var v in this._rangeMonthData){this._rangeMonthData[v]=false;delete this._rangeMonthData[v]}for(var x=0;x<y.length;x++){this._rangeMonthData[y[x]]=true}this._rangeMonth=true}if(A=="year"){var w=this._extractDates(y);if(!this._rangeYearData){this._rangeYearData={}}for(var v in this._rangeYearData){this._rangeYearData[v]=false;delete this._rangeYearData[v]}for(var x=0;x<w.length;x++){this._rangeYearData[w[x].getMonth()+"_"+w[x].getDate()]=true}this._rangeYear=true}this._drawMonth(this._activeMonth)};this.enableDays=function(a){if(a=="week"){this._rangeWeek=false}if(a=="month"){this._rangeMonth=false}if(a=="year"){this._rangeYear=false}this._drawMonth(this._activeMonth)};this._tipData={};this._tipTM=null;this._tipTMTime=400;this._tipEvs=false;this._tipPopup=null;this._tipCellDate=null;this._tipCellDim=null;this.setTooltip=function(w,A,C,a){var x=this._extractDates(w);for(var y=0;y<x.length;y++){var v=new Date(x[y].getFullYear(),x[y].getMonth(),x[y].getDate(),0,0,0,0).getTime();this._tipData[v]={text:A,showIcon:C,usePopup:a}}this._drawMonth(this._activeMonth)};this.clearTooltip=function(v){var w=this._extractDates(v);for(var x=0;x<w.length;x++){var a=new Date(w[x].getFullYear(),w[x].getMonth(),w[x].getDate(),0,0,0,0).getTime();this._tipData[a]=null;delete this._tipData[a]}this._drawMonth(this._activeMonth)};this._initTooltipPopup=function(){if(this._tipEvs){return}this.attachEvent("onMouseOver",function(q){var a=new Date(q.getFullYear(),q.getMonth(),q.getDate(),0,0,0,0).getTime();if(this._tipData[a]!=null){if(this._tipTM){window.clearTimeout(this._tipTM)}this._tipCellDate=q;this._tipCellDim=this.getCellDimension(q);this._tipText=this._tipData[a].text;this._tipTM=window.setTimeout(this._showTooltipPopup,this._tipTMTime)}});this.attachEvent("onMouseOut",this._hideTooltipPopup);this._tipEvs=true};this._showTooltipPopup=function(A,a,C,q,v){if(!l._tipPopup){l._tipPopup=new dhtmlXPopup({mode:"top"})}l._tipPopup.attachHTML(l._tipText);l._tipPopup.show(l._tipCellDim.x,l._tipCellDim.y,l._tipCellDim.w,l._tipCellDim.h);l.callEvent("onPopupShow",[l._tipCellDate])};this._hideTooltipPopup=function(){if(this._tipTM){window.clearTimeout(this._tipTM)}if(this._tipPopup!=null&&this._tipPopup.isVisible()){this._tipPopup.hide();this.callEvent("onPopupHide",[this._tipCellDate])}};this.getPopup=function(){return this._tipPopup};this.getCellDimension=function(x){if(typeof(x)=="string"){x=this._strToDate(x)}if(!(x instanceof Date)){return null}var y=new Date(x.getFullYear(),x.getMonth(),x.getDate(),0,0,0,0).getTime();var v=null;for(var A=0;A<this.contDates.childNodes.length;A++){for(var a=0;a<this.contDates.childNodes[A].childNodes.length;a++){var C=this.contDates.childNodes[A].childNodes[a];if(C._date!=null&&C._date.getTime()==y){v={x:this._getLeft(C),y:this._getTop(C),w:C.offsetWidth,h:C.offsetHeight}}C=null}}return v};this._updateFromInput=function(a){if(this._nullInInput&&((a.value).replace(/\s/g,"")).length==0){if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[null])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this.setDate(null)}else{this._updateDateStr(a.value)}a=null};this._doOnClick=function(q){q=q||event;var a=(q.target||q.srcElement);if(a._dhtmlxcalendar_uid&&a._dhtmlxcalendar_uid!=l._activeInp&&l._isVisible()&&l._activeInp){l._hide();return}if(!a._dhtmlxcalendar_uid||!l.i[a._dhtmlxcalendar_uid]){if(l._isSelectorVisible()){l._hideSelector()}else{if(!l._hasParent&&l._isVisible()){l._hide()}}}};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13){if(l._isSelectorVisible()){l._hideSelector()}else{if(l._isVisible()&&!l._hasParent){l._hide()}}}};this._doOnInpClick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}var a=(q.target||q.srcElement);if(!a._dhtmlxcalendar_uid){return}if(!l._listenerEnabled){l._updateFromInput(a)}l._show(a._dhtmlxcalendar_uid,true)};this._doOnInpKeyUp=function(q){q=q||event;var a=(q.target||q.srcElement);if(q.keyCode==13||!a._dhtmlxcalendar_uid){return}if(!l._listenerEnabled){l._updateFromInput(a)}};this._doOnBtnClick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}var a=(q.target||q.srcElement);if(!a._dhtmlxcalendar_uid){return}if(l.i[a._dhtmlxcalendar_uid].input!=null){l._updateFromInput(l.i[a._dhtmlxcalendar_uid].input)}l._show(a._dhtmlxcalendar_uid,true)};this._doOnUnload=function(){if(l&&l.unload){l.unload()}};if(typeof(window.addEventListener)=="function"){document.body.addEventListener("click",l._doOnClick,false);window.addEventListener("keydown",l._doOnKeyDown,false);window.addEventListener("unload",l._doOnUnload,false);if(this.conf.touch==true){document.body.addEventListener("touchstart",l._doOnClick,false)}}else{document.body.attachEvent("onclick",l._doOnClick);document.body.attachEvent("onkeydown",l._doOnKeyDown);window.attachEvent("onunload",l._doOnUnload)}this.attachObj=function(v){var q=window.dhx4.newId();if(typeof(v)=="string"){this.i[q]={input:document.getElementById(v)}}else{if(typeof(v.tagName)!="undefined"){this.i[q]={input:v}}else{if(typeof(v)=="object"&&(v.input!=null||v.button!=null)){this.i[q]={};if(v.input!=null){this.i[q].input=(typeof(v.input)=="string"?document.getElementById(v.input):v.input)}if(v.button!=null){this.i[q].button=(typeof(v.button)=="string"?document.getElementById(v.button):v.button)}}}}this._attachEventsToObject(q);return q};this.detachObj=function(w){var v=null;if(this.i[w]!=null){v=w}else{if(typeof(w)=="string"){w=document.getElementById(w);v=w._dhtmlxcalendar_uid}else{if(typeof(w.tagName)!="undefined"){v=w._dhtmlxcalendar_uid}else{if(typeof(w)=="object"&&(w.input!=null||w.button!=null)){if(v==null&&w.input!=null){v=(typeof(w.input)=="string"?document.getElementById(w.input):w.input)._dhtmlxcalendar_uid}if(v==null&&w.button!=null){v=(typeof(w.button)=="string"?document.getElementById(w.button):w.button)._dhtmlxcalendar_uid}}}}}if(v!=null&&this.i[v]!=null){this._detachEventsFromObject(v);for(var q in this.i[q]){this.i[v][q]._dhtmlxcalendar_uid=null;this.i[v][q]=null;delete this.i[v][q]}this.i[v]=null;delete this.i[v];return true}return false};this._attachEventsToObject=function(q){if(this.i[q].button!=null){this.i[q].button._dhtmlxcalendar_uid=q;if(typeof(window.addEventListener)=="function"){this.i[q].button.addEventListener("click",l._doOnBtnClick,false);if(this.conf.touch==true){this.i[q].button.addEventListener("touchstart",l._doOnBtnClick,false)}}else{this.i[q].button.attachEvent("onclick",l._doOnBtnClick)}}else{if(this.i[q].input!=null){this.i[q].input._dhtmlxcalendar_uid=q;if(typeof(window.addEventListener)=="function"){this.i[q].input.addEventListener("click",l._doOnInpClick,false);this.i[q].input.addEventListener("keyup",l._doOnInpKeyUp,false);if(this.conf.touch==true){this.i[q].input.addEventListener("touchstart",l._doOnInpClick,false)}}else{this.i[q].input.attachEvent("onclick",l._doOnInpClick);this.i[q].input.attachEvent("onkeyup",l._doOnInpKeyUp)}}}};this._detachEventsFromObject=function(q){if(this.i[q].button!=null){if(typeof(window.addEventListener)=="function"){this.i[q].button.removeEventListener("click",l._doOnBtnClick,false);if(this.conf.touch==true){this.i[q].button.removeEventListener("touchstart",l._doOnBtnClick,false)}}else{this.i[q].button.detachEvent("onclick",l._doOnBtnClick)}}else{if(this.i[q].input!=null){if(typeof(window.addEventListener)=="function"){this.i[q].input.removeEventListener("click",l._doOnInpClick,false);this.i[q].input.removeEventListener("keyup",l._doOnInpKeyUp,false);if(this.conf.touch==true){this.i[q].input.removeEventListener("touchstart",l._doOnInpClick,false)}}else{this.i[q].input.detachEvent("onclick",l._doOnInpClick);this.i[q].input.detachEvent("onkeyup",l._doOnInpKeyUp)}}}};this.enableListener=function(a){if(!a){return}if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",l._listenerEvFocus,false);a.addEventListener("blur",l._listenerEvBlur,false)}else{a.attachEvent("onfocus",l._listenerEvFocus);a.attachEvent("onblur",l._listenerEvBlur)}a=null};this.disableListener=function(a){if(!a){return}a._f0=false;if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",l._listenerEvFocus,false);a.removeEventListener("blur",l._listenerEvBlur,false)}else{a.detachEvent("onfocus",l._listenerEvFocus);a.detachEvent("onblur",l._listenerEvBlur)}a=null};this._startListener=function(a){if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(a._v1)=="undefined"){a._v1=a.value}if(a._v1!=a.value){this._updateFromInput(a);a._v1=a.value}if(a._f0){this._tmListener=window.setTimeout(function(){l._startListener(a)},100)}};this._listenerEvFocus=function(q){q=q||event;var a=q.target||q.srcElement;a._f0=true;l._startListener(a);a=null};this._listenerEvBlur=function(q){q=q||event;var a=q.target||q.srcElement;a._f0=false;a=null};for(var o in this.i){this._attachEventsToObject(o)}window.dhx4._eventable(this);this._evOnArrowClick=function(a){return this.callEvent("onArrowClick",a)};this._evOnClick=function(a){return this.callEvent("onClick",a)};this._evOnMouseOut=function(a){return this.callEvent("onMouseOut",a)};this._evOnMouseOver=function(a){return this.callEvent("onMouseOver",a)};this.unload=function(){this._activeDate=null;this._activeDateCell=null;this._activeInp=null;this._activeMonth=null;this._dateFormat=null;this._dateFormatRE=null;this._lastHover=null;if(this._tmListener){window.clearTimeout(this._tmListener)}this._tmListener=null;if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("click",l._doOnClick,false);window.removeEventListener("keydown",l._doOnKeyDown,false);window.removeEventListener("unload",l._doOnUnload,false);if(this.conf.touch==true){document.body.removeEventListener("touchstart",l._doOnClick,false)}}else{document.body.detachEvent("onclick",l._doOnClick);document.body.detachEvent("onkeydown",l._doOnKeyDown);window.detachEvent("onunload",l._doOnKeyDown)}this._doOnClick=null;this._doOnKeyDown=null;this._doOnUnload=null;for(var q in this.i){this.i[q]._dhtmlxcalendar_uid=null;this._detachEventsFromObject(q);this.disableListener(this.i[q].input);this.i[q]=null;delete this.i[q]}this.i=null;this._doOnInpClick=null;this._doOnInpKeyUp=null;window.dhx4._eventable(this,"clear");this.contMonth.onselectstart=null;this.contMonth.firstChild.firstChild.onclick=null;this.contMonth.firstChild.firstChild.ontouchstart=null;this.contMonth.firstChild.firstChild.firstChild.onmouseover=null;this.contMonth.firstChild.firstChild.firstChild.onmouseout=null;this.contMonth.firstChild.firstChild.lastChild.onmouseover=null;this.contMonth.firstChild.firstChild.lastChild.onmouseout=null;while(this.contMonth.firstChild.firstChild.childNodes.length>0){this.contMonth.firstChild.firstChild.removeChild(this.contMonth.firstChild.firstChild.lastChild)}this.contMonth.firstChild.removeChild(this.contMonth.firstChild.firstChild);this.contMonth.removeChild(this.contMonth.firstChild);this.contMonth.parentNode.removeChild(this.contMonth);this.contMonth=null;while(this.contDays.firstChild.childNodes.length>0){this.contDays.firstChild.removeChild(this.contDays.firstChild.lastChild)}this.contDays.removeChild(this.contDays.firstChild);this.contDays.parentNode.removeChild(this.contDays);this.contDays=null;this.contDates.onclick=null;this.contDates.ontouchstart=null;this.contDates.onmouseover=null;this.contDates.onmouseout=null;while(this.contDates.childNodes.length>0){while(this.contDates.lastChild.childNodes.length>0){this.contDates.lastChild.lastChild._css_date=null;this.contDates.lastChild.lastChild._css_month=null;this.contDates.lastChild.lastChild._css_weekend=null;this.contDates.lastChild.lastChild._css_hover=null;this.contDates.lastChild.lastChild._date=null;this.contDates.lastChild.lastChild._q=null;this.contDates.lastChild.lastChild._w=null;this.contDates.lastChild.removeChild(this.contDates.lastChild.lastChild)}this.contDates.removeChild(this.contDates.lastChild)}this.contDates.parentNode.removeChild(this.contDates);this.contDates=null;this.contTime.firstChild.firstChild.onclick=null;this.contTime.firstChild.firstChild.ontouchstart=null;while(this.contTime.firstChild.firstChild.childNodes.length>0){this.contTime.firstChild.firstChild.removeChild(this.contTime.firstChild.firstChild.lastChild)}this.contTime.firstChild.removeChild(this.contTime.firstChild.firstChild);this.contTime.removeChild(this.contTime.firstChild);this.contTime.parentNode.removeChild(this.contTime);this.contTime=null;this._lastHover=null;this._unloadSelector("month");this._unloadSelector("year");this._unloadSelector("hours");this._unloadSelector("minutes");if(this._selCover){this._selCover.parentNode.removeChild(this._selCover);this._selCover=null}if(this._sel){for(var q in this._sel._ta){this._sel._ta[q]=null}this._sel._ta=null;this._sel._t=null;this._sel.onmouseover=null;this._sel.onmouseout=null;while(this._sel.firstChild.firstChild.firstChild.childNodes.length>0){this._sel.firstChild.firstChild.firstChild.lastChild.onclick=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseover=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseout=null;this._sel.firstChild.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild.lastChild)}this._sel.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild);this._sel.firstChild.removeChild(this._sel.firstChild.firstChild);while(this._sel.childNodes.length>0){this._sel.removeChild(this._sel.lastChild)}this._sel.parentNode.removeChild(this._sel);this._sel=null}this.base.onclick=null;this.base.onmousedown=null;this.base.ontouchstart=null;this.base.onmouseout=null;this.base.parentNode.removeChild(this.base);this.base=null;this._clearDayHover=null;this._clearSelHover=null;this._doOnSelectorChange=null;this._doOnSelectorShow=null;this._drawMonth=null;this._fixLength=null;this._getLeft=null;this._getTop=null;this._ifrSize=null;this._hide=null;this._hideSelector=null;this._initSelector=null;this._isSelectorVisible=null;this._isVisible=null;this._posGetOffset=null;this._posGetOffsetRect=null;this._posGetOffsetSum=null;this._scrollYears=null;this._show=null;this._showSelector=null;this._strToDate=null;this._updateActiveHours=null;this._updateActiveMinutes=null;this._updateActiveMonth=null;this._updateActiveYear=null;this._updateCellStyle=null;this._updateDateStr=null;this._updateVisibleHours=null;this._updateVisibleMinutes=null;this._updateYearsList=null;this.enableIframe=null;this.hide=null;this.hideTime=null;this.setDate=null;this.setDateFormat=null;this.setYearsRange=null;this.show=null;this.showTime=null;this.unload=null;if(this._tipPopup!=null){this._tipPopup.unload();this._tipPopup=null}for(var q in this){delete this[q]}q=l=null};this.setDate(this._activeDate);return this}dhtmlXCalendarObject.prototype.lang="en";dhtmlXCalendarObject.prototype.langData={en:{dateformat:"%Y-%m-%d",hdrformat:"%F %Y",monthesFNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthesSNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysFNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysSNames:["Su","Mo","Tu","We","Th","Fr","Sa"],weekstart:1,weekname:"w"}};dhtmlXCalendarObject.prototype._buildMonthHdr=function(l){var c=this;var j=function(m){return(String(m).length==1?"0"+String(m):m)};var a=function(m,n){return"<span class='dhtmlxcalendar_month_label_"+m+"'>"+n+"</span>"};var g=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(m){switch(m){case"%m":return a("month",j(l.getMonth()+1));case"%n":return a("month",l.getMonth()+1);case"%M":return a("month",c.langData[c.lang].monthesSNames[l.getMonth()]);case"%F":return a("month",c.langData[c.lang].monthesFNames[l.getMonth()]);case"%y":return a("year",j(l.getYear()%100));case"%Y":return a("year",l.getFullYear());case"%%":return"%";default:return m}});c=j=a=null;return g};dhtmlXCalendarObject.prototype.enableIframe=function(a){if(a==true){if(!this._ifr){this._ifr=document.createElement("IFRAME");this._ifr.frameBorder=0;this._ifr.border=0;this._ifr.setAttribute("src","javascript:false;");this._ifr.className="dhtmlxcalendar_ifr";this._ifr.onload=function(){this.onload=null;this.contentWindow.document.open("text/html","replace");this.contentWindow.document.write("<html><head><style>html,body{width:100%;height:100%;overflow:hidden;margin:0px;}</style></head><body</body></html>")};this.base.parentNode.insertBefore(this._ifr,this.base);this._ifrSize()}}else{if(this._ifr){this._ifr.parentNode.removeChild(this._ifr);this._ifr=null}}};dhtmlXCalendarObject.prototype._ifrSize=function(){if(this._ifr){this._ifr.style.left=this.base.style.left;this._ifr.style.top=this.base.style.top;this._ifr.style.width=this.base.offsetWidth+"px";this._ifr.style.height=this.base.offsetHeight+"px"}};dhtmlxCalendarObject=dhtmlXCalendarObject;dhtmlXCalendarObject.prototype._dateStrings=function(){var a=this.langData[this.lang];return{monthFullName:a.monthesFNames,monthShortName:a.monthesSNames,dayFullName:a.daysFNames,dayShortName:a.daysSNames}};dhtmlXCalendarObject.prototype._strToDate=function(c,a){return window.dhx4.str2date(c,a||this._dateFormat,this._dateStrings())};dhtmlXCalendarObject.prototype._dateToStr=function(c,a){return window.dhx4.date2str(c,a||this._dateFormat,this._dateStrings())};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(c){var a=this;this.leftCalendar=new dhtmlXCalendarObject(c);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(c);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(g){a._updateRange("rightCalendar",g,null);a._evOnClick(["left",g])});this.rightCalendar.attachEvent("onClick",function(g){a._updateRange("leftCalendar",null,g);a._evOnClick(["right",g])});this.leftCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["left",g])});this.rightCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["right",g])});this.show=function(){this.leftCalendar.show();this.rightCalendar.base.style.marginLeft=this.leftCalendar.base.offsetWidth-1+"px";this.rightCalendar.show()};this.hide=function(){this.leftCalendar.hide();this.rightCalendar.hide()};this.setDateFormat=function(g){this.leftCalendar.setDateFormat(g);this.rightCalendar.setDateFormat(g)};this.setDates=function(j,g){if(j!=null){this.leftCalendar.setDate(j)}if(g!=null){this.rightCalendar.setDate(g)}this._updateRange()};this._updateRange=function(g,l,j){if(arguments.length==3){(g=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(l,j)}else{this.leftCalendar.setSensitiveRange(null,this.rightCalendar.getDate());this.rightCalendar.setSensitiveRange(this.leftCalendar.getDate(),null)}};this.getFormatedDate=function(){return this.leftCalendar.getFormatedDate.apply(this.leftCalendar,arguments)};this.unload=function(){window.dhx4._eventable(this,"clear");this.leftCalendar.unload();this.rightCalendar.unload();this.leftCalendar=this.rightCalendar=null;this._updateRange=null;this._evOnClick=null;this._evOnBeforeChange=null;this.show=null;this.hide=null;this.setDateFormat=null;this.setDates=null;this.getFormatedDate=null;this.unload=null;a=null};this._evOnClick=function(g){return this.callEvent("onClick",g)};this._evOnBeforeChange=function(g){return this.callEvent("onBeforeChange",g)};window.dhx4._eventable(this);return this};function dhtmlXCombo(m,s,g,o,l){var n=this;var j=null;var u=null;if(typeof(m)=="object"&&!m.tagName){j=m;m=j.parent;g=j.width;s=j.name;o=j.mode;u=j.skin}this.cont=(typeof(m)=="string"?document.getElementById(m):m);this.conf={skin:null,form_name:s||"dhxcombo",combo_width:(parseInt(g)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(o)=="string"&&typeof(this.modes[o])!="undefined"?o:"option"),opts_count:8,opts_count_min:3,opts_width:null,item_h:null,list_zi_id:window.dhx4.newId(),allow_free_text:true,allow_empty_value:true,enabled:true,img_path:"",img_def:"",img_def_dis:true,template:{input:"#text#",option:"#text#"},f_func:null,f_mode:false,f_url:false,f_cache:false,f_cache_data:{},f_dyn:false,f_dyn_end:false,f_mask:"",f_ac:true,f_ac_text:"",f_server_tm:null,f_server_last:"",f_loading:false,s_tm:null,s_time:200,s_mode:"select",last_hover:null,last_selected:null,last_match:null,last_text:"",last_value:"",tm_hover:null,tm_confirm_blur:null,clear_click:false,clear_blur:false,clear_bsp:false,clear_key:false,sp:{dhx_skyblue:{list_ofs:1,hdr_ofs:1,scr_ofs:1},dhx_web:{list_ofs:0,hdr_ofs:1,scr_ofs:0},dhx_terrace:{list_ofs:1,hdr_ofs:1,scr_ofs:1}},col_w:null};this.conf.combo_image=(this.modes[this.conf.opts_type].image==true);this.t={};this.base=document.createElement("DIV");this.base.style.width=this.conf.combo_width+"px";this.base.innerHTML="<input type='text' class='dhxcombo_input' style='width:"+(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px;"+(this.conf.combo_image?"margin-left:23px;":"")+"' autocomplete='off'><input type='hidden' value=''><input type='hidden' value='false'><div class='dhxcombo_select_button'><div class='dhxcombo_select_img'></div></div>"+(this.conf.combo_image?"<div class='dhxcombo_top_image'>"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"</div>":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list._listId=window.dhx4.newId();this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this._doOnListScroll=function(){if(n.conf.s_tm!=null){window.clearTimeout(n.conf.s_tm)}n.conf.s_tm=window.setTimeout(n._doOnListScrollAction,n.conf.s_time)};this._doOnListScrollAction=function(){n.conf.s_tm=null;if(n.conf.s_mode=="scroll"&&n.list.scrollHeight-n.list.scrollTop-10<n.list.clientHeight){n._subloadRequest()}};if(typeof(window.addEventListener)=="function"){this.list.addEventListener("scroll",this._doOnListScroll,false)}else{this.list.attachEvent("onscroll",this._doOnListScroll)}this.setSkin(u||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcombo")||"dhx_skyblue");this._updateTopImage=function(a){if(!this.conf.combo_image){return}if(a!=null){this.base.lastChild.innerHTML=this.t[a].obj.getTopImage(this.t[a].item,this.conf.enabled)}else{this.base.lastChild.innerHTML=this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)}};this._filterOpts=function(C){if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}var x=String(this.base.firstChild.value).replace(new RegExp(this.conf.f_ac_text+"$","i"),"");if(this.conf.f_server_last==x.toLowerCase()){this._checkForMatch();return}if(this.conf.f_url!=null&&this.checkEvent("onDynXLS")){this.conf.f_server_last=x.toLowerCase();this.callEvent("onDynXLS",[x]);return}if(this.conf.f_url!=null){if(x.length==0){this.conf.f_server_last=x.toLowerCase();this.clearAll();return}if(this.conf.f_cache==true&&this.conf.f_cache_data[x]!=null){this.clearAll();this.conf.f_server_last=x.toLowerCase();for(var w=0;w<this.conf.f_cache_data[x].data.length;w++){this.load(this.conf.f_cache_data[x].data[w])}if(this.conf.f_dyn){this.conf.f_dyn_end=this.conf.f_cache_data[x].dyn_end;this.conf.f_mask=this.conf.f_cache_data[x].mask}if(C!==true){this._showList(true);this._checkForMatch()}}else{this.conf.f_server_tm=window.setTimeout(function(){n.conf.f_server_last=x.toLowerCase();n.conf.f_mask=x;var q="mask="+encodeURIComponent(x);if(n.conf.f_dyn){q+="&pos=0";n.conf.f_dyn_end=false}var a=function(J){if(n.conf.f_cache){if(!n.conf.f_cache_data[x]){n.conf.f_cache_data[x]={data:[],dyn_end:false,mask:x}}n.conf.f_cache_data[x].data.push(J.xmlDoc.responseXML)}n.clearAll();n.load(J.xmlDoc.responseXML);var I=(n.base.offsetWidth>0&&n.base.offsetHeight>0);if(I==true&&n.conf.enabled==true&&n.conf.combo_focus==true&&C!==true){if(n.conf.f_ac&&n.conf.f_mode=="start"&&n.conf.clear_bsp==false&&n.list.firstChild!=null){var H=n.list.firstChild._optId;var K=String(n.t[H].obj.getText(n.list.firstChild,true));if(String(K).toLowerCase().indexOf(String(x).toLowerCase())===0){n.base.firstChild.value=K;n._selectRange(x.length,K.length)}}n._showList(true);n._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(n.conf.f_url,q,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(n.conf.f_url+(String(n.conf.f_url).indexOf("?")>=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=x.toLowerCase();var v=(x.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+String(x).replace(/[\\\^\$\*\+\?\.\(\)\|\{\}\[\]]/gi,"\\$&"),"i"));var y=null;for(var D in this.t){var F=false;if(v!==true){if(this.conf.f_func!=null){var A=this._getOption(this.t[D].item._optId,w);F=(this.conf.f_func.apply(window,[x,A])==true)}else{var E=this.t[D].obj.getText(this.t[D].item,true);F=(v.test(E)==true)}}if(v===true||F==true){this.t[D].item.style.display="";if(y==null&&x.length>0){y=String(this.t[D].obj.getText(this.t[D].item,true))}}else{this.t[D].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&y!=null){this.conf.f_ac_text=y.replace(new RegExp("^"+x,"i"),"");this.base.firstChild.value=y;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}if(this.conf.f_mode=="between"&&this.conf.clear_bsp==true){this._checkForMatch(true)}if(C!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}if(a.add!=true&&this.conf.f_loading!=true){this.clearAll(false)}this.addOption(a.options)};this._xmlToObj=function(Q,y,x){var D={add:false,options:[]};var K=(y==true?Q:Q.getElementsByTagName("complete"));if(K.length>0){if(window.dhx4.s2b(K[0].getAttribute("add"))==true){D.add=true}var J=K[0].childNodes;for(var H=0;H<J.length;H++){if(typeof(J[H].tagName)!="undefined"){if(String(J[H].tagName).toLowerCase()=="template"){var P={};for(var C=0;C<J[H].childNodes.length;C++){var I=J[H].childNodes[C];if(I.tagName!=null){var L=I.tagName;if(typeof(this.conf.template[L])!="undefined"){P[L]=window.dhx4._xmlNodeValue(I)}if(L=="columns"){for(var N=0;N<I.childNodes.length;N++){var A=I.childNodes[N];if(A.tagName!=null&&A.tagName=="column"){var F={};for(var O in {width:1,css:1,header:1,option:1}){if(A.getAttribute(O)!=null){F[O]=A.getAttribute(O)}}for(var O in {header:1,option:1}){var M=A.getElementsByTagName(O);if(M[0]!=null&&M[0].firstChild!=null){F[O]=window.dhx4._xmlNodeValue(M[0])}}if(P.columns==null){P.columns=[]}P.columns.push(F)}A=null}}}I=null}this.setTemplate(P)}if(String(J[H].tagName).toLowerCase()=="option"){var E=false;if(y==true){E=(D.options.length==x)}else{E=window.dhx4.s2b(J[H].getAttribute("selected"))}var v={value:J[H].getAttribute("value"),text:window.dhx4._xmlNodeValue(J[H]),selected:E,checked:window.dhx4.s2b(J[H].getAttribute("checked"))};for(var O in {img:1,img_dis:1,img_src:1,img_src_dis:1,css:1}){if(J[H].getAttribute(O)!=null){v[O]=J[H].getAttribute(O)}}for(var C=0;C<J[H].childNodes.length;C++){if(J[H].childNodes[C].tagName!=null&&String(J[H].childNodes[C].tagName).toLowerCase()=="text"){v.text={};var I=J[H].childNodes[C];for(var N=0;N<I.childNodes.length;N++){if(I.childNodes[N].tagName!=null){v.text[I.childNodes[N].tagName]=window.dhx4._xmlNodeValue(I.childNodes[N])}}}}D.options.push(v)}}}K=J=null}return D};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","complete",{data:true});window.dhx4._eventable(this);this._getNearItem=function(v,q){var a=null;while(v!=null){v=v[q<0?"previousSibling":"nextSibling"];if(a==null&&v!=null&&v.style.display==""&&v._optId!=null){a=v;v=null}}return a};this.setName(this.conf.form_name);this._doOnListMouseMove=function(q){q=q||event;var a=q.target||q.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){if(n.conf.tm_hover){window.clearTimeout(n.conf.tm_hover)}n._setSelected(a._optId)}a=a.parentNode}a=null};this._doOnListMouseDown=function(a){a=a||event;a.cancelBubble=true;n.conf.clear_click=true;window.setTimeout(function(){n.base.firstChild.focus()},1)};this._doOnListMouseUp=function(v){v=v||event;var a=v.target||v.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){var q=true;if(typeof(n.t[a._optId].obj.optionClick)=="function"&&n.t[a._optId].obj.optionClick(a,v,n)!==true){q=false}if(q){n._setSelected(a._optId,null,true);n._confirmSelect("click")}}a=a.parentNode}a=null};this._doOnListMouseOut=function(a){if(n.conf.tm_hover){window.clearTimeout(n.conf.tm_hover)}n.conf.tm_hover=window.setTimeout(function(){var q=n.conf.last_match||n.conf.last_selected;if(n.conf.last_match==null&&n.t[q]!=null){if(n.base.firstChild.value!=n.t[q].obj.getText(n.t[q].item,true)){q=null}}n._setSelected(q,null,true)},1)};this._doOnBaseMouseDown=function(x){if(!n.conf.enabled){return}n.conf.clear_click=true;x=x||event;var q=x.target||x.srcElement;if(q!=this.firstChild){window.setTimeout(function(){n.base.firstChild.focus()},1);var w=q;while(w!=this&&w!=null){if(w==this.lastChild){if(typeof(n.modes[n.conf.opts_type].topImageClick)=="function"){var v=(n.conf.last_hover||n.conf.last_selected);var a=(v!=null?n.t[v].item:null);if(n.modes[n.conf.opts_type].topImageClick(a,n)!==true){v=a=null;return}}w=null}else{w=w.parentNode}}}if(n._isListVisible()){n._hideList()}else{if(q!=this.firstChild){n.conf.clear_blur=true}n._showList();n._setSelected(n.conf.last_selected,true,true)}q=null};this._doOnBodyMouseDown=function(){if(n.conf.clear_click){n.conf.clear_click=false;return}n._confirmSelect("blur")};this._doOnInputFocus=function(){n.conf.clear_blur=false;if(n.conf.tm_confirm_blur){window.clearTimeout(n.conf.tm_confirm_blur)}if(n.conf.combo_focus==false){n.conf.combo_focus=true;n.callEvent("onFocus",[])}};this._doOnInputBlur=function(){if(n.conf.clear_blur==true){n.conf.clear_blur=false;return}if(n.conf.tm_confirm_blur){window.clearTimeout(n.conf.tm_confirm_blur)}n.conf.tm_confirm_blur=window.setTimeout(function(){if(n.conf.clear_click==false){n._confirmSelect("blur");n.conf.combo_focus=false;n.callEvent("onBlur",[])}},20)};this._doOnInputKeyUp=function(a){a=a||event;if(n.conf.f_mode!=false){n.conf.clear_bsp=(a.keyCode==8||a.keyCode==46);n._filterOpts();return}else{n._checkForMatch()}};this._doOnInputKeyDown=function(a){a=a||event;if((a.keyCode==38||a.keyCode==40)&&!a.ctrlKey&&!a.shiftKey&&!a.altKey){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;n._keyOnUpDown(a.keyCode==38?-1:1)}if(a.keyCode==113){if(!n._isListVisible()){n._showList();if(n.base.firstChild.value==n.conf.last_text){n._setSelected(n.conf.last_selected,true,true);n.base.firstChild.value=n.conf.last_text;n.conf.f_server_last=n.base.firstChild.value.toLowerCase()}else{n.conf.f_server_last=n.base.firstChild.value.toLowerCase();if(n.conf.f_mode==false){n._checkForMatch()}}}else{}}if(a.keyCode==27){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;n._cancelSelect()}if(a.keyCode==13){if(a.preventDefault){a.preventDefault()}n._confirmSelect("kbd")}n.conf.clear_key=true;n.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(n.conf.clear_key){n.conf.clear_key=false;return}a=a||event;n.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var q=null;if(this.conf.last_hover){q=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){q=this.t[this.conf.last_selected].item}}if(!q&&this._getListVisibleCount()==0){return}if(q!=null&&q.style.display!=""){q=null}this._showList();if(q!=null){if(this.t[q._optId].obj.isSelected(q)){q=this._getNearItem(q,a)}}else{q=this.list.firstChild;if(q.style.display!=""){q=this._getNearItem(q,1)}}if(q==null){return}this._setSelected(q._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[q._optId].obj.getText(q,true)}else{var v=String(this.t[q._optId].obj.getText(q,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(v.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=v.substring(this.conf.f_server_last.length,v.length);this.base.firstChild.value=v;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=v;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=v;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}q=null};this.conf.evs_nodes=[{node:document.body,evs:{mousedown:"_doOnBodyMouseDown"}},{node:this.base,evs:{mousedown:"_doOnBaseMouseDown"}},{node:this.base.firstChild,evs:{keyup:"_doOnInputKeyUp",keydown:"_doOnInputKeyDown",keypress:"_doOnInputKeyPress",focus:"_doOnInputFocus",blur:"_doOnInputBlur"}},{node:this.list,evs:{mousemove:"_doOnListMouseMove",mousedown:"_doOnListMouseDown",mouseup:"_doOnListMouseUp",mouseout:"_doOnListMouseOut"}}];for(var c=0;c<this.conf.evs_nodes.length;c++){for(var r in this.conf.evs_nodes[c].evs){if(typeof(window.addEventListener)=="function"){this.conf.evs_nodes[c].node.addEventListener(r,this[this.conf.evs_nodes[c].evs[r]],false)}else{this.conf.evs_nodes[c].node.attachEvent("on"+r,this[this.conf.evs_nodes[c].evs[r]])}}}this.unload=function(){this.clearAll();this.t=null;for(var w=0;w<this.conf.evs_nodes.length;w++){for(var v in this.conf.evs_nodes[w].evs){if(typeof(window.addEventListener)=="function"){this.conf.evs_nodes[w].node.removeEventListener(v,this[this.conf.evs_nodes[w].evs[v]],false)}else{this.conf.evs_nodes[w].node.detachEvent("on"+v,this[this.conf.evs_nodes[w].evs[v]])}this.conf.evs_nodes[w].evs[v]=null;delete this.conf.evs_nodes[w].evs[v]}this.conf.evs_nodes[w].node=null;this.conf.evs_nodes[w].evs=null;delete this.conf.evs_nodes[w].node;delete this.conf.evs_nodes[w].evs;this.conf.evs_nodes[w]=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");this._mcDetachHeader();this.DOMelem_input=this.DOMelem_button=this.DOMlist=this.DOMelem=this.DOMParent=null;for(var v in this.conf){this.conf[v]=null;delete this.conf[v]}this.conf=null;if(typeof(window.addEventListener)=="function"){this.list.removeEventListener("scroll",this._doOnListScroll,false)}else{this.list.detachEvent("onscroll",this._doOnListScroll)}this.base.parentNode.removeChild(this.base);this.list.parentNode.removeChild(this.list);this.base=this.list=this.cont=null;this.modes=null;for(var v in this){if(typeof(this[v])=="function"){this[v]=null}}n=null};this.DOMelem_input=this.base.firstChild;this.DOMelem_button=this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)];this.DOMlist=this.list;this.DOMelem=this.base;this.DOMParent=m;m=null;if(j!=null){if(j.filter!=null){if(typeof(j.filter)=="string"){this.enableFilteringMode(true,j.filter,window.dhx4.s2b(j.filter_cache),window.dhx4.s2b(j.filter_sub_load))}else{this.enableFilteringMode(true)}}if(j.image_path!=null){this.setImagePath(j.image_path)}if(j.default_image!=null||j.default_image_dis!=null){this.setDefaultImage(j.default_image,j.default_image_dis)}if(j.items||j.options){this.addOption(j.items||j.options)}if(j.xml||j.json){this.load(j.xml||j.json)}if(typeof(j.readonly)!="undefined"){this.readonly(j.readonly)}j=null}return this}function dhtmlXComboFromSelect(g){if(typeof(g)=="string"){g=document.getElementById(g)}var c=g.offsetWidth;var r=g.getAttribute("name")||null;var j=document.createElement("SPAN");g.parentNode.insertBefore(j,g);var m=g.getAttribute("mode")||g.getAttribute("opt_type")||"option";var l=new dhtmlXCombo(j,r,c,m);j=null;var o=g.getAttribute("imagePath");if(o){l.setImagePath(o)}var q=g.getAttribute("defaultImage");var n=g.getAttribute("defaultImageDis");if(window.dhx4.s2b(n)==true){n=true}if(q!=null||n!=null){l.setDefaultImage(q,n)}var a=l._xmlToObj([g],true,g.selectedIndex);if(a.options.length>0){l.addOption(a.options)}a=null;g.parentNode.removeChild(g);g=null;return l}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a.replace(/(\[.*)?$/,"_new_value$1")};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true")}else{this.base.firstChild.removeAttribute("readOnly")}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(g){for(var c in g){if(typeof(this.conf.template[c])!="undefined"){this.conf.template[c]=String(g[c])}}if(g.columns!=null){this._mcMakeTemplate(g.columns)}else{this._mcDetachHeader()}for(var c in this.t){this.t[c].obj.setText(this.t[c].item,this.t[c].item._conf.text)}this._confirmSelect()};dhtmlXCombo.prototype.setSkin=function(a){if(a==this.conf.skin){return}this.conf.skin=a;this.base.className="dhxcombo_"+this.conf.skin+(this.conf.enabled?"":" dhxcombo_disabled");this.list.className="dhxcombolist_"+this.conf.skin+(this.hdr!=null?" dhxcombolist_multicolumn":"");if(this.hdr!=null){this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr"}};dhtmlXCombo.prototype.getInput=function(){return this.base.firstChild};dhtmlXCombo.prototype.getButton=function(){return this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)]};dhtmlXCombo.prototype.getList=function(){return this.list};dhtmlXCombo.prototype.getBase=function(){return this.base};dhtmlXCombo.prototype.getParent=function(){return this.DOMParent};dhtmlXCombo.prototype.forEachOption=function(a){for(var c=0;c<this.list.childNodes.length;c++){a.apply(window,[this._getOption(this.list.childNodes[c]._optId,c)])}};dhtmlXCombo.prototype.setFocus=function(){if(this.conf.enabled){this.base.firstChild.focus()}};dhtmlXCombo.prototype.setFontSize=function(a,c){if(a!=null){this.base.firstChild.style.fontSize=a}if(c!=null){this.list.style.fontSize=c}};dhtmlXCombo.prototype.getOption=function(l){var m=null;var g=null;for(var j=0;j<this.list.childNodes.length;j++){if(m==null){var c=this.list.childNodes[j]._optId;if(this.t[c].obj.getValue(this.t[c].item)==l){m=c;g=j}}}return(m==null?null:this._getOption(m,g))};dhtmlXCombo.prototype.getOptionByIndex=function(a){if(a<0){return null}if(this.list.childNodes[a]==null){return null}return this._getOption(this.list.childNodes[a]._optId,a)};dhtmlXCombo.prototype.getOptionByLabel=function(l){var m=null;var g=null;for(var j=0;j<this.list.childNodes.length;j++){if(m==null){var c=this.list.childNodes[j]._optId;if(this.t[c].obj.getText(this.t[c].item,true)==l){m=c;g=j}}}return(m==null?null:this._getOption(m,g))};dhtmlXCombo.prototype.getSelectedIndex=function(){return this._getOptionProp(this.conf.last_selected,"index",-1)};dhtmlXCombo.prototype.getSelectedText=function(){return this._getOptionProp(this.conf.last_selected,"text","")};dhtmlXCombo.prototype.getSelectedValue=function(){return this._getOptionProp(this.conf.last_selected,"value",null)};dhtmlXCombo.prototype.getActualValue=function(){return this.base.childNodes[1].value};dhtmlXCombo.prototype.getComboText=function(){return this.base.childNodes[0].value};dhtmlXCombo.prototype.getIndexByValue=function(c){var a=this.getOption(c);return(a!=null?a.index:-1)};dhtmlXCombo.prototype.setComboText=function(a){if(this.conf.allow_free_text!=true){return}this.unSelectOption();this.conf.last_text=this.base.firstChild.value=a;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()};dhtmlXCombo.prototype.setComboValue=function(c){var a=this.getOption(c);if(a!=null){this.selectOption(a.index)}else{this.conf.last_value=c;this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="true"}};dhtmlXCombo.prototype.selectOption=function(c,g,a){if(c<0||c>=this.list.childNodes.length){return}var j=this.list.childNodes[c]._optId;this._setSelected(j,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null}this.base.firstChild.value="";if(this.conf.f_mode!=false){this._filterOpts(true)}this._hideList();this._updateTopImage(null);this._confirmSelect("script")};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelect("script")};dhtmlXCombo.prototype.enable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));if(this.conf.enabled==a){return}this.conf.enabled=a;if(a){this.base.className="dhxcombo_"+this.conf.skin;this.base.firstChild.removeAttribute("disabled")}else{this._hideList();this.base.className="dhxcombo_"+this.conf.skin+" dhxcombo_disabled";this.base.firstChild.setAttribute("disabled","true")}this._updateTopImage(this.conf.last_selected)};dhtmlXCombo.prototype.disable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));this.enable(!a)};dhtmlXCombo.prototype.isEnabled=function(){return(this.conf.enabled==true)};dhtmlXCombo.prototype.show=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.base.style.display=(a==true?"":"none")};dhtmlXCombo.prototype.hide=function(a){if(typeof(a)=="undefined"){a=true}this.show(!a)};dhtmlXCombo.prototype.isVisible=function(){return(this.base.style.display=="")};dhtmlXCombo.prototype.setFilterHandler=function(a){if(typeof(a)=="function"){this.conf.f_func=a;this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{if(typeof(a)=="string"&&typeof(window[a])=="function"){this.conf.f_func=window[a];this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{this.conf.f_func=null}}};dhtmlXCombo.prototype.enableFilteringMode=function(j,c,a,g){if(j==true||j=="between"){this.conf.f_mode=(j==true?"start":"between");if(c!=null){this.conf.f_url=c;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(g)}else{this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}}else{this.conf.f_mode=false;this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}};dhtmlXCombo.prototype.filter=function(g,a){for(var j=0;j<this.list.childNodes.length;j++){var c=g.apply(window,[this._getOption(this.list.childNodes[j]._optId,j)]);this.list.childNodes[j].style.display=(c===true?"":"none")}if(typeof(a)=="undefined"||a==true){this._showList(true)}};dhtmlXCombo.prototype.sort=function(g){var a=[];for(var c=0;c<this.list.childNodes.length;c++){var j=this.list.childNodes[c]._optId;a.push([j,this._getOption(j,c)])}if(g=="asc"||g=="desc"){k=true;a.sort(function(m,l){m=m[1].text_option.toLowerCase();l=l[1].text_option.toLowerCase();var n=(g=="asc"?1:-1);return(m>l?n:-1*n)})}else{if(typeof(g)=="function"||typeof(window[g])=="function"){if(typeof(window[g])=="function"){g=window[g]}a.sort(function(m,l){return g.apply(window,[m[1],l[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var c=0;c<a.length;c++){this.list.appendChild(this.t[a[c][0]].item)}};dhtmlXCombo.prototype.enableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.conf.f_ac=a};dhtmlXCombo.prototype.disableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.enableAutocomplete(!a)};dhtmlXCombo.prototype.allowFreeText=function(a){this.conf.allow_free_text=(typeof(a)=="undefined"?true:window.dhx4.s2b(a))};dhtmlXCombo.prototype._checkForMatch=function(j){var a=window.dhx4.trim(this.base.firstChild.value).toLowerCase();var l=null;var c=this.list.firstChild;while(c!=null){if(c.style.display==""&&c._optId!=null){var g=window.dhx4.trim(this.t[c._optId].obj.getText(c,true)).toLowerCase();if(a==g){l=c._optId;c=null}}if(c!=null){c=c.nextSibling}}if(this.conf.last_match==null){if(l!=null){this._setSelected(l,true,true);this.conf.last_match=l}else{if(this.conf.f_mode!="between"||j==true){this._setSelected(null,true,true);this.conf.last_match=null}}}else{if(l!=null){if(l!=this.conf.last_match){this._setSelected(l,true,true);this.conf.last_match=l}}else{this._setSelected(null,true,true);this.conf.last_match=null}}};dhtmlXCombo.prototype._selectRange=function(c,a){if(this.conf.combo_focus==true){window.dhx4.selectTextRange(this.base.firstChild,c,a)}};dhtmlXCombo.prototype.openSelect=function(){if(!this._isListVisible()){this._showList()}};dhtmlXCombo.prototype.closeAll=function(){this._hideList()};dhtmlXCombo.prototype._showList=function(a){if(this._getListVisibleCount()==0){if(a&&this._isListVisible()){this._hideList()}return}if(this._isListVisible()){this._checkListHeight();return}this.list.style.zIndex=window.dhx4.zim.reserve(this.conf.list_zi_id);if(this.hdr!=null){this.hdr.style.zIndex=Number(this.list.style.zIndex)+1}this.list.style.visibility="hidden";this.list.style.display="";if(this.hdr!=null){this.hdr.style.visibility=this.list.style.visibility;this.hdr.style.display=this.list.style.display}var c=(this.hdr!=null?this.hdr.offsetHeight:0);this.list.style.width=Math.max(this.conf.opts_width||this.conf.col_w||0,this.conf.combo_width)+"px";this.list.style.top=window.dhx4.absTop(this.base)+c+this.base.offsetHeight-1+"px";this.list.style.left=window.dhx4.absLeft(this.base)+"px";if(this.hdr!=null){this.hdr.style.width=this.list.style.width;this.hdr.style.left=this.list.style.left;this.hdr.style.top=parseInt(this.list.style.top)-c+"px"}this._checkListHeight();this.list.style.visibility="visible";if(this.hdr!=null){this.hdr.style.visibility="visible"}this.callEvent("onOpen",[])};dhtmlXCombo.prototype._hideList=function(){if(!this._isListVisible()){return}window.dhx4.zim.clear(this.conf.list_zi_id);this.list.style.display="none";if(this.hdr!=null){this.hdr.style.display="none"}this.conf.clear_click=false;this.callEvent("onClose",[])};dhtmlXCombo.prototype._isListVisible=function(){return(this.list.style.display=="")};dhtmlXCombo.prototype._getListVisibleCount=function(){var a=0;for(var c=0;c<this.list.childNodes.length;c++){a+=(this.list.childNodes[c].style.display==""?1:0)}return a};dhtmlXCombo.prototype._checkListHeight=function(){if(!this._isListVisible()){return}if(this.conf.item_h==null){var q=this.list.firstChild;while(q!=null){if(q.style.display==""){this.conf.item_h=q.offsetHeight+(this.hdr!=null?-1:0);q=null}else{q=q.nextSibling}}q=null}var r=window.dhx4.screenDim();var m=window.dhx4.absTop(this.base);var c=this.base.offsetHeight;var a=(this.hdr!=null?this.hdr.offsetHeight:0);var g=Math.max(0,Math.floor((m+a-r.top)/this.conf.item_h));var o=Math.max(0,Math.floor((r.bottom-(m+c+a))/this.conf.item_h));var u=this._getListVisibleCount();if(o<Math.min(this.conf.opts_count_min,u)&&g>o){o=null}var n=Math.min((o==null?g:o),this.conf.opts_count,u);var j=(n<u?(n*this.conf.item_h)+"px":"");var l=this.conf.sp[this.conf.skin][this.hdr!=null?"hdr_ofs":"list_ofs"];this.list.style.height=j;this.list.style.top=(o==null?m-this.list.offsetHeight+l:m+c+a-l)+"px";if(this.hdr!=null){this.hdr.style.top=(o==null?m-a-this.list.offsetHeight+l:m+c-l)+"px"}};dhtmlXCombo.prototype._scrollToItem=function(l){var j=this.t[l].item.offsetTop;var g=j+this.t[l].item.offsetHeight;var c=this.list.scrollTop;var a=c+this.list.clientHeight;if(j<c){this.list.scrollTop=j+(this.hdr!=null?1:0)}else{if(g>a){this.list.scrollTop=g-this.list.clientHeight+(this.hdr!=null?-this.conf.sp[this.conf.skin].scr_ofs:0)}}};dhtmlXCombo.prototype._setSelected=function(g,c,a){if(a){this._updateTopImage(g)}if(g!=null&&this.conf.last_hover==g){if(c){this._scrollToItem(g)}return}if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null;if(g==null){this.callEvent("onSelectionChange",[])}}if(g!=null){this.t[g].obj.setSelected(this.t[g].item,true);this.conf.last_hover=g;this.callEvent("onSelectionChange",[]);if(this.conf.s_mode=="select"&&this.t[g].item==this.t[g].item.parentNode.lastChild){this._subloadRequest()}if(c){this._scrollToItem(g)}}};dhtmlXCombo.prototype._subloadRequest=function(){if(this.conf.f_url!=null&&this.conf.f_dyn==true&&this.conf.f_dyn_end==false){var g="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(l){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(l.xmlDoc.responseXML)}var j=a.list.childNodes.length;a.conf.f_loading=true;a.load(l.xmlDoc.responseXML);a.conf.f_loading=false;if(j==a.list.childNodes.length){a.conf.f_dyn_end=true;if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].dyn_end=true}}c=a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.f_url,g,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+g,c)}}}};dhtmlXCombo.prototype.addOption=function(m,n,c,a,j){var g=null;if(!(m instanceof Array)){var o=this._renderOption({value:m,text:n,css:c,img:a});if(g==null&&window.dhx4.s2b(j)==true){g=o}}else{for(var l=0;l<m.length;l++){if(typeof(m[l])=="undefined"){continue}if(m[l] instanceof Array){o=this._renderOption({value:m[l][0],text:m[l][1],css:m[l][2],img:m[l][3]});if(g==null&&window.dhx4.s2b(m[l][4])==true){g=o}}else{var o=this._renderOption(m[l]);if(g==null&&window.dhx4.s2b(m[l].selected)==true){g=o}}}}if(g!=null){this._setSelected(g,this._isListVisible(),true);this._confirmSelect("onInit")}};dhtmlXCombo.prototype.updateOption=function(a,g,c,j){var l=this._getOptionId(a);if(l==null){return}this.t[l].obj.update(this.t[l].item,{value:g,text:c,css:j});if(this.conf.last_selected==l){this.conf.last_text=this.base.firstChild.value=this.t[l].obj.getText(this.t[l].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}};dhtmlXCombo.prototype.deleteOption=function(j){for(var c in this.t){var g=this.t[c].obj.getValue(this.t[c].item);if(g==j){this._removeOption(c)}}if(this._isListVisible()){this._showList(true)}};dhtmlXCombo.prototype.clearAll=function(c){c=(typeof(c)=="undefined"?true:window.dhx4.s2b(c));for(var g in this.t){this._removeOption(g)}if(this.conf.tm_hover){window.clearTimeout(this.conf.tm_hover)}this.conf.last_hover=null;this.conf.last_selected=null;this.list.scrollTop=0;if(c==true){this._hideList()}};dhtmlXCombo.prototype._renderOption=function(j){var l=window.dhx4.newId();var g=document.createElement("DIV");g._optId=l;g._tpl=this.conf.template;if(typeof(j.img)=="undefined"&&typeof(j.img_src)!="undefined"){j.img=j.img_src;delete j.img_src}if(typeof(j.img_dis)=="undefined"&&typeof(j.img_src_dis)!="undefined"){j.img_dis=j.img_src_dis;delete j.img_src_dis}j.img_path=this.conf.img_path;j.img_def=this.conf.img_def;j.img_def_dis=this.conf.img_def_dis;this.list.appendChild(g);var c=(this._isListVisible()&&window.dhx4.isFF==true);if(c==true){var a=this.list.scrollTop;this.list.scrollTop-=1}if(this.hdr!=null){j.multicol=true}this.t[g._optId]={obj:this.modes[this.conf.opts_type].render(g,j),item:g,conf:{type:this.conf.opts_type}};g=null;if(c==true){this.list.scrollTop+=1}return l};dhtmlXCombo.prototype._removeOption=function(a){this.t[a].obj.destruct(this.t[a].item);this.t[a].obj=null;this.t[a].item.parentNode.removeChild(this.t[a].item);this.t[a].item=null;this.t[a].conf=null;this.t[a]=null;delete this.t[a];if(this.conf.last_hover==a){this.conf.last_hover=null}if(this.conf.last_selected==a){this.conf.last_selected=null;this._confirmSelect("onDelete")}};dhtmlXCombo.prototype._confirmSelect=function(c){var a=false;if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}if(this.conf.last_hover!=null){a=a||(this.conf.last_value!=this._getOptionValue(this.conf.last_hover));this.conf.last_match=this.conf.last_selected=this.conf.last_hover;this.conf.last_value=this._getOptionValue(this.conf.last_selected);this.conf.last_text=this.base.firstChild.value=this.t[this.conf.last_selected].obj.getText(this.t[this.conf.last_selected].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="false"}else{if(this.conf.allow_free_text||(this.base.firstChild.value==""&&this.conf.allow_empty_value)){a=a||(this.conf.last_text!=this.base.firstChild.value);this.conf.last_match=this.conf.last_value=this.conf.last_selected=null;this.conf.last_text=this.base.firstChild.value;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_text;this.base.childNodes[2].value="true"}else{this._cancelSelect();this._updateTopImage(this.conf.last_selected);return}}if(this.conf.f_ac&&this.conf.f_mode=="start"){this.conf.f_ac_text="";if(c!="blur"){this._selectRange(this.base.firstChild.value.length,this.base.firstChild.value.length)}}this._hideList();if(a==true&&c!="onInit"&&c!="onDelete"){this.callEvent("onChange",[this.conf.last_value,this.conf.last_text])}};dhtmlXCombo.prototype._cancelSelect=function(){this._hideList();this.base.firstChild.value=this.conf.last_text;if(this.conf.f_mode!=false){this._filterOpts(true)}};dhtmlXCombo.prototype._getOption=function(n,j){if(!this.t[n]){return null}if(typeof(j)=="undefined"){j=-1}if(j<0){for(var m=0;m<this.list.childNodes.length;m++){if(j<0&&this.list.childNodes[m]._optId==n){j=m}}}var l={value:this.t[n].obj.getValue(this.t[n].item),text:this.t[n].obj.getText(this.t[n].item),text_input:this.t[n].obj.getText(this.t[n].item,true),text_option:this.t[n].obj.getText(this.t[n].item,null,true),css:this.t[n].obj.getCss(this.t[n].item),selected:(n==this.conf.last_selected),index:j};if(typeof(this.t[n].obj.getExtraData)=="function"){var g=this.t[n].obj.getExtraData(this.t[n].item);for(var c in g){if(typeof(l[c])=="undefined"){l[c]=g[c]}}}return l};dhtmlXCombo.prototype._getOptionProp=function(j,g,c){if(j!=null){var a=this._getOption(j);if(a!=null){return a[g]}}return c};dhtmlXCombo.prototype._getOptionId=function(c){var j=null;for(var a=0;a<this.list.childNodes.length;a++){if(j==null){var g=this.list.childNodes[a]._optId;if(c==this.t[g].obj.getValue(this.t[g].item)){j=g}}}return j};dhtmlXCombo.prototype._getOptionValue=function(a){return this._getOptionProp(a,"value",null)};dhtmlXCombo.prototype.setSize=function(a){this.conf.combo_width=parseInt(a)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0);this.base.style.width=Math.max(0,this.conf.combo_width)+"px";this._adjustBase()};dhtmlXCombo.prototype._adjustBase=function(){this.base.firstChild.style.width=Math.max(0,(this.conf.combo_width-24-(this.conf.combo_image?23:0)))+"px";this.base.firstChild.style.marginLeft=(this.conf.combo_image?"23px":"0px")};dhtmlXCombo.prototype.setOptionWidth=function(a){this.conf.opts_width=(parseInt(a)||null)};dhtmlXCombo.prototype.setOptionIndex=function(g,a){if(isNaN(a)||a<0){return}var j=this.getOption(g);if(j==null){return}if(a==j.index){return}var c=this.list.childNodes[j.index];c.parentNode.removeChild(c);if(this.list.childNodes[a]!=null){this.list.insertBefore(c,this.list.childNodes[a])}else{this.list.appendChild(c)}c=null};dhtmlXCombo.prototype.getOptionsCount=function(){return this.list.childNodes.length};dhtmlXCombo.prototype._mcMakeTemplate=function(o){var l="";var j="";this.conf.col_w=0;for(var m=0;m<o.length;m++){var a=Number(parseInt(o[m].width)||50);var g=(o[m].css||"");var n=(m==0&&window.dhx4.isIE6==true?"_first":"");j+="<div class='dhxcombo_cell"+n+" "+g+"' style='width:"+a+"px;'><div class='dhxcombo_cell_text'>"+(o[m].option||"&nbsp;")+"</div></div>";l+="<div class='dhxcombo_hdrcell"+n+" "+g+"' style='width:"+a+"px;'><div class='dhxcombo_hdrcell_text'>"+(o[m].header||"&nbsp;")+"</div></div>";this.conf.col_w+=a+1}var a=500;var c=document.createElement("DIV");c.style.position="absolute";c.style.top="10px";c.style.left=-a*2+"px";c.style.width=a+"px";c.style.height="50px";c.style.overflowY="scroll";c.innerHTML="<div>&nbsp;</div>";document.body.appendChild(c);this.conf.col_w+=a-c.firstChild.offsetWidth+10;c.parentNode.removeChild(c);c=null;this.conf.template.option=j;this._mcAttachHeader(l);this.list.className+=" dhxcombolist_multicolumn"};dhtmlXCombo.prototype._mcAttachHeader=function(a){if(this.hdr==null){this.hdr=document.createElement("DIV");this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr";this.hdr.style.display="none";this.list.parentNode.insertBefore(this.hdr,this.list);if(typeof(window.addEventListener)=="function"){this.hdr.addEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.attachEvent("onmousedown",this._doOnListMouseDown)}if(this.conf.opts_type=="checkbox"&&this.conf.combo_image==true){this.conf.combo_image=false;if(this.base.lastChild.className.match(/dhxcombo_top_image/)!=null){this.base.removeChild(this.base.lastChild)}this._adjustBase()}}this.hdr.innerHTML="<div class='dhxcombo_hdrtext'>"+a+"</div>"};dhtmlXCombo.prototype._mcDetachHeader=function(){if(this.hdr!=null){if(typeof(window.addEventListener)=="function"){this.hdr.removeEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.detachEvent("onmousedown",this._doOnListMouseDown)}this.hdr.parentNode.removeChild(this.hdr);this.hdr=null}this.conf.col_w=null;this.conf.item_h=null};dhtmlXCombo.prototype.modes={};dhtmlXCombo.prototype.doWithItem=function(a,n,l,g){var m=(a>=0&&a<this.list.childNodes.length?this.list.childNodes[a]._optId:null);if(m==null){return null}if(typeof(this.t[m].obj[n])!="function"){return null}var j=[this.t[m].item];for(var c=2;c<arguments.length;c++){j.push(arguments[c])}return this.t[m].obj[n].apply(this.t[m].obj,j)};function dhtmlXComboExtend(j,g){for(var c in dhtmlXCombo.prototype.modes[g]){if(typeof(dhtmlXCombo.prototype.modes[j][c])=="undefined"){dhtmlXCombo.prototype.modes[j][c]=dhtmlXCombo.prototype.modes[g][c]}}}dhtmlXCombo.prototype.modes.option={image:false,option_css:"dhxcombo_option_text",render:function(a,c){a._conf={value:c.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.option_css+"'>&nbsp;</div>";if(c.css!=null){a.lastChild.style.cssText=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},destruct:function(a){a._conf=null},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text)},setText:function(c,g){c._conf.text=g;var a=(typeof(g)=="object"?window.dhx4.template(c._tpl.option,c._conf.text,true):window.dhx4.trim(c._conf.text||""));c.lastChild.innerHTML=(a.length==0?"&nbsp;":a)},getText:function(g,a,c){if(window.dhx4.s2b(a)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.input,g._conf.text,true)}if(window.dhx4.s2b(c)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.option,g._conf.text,true)}return g._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,c){a.className="dhxcombo_option"+(c?" dhxcombo_option_selected":"")},isSelected:function(a){return String(a.className).indexOf("dhxcombo_option_selected")>=0},getExtraData:function(a){return{type:"option"}}};dhtmlXCombo.prototype.modes.checkbox={image:true,image_css:"dhxcombo_checkbox dhxcombo_chbx_#state#",option_css:"dhxcombo_option_text dhxcombo_option_text_chbx",render:function(a,c){if(this.image_css_regexp==null){this.image_css_regexp=new RegExp(this.image_css.replace("#state#","\\d*"))}a._conf={value:c.value,css:"",checked:window.dhx4.s2b(c.checked)};a.className="dhxcombo_option";if(c.multicol==true){c.text.checkbox="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div>&nbsp;";a.innerHTML="<div class='"+dhtmlXCombo.prototype.modes.option.option_css+"'></div>"}else{a.innerHTML="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div><div class='"+this.option_css+"'>&nbsp;</div>"}if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},setChecked:function(c,g){c._conf.checked=window.dhx4.s2b(g);var a=String(this.image_css).replace("#state#",(c._conf.checked?"1":"0"));this._changeChbxCss(c.childNodes,a)},_changeChbxCss:function(a,c){for(var g=0;g<a.length;g++){if(a[g].tagName!=null&&a[g].className!=null&&a[g].className.match(this.image_css_regexp)!=null){a[g].className=c}else{if(a[g].childNodes.length>0){this._changeChbxCss(a[g].childNodes,c)}}}},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(j,g,l){var c=true;var a=(g.target||g.srcElement);while(c==true&&a!=null&&a!=j&&a.className!=null){if(a.className.match(this.image_css_regexp)!=null){if(l.callEvent("onCheck",[j._conf.value,!j._conf.checked])===true){this.setChecked(j,!this.isChecked(j))}c=false}else{a=a.parentNode}}a=l=j=null;return c},getTopImage:function(c,a){return""},topImageClick:function(a,c){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,c){this.doWithItem(a,"setChecked",c)};dhtmlXCombo.prototype.getChecked=function(a){var c=[];for(var g=0;g<this.list.childNodes.length;g++){if(this.isChecked(g)){c.push(this._getOptionProp(this.list.childNodes[g]._optId,"value",""))}}return c};dhtmlXCombo.prototype.isChecked=function(a){return this.doWithItem(a,"isChecked")};dhtmlXCombo.prototype.modes.image={image:true,image_css:"dhxcombo_image",option_css:"dhxcombo_option_text dhxcombo_option_text_image",render:function(a,c){a._conf={value:c.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.image_css+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis);return this},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis)},setImage:function(g,a,l,m,j,c){if(a!=null&&a.length>0){a=m+a}else{if(j!=null&&j.length>0){a=m+j}else{a=null}}if(l!=null&&l.length>0){l=m+l}else{if(c!=null&&c.length>0){l=m+c}else{if(c==true){l=a}else{l=null}}}g._conf.img=a;g._conf.img_dis=l;g.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(j,g){var c=(g?"img":"img_dis");if(j!=null&&j._conf[c]!=null){return"<div class='"+this.image_css+"' style='background-image:url("+j._conf[c]+");'></div>"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,c){if(a!=null){this.conf.img_def=a}if(c!=null){this.conf.img_def_dis=c}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXColorPicker(o){if(!(this instanceof dhtmlXColorPicker)){return new dhtmlXColorPicker(o)}dhx4._eventable(this);var m=this,j=undefined,n=null,g,a,c;this._nodes=[];this.activeNode=null;this._inputListenerId=null;this.base=null;this._globalNode=null;this.memory=null;this.skin=null;this.conf={cp_id:dhx4.newId(),x:0,y:0,c:0,indent:2,position:"right",customColors:false,selectedColor:null,hide:false,hideOnSelect:false,lang:"en",closeable:true};this.value={red:-1,blue:-1,green:-1,hue:-1,sat:-1,lum:-1};this._initMoveSelection=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){m._controllerNodes.colorArea.addEventListener("mousemove",m._setMoveSelection,false);document.body.addEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.attachEvent("onmousemove",m._setMoveSelection);document.body.attachEvent("onmouseup",m._cleanMoveSelection)}m._setMoveSelection(l,m._controllerNodes.colorArea);return false};this._cleanMoveSelection=function(){if(typeof(window.removeEventListener)=="function"){m._controllerNodes.colorArea.removeEventListener("mousemove",m._setMoveSelection,false);document.body.removeEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.detachEvent("onmousemove",m._setMoveSelection);document.body.detachEvent("onmouseup",m._cleanMoveSelection)}return false};this._setMoveSelection=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.colorArea);if(m._controllerNodes.fr_cover){setTimeout(function(){m._setColorAreaXY(q.x,q.y);m._setColorByXYC()},0)}else{m._setColorAreaXY(q.x,q.y);m._setColorByXYC()}return false};this._initMoveContrast=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",m._setMoveContrast,false);document.body.addEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.attachEvent("onmousemove",m._setMoveContrast);document.body.attachEvent("onmouseup",m._cleanMoveContrast)}m._setMoveContrast(l,m._controllerNodes.contrastArea)};this._cleanMoveContrast=function(){if(typeof(window.removeEventListener)=="function"){document.body.removeEventListener("mousemove",m._setMoveContrast,false);document.body.removeEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.detachEvent("onmousemove",m._setMoveContrast);document.body.detachEvent("onmouseup",m._cleanMoveContrast)}};this._setMoveContrast=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.contrastArea);m._setContrastY(q.y);m._setColorByXYC(true)};this._doOnSelectColor=function(){var l=m.colorAIP.rgb2hex({r:m.value.red,g:m.value.green,b:m.value.blue});if(m.activeNode!=null){if(m.activeNode.valueCont){m.activeNode.valueCont.value=l}if(m.activeNode.valueColor){m.activeNode.valueColor.style.backgroundColor=l}}if(m.base._dhx_remove||m.conf.hideOnSelect){m.hide()}m.callEvent("onSelect",[l,((m.activeNode)?m.activeNode.node:null)])};this._doOnCancel=function(){if(m.callEvent("onCancel",[((m.activeNode)?m.activeNode.node:null)])==true&&m.conf.closeable==true){m.hide()}};this._doOnFocusByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);m.activeNode=l;if(l&&l==m.activeNode){m._initListenerInput()}};this._doOnBlurByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);if(l&&l==m.activeNode){m._removeListenerInput()}};this._doOnClickByNode=function(q){q=q||event;var l=(this!=window)?this:event.srcElement;m.activeNode=(m.activeNode.node!=l)?m._getNodeByElement(l):m.activeNode;if(!m.isVisible()){m.show()}};this.saveColor=function(){m.memory.setValue(m.value)};this._onSelectMemoryEl=function(q){var l;m._refreshCoordinatesByHSL(q.value.hue,q.value.sat,q.value.lum);for(l in q.value){m.value[l]=q.value[l]}m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnClickByBody=function(r){r=r||event;var l=true,q=r.target||r.srcElement;if(m._isBaseNode(q)){l=false}if(l&&m.activeNode&&(m.activeNode.node==q||m.activeNode.valueCont==q)){l=false}if(l){m.hide()}};this._doOnChangeHSL=function(){var r=parseInt(m._controllerNodes.hue.value),q=parseInt(m._controllerNodes.sat.value),l=parseInt(m._controllerNodes.lum.value),s;if(isNaN(r)||r>359||r<0){m._controllerNodes.hue.value=m.value.hue}else{m.value.hue=r}if(isNaN(q)||q>100||q<0){m._controllerNodes.sat.value=m.value.sat}else{m.value.sat=q}if(isNaN(l)||l>100||l<0){m._controllerNodes.lum.value=m.value.lum}else{m.value.lum=l}s=m.colorAIP.hsl2rgb(m.value.hue,m.value.sat/100,m.value.lum/100);m.value.red=Math.round(255*s.r);m.value.green=Math.round(255*s.g);m.value.blue=Math.round(255*s.b);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeRGB=function(){var s=parseInt(m._controllerNodes.red.value),r=parseInt(m._controllerNodes.green.value),l=parseInt(m._controllerNodes.blue.value),q;if(isNaN(s)||s>255||s<0){m._controllerNodes.red.value=m.value.red}else{m.value.red=s}if(isNaN(r)||r>255||r<0){m._controllerNodes.green.value=m.value.green}else{m.value.green=r}if(isNaN(l)||l>255||l<0){m._controllerNodes.blue.value=m.value.blue}else{m.value.blue=l}q=m.colorAIP.rgb2hsl(m.value.red/255,m.value.green/255,m.value.blue/255);m.value.hue=Math.round(q.h);m.value.sat=Math.round(q.s*100);m.value.lum=Math.round(q.l*100);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeHSV=function(){m._controllerNodes.hsv.value=m.setColor(m._controllerNodes.hsv.value)};this._checkType=function(q){var l;if(q instanceof Array){l=m._checkType(q[0]);switch(l){case"string":return"array_string";break;case"input":case"textarea":return"array_input";break;case"object":return"array_object";break;default:return undefined}}else{if(q==undefined){return null}else{if(typeof(q)=="string"){return"string"}else{if(q.tagName&&q.tagName.toLowerCase()=="input"){return"input"}else{if(q.tagName&&q.tagName.toLowerCase()=="textarea"){return"textarea"}else{if(q.tagName){return"container"}else{if(typeof(q)=="object"){return"object"}else{return undefined}}}}}}}};this._initByObject=function(l){if(l.parent&&l.parent.tagName){m.base=l.parent}else{if(typeof(l.parent)=="string"){m.base=document.getElementById(l.parent)}else{m.base=document.createElement("div");m.base._dhx_remove=true}}if(l.color){m.conf.selectedColor=l.color}if(typeof(l.closeable)!="undefined"){this.conf.closeable=dhx4.s2b(l.closeable)}if(l.custom_colors){this._tempInitCC=function(){var s,r;this.initMemoryColors();this.conf.customColors=true;if(l.custom_colors instanceof Array){r=l.custom_colors.length;for(s=0;s<r;s++){this.setCustomColors(l.custom_colors[s])}}if(this.base.parentNode){this.showMemory()}delete this._tempInitCC}}if(l.hide){m.conf.hide=true}if(l.input){m._addNode(l.input,l.target_color,l.target_value)}var q=l.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcolorpicker")||"dhx_skyblue";m.setSkin(q);if(l.colors){m.initMemoryColors();m.conf.customColors=true}if(l.link){m._addNode(l.link)}};this.unload=function(){var s,q,r;if(this.isVisible()){this.hide()}this.destructMemory();q=this._nodes.length;for(s=0;s<q;s++){this._detachEventsFromNode(this._nodes[s]);for(r in this._nodes[s]){this._nodes[s][r]=null}delete this._nodes[s]}this._nodes=null;if(!this.base._dhx_remove){this.base.className=this.base.className.replace(/\s?dhtmlxcp_\S*/,"")}else{delete this.base._dhx_remove}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.removeEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.removeEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.removeEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.removeEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.removeEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.removeEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.detachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.detachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.detachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.detachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.detachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.detachEvent("onchange",this._doOnChangeHSV)}if(this._controllerNodes.fr_cover){if(this._controllerNodes.fr_cover.parentNode){this._controllerNodes.fr_cover.parentNode.removeChild(this._controllerNodes.fr_cover)}delete this._controllerNodes.fr_cover}dhx4.zim.clear(this.conf.cp_id);dhx4._eventable(this,"clear");for(r in this){this[r]=null}m=null,n=null,c=null};j=this._checkType(o);switch(j){case"object":m._initByObject(o);break;case"input":case"textarea":m._initByObject({});this._addNode(o);break;case"string":n=document.getElementById(o);return new dhtmlXColorPicker(n);break;case"container":m._initByObject({parent:o});break;case null:m._initByObject({});break;case"array_string":case"array_input":m._initByObject({});a=o.length;for(g=0;g<a;g++){this._addNode(o[g])}break;case"array_object":m._initByObject({});a=o.length;for(g=0;g<a;g++){c=this._addNode(o[g].input,o[g].target_color,o[g].target_value).conf;c.customColors=(o[g].custom_colors!=undefined)?dhx4.s2b(o[g].custom_colors):c.customColors;c.selectedColor=(o[g].color!=undefined)?o[g].color:c.selectedColor}break}this.base.innerHTML="<div class='dhxcp_g_area'><div class='dhxcp_sub_area'><div class='dhxcp_g_color_area'><div class='dhxcp_color_selector'><div class='dhxcp_v_line'></div><div class='dhxcp_h_line'></div></div><div class='dhxcp_contrast_area'><div class='dhxcp_h_line'></div></div></div><div class='dhxcp_g_input_area'><div class='dhxcp_value_cont'><div class='dhxcp_value_color'></div><input type='text' class='dhxcp_value'/></div><table class='dhxcp_inputs_cont' cellpadding='0' cellspacing='0' border='0'><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelHue+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelRed+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelSat+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelGreen+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelLum+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelBlue+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr></table></div><div class='dhxcp_g_memory_area'></div><div class='dhxcp_buttons_area'><button class='dhx_button_save'>"+this.i18n[this.conf.lang].btnSelect+"</button><button class='dhx_button_cancel'>"+this.i18n[this.conf.lang].btnCancel+"</button></div></div>";"</div>";this._globalNode=this.base.firstChild;this._controllerNodes={colorArea:this._globalNode.firstChild.firstChild.firstChild,v_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[0],h_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[1],contrastArea:this._globalNode.firstChild.firstChild.childNodes[1],contrast_line:this._globalNode.firstChild.firstChild.childNodes[1].firstChild,color:this._globalNode.firstChild.childNodes[1].childNodes[0].firstChild,hsv:this._globalNode.firstChild.childNodes[1].childNodes[0].childNodes[1],hue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[1].firstChild,sat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[1].firstChild,lum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[1].firstChild,red:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[3].firstChild,green:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[3].firstChild,blue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[3].firstChild,memory_block:this._globalNode.firstChild.childNodes[2],button_save:this._globalNode.firstChild.childNodes[3].firstChild,button_cancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};this._labelNodes={labelHue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].firstChild,labelSat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].firstChild,labelLum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].firstChild,labelRed:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[2],labelGreen:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[2],labelBlue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[2],btnAddColor:null,btnSelect:this._globalNode.firstChild.childNodes[3].firstChild,btnCancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};if(typeof(this._tempInitCC)=="function"){this._tempInitCC()}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.addEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.addEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.addEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.addEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.addEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.addEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.attachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.attachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.attachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.attachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.attachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.attachEvent("onchange",this._doOnChangeHSV)}this.setColor(this.conf.selectedColor||"#ffffff");if(this._nodes.length){for(var g=0;g<this._nodes.length;g++){this._attachEventsToNode(this._nodes[g])}}if(this.conf.hide){this.hide()}if(typeof(this._cpInitFRM)=="function"){this._cpInitFRM()}}dhtmlXColorPicker.prototype.linkTo=function(c,g,j){if(arguments.length==1){g=j=c}var a;c=c||null;j=j||null;if(typeof(g)=="string"){g=document.getElementById(g)}a=this._addNode(g,c,j);if(a){this._attachEventsToNode(a)}return a};dhtmlXColorPicker.prototype._isBaseNode=function(a){if(a==this.base){return true}if(a.parentElement==document.body){return false}else{if(!a.parentElement){return false}else{return this._isBaseNode(a.parentElement)}}};dhtmlXColorPicker.prototype._hasInput=function(g){var c,a,j=false;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].valueCont==g){j=true;break}}return j};dhtmlXColorPicker.prototype._findNodesByArray=function(m){var g,a,c,j=[];a=m.length;for(g=0;g<a;g++){if(typeof(m[g])=="string"){c=document.getElementById(m[g])}else{c=m[g]}if(c){this._addNode(c)}}};dhtmlXColorPicker.prototype._addNode=function(l,n,m){var c,j,g,a;if(typeof(l)=="string"){c=document.getElementById(l)}else{c=l}if(typeof(n)=="string"){n=document.getElementById(n)}if(typeof(m)=="string"){m=document.getElementById(m)}if(!c){return null}if(dhx4.s2b(c.getAttribute("colorbox"))){j=document.createElement("div");j.style.width=c.offsetWidth+"px";j.style.height=c.offsetHeight+"px";c.style.width=c.offsetWidth-(c.offsetHeight+8)+"px";c.parentNode.insertBefore(j,c);j.style.position="relative";g=document.createElement("div");j.appendChild(c);j.appendChild(g);g.className="dhxcp_colorBox";c.className+=" dhxcp_colorInput";g.style.width=g.style.height=c.offsetHeight+"px"}a={node:c,valueColor:(n!=undefined)?n:g||c,valueCont:(m!=undefined)?m:c,conf:{customColors:(c.getAttribute("customcolors")!=null)?dhx4.s2b(c.getAttribute("customcolors")):null,selectedColor:c.getAttribute("selectedcolor")}};this._nodes.push(a);if(!this.activeNode){this.activeNode=a}return a};dhtmlXColorPicker.prototype.getNode=function(g){var a=null,c=null;if(typeof(g)=="string"){a=document.getElementById(g)}else{a=g}if(a.tagName!=undefined){c=this._getNodeByElement(a)}return c};dhtmlXColorPicker.prototype._getNodeByElement=function(g){var j=null,c,a;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].node==g){j=this._nodes[c]}}return j};dhtmlXColorPicker.prototype._getNodeByValueCont=function(g){var j=null,c,a;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].valueCont&&this._nodes[c].valueCont==g){j=this._nodes[c]}}return j};dhtmlXColorPicker.prototype.initMemoryColors=function(){var c=this;this._controllerNodes.memory_block.innerHTML="<div class='dhxcp_memory_button_cont'><button class='dhxcp_save_to_memory'><div class='dhxcp_label_bm'>"+this.i18n[this.conf.lang].btnAddColor+"</div></button></div><div class='dhxcp_memory_els_cont'><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a></div>";this.memory=new this.Memory(this._controllerNodes.memory_block.childNodes[1]);this.memory.onSelect=this._onSelectMemoryEl;this.memory.onSave=function(j){var g=c.colorAIP.rgb2hex({r:j.red,g:j.green,b:j.blue});c.callEvent("onSaveColor",[g])};var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=this._controllerNodes.memory_block.childNodes[0].firstChild.firstChild;if(typeof(window.addEventListener)=="function"){a.addEventListener("click",this.saveColor,false)}else{a.attachEvent("onclick",this.saveColor)}};dhtmlXColorPicker.prototype._refreshCoordinatesByHSL=function(n,m,c){var a,j,g;a=Math.round((this.configColorArea.maxX-this.configColorArea.minX)*n/359)+this.configColorArea.minX;j=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-c)/100)+this.configColorArea.minY;g=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-m)/100)+this.configColorArea.minY;this._setColorAreaXY(a,j);this._setContrastY(g)};dhtmlXColorPicker.prototype._parseColor=function(g){if(g instanceof Array){var c={r:parseInt(g[0]),g:parseInt(g[1]),b:parseInt(g[2])}}else{if(typeof(g)=="string"){g=g.replace(/\s/g,"");if(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i.test(g)){var a=g.match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);var c={r:parseInt(a[1]),g:parseInt(a[2]),b:parseInt(a[3])}}else{var c=this.colorAIP.hex2rgb(g)}}}return c};dhtmlXColorPicker.prototype.setColor=function(m){var c=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});var g=this._parseColor(m);var l=(g instanceof Object);l=l&&(0<=g.r&&g.r<=255);l=l&&(0<=g.g&&g.g<=255);l=l&&(0<=g.b&&g.b<=255);if(!l){return c}var j=this.colorAIP.rgb2hex({r:g.r,g:g.g,b:g.b});if(j==c){return c}this.value.red=g.r;this.value.green=g.g;this.value.blue=g.b;var a=this.colorAIP.rgb2hsl(g.r/255,g.g/255,g.b/255);this.value.hue=Math.round(a.h);this.value.sat=Math.round(a.s*100);this.value.lum=Math.round(a.l*100);this._refreshCoordinatesByHSL(this.value.hue,this.value.sat,this.value.lum);this._refreshContrast();this._refreshInputValues();this._refreshColorValue();return j};dhtmlXColorPicker.prototype.getSelectedColor=function(){return[this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue}),[this.value.red,this.value.green,this.value.blue],[this.value.hue,this.value.sat,this.value.lum]]};dhtmlXColorPicker.prototype._attachEventsToNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.addEventListener("click",this._doOnClickByNode,false)}else{a.node.attachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.addEventListener("focus",this._doOnFocusByInput,false);a.valueCont.addEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.attachEvent("onfocus",this._doOnFocusByInput);a.valueCont.attachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype._detachEventsFromNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.removeEventListener("click",this._doOnClickByNode,false)}else{a.node.detachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.removeEventListener("focus",this._doOnFocusByInput,false);a.valueCont.removeEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.detachEvent("onfocus",this._doOnFocusByInput);a.valueCont.detachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype.show=function(c){var a=false;if(c!=undefined){this.activeNode=this.getNode(c)||this.activeNode}if(this.activeNode&&this.activeNode.valueCont&&this.activeNode.valueCont.value){this.setColor(this.activeNode.valueCont.value)}if(this.activeNode){a=(this.activeNode.conf.customColors!=null?this.activeNode.conf.customColors:this.conf.customColors);this.setColor(this.activeNode.conf.selectedColor)}else{a=this.conf.customColors}if(a){this.showMemory()}else{this.hideMemory()}if(this.base._dhx_remove){this.base.firstChild.style.zIndex=dhx4.zim.reserve(this.conf.cp_id);this.base.style.visibility="hidden";if(document.body.firstChild){document.body.insertBefore(this.base,document.body.firstChild)}else{document.body.appendChild(this.base)}this._refreshPosition();this.base.style.visibility="visible";if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.attachEvent("onmousedown",this._doOnClickByBody)}}else{this.base.appendChild(this._globalNode)}if(this._controllerNodes.fr_cover){this.base.insertBefore(this._controllerNodes.fr_cover,this._globalNode)}this.callEvent("onShow",[((this.activeNode)?this.activeNode.node:null)])};dhtmlXColorPicker.prototype.setPosition=function(c,l){var j=null;var a=parseInt(c);var g=parseInt(l);if(isNaN(a)){j=({right:"right",bottom:"bottom"}[c.toLowerCase()]?c:null)}if(this.base._dhx_remove){if(j==null){}else{this.conf.position=j;this._refreshPosition(j)}}else{if(isNaN(a)||isNaN(g)){}else{this._globalNode.style.left=a+"px";this._globalNode.style.top=g+"px";if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}}}};dhtmlXColorPicker.prototype._initListenerInput=function(){var a=this;this._inputListenerId=this._inputListenerId||setInterval(function(){a._refreshValueByInput()},70)};dhtmlXColorPicker.prototype._removeListenerInput=function(){if(this._inputListenerId){clearInterval(this._inputListenerId);this._inputListenerId=null}};dhtmlXColorPicker.prototype._refreshValueByInput=function(){var c=this.activeNode.valueCont.value,a=this.getSelectedColor()[0];if(this._inputListenerId){if(/^#[\da-f]{6}$/i.test(c)&&c!=a){this.setColor(c);this.callEvent("onSelect",[c,this.activeNode.node])}}};dhtmlXColorPicker.prototype._refreshPosition=function(c){if(this.activeNode==null){return}var o=dhx4.absTop(this.activeNode.node);var a=dhx4.absLeft(this.activeNode.node);var j=dhx4.screenDim();var g=this._globalNode.offsetWidth;var l=this._globalNode.offsetHeight;var n=0;c=c||this.conf.position;switch(c){case"bottom":var n=o+this.activeNode.node.offsetHeight+this.conf.indent;var m=a;if(m+g>j.left+j.right){m=a+this.activeNode.node.offsetWidth-g}if(m<j.left){m=a}if(n+l>j.top+j.bottom){n=o-l-this.conf.indent}if(n-j.top<0){n=j.top+this.conf.indent}this._globalNode.style.top=n+"px";this._globalNode.style.left=m+"px";break;default:var m=a+this.activeNode.node.offsetWidth+this.conf.indent;n=o;if(c=="right"){if(m+g>j.left+j.right){m=a-g-this.conf.indent}if(m<j.left){m=a+this.activeNode.node.offsetWidth+this.conf.indent}}if(j.bottom-(n+l)<=0){n=o+this.activeNode.node.offsetHeight-l}if(n-j.top<0){n=j.top+this.conf.indent}this._globalNode.style.left=m+"px";this._globalNode.style.top=n+"px"}if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}};dhtmlXColorPicker.prototype.isVisible=function(){var a=false;if(this.base._dhx_remove){a=this.base.parentNode==document.body}else{a=this._globalNode.parentNode==this.base}return a};dhtmlXColorPicker.prototype.hide=function(){if(this.base._dhx_remove){if(this.base.parentNode){this.base.parentNode.removeChild(this.base);dhx4.zim.clear(this.conf.cp_id);if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.detachEvent("onmousedown",this._doOnClickByBody)}}}else{if(this.isVisible()==false){return}this.base.removeChild(this._globalNode)}if(this._controllerNodes.fr_cover&&this._controllerNodes.fr_cover.parentNode){this._controllerNodes.fr_cover.parentNode.removeChild(this._controllerNodes.fr_cover)}if(this.callEvent!=undefined){this.callEvent("onHide",[((this.activeNode)?this.activeNode.node:null)])}};dhtmlXColorPicker.prototype.configColorArea={minX:1,maxX:209,minY:1,maxY:119};dhtmlXColorPicker.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXColorPicker.prototype.i18n={en:{labelHue:"Hue",labelSat:"Sat",labelLum:"Lum",labelRed:"Red",labelGreen:"Green",labelBlue:"Blue",btnAddColor:"Save the color",btnSelect:"Select",btnCancel:"Cancel"}};dhtmlXColorPicker.prototype.loadUserLanguage=function(a){if(typeof(this._mergeLangModules)=="function"){this._mergeLangModules()}this.conf.lang=a;this._refreshLanguage()};dhtmlXColorPicker.prototype._refreshLanguage=function(){var a,c=this.i18n[this.conf.lang];for(a in c){if(this._labelNodes[a]){this._labelNodes[a].innerHTML=c[a]}}};dhtmlXColorPicker.prototype._setColorAreaXY=function(a,g){var c=this.configColorArea;a=parseInt(a);if(c.minX>a){this.conf.x=c.minX}else{if(a>c.maxX){this.conf.x=c.maxX}else{if(!isNaN(a)){this.conf.x=a}}}g=parseInt(g);if(c.minY>g){this.conf.y=c.minY}else{if(g>c.maxY){this.conf.y=c.maxY}else{if(!isNaN(g)){this.conf.y=g}}}this._refreshLines()};dhtmlXColorPicker.prototype._setColorByXYC=function(c){c=c||false;this.value.hue=Math.round((359*(this.conf.x-this.configColorArea.minX))/(this.configColorArea.maxX-this.configColorArea.minX));this.value.lum=Math.round(100-(100*(this.conf.y-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));this.value.sat=Math.round(100-(100*(this.conf.c-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));var a=this.colorAIP.hsl2rgb(this.value.hue,this.value.sat/100,this.value.lum/100);this.value.red=Math.round(255*a.r);this.value.green=Math.round(255*a.g);this.value.blue=Math.round(255*a.b);if(!c){this._refreshContrast()}this._refreshInputValues();this._refreshColorValue()};dhtmlXColorPicker.prototype._setContrastY=function(c){var a=this.configColorArea;c=parseInt(c);if(!isNaN(c)){this.conf.c=Math.min(Math.max(a.minY,c),a.maxY)}this._refreshContrastLine()};dhtmlXColorPicker.prototype._refreshInputValues=function(){this._controllerNodes.hue.value=this.value.hue;this._controllerNodes.sat.value=this.value.sat;this._controllerNodes.lum.value=this.value.lum;this._controllerNodes.red.value=this.value.red;this._controllerNodes.green.value=this.value.green;this._controllerNodes.blue.value=this.value.blue};dhtmlXColorPicker.prototype._refreshColorValue=function(){this._controllerNodes.color.style.backgroundColor="rgb("+[this.value.red,this.value.green,this.value.blue].join(", ")+")";var a=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});this._controllerNodes.hsv.value=a;this.callEvent("onChange",[a])};dhtmlXColorPicker.prototype._refreshContrast=function(){var j=this.colorAIP.hsl2rgb(this.value.hue,0,this.value.lum/100);var l=this.colorAIP.hsl2rgb(this.value.hue,1,this.value.lum/100);var g=this._checkIeVersion();if(g&&g<=9){var m=this._controllerNodes.contrastArea.firstChild;if(m==this._controllerNodes.contrast_line){m=document.createElement("div");m.className+="dhxcp_ie_gradient";this._controllerNodes.contrastArea.appendChild(m);this._controllerNodes.contrastArea.appendChild(this._controllerNodes.contrast_line)}var c=this.colorAIP.rgb2hex({r:Math.round(255*j.r),g:Math.round(255*j.g),b:Math.round(255*j.b)});var a=this.colorAIP.rgb2hex({r:Math.round(255*l.r),g:Math.round(255*l.g),b:Math.round(255*l.b)});m.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', endColorstr='"+c+"', GradientType=0)"}else{j=[Math.round(255*j.r),Math.round(255*j.g),Math.round(255*j.b)];l=[Math.round(255*l.r),Math.round(255*l.g),Math.round(255*l.b)];this._controllerNodes.contrastArea.style.backgroundImage="linear-gradient(to top, rgb("+j.join(",")+"), rgb("+l.join(",")+"))"}};dhtmlXColorPicker.prototype._refreshLines=function(){this._controllerNodes.v_line.style.left=this.conf.x+"px";this._controllerNodes.h_line.style.top=this.conf.y+"px"};dhtmlXColorPicker.prototype._refreshContrastLine=function(){this._controllerNodes.contrast_line.style.top=this.conf.c+"px"};dhtmlXColorPicker.prototype._getOffsetPosition=function(j,a){var c={x:NaN,y:NaN},g=j.target||j.srcElement;if(g==a){c.x=(j.offsetX!=undefined)?j.offsetX:j.layerX;c.y=(j.offsetY!=undefined)?j.offsetY:j.layerY}else{if(g==this._controllerNodes.v_line){c.y=(j.offsetY!=undefined)?j.offsetY:j.layerY}else{c.x=(j.offsetX!=undefined)?j.offsetX:j.layerX}}return c};dhtmlXColorPicker.prototype.colorAIP={hex2rgb:function(c){var a=c.match(/^(#)([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(a!=null){return{r:parseInt("0x"+a[2]),g:parseInt("0x"+a[3]),b:parseInt("0x"+a[4])}}else{return null}},rgb2hex:function(l){var j=parseInt(l.r),c=parseInt(l.g),a=parseInt(l.b);j=j||0,c=c||0,a=a||0;return"#"+((j)?((j<16)?"0"+j.toString(16):j.toString(16)):"00")+((c)?((c<16)?"0"+c.toString(16):c.toString(16)):"00")+((a)?((a<16)?"0"+a.toString(16):a.toString(16)):"00")},rgb2hsl:function(q,o,j){var n,m,c;var a=Math.max(q,o,j),l=Math.min(q,o,j);c=0.5*(a+l);if(a==l){n=0}else{if(a==q){n=60*(o-j)/(a-l);if(o<j){n+=360}}else{if(a==o){n=60*(j-q)/(a-l)+120}else{n=60*(q-o)/(a-l)+240}}}if(c==0||a==l){m=0}else{if(c<=0.5){m=0.5*(a-l)/c}else{m=0.5*(a-l)/(1-c)}}return{h:n,s:m,l:c}},hsl2rgb:function(q,g,n){var l,m,o;var c=[],a=[];if(n<=0.5){l=n*(1+g)}else{l=n+g-(n*g)}m=2*n-l;o=q/360;c.push(o+1/3);c.push(o);c.push(o-1/3);for(var j=0;j<3;j++){if(c[j]<0){c[j]+=1}else{if(c[j]>1){c[j]-=1}}if(c[j]<1/6){a.push(m+(l-m)*6*c[j])}else{if(c[j]<0.5){a.push(l)}else{if(c[j]<2/3){a.push(m+(l-m)*(2/3-c[j])*6)}else{a.push(m)}}}}return{r:a[0],g:a[1],b:a[2]}}};dhtmlXColorPicker.prototype._checkIeVersion=function(){var a;var c=navigator.userAgent.match(/(MSIE)\s(\d\.\d)/i);a=(c&&c[2])?parseInt(c[2]):null;return a};dhtmlXColorPicker.prototype.setCustomColors=function(){if(this.memory==null){this.initMemoryColors();this.conf.customColors=true}var j,g,n,c,m,a;g=arguments.length;for(j=0;j<g;j++){if(arguments[j] instanceof Array){n=this._rgb2value(arguments[j][0],arguments[j][1],arguments[j][2]);this.memory.setValue(n,null,false);continue}else{if(typeof(arguments[j])=="string"){c=arguments[j].match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);if(c instanceof Array){n=this._rgb2value(c[1],c[2],c[3]);this.memory.setValue(n,null,false);continue}c=arguments[j].match(/(#[\da-f]{6})/ig);if(c instanceof Array){a=c.length;for(m=0;m<a;m++){n=this._hex2value(c[m]);this.memory.setValue(n,null,false)}}}}}};dhtmlXColorPicker.prototype.getCustomColors=function(){var c=[];if(this.memory!=null&&this.conf.customColors==true){for(var g=0;g<this.memory.controllers.length;g++){var a=this.memory.controllers[g].value;c.push(this.colorAIP.rgb2hex({r:a.red,g:a.green,b:a.blue}))}}return c};dhtmlXColorPicker.prototype._rgb2value=function(l,j,a){var c=this.colorAIP.rgb2hsl(l/255,j/255,a/255);return{red:l,green:j,blue:a,hue:Math.round(c.h),sat:Math.round(c.s*100),lum:Math.round(c.l*100)}};dhtmlXColorPicker.prototype._hex2value=function(g){var c,a;c=this.colorAIP.hex2rgb(g);a=this.colorAIP.rgb2hsl(c.r/255,c.g/255,c.b/255);return{red:c.r,green:c.g,blue:c.b,hue:Math.round(a.h),sat:Math.round(a.s*100),lum:Math.round(a.l*100)}};dhtmlXColorPicker.prototype.showMemory=function(){if(this.memory==null){this.initMemoryColors()}if(!this._globalNode.className.match(/dhxcp_add_memory/)){this._globalNode.className+=" dhxcp_add_memory"}this.conf.customColors=true};dhtmlXColorPicker.prototype.hideMemory=function(){if(this.memory!=null){this._globalNode.className=this._globalNode.className.replace(/\sdhxcp_add_memory/,"")}this.conf.customColors=false};dhtmlXColorPicker.prototype.setSkin=function(l){l=l.toLowerCase();var g,c=-1,a,j="dhtmlxcp";g=this.base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,j+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=j+"_"+l;this.base.className=g.join(" ");this.skin=l};dhtmlXColorPicker.prototype.hideOnSelect=function(a){a=dhx4.s2b(a);this.conf.hideOnSelect=a};dhtmlXColorPicker.prototype._indexOf=function(a,j){var g,c,m=-1;c=a.length;for(g=c;g>=0;g--){if(a[g]==j){m=g;break}}return m};dhtmlXColorPicker.prototype.destructMemory=function(){if(this.memory==null){return}this.hideMemory();var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=null;if(typeof(window.addEventListener)=="function"){a.removeEventListener("click",this.saveColor,false)}else{a.detachEvent("onclick",this.saveColor)}this.memory.remove();this._controllerNodes.memory_block.innerHTML="";this.memory=null};dhtmlXColorPicker.prototype.Memory=function(g){var c=this,a=null,j={red:255,blue:255,green:255,hue:0,sat:0,lum:100};this.select=function(){var m=(this!=window)?this:event.srcElement;var l=l||m.dhxpc_memory;if(a!=null){c.unSelect()}a=l;l.domElement.className+=" dhxcp_memory_el_select";if(typeof(c.onSelect)=="function"){c.onSelect(l)}};this.onSelect=null;this.onSave=null;this._createMemoryController=function(l){var m={domElement:l,value:dhx4._copyObj(j)};l.dhxpc_memory=m;if(typeof(window.addEventListener)=="function"){l.addEventListener("click",c.select,false)}else{l.attachEvent("onclick",c.select)}return m};this._findMemoryControllers=function(r){var o=r.getElementsByTagName("a"),n,m,q=[];m=o.length;for(n=0;n<m;n++){q.push(this._createMemoryController(o[n]))}return q};this.controllers=this._findMemoryControllers(g);this.unSelect=function(){if(a){a.domElement.className=a.domElement.className.replace(/\s.*$/i,"")}a=null};this.setActiveNext=function(){var n=null,m;if(a==null){a=this.controllers[0]}else{n=this.getIndex(a);m=this.controllers.length;this.unSelect();a=(n+1<m)?this.controllers[n+1]:this.controllers[0]}a.domElement.className+=" dhxcp_memory_el_next";return a};this.setValue=function(m,l,n){a=l||a;if(a==null){a=this.controllers[0]}a.value.red=m.red;a.value.blue=m.blue;a.value.green=m.green;a.value.hue=m.hue;a.value.sat=m.sat;a.value.lum=m.lum;a.domElement.style.backgroundColor="rgb("+[m.red,m.green,m.blue].join(", ")+")";this.setActiveNext();if((n!=false)&&(typeof(this.onSave)=="function")){this.onSave(m)}};this.clean=function(){var m=this.controllers.length,o;for(var n=0;n<m;n++){o=this.controllers[n];o.value=dhx4._copyObj(j);o.domElement.style.backgroundColor="rgb("+[j.red,j.green,j.blue].join(", ")+")"}this.unSelect();a=this.controllers[0]};this.getIndex=function(o){var n,m,q=-1;m=this.controllers.length;for(n=0;n<m;n++){if(this.controllers[n]==o){q=n;break}}return q};this.remove=function(){var n,m;m=this.controllers.length;for(n=0;n<m;n++){if(typeof(window.addEventListener)=="function"){this.controllers[n].domElement.removeEventListener("click",this.select,false)}else{this.controllers[n].domElement.detachEvent("onclick",this.select)}delete this.controllers[n].domElement.dhxpc_memory}delete this.onSelect;delete this.controllers;delete this.onSave}};if(window.dhx4.isIE6){dhtmlXColorPicker.prototype._cpInitFRM=function(){var a;if(!this._controllerNodes.fr_cover){a=document.createElement("IFRAME");a.className="dhxcp_frm";a.border=0;a.frameBorder=0;this._controllerNodes.fr_cover=a}if(!this.base._dhx_remove){this.base.insertBefore(a,this._globalNode)}}}function dhtmlXSlider(c){var a=this;this.conf={size:null,skin:null,vertical:false,min:0,max:99,value:0,step:1,decimals:0,margin:2,border:1,inverse:false,disabled:false,tooltip:false,visible:true,linkTo:undefined};this._attachedNode={};this._movingInitialValues=null;this.base=null;if(arguments.length>1){return new dhtmlXSlider(this._renderArgumets(arguments))}else{if(typeof(c)=="string"||(typeof(c)=="object"&&c.tagName)){return new dhtmlXSlider({parent:c})}}if(typeof(c.parent)=="string"){this.base=document.getElementById(c.parent)}else{this.base=c.parent}this._mergeConfig(this._readAttFormNode(this.base));this._mergeConfig(c);this._detectDecimals();if(this.conf.size==null||this.conf.size==undefined){if(this.conf.vertical){this.conf.size=this.base.offsetHeight}else{this.conf.size=this.base.offsetWidth}}var g=this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxslider")||"dhx_skyblue";this.setSkin(g);this.base.innerHTML="<div class='dhxsl_container'><div class='dhxsl_track'></div><div class='dhxsl_runner'></div></div>";this._nodes={cont:this.base.firstChild,track:this.base.firstChild.firstChild,runner:this.base.firstChild.childNodes[1]};this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=function(j){j=j||event;if(typeof(j.preventDefault)=="function"){j.preventDefault()}else{j.returnValue=false}return false};this.conf.value=this._normalize(this.conf.value);this._setOrient(this.conf.vertical);this.setSize(this.conf.size);this._initMover=function(l){l=l||event;if(typeof(l.preventDefault)=="function"){l.preventDefault()}a._nodes.runner.className="dhxsl_runner dhxsl_runner_actv";var j=(l.type=="mousedown"?"client":"page")+(a.conf.vertical?"Y":"X");a._movingInitialValues={};a._movingInitialValues.value=a.conf.value;a._movingInitialValues.coord=(typeof(l[j])!="undefined"?l[j]:l.touches[0][j]);if(a.conf.disabled==false){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._move,false);window.addEventListener("mouseup",a._cleanMove,false);window.addEventListener("touchmove",a._move,false);window.addEventListener("touchend",a._cleanMove,false)}else{document.body.attachEvent("onmousemove",a._move);document.body.attachEvent("onmouseup",a._cleanMove)}}a.callEvent("_onRunnerMouseDown",[]);return false};this._move=function(q){q=q||event;if(typeof(q.preventDefault)=="function"){q.preventDefault()}var n=(q.type=="mousemove"?"client":"page")+(a.conf.vertical?"Y":"X");var o=(a.conf.vertical)?a._nodes.runner.offsetHeight:a._nodes.runner.offsetWidth;var l=a.conf.max-a.conf.min;var j=(typeof(q[n])!="undefined"?q[n]:q.touches[0][n]);var m=a._movingInitialValues.value+(j-a._movingInitialValues.coord)*l/(a.conf.size-o)*(a.conf.inverse?-1:1);a.setValue(m,true)};this._cleanMove=function(j){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._move,false);window.removeEventListener("mouseup",a._cleanMove,false);window.removeEventListener("touchmove",a._move,false);window.removeEventListener("touchend",a._cleanMove,false)}else{document.body.detachEvent("onmousemove",a._move);document.body.detachEvent("onmouseup",a._cleanMove)}a._movingInitialValues=null;a._nodes.runner.className=a._nodes.runner.className.replace(/\s{0,}dhxsl_runner_actv/gi,"");a.callEvent("onSlideEnd",[a.conf.value]);a.callEvent("_onRunnerMouseUp",[])};this._doOnSetValue=function(o){if(a._movingInitialValues!=null){return false}o=o||event;if(typeof(o.preventDefault)=="function"){o.preventDefault()}var n=(a.conf.vertical)?(o.offsetY||o.layerY):(o.offsetX||o.layerX);var m=(a.conf.vertical)?a._nodes.runner.offoffsetHeightsetHe:a._nodes.runner.offsetWidth;var j=a.conf.max-a.conf.min;var l=n*j/(a.conf.size)+a.conf.min;a.setValue(l,true);if(a._movingInitialValues==null){a._initMover(o)}return false};this._doOnChangeInput=function(l){l=l||event;var j=l.target||l.srcElement;a.setValue(j.value)};this._doOnKeyDown=function(l){l=l||event;var j=l.target||l.srcElement;if(l.keyCode==13){a.setValue(j.value)}};this._attachEvents(this._nodes);this.unload=function(){dhx4._eventable(this,"clear");this._detachNode();this._detachEvents(this._nodes);this.base.removeChild(this._nodes.cont);this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=null;delete this._nodes.cont;delete this._nodes.track;delete this._nodes.max;delete this._nodes.min;delete this._nodes.runner;if(/\s?dhtmlxslider_\S*/.test(this.base.className)){this.base.className=this.base.className.replace(/\s?dhtmlxslider_\S*/,"")}for(var j in this){this[j]=null}a=null};dhx4._eventable(this);if(this.conf.disabled){this.disable()}if(this.conf.tooltip){this.enableTooltip()}if(!this.conf.visible){this.hide()}if(this.conf.linkTo){this.linkTo(this.conf.linkTo)}return this}dhtmlXSlider.prototype._setOrient=function(a){a=a||false;if(/\s?dhxsl_cont_hr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_hr/i,"")}if(/\s?dhxsl_cont_vr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_vr/i,"")}if(a){this._nodes.cont.className+=" dhxsl_cont_vr"}else{this._nodes.cont.className+=" dhxsl_cont_hr"}};dhtmlXSlider.prototype._attachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.addEventListener("mousedown",this._initMover,false);a.runner.addEventListener("touchstart",this._initMover,false);a.cont.addEventListener("mousedown",this._doOnSetValue,false);a.cont.addEventListener("touchstart",this._doOnSetValue,false)}else{a.runner.attachEvent("onmousedown",this._initMover);a.cont.attachEvent("onmousedown",this._doOnSetValue)}};dhtmlXSlider.prototype._detachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.removeEventListener("mousedown",this._initMover,false);a.runner.removeEventListener("touchstart",this._initMover,false);a.cont.removeEventListener("mousedown",this._doOnSetValue,false);a.cont.removeEventListener("touchstart",this._doOnSetValue,false)}else{a.runner.detachEvent("onmousedown",this._initMover);a.cont.detachEvent("onmousedown",this._doOnSetValue)}};dhtmlXSlider.prototype._mergeConfig=function(c){for(var a in c){switch(a.toLowerCase()){case"min":case"max":case"size":case"step":case"value":case"inverse":this.conf[a]=c[a];break;case"tooltip":case"visible":case"vertical":case"disabled":this.conf[a]=dhx4.s2b(c[a]);break;case"parent":continue;break;default:this.conf[a]=c[a]}}};dhtmlXSlider.prototype._readAttFormNode=function(j){var n=j.attributes,a=n.length,g,m={},c;for(g=0;g<a;g++){c=n[g];switch(c.name.toLowerCase()){case"size":case"min":case"max":case"value":case"step":m[c.name]=c.value;break;case"skin":m.skin=c.value;break;case"vertical":case"disabled":case"visible":m[c.name]=dhx4.s2b(c.value);break;case"linkto":m.linkTo=c.value;break;case"tooltip":m.tooltip=dhx4.s2b(c.value);break}}return m};dhtmlXSlider.prototype._renderArgumets=function(a){var j={},g,c;c=a.length;for(g=0;g<c;g++){switch(g){case 0:j.parent=a[g];break;case 1:j.size=a[g];break;case 2:j.skin=a[g];break;case 3:j.vertical=a[g];break;case 4:j.min=a[g];break;case 5:j.max=a[g];break;case 6:j.value=a[g];break;case 7:j.step=a[g];break}}return j};dhtmlXSlider.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXSlider.prototype._indexOf=function(a,j){var g,c,m=-1;c=a.length;for(g=c;g>=0;g--){if(a[g]==j){m=g;break}}return m};dhtmlXSlider.prototype._refreshRunner=function(){var a,c;if(this.conf.vertical){a=this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight;c=this._getCoord(a);this._nodes.runner.style.top=c+this.conf.border+"px";this._nodes.runner.style.left=Math.round((this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)/2)+"px"}else{a=this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth;c=this._getCoord(a);this._nodes.runner.style.left=c+this.conf.border+"px";this._nodes.runner.style.top=Math.round((this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)/2)+"px"}};dhtmlXSlider.prototype._setValueByCoord=function(j){var a=dhx4.absLeft(this._nodes.cont),l=dhx4.absTop(this._nodes.cont),g,c;if(this.conf.vertical){c=(j.y-l-this._nodes.runner.offsetHeight/2)/(this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)}else{c=(j.x-a-this._nodes.runner.offsetWidth/2)/(this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)}g=(this.conf.max-this.conf.min)*c+this.conf.min;this.setValue(g,true)};dhtmlXSlider.prototype._getCoord=function(a){var g=(this.conf.inverse?this._inverseValue(this.conf.value):this.conf.value);var c=(g-this.conf.min)/(this.conf.max-this.conf.min);return Math.round(a*c)};dhtmlXSlider.prototype._normalize=function(c){c=Number(c);c=Math.round(c/this.conf.step)*this.conf.step;var a=Math.pow(10,this.conf.decimals);c=Math.round(c*a)/a;c=Math.max(this.conf.min,Math.min(this.conf.max,c));return c};dhtmlXSlider.prototype._attachNode=function(c){var a=c.tagName.toLowerCase();if(!a){return}this._attachedNode.node=c;switch(a){case"input":case"select":if(typeof(window.addEventListener)=="function"){c.addEventListener("change",this._doOnChangeInput,false);c.addEventListener("keydown",this._doOnKeyDown,false)}else{c.attachEvent("onchange",this._doOnChangeInput);c.attachEvent("onkeydown",this._doOnKeyDown)}this._attachedNode.setValue=function(m,g){m=String(m);if(g>0){var j=m.match(/\.\d{1,}$/);if(j!=null){g=Math.max(g-j[0].length+1)}m+=(m.indexOf(".")<0?".":"");for(var l=0;l<g;l++){m+="0"}}this.node.value=m};break;default:this._attachedNode.setValue=function(g){this.node.innerHTML=g}}this._attachedNode.setValue(this.conf.value,this.conf.decimals)};dhtmlXSlider.prototype._detachNode=function(){var c=this._attachedNode.node;if(!c){return}var a=c.tagName;switch(a){case"input":case"select":if(typeof(window.addEventListener)=="function"){c.removeEventListener("change",this._doOnChangeInput,false);c.removeEventListener("keydown",this._doOnChangeInput,false)}else{c.detachEvent("change",this._doOnChangeInput);c.detachEvent("keydown",this._doOnChangeInput)}break}delete this._attachedNode.node;delete this._attachedNode.setValue};dhtmlXSlider.prototype._detectDecimals=function(){var a=this.conf.step.toString().match(/\.(\d*)$/);this.conf.decimals=(a!=null?a[1].length:0)};dhtmlXSlider.prototype.setSize=function(a){if(!isNaN(a)){if(this.conf.vertical){if(this._nodes.cont.style.width){delete this._nodes.cont.style.width}this._nodes.cont.style.height=a-this.conf.margin+"px"}else{if(this._nodes.cont.style.height){delete this._nodes.cont.style.height}this._nodes.cont.style.width=a-this.conf.margin+"px"}this._refreshRunner()}};dhtmlXSlider.prototype.setSkin=function(l){l=l.toLowerCase();var g,c=-1,a,j="dhtmlxslider";g=this.base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,j+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=j+"_"+l;this.base.className=g.join(" ");this.conf.skin=l;if(this._nodes){this._refreshRunner()}};dhtmlXSlider.prototype.setValue=function(a,c){c=c||false;if(!isNaN(a)){a=this._normalize(a);if(this.conf.value!=a){this.conf.value=a;this._refreshRunner();if(this.conf.tooltip){this._nodes.cont.title=a}if(c){this.callEvent("onChange",[a,this])}}}if(typeof(this._attachedNode.setValue)=="function"){this._attachedNode.setValue(this.conf.value,this.conf.decimals)}};dhtmlXSlider.prototype.getValue=function(){return this.conf.value};dhtmlXSlider.prototype._inverseValue=function(){return this.conf.max+this.conf.min-this.conf.value};dhtmlXSlider.prototype.disable=function(g){g=(g==false)?false:true;var c=null;if(g){for(var a in this._nodes){if(a=="cont"){continue}c=new RegExp("\\s?dhxsl_"+a+"_dis","i");if(!c.test(this._nodes[a].className)){this._nodes[a].className+=" dhxsl_"+a+"_dis"}}this.conf.disabled=true}else{this.enable()}};dhtmlXSlider.prototype.enable=function(){var c;for(var a in this._nodes){if(a=="cont"){continue}c=new RegExp("\\s?dhxsl_"+a+"_dis","i");if(c.test(this._nodes[a].className)){this._nodes[a].className=this._nodes[a].className.replace(c,"")}}this.conf.disabled=false};dhtmlXSlider.prototype.isEnabled=function(){return !this.conf.disabled};dhtmlXSlider.prototype.disableTooltip=function(){this._nodes.cont.removeAttribute("title");this.conf.tooltip=false};dhtmlXSlider.prototype.enableTooltip=function(a){if(typeof(a)=="undefined"){a=true}else{a=dhx4.s2b(a)}if(a){this._nodes.cont.title=this.conf.value;this.conf.tooltip=true}else{this.disableTooltip()}};dhtmlXSlider.prototype.setMax=function(a){if(!isNaN(a)&&this.conf.min<a){this.conf.max=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMax=function(){return this.conf.max};dhtmlXSlider.prototype.setMin=function(a){if(!isNaN(a)&&this.conf.max>a){this.conf.min=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMin=function(){return this.conf.min};dhtmlXSlider.prototype.setStep=function(a){var c=this.conf.max-this.conf.min;if(!isNaN(a)&&a<c){this.conf.step=a;this._detectDecimals();this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getStep=function(){return this.conf.step};dhtmlXSlider.prototype.show=function(){if(/\s?dhxsl_hidden/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_hidden/i,"")}this.conf.visible=true};dhtmlXSlider.prototype.hide=function(){if(!/\s?dhxsl_hidden/i.test(this._nodes.cont.className)){this._nodes.cont.className+=" dhxsl_hidden"}this.conf.visible=false};dhtmlXSlider.prototype.isVisible=function(){return this.conf.visible};dhtmlXSlider.prototype.linkTo=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(this._attachedNode.node){this._detachNode()}this._attachNode(a)};function dhtmlXPopup(g){var j=this;this.conf=g||{};g=null;this.mode=(this.conf.mode||"bottom");this.conf.zi=window.dhx4.newId();this.conf.context=(this.conf.context==null?true:window.dhx4.s2b(this.conf.context));this.conf.IE6_display_fix=(this.conf.IE6_display_fix==null?false:window.dhx4.s2b(this.conf.IE6_display_fix));this.conf.last_p_click=this.conf.last_body_click=null;this.p=document.createElement("DIV");this.p.style.display="none";this.p.innerHTML="<div class='dhx_popup_area"+(window.dhx4.isIE?" dhx_popup_area_ie":"")+"'><table cellspacing='0' cellpadding='0' border='0' class='dhx_popup_table'><tbody></tbody></table></div><div class='dhx_popup_arrow dhx_popup_arrow_"+this.mode+"'></div>";document.body.appendChild(this.p);this.p.oncontextmenu=function(a){if(j.conf.context==false){a=a||event;a.returnValue=false;return false}};this.skinParams={dhx_terrace:{t0:19,t1:9,t2:19,t3:9},dhx_skyblue:{t0:12,t1:9,t2:12,t3:9},dhx_web:{t0:12,t1:9,t2:12,t3:9}};this.p.ontouchstart=this.p.onclick=function(m){m=m||event;var l=(j.conf.last_p_click!=null&&j.conf.last_p_click!=m.type);j.conf.last_p_click=m.type;if(l==true){return}j._clearClick=true;if(j._nodeObj!=null){j.callEvent("onContentClick",[]);return true}var a=(m.target||m.srcElement);var n=null;while(a!=j.p&&a!=null){if(typeof(a._idd)!="undefined"&&!a._isSeparator){n=a._idd;a=null}else{a=a.parentNode}}a=null;if(n!=null){j.callEvent("onClick",[n]);if(j!=null&&j.isVisible!=null&&j.isVisible()&&j.callEvent("onBeforeHide",["select",m,n])===true){m.cancelBubble=true;j.hide()}}};this.separator="DHXSEP_"+window.dhx4.newId();this.tpl=[];this._setTemplate=function(a){this.tpl=a.split(",")};this.show=function(l){var a=null;if(arguments.length==1){if(!l){l=this.conf.id[0]}else{if(!this._idExists(l)){return}}if(this.conf.toolbar){a=this.conf.toolbar._getItemDim(l)}if(this.conf.ribbon){a=this.conf.ribbon._getItemDim(l)}if(this.conf.form){a=this.conf.form._getItemDim(l)}}else{if(arguments.length==4){this._clearClick=true;a={left:arguments[0],top:arguments[1],width:arguments[2],height:arguments[3]};l=null}}if(!a){return}this.p.style.visibility="hidden";this.p.style.display="";this._setPos(a);this.p.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this.p.style.visibility="visible";this._lastId=l;this.callEvent("onShow",[l])};this._setPos=function(I,n){var v=I.left;var s=I.top;var C=I.width;var L=I.height;this._posData={left:v,top:s,width:C,height:L};var N=window.dhx4.screenDim();var F=n||this.mode;if(typeof(n)=="undefined"){n=false}var P={top:(s-this.p.offsetHeight)-N.top,bottom:N.bottom-(s+L+this.p.offsetHeight),left:v-this.p.offsetWidth-N.left,right:N.right-(v+C+this.p.offsetWidth)};if(!n&&P[F]<0){var J=this._getAvailPos(F,P);if(J!==false){this._setPos(I,J);return}}if(F=="top"||F=="bottom"){var D=this.skinParams[this.conf.skin].t2;var A=this.skinParams[this.conf.skin].t3;var r=Math.round(this.p.offsetWidth/2);var a=Math.round(this.p.lastChild.offsetWidth/2);if(v<N.left){var M=Math.min(v+C,N.left);C=v+C-M;v=M}if(v+C>N.right){C=N.right-v}var u=Math.round(v+C/2);var m=u-r;var K=u-D-a;var q=u+a+D-this.p.offsetWidth;if(m<N.left-A){m=Math.min(N.left-A,K)}else{if(m+this.p.offsetWidth>N.right+A){m=Math.max(q,N.right+A-this.p.offsetWidth)}}this.p.style.left=m+"px";this.p.style.top=(F=="top"?s-this.p.offsetHeight:s+L)+"px";u=u-m-a;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.top=(F=="top"?this.p.offsetHeight-this.p.lastChild.offsetHeight:0)+"px";this.p.lastChild.style.left=u+"px"}if(F=="left"||F=="right"){var D=this.skinParams[this.conf.skin].t0;var A=this.skinParams[this.conf.skin].t1;var o=Math.round(this.p.offsetHeight/2);var S=Math.round(this.p.lastChild.offsetHeight/2);if(s<N.top){var l=Math.min(s+L,N.top);L=s+L-l;s=l}if(s+L>N.bottom){L=N.bottom-s}var u=Math.round(s+L/2);var H=u-o;var Q=u-D-S;var O=u+S+D-this.p.offsetHeight;if(H<N.top-A){H=Math.min(N.top-A,Q)}else{if(H+this.p.offsetHeight>N.bottom+A){H=Math.max(O,N.bottom+A-this.p.offsetHeight)}}this.p.style.left=(F=="left"?v-this.p.offsetWidth:v+C)+"px";this.p.style.top=H+"px";u=u-H-S;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.left=(F=="left"?this.p.offsetWidth-this.p.lastChild.offsetWidth:0)+"px";this.p.lastChild.style.top=u+"px"}if(this._IEDisp&&this._nodeId!=null){var E=document.getElementById(this._nodeId);if(this.conf.IE6_display_fix==true){E.style.visibility="hidden"}window.setTimeout(function(){E.style.visibility="visible";E=null},1)}};this._getAvailPos=function(s,r){var m={top:["bottom","right","left"],bottom:["top","right","left"],left:["right","bottom","top"],right:["left","bottom","top"]};var n=null;for(var o=0;o<m[s].length;o++){if(n==null&&r[m[s][o]]>0){n=m[s][o]}}if(n==null){n="bottom";for(var l in r){if(r[l]>r[n]){n=l}}}if(n==s){return false}return n};this._repaint=function(){if(this.isVisible()){this._setPos(this._posData)}};this.clear=function(){if(this._nodeObj){if(window.dhx4.isIE&&typeof(window.dhtmlXLayoutObject)!="undefined"&&this._nodeObj instanceof dhtmlXLayoutObject){this.p.onmousedown=null}if(this._nodeObj.unload){this._nodeObj.unload()}else{if(this._nodeObj.destruct){this._nodeObj.destruct()}}this._nodeObj=this._nodeId=null;if(this._nodeObjEv!=null){for(var l=0;l<this._nodeObjEv.length;l++){this.detachEvent(this._nodeObjEv[l])}this._nodeObjEv=null}}if(this._IEHoverInited){this._IEHoverClear()}var a=this.p.firstChild.firstChild.firstChild;while(a.childNodes.length>0){a.removeChild(a.lastChild)}a=null;this.itemData={}};this.hide=function(){if(this.p.style.display!="none"){this.p.style.display="none";window.dhx4.zim.clear(this.conf.zi);var a=this._lastId;this._lastId=null;this.callEvent("onHide",[a]);this.conf.last_p_click=this.conf.last_body_click=null}};this.isVisible=function(){return(this.p.style.display=="")};this.itemData={};this.getItemData=function(a){if(!a){return this.itemData}if(this.itemData[a]){return this.itemData[a]}return{}};this.setSkin=function(a){this.conf.skin=a;this.p.className="dhx_popup_"+this.conf.skin;if(this._nodeObj!=null&&typeof(this._nodeObj.setSkin)=="function"){this._nodeObj.setSkin(this.conf.skin)}this._repaint()};this.attachList=function(m,u){this._setTemplate(m);this.clear();var n=this.p.firstChild.firstChild.firstChild;for(var s=0;s<u.length;s++){var o=document.createElement("TR");if(u[s]!=this.separator){if(typeof(u[s].id)=="undefined"||u[s].id==null){o._idd=window.dhx4.newId();while(this.itemData[o._idd]!=null){o._idd=window.dhx4.newId()}}else{o._idd=u[s].id}this.itemData[o._idd]=u[s]}n.appendChild(o);if(u[s]==this.separator){o.className="dhx_popup_sep";o._isSeparator=true;var v=document.createElement("TD");v.className="dhx_popup_sep";v.colSpan=this.tpl.length;v.innerHTML="<div class='dhx_popup_sep'>&nbsp;</div>";o.appendChild(v);v=null}else{for(var a=0;a<this.tpl.length;a++){var l="dhx_popup_td";if(this._IEFirstLast&&(this.tpl.length==1||a==0||a==this.tpl.length-1)){if(this.tpl.length==1){l+=" dhx_popup_td_single"}else{l+=(a==0?" dhx_popup_td_first":" dhx_popup_td_last")}}var v=document.createElement("TD");v.className=l;v.innerHTML=u[s][this.tpl[a]]||"&nbsp;";o.appendChild(v);v=null}if(this._IEHover){o._IEHover=true;if(!this._IEHoverInited){this._IEHoverInit()}}}o=null}n=null;this._repaint()};this._attachNode=function(n,m){this.clear();this._nodeId="dhxpopup_node_"+window.dhx4.newId();var a=this.p.firstChild.firstChild.firstChild;var l=document.createElement("TR");l.className="dhxnode";a.appendChild(l);var o=document.createElement("TD");o.className="dhx_popup_td";o.innerHTML="<div id='"+this._nodeId+"' style='position:relative;'></div>";if(m.width){o.firstChild.style.width=m.width+"px"}if(m.height){o.firstChild.style.height=m.height+"px"}l.appendChild(o);o=l=a=null;if(typeof(this["_attach_init_"+n])=="function"){this["_attach_init_"+n](m);this._enableIEVFix()}this._repaint();return this._nodeObj};this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("touchstart",this._doOnClick,false);window.removeEventListener("click",this._doOnClick,false);window.removeEventListener("keyup",this._doOnKeyUp,false);window.removeEventListener("unload",this._doOnUnload,false)}else{document.body.detachEvent("onclick",this._doOnClick,false);document.body.detachEvent("onkeyup",this._doOnKeyUp,false);document.body.detachEvent("onunload",this._doOnUnload,false)}this.clear();if(this.conf.toolbarEvent!=null&&this.conf.toolbar!=null){if(this.conf.toolbar.detachEvent!=null){this.conf.toolbar.detachEvent(this.conf.toolbarEvent)}else{this.conf.toolbar._getItemDim=null}}if(this.conf.ribbonEvent!=null&&this.conf.ribbon!=null){if(this.conf.ribbon.detachEvent!=null){this.conf.ribbon.detachEvent(this.conf.ribbonEvent)}else{this.conf.ribbon._getItemDim=null}}if(this.conf.slider!=null){for(var m=0;m<this.conf.slider_events.length;m++){this.conf.slider.detachEvent(this.conf.slider_events[m])}this.conf.slider_events=null;this._sliderShow=this._sliderHide=null;this.conf.slider=null}window.dhx4._eventable(this,"clear");this.p.onclick=this.p.ontouchstart=this.p.oncontextmenu=null;this.p.parentNode.removeChild(this.p);this.p=null;for(var l in this.conf){this.conf[l]=null}for(var l in this){this[l]=null}j=null};window.dhx4._eventable(this);this._doOnClick=function(s){s=s||event;var a=(j.conf.last_body_click!=null&&j.conf.last_body_click!=s.type);j.conf.last_body_click=s.type;if(a==true){return}if(j._clearClick==true){j._clearClick=false;return}if(j.conf.form!=null){var m;var u=(s.target||s.srcElement);if((u.tagName||"").toLowerCase()=="option"){u=u.parentNode}if(u.className!=null&&u.className.search("dhxform")>=0){if(u.parentNode!=null&&u.parentNode.parentNode!=null&&u.parentNode.parentNode._idd!=null){m=u.parentNode.parentNode._idd;if(u.parentNode.parentNode._type=="ra"){m=[u.parentNode.parentNode._group,u.parentNode.parentNode._value]}}}else{var o=true;var q=false;while(o&&!q){var n=(u.className||"").toLowerCase();if(n.length>0){q=(n=="dhxform_btn"||n.search(/dhxeditor_inside/gi)>=0||n=="dhxcombo_input"||n.search(/dhxcombolist/gi)>=0)}u=u.parentNode;o=(u!=null)}if(q){return}}u=null;if(m!=null&&j._idExists(m)){return}}if(typeof(window.dhtmlXForm)!="undefined"&&j._nodeObj instanceof window.dhtmlXForm){var v={};var n=0;var l=j._nodeObj;l.forEachItem(function(r){if(l.getItemType(r)=="combo"){v[l.getCombo(r).list._listId]=true;n++}});l=null;if(n>0){var u=(s.target||s.srcElement);var o=true;var q=false;while(o==true&&q!=true){var n=(u.className||"").toLowerCase();if(n.length>0&&n.search(/^dhxcombolist/gi)>=0&&u._listId!=null&&v[u._listId]==true){q=true;u=null}else{u=u.parentNode;o=(u!=null)}}if(q==true){return}}}if(j.isVisible()&&j.callEvent("onBeforeHide",["click",s])===true){j.hide()}};this._doOnKeyUp=function(a){a=a||event;if(a.keyCode==27){if(j.isVisible()&&j.callEvent("onBeforeHide",["esc",a])===true){j.hide()}}};this._doOnUnload=function(){j.unload()};if(typeof(window.addEventListener)=="function"){window.addEventListener("touchstart",this._doOnClick,false);window.addEventListener("click",this._doOnClick,false);window.addEventListener("keyup",this._doOnKeyUp,false);window.addEventListener("unload",this._doOnUnload,false)}else{document.body.attachEvent("onclick",this._doOnClick,false);document.body.attachEvent("onkeyup",this._doOnKeyUp,false);document.body.attachEvent("onunload",this._doOnUnload,false)}this._idExists=function(m){var a=false;for(var l=0;l<this.conf.id.length;l++){if(this.conf.id[l] instanceof Array){a=a||(this.conf.id[l][0]==m[0]&&this.conf.id[l][1]==m[1])}else{a=a||this.conf.id[l]==m}}return a};this._IEDisp=(window.dhx4.isIE6||document.compatMode!="CSS1Compat");this._IEHover=(window.dhx4.isIE6==true);if(this._IEHover){this._IEHoverInit=function(){this.p.onmouseover=function(){var a=event.srcElement;while(a!=this&&a._IEHover!=true){a=a.parentNode}if(a._IEHover){if(j._IEHoverTM){window.clearTimeout(j._IEHoverTM)}if(j._lastIEHover==a){return}j._IEHoverRender(a);a=null}};this.p.onmouseout=function(){if(j._IEHoverTM){window.clearTimeout(j._IEHoverTM)}j._IEHoverTM=window.setTimeout(function(){j._IEHoverRender(null)},1)};this._IEHoverRender=function(a){if(this._lastIEHover!=null){if(this._lastIEHover.className.search(/tr_hover/gi)>=0){this._lastIEHover.className=this._lastIEHover.className.replace(/\s{0,}tr_hover/gi,"");this._lastIEHover=null}}if(a!=null&&a.className.search(/tr_hover/gi)<0){a.className+=" tr_hover";j._lastIEHover=a}};this._IEHoverInited=true};this._IEHoverClear=function(){this.p.onmouseover=null;this.p.onmouseout=null;this._IEHoverInited=false}}this._IEFirstLast=(window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8);this._enableIEVFix=function(){if(window.dhx4.isIE6||window.dhx4.isIE7){var l=this.attachEvent("onHide",function(){document.getElementById(this._nodeId).style.visibility="hidden"});var a=this.attachEvent("onShow",function(){document.getElementById(this._nodeId).style.visibility="visible"});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(l,a)}};if(typeof(window.dhtmlXToolbarObject)!="undefined"&&this.conf.toolbar!=null&&this.conf.toolbar instanceof window.dhtmlXToolbarObject&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.toolbar.conf.skin;this._doOnToolbarClick=function(l){for(var a=0;a<j.conf.id.length;a++){if(l==j.conf.id[a]){if(l!=j._lastId){j.show(l);j._clearClick=true}}}};if(typeof(dhtmlXToolbarObject.prototype._getItemDim)=="undefined"){dhtmlXToolbarObject.prototype._getItemDim=function(m){var a=this.objPull[this.idPrefix+m];var l={left:window.dhx4.absLeft(a.obj),top:window.dhx4.absTop(a.obj),width:a.obj.offsetWidth+(a.arw?a.arw.offsetWidth:0),height:a.obj.offsetHeight};a=null;return l}}this.conf.toolbarEvent=this.conf.toolbar.attachEvent("onClick",this._doOnToolbarClick)}if(typeof(window.dhtmlXRibbon)!="undefined"&&this.conf.ribbon!=null&&this.conf.ribbon instanceof window.dhtmlXRibbon&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.ribbon.conf.skin;this._doOnRibbonClick=function(l){for(var a=0;a<j.conf.id.length;a++){if(l==j.conf.id[a]){if(l!=j._lastId){j.show(l);j._clearClick=true}}}};if(typeof(dhtmlXRibbon.prototype._getItemDim)=="undefined"){dhtmlXRibbon.prototype._getItemDim=function(m){var a=this._items[m].base;var l={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};a=null;return l}}this.conf.ribbonEvent=this.conf.ribbon.attachEvent("_showPopup",this._doOnRibbonClick)}if(typeof(window.dhtmlXForm)!="undefined"&&this.conf.form!=null&&this.conf.form instanceof window.dhtmlXForm&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}if(!this.conf.mode){this.mode="right"}this.skinParent=this.conf.form.skin;if(typeof(dhtmlXForm.prototype._getItemDim)=="undefined"){dhtmlXForm.prototype._getItemDim=function(a,l){return this.doWithItem(a,"_getDim")};for(var c in {input:1,password:1,select:1,multiselect:1,checkbox:1,radio:1,button:1,combo:1,btn2state:1,calendar:1,colorpicker:1,editor:1}){if(dhtmlXForm.prototype.items[c]!=null){dhtmlXForm.prototype.items[c]._getDim=function(l){var a=l;if({ta:true,pw:true,se:true,calendar:true,colorpicker:1,editor:true}[l._type]){a=l.childNodes[l._ll?1:0].childNodes[0]}if({ch:true,ra:true,btn2state:true}[l._type]){a=l.childNodes[l._ll?1:0].childNodes[1]}if({bt:true}[l._type]){a=l.firstChild}if({combo:true}[l._type]){a=l._combo.DOMParent.firstChild}var m={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};a=null;return m}}}}}if(typeof(window.dhtmlXSlider)!="undefined"&&this.conf.slider!=null&&this.conf.slider instanceof window.dhtmlXSlider){if(!this.conf.mode){this.mode="top"}this.conf.slider_tm=null;this._sliderShow=function(){if(j.conf.slider_tm){window.clearTimeout(j.conf.slider_tm)}var a=j.conf.slider._nodes.runner;var l={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};j.show(l.left,l.top,l.width,l.height)};this._sliderHide=function(){j.conf.slider_tm=window.setTimeout(function(){j.hide()},200)};this.conf.slider_events=[this.conf.slider.attachEvent("_onRunnerMouseDown",this._sliderShow),this.conf.slider.attachEvent("_onRunnerMouseUp",this._sliderHide),this.conf.slider.attachEvent("onChange",this._sliderShow)]}this.setSkin(this.skinParent||this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_popup")||"dhx_skyblue");return this}dhtmlXPopup.prototype.attachObject=function(a){return this._attachNode("object",{obj:a})};dhtmlXPopup.prototype._attach_init_object=function(a){this._nodeObj=(typeof(a.obj)=="string"?document.getElementById(a.obj):a.obj);a.obj=null;document.getElementById(this._nodeId).appendChild(this._nodeObj);this._nodeObj.style.display="";this._nodeObj.style.visibility="visible"};dhtmlXPopup.prototype.attachHTML=function(a){return this._attachNode("html",{html:a})};dhtmlXPopup.prototype._attach_init_html=function(a){document.getElementById(this._nodeId).innerHTML=a.html;this._nodeObj={text:a.html}};dhtmlXPopup.prototype.attachForm=function(c,a){return this._attachNode("form",{struct:c,width:a})};dhtmlXPopup.prototype._attach_init_form=function(c){var a=this;this._nodeObj=new dhtmlXForm(this._nodeId,c.struct);this._nodeObj.setSkin(this.conf.skin);this._nodeObj.attachEvent("_onBeforeEditorAccess",function(){a._clearClick=true});if(this.conf.editorEv!=null&&this.checkEvent(this.conf.editorEv)==false){this.conf.editorEv=null}if(dhtmlXForm.prototype.items.editor!=null&&this.conf.editorEv==null){this.conf.editorEv=this.attachEvent("onShow",function(){var l=dhtmlXForm.prototype.items.editor.editor;for(var g in l){var m=l[g].base;var j=false;while(m!=null){if(m==this.p){j=true;m=null}else{m=m.parentNode}}m=null;if(j==true){l[g].cell.conf.cells_cont=null;l[g].setSizes()}}l=null;this.detachEvent(this.conf.editorEv);this.conf.editorEv=null});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(this.conf.editorEv)}};dhtmlXPopup.prototype.attachCalendar=function(){return this._attachNode("calendar",{})};dhtmlXPopup.prototype._attach_init_calendar=function(a){this._nodeObj=new dhtmlXCalendarObject(this._nodeId);this._nodeObj.setSkin(this.conf.skin);this._nodeObj.show()};dhtmlXPopup.prototype.attachGrid=function(c,a){return this._attachNode("grid",{width:c||400,height:a||200})};dhtmlXPopup.prototype._attach_init_grid=function(){this._nodeObj=new dhtmlXGridObject(this._nodeId);this._nodeObj.setSkin(this.conf.skin)};dhtmlXPopup.prototype.attachTree=function(g,c,a){return this._attachNode("tree",{width:g||400,height:c||200,rootId:a||0})};dhtmlXPopup.prototype._attach_init_tree=function(a){this._nodeObj=new dhtmlXTreeObject(this._nodeId,"100%","100%",(a.rootId))};dhtmlXPopup.prototype.attachLayout=function(c,a,g){return this._attachNode("layout",{width:c||400,height:a||200,pattern:g||"3L"})};dhtmlXPopup.prototype._attach_init_layout=function(a){this._nodeObj=new dhtmlXLayoutObject(this._nodeId,a.pattern,this.conf.skin)};dhtmlXPopup.prototype.attachAccordion=function(g,a,c){return this._attachNode("accordion",{width:g||400,height:a||200,conf:c||{}})};dhtmlXPopup.prototype._attach_init_accordion=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXAccordion(a.conf)};dhtmlXPopup.prototype.attachTabbar=function(g,a,c){if(typeof(c)=="string"){c={mode:c}}else{if(typeof(c)!="object"||c==null){c={}}}return this._attachNode("tabbar",{width:g||400,height:a||200,conf:c})};dhtmlXPopup.prototype._attach_init_tabbar=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXTabBar(a.conf)};dhtmlXPopup.prototype.attachSidebar=function(g,a,c){if(c==null){c={}}return this._attachNode("tabbar",{width:g||400,height:a||200,conf:c})};dhtmlXPopup.prototype._attach_init_tabbar=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXSideBar(a.conf)};dhtmlXPopup.prototype.attachEditor=function(g,a,c){return this._attachNode("editor",{width:g||400,height:a||200,conf:c||{}})};dhtmlXPopup.prototype._attach_init_editor=function(c){document.getElementById(this._nodeId).className="dhxeditor_"+this.conf.skin;c.conf.parent=this._nodeId;if(c.conf.skin==null){c.conf.skin=this.conf.skin}this._nodeObj=new dhtmlXEditor(c.conf);var a=this.attachEvent("onShow",function(){if(this._nodeObj instanceof window.dhtmlXEditor){this._nodeObj.setSizes()}});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(a)};dhtmlXPopup.prototype.attachColorPicker=function(a){if(typeof(a)!="object"||a==null){a={}}return this._attachNode("colorpicker",{conf:a})};dhtmlXPopup.prototype._attach_init_colorpicker=function(a){a.conf.skin=this.conf.skin;a.conf.parent=this._nodeId;this._nodeObj=new dhtmlXColorPicker(a.conf)};function dhtmlXMenuObject(l,m){var j=this;this.conf={skin:(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxmenu")||"dhx_skyblue"),mode:"web",align:"left",is_touched:false,selected:-1,last_click:-1,fixed_pos:false,rtl:false,icons_path:"",arrow_ff_fix:(navigator.userAgent.indexOf("MSIE")>=0&&document.compatMode=="BackCompat"),live_id:window.dhx4.newId(),tags:{root:"menu",item:"item",text_ext:"itemtext",userdata:"userdata",tooltip:"tooltip",hotkey:"hotkey",href:"href"},autoload:{},hide_tm:{},top_mode:true,top_tmtime:200,v_enabled:false,v:{x1:null,x2:null,y1:null,y2:null},dir_toplv:"bottom",dir_sublv:"right",auto_overflow:false,overflow_limit:0,of_utm:null,of_utime:20,of_ustep:3,of_dtm:null,of_dtime:20,of_dstep:3,tm_sec:400,tm_handler:null,dload:false,dload_url:"",dload_icon:false,dload_params:{action:"loadMenu"},dload_pid:"parentId",tl_botmarg:1,tl_rmarg:0,tl_ofsleft:1,context:false,ctx_zoneid:false,ctx_autoshow:true,ctx_autohide:true,ctx_hideall:true,ctx_zones:{},ctx_baseid:null,selected_sub:[],opened_poly:[]};if(typeof(l)=="object"&&l!=null&&typeof(l.tagName)=="undefined"){if(l.icons_path!=null||l.icon_path!=null){this.conf.icons_path=(l.icons_path||l.icon_path)}if(l.skin!=null){this.conf.skin=l.skin}if(l.visible_area){this.conf.v_enabled=true;this.conf.v={x1:l.visible_area.x1,x2:l.visible_area.x2,y1:l.visible_area.y1,y2:l.visible_area.y2}}for(var g in {json:1,xml:1,items:1,top_text:1,align:1,open_mode:1,overflow:1,dynamic:1,dynamic_icon:1,context:1,onload:1,onclick:1,oncheckboxclick:1,onradioclick:1}){if(l[g]!=null){this.conf.autoload[g]=l[g]}}l=l.parent}if(l==null){this.base=document.body}else{var c=(typeof(l)=="string"?document.getElementById(l):l);if(c!=null){this.base=c;if(!this.base.id){this.base.id=(new Date()).valueOf()}this.base.className+=" dhtmlxMenu_"+this.conf.skin+"_Middle dir_left";this.base._autoSkinUpdate=true;if(this.base.oncontextmenu){this.base._oldContextMenuHandler=this.base.oncontextmenu}this.conf.ctx_baseid=this.base.id;this.base.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.oncontextmenu=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false}}else{this.base=document.body}}this.idPrefix="";this.topId="dhxWebMenuTopId";this.idPull={};this.itemPull={};this.userData={};this.radio={};this.setSkin=function(o){var q=this.conf.skin;this.conf.skin=o;switch(this.conf.skin){case"dhx_skyblue":case"dhx_web":this.conf.tl_botmarg=2;this.conf.tl_rmarg=1;this.conf.tl_ofsleft=1;break;case"dhx_terrace":this.conf.tl_botmarg=0;this.conf.tl_rmarg=0;this.conf.tl_ofsleft=0;break}if(this.base._autoSkinUpdate){this.base.className=this.base.className.replace("dhtmlxMenu_"+q+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var n in this.idPull){this.idPull[n].className=String(this.idPull[n].className).replace(q,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(o,n){var a=true;for(var r=0;r<this.conf.selected_sub.length;r++){if((this.conf.selected_sub[r][0]==o)&&(this.conf.selected_sub[r][1]==n)){a=false}}if(a==true){this.conf.selected_sub.push(new Array(o,n))}return a};this._removeSubItemFromSelected=function(r,o){var a=new Array();var n=false;for(var s=0;s<this.conf.selected_sub.length;s++){if((this.conf.selected_sub[s][0]==r)&&(this.conf.selected_sub[s][1]==o)){n=true}else{a[a.length]=this.conf.selected_sub[s]}}if(n==true){this.conf.selected_sub=a}return n};this._getSubItemToDeselectByPolygon=function(r){var a=new Array();for(var s=0;s<this.conf.selected_sub.length;s++){if(this.conf.selected_sub[s][1]==r){a[a.length]=this.conf.selected_sub[s][0];a=a.concat(this._getSubItemToDeselectByPolygon(this.conf.selected_sub[s][0]));var o=true;for(var n=0;n<this.conf.opened_poly.length;n++){if(this.conf.opened_poly[n]==this.conf.selected_sub[s][0]){o=false}}if(o==true){this.conf.opened_poly[this.conf.opened_poly.length]=this.conf.selected_sub[s][0]}this.conf.selected_sub[s][0]=-1;this.conf.selected_sub[s][1]=-1}}return a};this._hidePolygon=function(a){if(this.idPull["polygon_"+a]!=null){if(this.idPull["polygon_"+a]._zId!=null){window.dhx4.zim.clear(this.idPull["polygon_"+a]._zId)}if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._hidePolygonEffect("polygon_"+a)}else{if(this.idPull["polygon_"+a].style.display=="none"){return}this.idPull["polygon_"+a].style.display="none";if(this.idPull["arrowup_"+a]!=null){this.idPull["arrowup_"+a].style.display="none"}if(this.idPull["arrowdown_"+a]!=null){this.idPull["arrowdown_"+a].style.display="none"}this._updateItemComplexState(a,true,false);if(window.dhx4.isIE6&&this.idPull["polygon_"+a+"_ie6cover"]!=null){this.idPull["polygon_"+a+"_ie6cover"].style.display="none"}}a=String(a).replace(this.idPrefix,"");if(a==this.topId){a=null}this.callEvent("onHide",[a]);if(a!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+a,true)}}};this._showPolygon=function(I,o){var N=this._countVisiblePolygonItems(I);if(N==0){return}var J="polygon_"+I;if((this.idPull[J]!=null)&&(this.idPull[I]!=null)){if(this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){if(!this.idPull[I]._mouseOver&&o==this.conf.dir_toplv){return}}if(!this.conf.fixed_pos){this._autoDetectVisibleArea()}var K=0;var M=0;var P=null;var E=null;if(this.idPull[J]._zId==null){this.idPull[J]._zId=window.dhx4.newId()}this.idPull[J]._zInd=window.dhx4.zim.reserve(this.idPull[J]._zId);this.idPull[J].style.visibility="hidden";this.idPull[J].style.left="0px";this.idPull[J].style.top="0px";this.idPull[J].style.display="";this.idPull[J].style.zIndex=this.idPull[J]._zInd;if(this.conf.auto_overflow){if(this.idPull[J].childNodes[1].childNodes[0].offsetHeight>this.conf.v.y1+this.conf.v.y2){var D=Math.floor((this.conf.v.y2-this.conf.v.y1-35)/24);this.conf.overflow_limit=D}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+I]!=null){this._removeUpArrow(String(I).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+I]!=null){this._removeDownArrow(String(I).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit<N){if(this.idPull["arrowup_"+I]==null){this._addUpArrow(String(I).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+I]==null){this._addDownArrow(String(I).replace(this.idPrefix,""))}P=this.idPull["arrowup_"+I];P.style.display="none";E=this.idPull["arrowdown_"+I];E.style.display="none"}if(this.conf.overflow_limit>0){if(this.conf.overflow_limit<N){this.idPull[J].childNodes[1].style.height=24*this.conf.overflow_limit+"px";P.style.width=E.style.width=this.idPull[J].childNodes[1].style.width=this.idPull[J].childNodes[1].childNodes[0].offsetWidth+"px";this.idPull[J].childNodes[1].scrollTop=0;P.style.display="";K=P.offsetHeight;E.style.display="";M=E.offsetHeight}else{this.idPull[J].childNodes[1].style.height="";this.idPull[J].childNodes[1].style.width=""}}if(this.itemPull[I]!=null){var A="polygon_"+this.itemPull[I]["parent"]}else{if(this.conf.context){var A=this.idPull[this.idPrefix+this.topId]}}var a=(this.idPull[I].tagName!=null?window.dhx4.absLeft(this.idPull[I]):this.idPull[I][0]);var O=(this.idPull[I].tagName!=null?window.dhx4.absTop(this.idPull[I]):this.idPull[I][1]);var n=(this.idPull[I].tagName!=null?this.idPull[I].offsetWidth:0);var q=(this.idPull[I].tagName!=null?this.idPull[I].offsetHeight:0);var v=0;var u=0;var C=this.idPull[J].offsetWidth;var L=this.idPull[J].childNodes[1].offsetHeight+K+M;if(o=="bottom"){if(this.conf.rtl){v=a+(n!=null?n:0)-C}else{if(this.conf.align=="right"){v=a+n-C}else{v=a-1+(o==this.conf.dir_toplv?this.conf.tl_rmarg:0)}}u=O-1+q+this.conf.tl_botmarg}if(o=="right"){v=a+n-1;u=O+2}if(o=="left"){v=a-this.idPull[J].offsetWidth+2;u=O+2}if(o=="top"){v=a-1;u=O-L+2}if(this.conf.fixed_pos){var H=65536;var F=65536}else{var H=(this.conf.v.x2!=null?this.conf.v.x2:0);var F=(this.conf.v.y2!=null?this.conf.v.y2:0);if(H==0){if(window.innerWidth){H=window.innerWidth;F=window.innerHeight}else{H=document.body.offsetWidth;F=document.body.scrollHeight}}}if(v+C>H&&!this.conf.rtl){v=a-C+2}if(v<this.conf.v.x1&&this.conf.rtl){v=a+n-2}if(v<0){v=0}if(u+L>F&&this.conf.v.y2!=null){u=Math.max(O+q-L+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==I&&E!=null){u=u-2}if(this.itemPull[I]!=null&&!this.conf.context){if(this.itemPull[I]["parent"]==this.idPrefix+this.topId){u=u-this.base.offsetHeight}}}this.idPull[J].style.left=v+"px";this.idPull[J].style.top=u+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(J)}else{this.idPull[J].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit<N){this.idPull[J].childNodes[1].scrollTop=0;this._checkArrowsState(I)}if(window.dhx4.isIE6){var s=J+"_ie6cover";if(this.idPull[s]==null){var r=document.createElement("IFRAME");r.className="dhtmlxMenu_IE6CoverFix_"+this.conf.skin;r.frameBorder=0;r.setAttribute("src","javascript:false;");document.body.insertBefore(r,document.body.firstChild);this.idPull[s]=r}this.idPull[s].style.left=v+"px";this.idPull[s].style.top=u+"px";this.idPull[s].style.width=this.idPull[J].offsetWidth+"px";this.idPull[s].style.height=this.idPull[J].offsetHeight+"px";this.idPull[s].style.zIndex=this.idPull[J].style.zIndex-1;this.idPull[s].style.display=""}}I=String(I).replace(this.idPrefix,"");if(I==this.topId){I=null}this.callEvent("onShow",[I]);if(I!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+I].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+I,false)}}};this._redistribSubLevelSelection=function(s,r){while(this.conf.opened_poly.length>0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(r);this._removeSubItemFromSelected(-1,-1);for(var n=0;n<a.length;n++){if((this.idPull[a[n]]!=null)&&(a[n]!=s)){if(this.itemPull[a[n]]["state"]=="enabled"){this.idPull[a[n]].className="sub_item"}}}for(var n=0;n<this.conf.opened_poly.length;n++){if(this.conf.opened_poly[n]!=r){this._hidePolygon(this.conf.opened_poly[n])}}if(this.itemPull[s]["state"]=="enabled"){this.idPull[s].className="sub_item_selected";if(this.itemPull[s]["complex"]&&this.conf.dload&&(this.itemPull[s]["loaded"]=="no")){if(this.conf.dload_icon==true){this._updateLoaderIcon(s,true)}this.itemPull[s].loaded="get";var o=s.replace(this.idPrefix,"");this._dhxdataload.onBeforeXLS=function(){var u={params:{}};u.params[this.conf.dload_pid]=o;for(var q in this.conf.dload_params){u.params[q]=this.conf.dload_params[q]}return u};this.loadStruct(this.conf.dload_url)}if(this.itemPull[s]["complex"]||(this.conf.dload&&(this.itemPull[s]["loaded"]=="yes"))){if((this.itemPull[s]["complex"])&&(this.idPull["polygon_"+s]!=null)){this._updateItemComplexState(s,true,true);this._showPolygon(s,this.conf.dir_sublv)}}this._addSubItemToSelected(s,r);this.conf.selected=s}};this._doOnClick=function(n,x,r){this.conf.last_click=n;if(this.itemPull[this.idPrefix+n]["href_link"]!=null&&this.itemPull[this.idPrefix+n].state=="enabled"){var s=document.createElement("FORM");var v=String(this.itemPull[this.idPrefix+n]["href_link"]).split("?");s.action=v[0];if(v[1]!=null){var o=String(v[1]).split("&");for(var a=0;a<o.length;a++){var w=String(o[a]).split("=");var u=document.createElement("INPUT");u.type="hidden";u.name=(w[0]||"");u.value=(w[1]||"");s.appendChild(u)}}if(this.itemPull[this.idPrefix+n]["href_target"]!=null){s.target=this.itemPull[this.idPrefix+n]["href_target"]}s.style.display="none";document.body.appendChild(s);s.submit();if(s!=null){document.body.removeChild(s);s=null}return}if(x.charAt(0)=="c"){return}if(x.charAt(1)=="d"){return}if(x.charAt(2)=="s"){return}if(this.checkEvent("onClick")){this.callEvent("onClick",[n,this.conf.ctx_zoneid,r])}else{if((x.charAt(1)=="d")||(this.conf.mode=="win"&&x.charAt(2)=="t")){return}}if(this.conf.context&&this._isContextMenuVisible()&&this.conf.ctx_autohide){this._hideContextMenu()}else{if(this._clearAndHide){this._clearAndHide()}}};this._doOnTouchMenu=function(a){if(this.conf.is_touched==false){this.conf.is_touched=true;if(this.checkEvent("onTouch")){this.callEvent("onTouch",[a])}}};this._searchMenuNode=function(o,s){var a=new Array();for(var r=0;r<s.length;r++){if(typeof(s[r])=="object"){if(s[r].length==5){if(typeof(s[r][0])!="object"){if((s[r][0].replace(this.idPrefix,"")==o)&&(r==0)){a=s}}}var n=this._searchMenuNode(o,s[r]);if(n.length>0){a=n}}}return a};this._getMenuNodes=function(q){var n=new Array;for(var o in this.itemPull){if(this.itemPull[o]["parent"]==q){n[n.length]=o}}return n};this._genStr=function(a){var n="";var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=0;o<a;o++){n+=r.charAt(Math.round(Math.random()*(r.length-1)))}return n};this.getItemType=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return this.itemPull[a]["type"]};this.forEachItem=function(o){for(var n in this.itemPull){o(String(n).replace(this.idPrefix,""))}};this._clearAndHide=function(){j.conf.selected=-1;j.conf.last_click=-1;while(j.conf.opened_poly.length>0){j.conf.opened_poly.pop()}for(var a=0;a<j.conf.selected_sub.length;a++){var n=j.conf.selected_sub[a][0];if(j.idPull[n]!=null){if(j.itemPull[n]["state"]=="enabled"){if(j.idPull[n].className=="sub_item_selected"){j.idPull[n].className="sub_item"}if(j.idPull[n].className=="dhtmlxMenu_"+j.conf.skin+"_TopLevel_Item_Selected"){if(j.itemPull[n]["cssNormal"]!=null){j.idPull[n].className=j.itemPull[n]["cssNormal"]}else{j.idPull[n].className="dhtmlxMenu_"+j.conf.skin+"_TopLevel_Item_Normal"}}}}j._hidePolygon(n)}j.conf.is_touched=false;if(j.conf.context&&j.conf.ctx_hideall){j._hidePolygon(j.idPrefix+j.topId)}};this._showSubLevelItem=function(n,a){if(document.getElementById("arrow_"+this.idPrefix+n)!=null){document.getElementById("arrow_"+this.idPrefix+n).style.display=(a?"none":"")}if(document.getElementById("image_"+this.idPrefix+n)!=null){document.getElementById("image_"+this.idPrefix+n).style.display=(a?"none":"")}if(document.getElementById(this.idPrefix+n)!=null){document.getElementById(this.idPrefix+n).style.display=(a?"":"none")}};this._hideSubLevelItem=function(a){this._showSubLevelItem(a,true)};this.idPrefix=this._genStr(12)+"_";this._bodyClick=function(a){a=a||event;if(a.button==2||(window.dhx4.isOpera&&a.ctrlKey==true)){return}if(j.conf.context){if(j.conf.ctx_autohide&&(!window.dhx4.isOpera||(j._isContextMenuVisible()&&window.dhx4.isOpera))){j._hideContextMenu()}}else{if(j._clearAndHide){j._clearAndHide()}}};this._bodyContext=function(o){o=o||event;var n=String((o.srcElement||o.target).className);if(n.search("dhtmlxMenu")!=-1&&n.search("SubLevelArea")!=-1){return}var a=true;var q=o.target||o.srcElement;while(q!=null){if(q.id!=null){if(j.isContextZone(q.id)){a=false}}if(q==document.body){a=false}q=q.parentNode}if(a){j.hideContextMenu()}};if(typeof(window.addEventListener)!="undefined"){window.addEventListener("click",this._bodyClick,false);window.addEventListener("contextmenu",this._bodyContext,false)}else{document.body.attachEvent("onclick",this._bodyClick);document.body.attachEvent("oncontextmenu",this._bodyContext)}this.unload=function(){window.dhx4._eventable(this,"clear");dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]=null;try{delete dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]}catch(o){}this.conf.live_id=null;if(typeof(window.addEventListener)=="function"){window.removeEventListener("click",this._bodyClick,false);window.removeEventListener("contextmenu",this._bodyContext,false)}else{document.body.detachEvent("onclick",this._bodyClick);document.body.detachEvent("oncontextmenu",this._bodyContext)}this._bodyClick=null;this._bodyContext=null;this.removeItem(this.idPrefix+this.topId,true);this.itemPull=null;this.idPull=null;if(this.conf.context){for(var n in this.conf.ctx_zones){this.removeContextZone(n)}}if(this.cont!=null){this.cont.className="";this.cont.parentNode.removeChild(this.cont);this.cont=null}if(this.base!=null){if(!this.conf.context){this.base.className=""}if(!this.conf.context){this.base.oncontextmenu=(this.base._oldContextMenuHandler||null)}this.base.onselectstart=null;this.base=null}for(var n in this){this[n]=null}j=null};dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]=this;window.dhx4._enableDataLoading(this,"_initObj","_xmlToJson",this.conf.tags.root,{struct:true});window.dhx4._eventable(this);if(window.dhx4.s2b(this.conf.autoload.context)==true){this.renderAsContextMenu()}if(this.conf.autoload.dynamic!=null){this.enableDynamicLoading(this.conf.autoload.dynamic,window.dhx4.s2b(this.conf.autoload.dynamic_icon))}else{if(this.conf.autoload.items!=null){this.loadStruct(this.conf.autoload.items,this.conf.autoload.onload)}else{if(this.conf.autoload.json!=null){this.loadStruct(this.conf.autoload.json,this.conf.autoload.onload)}else{if(this.conf.autoload.xml!=null){this.loadStruct(this.conf.autoload.xml,this.conf.autoload.onload)}}}}for(var g in {onclick:1,oncheckboxclick:1,onradioclick:1}){if(this.conf.autoload[g]!=null){if(typeof(this.conf.autoload[g])=="function"){this.attachEvent(g,this.conf.autoload[g])}else{if(typeof(window[this.conf.autoload[g]])=="function"){this.attachEvent(g,window[this.conf.autoload[g]])}}}}if(this.conf.autoload.top_text!=null){this.setTopText(this.conf.autoload.top_text)}if(this.conf.autoload.align!=null){this.setAlign(this.conf.autoload.align)}if(this.conf.autoload.open_mode!=null){this.setOpenMode(this.conf.autoload.open_mode)}if(this.conf.autoload.overflow!=null){this.setOverflowHeight(this.conf.autoload.overflow)}for(var g in this.conf.autoload){this.conf.autoload[g]=null;delete this.conf.autoload[g]}this.conf.autoload=null;return this}dhtmlXMenuObject.prototype._init=function(){if(this._isInited==true){return}if(this.conf.dload){this._dhxdataload.onBeforeXLS=function(){var g={params:{}};for(var c in this.conf.dload_params){g.params[c]=this.conf.dload_params[c]}return g};this.loadStruct(this.conf.dload_url)}else{this._initTopLevelMenu();this._isInited=true}};dhtmlXMenuObject.prototype._countVisiblePolygonItems=function(m){var j=0;for(var c in this.itemPull){var g=this.itemPull[c]["parent"];var l=this.itemPull[c]["type"];if(this.idPull[c]!=null){if(g==m&&(l=="item"||l=="radio"||l=="checkbox")&&this.idPull[c].style.display!="none"){j++}}}return j};dhtmlXMenuObject.prototype._redefineComplexState=function(c){if(this.idPrefix+this.topId==c){return}if((this.idPull["polygon_"+c]!=null)&&(this.idPull[c]!=null)){var a=this._countVisiblePolygonItems(c);if((a>0)&&(!this.itemPull[c]["complex"])){this._updateItemComplexState(c,true,false)}if((a==0)&&(this.itemPull[c]["complex"])){this._updateItemComplexState(c,false,false)}}};dhtmlXMenuObject.prototype._updateItemComplexState=function(l,g,j){if((!this.conf.context)&&(this._getItemLevelType(l.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[l]["complex"]=g;return}if((this.idPull[l]==null)||(this.itemPull[l]==null)){return}this.itemPull[l]["complex"]=g;if(l==this.idPrefix+this.topId){return}var a=null;var c=this.idPull[l].childNodes[this.conf.rtl?0:2];if(c.childNodes[0]){if(String(c.childNodes[0].className).search("complex_arrow")===0){a=c.childNodes[0]}}if(this.itemPull[l]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+l;while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(a)}if(this.conf.dload&&(this.itemPull[l].loaded=="get")&&this.conf.dload_icon){if(a.className!="complex_arrow_loading"){a.className="complex_arrow_loading"}}else{a.className="complex_arrow"}return}if((!this.itemPull[l]["complex"])&&(a!=null)){c.removeChild(a);if(this.itemPull[l]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(l.replace(this.idPrefix,""),this.itemPull[l]["hotkey_backup"])}}};dhtmlXMenuObject.prototype._getItemLevelType=function(a){return(this.itemPull[this.idPrefix+a]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea")};dhtmlXMenuObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXMenuObject.prototype._updateItemImage=function(g,j){g=this.idPrefix+g;var o=this.itemPull[g]["type"];if(o=="checkbox"||o=="radio"){return}var l=(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var m=null;if(l){for(var a=0;a<this.idPull[g].childNodes.length;a++){try{if(this.idPull[g].childNodes[a].className=="dhtmlxMenu_TopLevel_Item_Icon"){m=this.idPull[g].childNodes[a]}}catch(n){}}}else{try{var m=this.idPull[g].childNodes[this.conf.rtl?2:0].childNodes[0]}catch(n){}if(!(m!=null&&typeof(m.className)!="undefined"&&m.className=="sub_icon")){m=null}}var s=this.itemPull[g][(this.itemPull[g]["state"]=="enabled"?"imgen":"imgdis")];if(s.length>0){if(m!=null){m.src=this.conf.icons_path+s}else{if(l){var m=document.createElement("IMG");m.className="dhtmlxMenu_TopLevel_Item_Icon";m.src=this.conf.icons_path+s;m.border="0";m.id="image_"+g;if(!this.conf.rtl&&this.idPull[g].childNodes.length>0){this.idPull[g].insertBefore(m,this.idPull[g].childNodes[0])}else{this.idPull[g].appendChild(m)}}else{var m=document.createElement("IMG");m.className="sub_icon";m.src=this.conf.icons_path+s;m.border="0";m.id="image_"+g;var r=this.idPull[g].childNodes[this.conf.rtl?2:0];while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}r.appendChild(m)}}}else{if(m!=null){var c=m.parentNode;c.removeChild(m);c.innerHTML="&nbsp;";c=m=null}}};dhtmlXMenuObject.prototype._getAllParents=function(m){var g=new Array();for(var c in this.itemPull){if(this.itemPull[c]["parent"]==m){g[g.length]=this.itemPull[c]["id"];if(this.itemPull[c]["complex"]){var j=this._getAllParents(this.itemPull[c]["id"]);for(var l=0;l<j.length;l++){g[g.length]=j[l]}}}}return g};dhtmlXMenuObject.prototype._autoDetectVisibleArea=function(){if(this.conf.v_enabled){return}var a=window.dhx4.screenDim();this.conf.v.x1=a.left;this.conf.v.x2=a.right;this.conf.v.y1=a.top;this.conf.v.y2=a.bottom};dhtmlXMenuObject.prototype.getItemPosition=function(l){l=this.idPrefix+l;var j=-1;if(this.itemPull[l]==null){return j}var a=this.itemPull[l]["parent"];var g=(this.idPull["polygon_"+a]!=null?this.idPull["polygon_"+a].tbd:this.cont);for(var c=0;c<g.childNodes.length;c++){if(g.childNodes[c]==this.idPull["separator_"+l]||g.childNodes[c]==this.idPull[l]){j=c}}return j};dhtmlXMenuObject.prototype.setItemPosition=function(n,m){n=this.idPrefix+n;if(this.idPull[n]==null){return}var c=(this.itemPull[n]["parent"]==this.idPrefix+this.topId);var a=this.idPull[n];var j=this.getItemPosition(n.replace(this.idPrefix,""));var g=this.itemPull[n]["parent"];var l=(this.idPull["polygon_"+g]!=null?this.idPull["polygon_"+g].tbd:this.cont);l.removeChild(l.childNodes[j]);if(m<0){m=0}if(c&&m<1){m=1}if(m<l.childNodes.length){l.insertBefore(a,l.childNodes[m])}else{l.appendChild(a)}};dhtmlXMenuObject.prototype.getParentId=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return((this.itemPull[a]["parent"]!=null?this.itemPull[a]["parent"]:this.topId).replace(this.idPrefix,""))};dhtmlXMenuObject.prototype.hide=function(){this._clearAndHide()};dhtmlXMenuObject.prototype.clearAll=function(){this.removeItem(this.idPrefix+this.topId,true);this._isInited=false;this.idPrefix=this._genStr(12)+"_";this.itemPull={}};if(typeof(dhtmlXMenuObject.prototype.liveInst)=="undefined"){dhtmlXMenuObject.prototype.liveInst={}}dhtmlXMenuObject.prototype._redistribTopLevelSelection=function(j,c){var a=this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1,-1);for(var g=0;g<a.length;g++){if(a[g]!=j){this._hidePolygon(a[g])}if((this.idPull[a[g]]!=null)&&(a[g]!=j)){this.idPull[a[g]].className=this.idPull[a[g]].className.replace(/Selected/g,"Normal")}}if(this.itemPull[this.idPrefix+j]["state"]=="enabled"){this.idPull[this.idPrefix+j].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+j,"parent");this.conf.selected=(this.conf.mode=="win"?(this.conf.selected!=-1?j:this.conf.selected):j);if((this.itemPull[this.idPrefix+j]["complex"])&&(this.conf.selected!=-1)){this._showPolygon(this.idPrefix+j,this.conf.dir_toplv)}}};dhtmlXMenuObject.prototype._initTopLevelMenu=function(){this.conf.dir_toplv="bottom";this.conf.dir_sublv=(this.conf.rtl?"left":"right");if(this.conf.context){this.idPull[this.idPrefix+this.topId]=new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId,this.idPrefix+this.topId)}else{var a=this._getMenuNodes(this.idPrefix+this.topId);for(var c=0;c<a.length;c++){if(this.itemPull[a[c]]["type"]=="item"){this._renderToplevelItem(a[c],null)}if(this.itemPull[a[c]]["type"]=="separator"){this._renderSeparator(a[c],null)}}}};dhtmlXMenuObject.prototype._renderToplevelItem=function(o,n){var l=this;var a=document.createElement("DIV");a.id=o;if(this.itemPull[o]["state"]=="enabled"&&this.itemPull[o]["cssNormal"]!=null){a.className=this.itemPull[o]["cssNormal"]}else{a.className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[o]["state"]=="enabled"?"Normal":"Disabled")}if(this.itemPull[o]["title"]!=""){var j=document.createElement("DIV");j.className="top_level_text";j.innerHTML=this.itemPull[o]["title"];a.appendChild(j)}if(this.itemPull[o]["tip"].length>0){a.title=this.itemPull[o]["tip"]}if((this.itemPull[o]["imgen"]!="")||(this.itemPull[o]["imgdis"]!="")){var g=this.itemPull[o][(this.itemPull[o]["state"]=="enabled")?"imgen":"imgdis"];if(g){var c=document.createElement("IMG");c.border="0";c.id="image_"+o;c.src=this.conf.icons_path+g;c.className="dhtmlxMenu_TopLevel_Item_Icon";if(a.childNodes.length>0&&!this.conf.rtl){a.insertBefore(c,a.childNodes[0])}else{a.appendChild(c)}}}a.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};a.oncontextmenu=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};if(!this.cont){this.cont=document.createElement("DIV");this.cont.dir="ltr";this.cont.className=(this.conf.align=="right"?"align_right":"align_left");this.base.appendChild(this.cont)}if(n!=null){n++;if(n<0){n=0}if(n>this.cont.childNodes.length-1){n=null}}if(n!=null){this.cont.insertBefore(a,this.cont.childNodes[n])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[o]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[o]["id"],this.itemPull[o]["id"])}a.onmouseover=function(){if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler)}var m=l._getSubItemToDeselectByPolygon("parent");l._removeSubItemFromSelected(-1,-1);for(var s=0;s<m.length;s++){if(m[s]!=this.id){l._hidePolygon(m[s])}if((l.idPull[m[s]]!=null)&&(m[s]!=this.id)){if(l.itemPull[m[s]]["cssNormal"]!=null){l.idPull[m[s]].className=l.itemPull[m[s]]["cssNormal"]}else{if(l.idPull[m[s]].className=="sub_item_selected"){l.idPull[m[s]].className="sub_item"}l.idPull[m[s]].className=l.idPull[m[s]].className.replace(/Selected/g,"Normal")}}}if(l.itemPull[this.id]["state"]=="enabled"){this.className="dhtmlxMenu_"+l.conf.skin+"_TopLevel_Item_Selected";l._addSubItemToSelected(this.id,"parent");l.conf.selected=(l.conf.mode=="win"?(l.conf.selected!=-1?this.id:l.conf.selected):this.id);if(l.conf.dload){if(l.itemPull[this.id].loaded=="no"){this._dynLoadTM=new Date().getTime();l.itemPull[this.id].loaded="get";var u=this.id.replace(l.idPrefix,"");l._dhxdataload.onBeforeXLS=function(){var v={params:{}};v.params[this.conf.dload_pid]=u;for(var q in this.conf.dload_params){v.params[q]=this.conf.dload_params[q]}return v};l.loadStruct(l.conf.dload_url)}if(l.conf.top_mode&&l.conf.mode=="web"&&!l.conf.context){this._mouseOver=true}}if((!l.conf.dload)||(l.conf.dload&&(!l.itemPull[this.id]["loaded"]||l.itemPull[this.id]["loaded"]=="yes"))){if((l.itemPull[this.id]["complex"])&&(l.conf.selected!=-1)){if(l.conf.top_mode&&l.conf.mode=="web"&&!l.conf.context){this._mouseOver=true;var r=this.id;this._menuOpenTM=window.setTimeout(function(){l._showPolygon(r,l.conf.dir_toplv)},l.conf.top_tmtime)}else{l._showPolygon(this.id,l.conf.dir_toplv)}}}}l._doOnTouchMenu(this.id.replace(l.idPrefix,""))};a.onmouseout=function(){if(!((l.itemPull[this.id]["complex"])&&(l.conf.selected!=-1))&&(l.itemPull[this.id]["state"]=="enabled")){if(l.itemPull[this.id]["cssNormal"]!=null){a.className=l.itemPull[this.id]["cssNormal"]}else{a.className="dhtmlxMenu_"+l.conf.skin+"_TopLevel_Item_Normal"}}if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler);l.conf.tm_handler=window.setTimeout(function(){l._clearAndHide()},l.conf.tm_sec,"JavaScript")}if(l.conf.top_mode&&l.conf.mode=="web"&&!l.conf.context){this._mouseOver=false;window.clearTimeout(this._menuOpenTM)}};a.onclick=function(u){if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler)}if(l.conf.mode!="web"&&l.itemPull[this.id]["state"]=="disabled"){return}u=u||event;u.cancelBubble=true;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}if(l.conf.mode=="win"){if(l.itemPull[this.id]["complex"]){if(l.conf.selected==this.id){l.conf.selected=-1;var r=false}else{l.conf.selected=this.id;var r=true}if(r){l._showPolygon(this.id,l.conf.dir_toplv)}else{l._hidePolygon(this.id)}}}var m=(l.itemPull[this.id]["complex"]?"c":"-");var v=(l.itemPull[this.id]["state"]!="enabled"?"d":"-");var q={ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey};l._doOnClick(this.id.replace(l.idPrefix,""),m+v+"t",q);return false};if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addSubMenuPolygon=function(n,m){var c=this._renderSublevelPolygon(n,m);var a=this._getMenuNodes(m);for(g=0;g<a.length;g++){if(this.itemPull[a[g]]["type"]=="separator"){this._renderSeparator(a[g],null)}else{this._renderSublevelItem(a[g],null)}}if(n==m){var l="topLevel"}else{var l="subLevel"}for(var g=0;g<a.length;g++){if(this.itemPull[a[g]]["complex"]){this._addSubMenuPolygon(n,this.itemPull[a[g]]["id"])}}};dhtmlXMenuObject.prototype._renderSublevelPolygon=function(l,j){var c=document.createElement("DIV");c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Polygon "+(this.conf.rtl?"dir_right":"");c.dir="ltr";c.oncontextmenu=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}m.cancelBubble=true;return false};c.id="polygon_"+j;c.onclick=function(m){m=m||event;m.cancelBubble=true};c.style.display="none";document.body.insertBefore(c,document.body.firstChild);c.innerHTML='<div style="position:relative;"></div><div style="position: relative; overflow:hidden;"></div><div style="position:relative;"></div>';var g=document.createElement("TABLE");g.className="dhtmlxMebu_SubLevelArea_Tbl";g.cellSpacing=0;g.cellPadding=0;g.border=0;var a=document.createElement("TBODY");g.appendChild(a);c.childNodes[1].appendChild(g);c.tbl=g;c.tbd=a;this.idPull[c.id]=c;if(this.sxDacProc!=null){this.idPull["sxDac_"+j]=new this.sxDacProc(c,c.className);if(window.dhx4.isIE){this.idPull["sxDac_"+j]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+j]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+j]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+j]._setCustomCycle(this.dacCycles)}}return c};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,r){var o=this;var q=document.createElement("TR");q.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var n=document.createElement("TD");n.className="sub_item_icon";var s=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(s!=""){var w=this.itemPull[a]["type"];if(w=="checkbox"||w=="radio"){var l=document.createElement("DIV");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon "+s;n.appendChild(l)}if(!(w=="checkbox"||w=="radio")){var l=document.createElement("IMG");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon";l.src=this.conf.icons_path+s;n.appendChild(l)}}else{n.innerHTML="&nbsp;"}var m=document.createElement("TD");m.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var v=document.createElement("DIV");v.className="sub_item_text";v.innerHTML=this.itemPull[a]["title"];m.appendChild(v)}else{m.innerHTML="&nbsp;"}var j=document.createElement("TD");j.className="sub_item_hk";if(this.itemPull[a]["complex"]){var c=document.createElement("DIV");c.className="complex_arrow";c.id="arrow_"+this.itemPull[a]["id"];j.appendChild(c)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var g=document.createElement("DIV");g.className="sub_item_hk";g.innerHTML=this.itemPull[a]["hotkey"];j.appendChild(g)}else{j.innerHTML="&nbsp;"}}q.appendChild(this.conf.rtl?j:n);q.appendChild(m);q.appendChild(this.conf.rtl?n:j);q.id=this.itemPull[a]["id"];q.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){q.title=this.itemPull[a]["tip"]}q.onselectstart=function(x){x=x||event;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}return false};q.onmouseover=function(x){if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}if(o.conf.mode=="web"){window.clearTimeout(o.conf.tm_handler)}if(!this._visible){o._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};q.onmouseout=function(){if(o.conf.mode=="web"){if(o.conf.tm_handler){window.clearTimeout(o.conf.tm_handler)}o.conf.tm_handler=window.setTimeout(function(){if(o&&o._clearAndHide){o._clearAndHide()}},o.conf.tm_sec,"JavaScript")}var x=this;if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}o.conf.hide_tm[this.id]=window.setTimeout(function(){x._visible=false},50)};q.onclick=function(y){if(!o.checkEvent("onClick")&&o.itemPull[this.id]["complex"]){return}y=y||event;y.cancelBubble=true;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}tc=(o.itemPull[this.id]["complex"]?"c":"-");td=(o.itemPull[this.id]["state"]=="enabled"?"-":"d");var x={ctrl:y.ctrlKey,alt:y.altKey,shift:y.shiftKey};switch(o.itemPull[this.id]["type"]){case"checkbox":o._checkboxOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"radio":o._radioOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"item":o._doOnClick(this.id.replace(o.idPrefix,""),tc+td+"n",x);break}return false};var u=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(r!=null){r++;if(r<0){r=0}if(r>u.tbd.childNodes.length-1){r=null}}if(r!=null&&u.tbd.childNodes[r]!=null){u.tbd.insertBefore(q,u.tbd.childNodes[r])}else{u.tbd.appendChild(q)}this.idPull[q.id]=q};dhtmlXMenuObject.prototype._renderSeparator=function(c,n){var a=(this.conf.context?"SubLevelArea":(this.itemPull[c]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var l=this;if(a!="TopLevel"){var m=document.createElement("TR");m.className="sub_sep";var g=document.createElement("TD");g.colSpan="3";m.appendChild(g)}var j=document.createElement("DIV");j.id="separator_"+c;j.className=(a=="TopLevel"?"top_sep":"sub_sep");j.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}};j.onclick=function(s){s=s||event;s.cancelBubble=true;var r={ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey};l._doOnClick(this.id.replace("separator_"+l.idPrefix,""),"--s",r)};if(a=="TopLevel"){if(n!=null){n++;if(n<0){n=0}if(this.cont.childNodes[n]!=null){this.cont.insertBefore(j,this.cont.childNodes[n])}else{this.cont.appendChild(j)}}else{var q=this.cont.childNodes[this.cont.childNodes.length-1];if(String(q).search("TopLevel_Text")==-1){this.cont.appendChild(j)}else{this.cont.insertBefore(j,q)}}this.idPull[j.id]=j}else{var o=this.idPull["polygon_"+this.itemPull[c]["parent"]];if(n!=null){n++;if(n<0){n=0}if(n>o.tbd.childNodes.length-1){n=null}}if(n!=null&&o.tbd.childNodes[n]!=null){o.tbd.insertBefore(m,o.tbd.childNodes[n])}else{o.tbd.appendChild(m)}g.appendChild(j);this.idPull[j.id]=m}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,c){c=this.idPrefix+(c!=null?c:this._genStr(24));var g=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(c,g,"","separator",false,"","");this._renderSeparator(c,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(u,v,n){if(!(u instanceof Array)){n=u.parentId;if(n!=null&&String(n).indexOf(this.idPrefix)!==0){n=this.idPrefix+String(n)}u=u.items}for(var g=0;g<u.length;g++){if(typeof(u[g].id)=="undefined"||u[g].id==null){u[g].id=this._genStr(24)}if(u[g].text==null){u[g].text=""}if(String(u[g].id).indexOf(this.idPrefix)!==0){u[g].id=this.idPrefix+String(u[g].id)}var j={type:"item",tip:"",hotkey:"",state:"enabled",imgen:"",imgdis:""};for(var w in j){if(typeof(u[g][w])=="undefined"){u[g][w]=j[w]}}if(u[g].imgen==""&&u[g].img!=null){u[g].imgen=u[g].img}if(u[g].imgdis==""&&u[g].img_disabled!=null){u[g].imgdis=u[g].img_disabled}if(u[g].title==null&&u[g].text!=null){u[g].title=u[g].text}if(u[g].href!=null){if(u[g].href.link!=null){u[g].href_link=u[g].href.link}if(u[g].href.target!=null){u[g].href_target=u[g].href.target}}if(u[g].userdata!=null){for(var w in u[g].userdata){this.userData[u[g].id+"_"+w]=u[g].userdata[w]}}if(typeof(u[g].enabled)!="undefined"&&window.dhx4.s2b(u[g].enabled)==false){u[g].state="disabled"}else{if(typeof(u[g].disabled)!="undefined"&&window.dhx4.s2b(u[g].disabled)==true){u[g].state="disabled"}}if(typeof(u[g].parent)=="undefined"){u[g].parent=(n!=null?n:this.idPrefix+this.topId)}if(u[g].type=="checkbox"){u[g].checked=window.dhx4.s2b(u[g].checked);u[g].imgen=u[g].imgdis="chbx_"+(u[g].checked?"1":"0")}if(u[g].type=="radio"){u[g].checked=window.dhx4.s2b(u[g].checked);u[g].imgen=u[g].imgdis="rdbt_"+(u[g].checked?"1":"0");if(typeof(u[g].group)=="undefined"||u[g].group==null){u[g].group=this._genStr(24)}if(this.radio[u[g].group]==null){this.radio[u[g].group]=[]}this.radio[u[g].group].push(u[g].id)}this.itemPull[u[g].id]=u[g];if(u[g].items!=null&&u[g].items.length>0){this.itemPull[u[g].id].complex=true;this._initObj(u[g].items,true,u[g].id)}else{if(this.conf.dload&&u[g].complex==true){this.itemPull[u[g].id].loaded="no"}}this.itemPull[u[g].id].items=null}if(v!==true){if(this.conf.dload==true){if(n==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(n,n);if(this.conf.selected==n){var s=(this.itemPull[n].parent==this.idPrefix+this.topId);var c=(s&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var l=false;if(s&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var x=this.idPull[n];if(x._mouseOver==true){var m=this.conf.top_tmtime-(new Date().getTime()-x._dynLoadTM);if(m>1){var r=n;var o=this;x._menuOpenTM=window.setTimeout(function(){o._showPolygon(r,c);o=r=null},m);l=true}}}if(!l){this._showPolygon(n,c)}}this.itemPull[n].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(n,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(l,j){var n=[];if(j==null){var o=l.getElementsByTagName(this.conf.tags.root);if(o==null||(o!=null&&o.length==0)){return{items:[]}}o=o[0]}else{o=l}if(o.getAttribute("parentId")!=null){j=this.idPrefix+o.getAttribute("parentId")}for(var c=0;c<o.childNodes.length;c++){if(typeof(o.childNodes[c].tagName)!="undefined"&&String(o.childNodes[c].tagName).toLowerCase()==this.conf.tags.item){var a=o.childNodes[c];var v={id:this.idPrefix+(a.getAttribute("id")||this._genStr(24)),title:a.getAttribute("text")||"",imgen:a.getAttribute("img")||"",imgdis:a.getAttribute("imgdis")||"",tip:"",hotkey:"",type:a.getAttribute("type")||"item"};if(a.getAttribute("cssNormal")!=null){v.cssNormal=a.getAttribute("cssNormal")}if(v.type=="checkbox"){v.checked=a.getAttribute("checked")}if(v.type=="radio"){v.checked=a.getAttribute("checked");v.group=a.getAttribute("group")}v.state="enabled";if(a.getAttribute("enabled")!=null&&window.dhx4.s2b(a.getAttribute("enabled"))==false){v.state="disabled"}else{if(a.getAttribute("disabled")!=null&&window.dhx4.s2b(a.getAttribute("disabled"))==true){v.state="disabled"}}v.parent=(j!=null?j:this.idPrefix+this.topId);if(this.conf.dload){v.complex=(a.getAttribute("complex")!=null);if(v.complex){v.loaded="no"}}else{var g=this._xmlToJson(a,v.id);v.items=g.items;v.complex=(v.items.length>0)}for(var s=0;s<a.childNodes.length;s++){if(typeof(a.childNodes[s].tagName)!="undefined"){var u=String(a.childNodes[s].tagName||"").toLowerCase();if(u==this.conf.tags.userdata){var m=a.childNodes[s];if(m.getAttribute("name")!=null){this.userData[v.id+"_"+m.getAttribute("name")]=(m.firstChild!=null&&m.firstChild.nodeValue!=null?m.firstChild.nodeValue:"")}}if(u==this.conf.tags.text_ext){v.title=a.childNodes[s].firstChild.nodeValue}if(u==this.conf.tags.tooltip){v.tip=a.childNodes[s].firstChild.nodeValue}if(u==this.conf.tags.hotkey){v.hotkey=a.childNodes[s].firstChild.nodeValue}if(u==this.conf.tags.href&&v.type=="item"){v.href_link=a.childNodes[s].firstChild.nodeValue;if(a.childNodes[s].getAttribute("target")!=null){v.href_target=a.childNodes[s].getAttribute("target")}}}}n.push(v)}}var a={parentId:j,items:n};return a};dhtmlXMenuObject.prototype.enableDynamicLoading=function(a,c){this.conf.dload=true;this.conf.dload_url=a;this.conf.dload_sign=(String(this.conf.dload_url).search(/\?/)==-1?"?":"&");this.conf.dload_icon=c;this._init()};dhtmlXMenuObject.prototype._updateLoaderIcon=function(j,g){if(this.idPull[j]==null){return}if(String(this.idPull[j].className).search("TopLevel_Item")>=0){return}var c=(this.conf.rtl?0:2);if(!this.idPull[j].childNodes[c]){return}if(!this.idPull[j].childNodes[c].childNodes[0]){return}var a=this.idPull[j].childNodes[c].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(g?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(j,l,a,c,g,o){var n=this.idPrefix+(l!=null?l:this._genStr(24));var m=this.idPrefix+(j!=null?this.getParentId(j):this.topId);this._addItemIntoGlobalStrorage(n,m,a,"item",c,g,o);if((m==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(n,this.getItemPosition(j))}else{this._renderSublevelItem(n,this.getItemPosition(j))}};dhtmlXMenuObject.prototype.addNewChild=function(n,m,j,a,c,g,l){if(n==null){if(this.conf.context){n=this.topId}else{this.addNewSibling(n,j,a,c,g,l);if(m!=null){this.setItemPosition(j,m)}return}}j=this.idPrefix+(j!=null?j:this._genStr(24));if(this.setHotKey){this.setHotKey(n,"")}n=this.idPrefix+n;this._addItemIntoGlobalStrorage(j,n,a,"item",c,g,l);if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(j,m-1);this._redefineComplexState(n)};dhtmlXMenuObject.prototype.removeItem=function(j,m,l){if(!m){j=this.idPrefix+j}var n=null;if(j!=this.idPrefix+this.topId){if(this.itemPull[j]==null){return}if(this.idPull["polygon_"+j]&&this.idPull["polygon_"+j]._tmShow){window.clearTimeout(this.idPull["polygon_"+j]._tmShow)}var v=this.itemPull[j]["type"];if(v=="separator"){var u=this.idPull["separator_"+j];if(this.itemPull[j]["parent"]==this.idPrefix+this.topId){u.onclick=null;u.onselectstart=null;u.id=null;u.parentNode.removeChild(u)}else{u.childNodes[0].childNodes[0].onclick=null;u.childNodes[0].childNodes[0].onselectstart=null;u.childNodes[0].childNodes[0].id=null;u.childNodes[0].removeChild(u.childNodes[0].childNodes[0]);u.removeChild(u.childNodes[0]);u.parentNode.removeChild(u)}this.idPull["separator_"+j]=null;this.itemPull[j]=null;delete this.idPull["separator_"+j];delete this.itemPull[j];u=null}else{n=this.itemPull[j]["parent"];var u=this.idPull[j];u.onclick=null;u.oncontextmenu=null;u.onmouseover=null;u.onmouseout=null;u.onselectstart=null;u.id=null;while(u.childNodes.length>0){u.removeChild(u.childNodes[0])}u.parentNode.removeChild(u);this.idPull[j]=null;this.itemPull[j]=null;delete this.idPull[j];delete this.itemPull[j];u=null}v=null}for(var r in this.itemPull){if(this.itemPull[r]["parent"]==j){this.removeItem(r,true,true)}}var s=new Array(j);if(n!=null&&!l){if(this.idPull["polygon_"+n]!=null){if(this.idPull["polygon_"+n].tbd.childNodes.length==0){s.push(n);this._updateItemComplexState(n,false,false)}}}for(var c=0;c<s.length;c++){if(this.idPull["polygon_"+s[c]]){var g=this.idPull["polygon_"+s[c]];g.onclick=null;g.oncontextmenu=null;g.tbl.removeChild(g.tbd);g.tbd=null;g.childNodes[1].removeChild(g.tbl);g.tbl=null;g.id=null;g.parentNode.removeChild(g);g=null;if(window.dhx4.isIE6){var o="polygon_"+s[c]+"_ie6cover";if(this.idPull[o]!=null){document.body.removeChild(this.idPull[o]);delete this.idPull[o]}}if(this.idPull["arrowup_"+j]!=null&&this._removeArrow){this._removeArrow("arrowup_"+j)}if(this.idPull["arrowdown_"+j]!=null&&this._removeArrow){this._removeArrow("arrowdown_"+j)}this.idPull["polygon_"+s[c]]=null;delete this.idPull["polygon_"+s[c]]}}s=null;if(this.conf.skin=="dhx_terrace"&&arguments.length==1){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage=function(o,a,g,n,j,c,m){var l={id:o,title:g,imgen:(c!=null?c:""),imgdis:(m!=null?m:""),type:n,state:(j==true?"disabled":"enabled"),parent:a,complex:false,hotkey:"",tip:""};this.itemPull[l.id]=l};dhtmlXMenuObject.prototype.renderAsContextMenu=function(){this.conf.context=true;if(this.base._autoSkinUpdate==true){this.base.className=this.base.className.replace("dhtmlxMenu_"+this.conf.skin+"_Middle","");this.base._autoSkinUpdate=false}if(this.conf.ctx_baseid!=null){this.addContextZone(this.conf.ctx_baseid)}};dhtmlXMenuObject.prototype.addContextZone=function(c){if(c==document.body){c="document.body."+this.idPrefix;var j=document.body}else{if(typeof(c)=="string"){var j=document.getElementById(c)}else{var j=c}}var m=false;for(var g in this.conf.ctx_zones){m=m||(g==c)||(this.conf.ctx_zones[g]==j)}if(m==true){return false}this.conf.ctx_zones[c]=j;var l=this;if(window.dhx4.isOpera){this.operaContext=function(a){l._doOnContextMenuOpera(a,l)};j.addEventListener("mouseup",this.operaContext,false)}else{if(j.oncontextmenu!=null&&!j._oldContextMenuHandler){j._oldContextMenuHandler=j.oncontextmenu}j.oncontextmenu=function(n){for(var a in dhtmlXMenuObject.prototype.liveInst){if(a!=l.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[a].context){dhtmlXMenuObject.prototype.liveInst[a]._hideContextMenu()}}}n=n||event;n.cancelBubble=true;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}l._doOnContextBeforeCall(n,this);return false}}};dhtmlXMenuObject.prototype._doOnContextMenuOpera=function(g,a){for(var c in dhtmlXMenuObject.prototype.liveInst){if(c!=a.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[c].context){dhtmlXMenuObject.prototype.liveInst[c]._hideContextMenu()}}}g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}if(g.button==0&&g.ctrlKey==true){a._doOnContextBeforeCall(g,this)}return false};dhtmlXMenuObject.prototype.removeContextZone=function(a){if(!this.isContextZone(a)){return false}if(a==document.body){a="document.body."+this.idPrefix}var c=this.conf.ctx_zones[a];if(window.dhx4.isOpera){c.removeEventListener("mouseup",this.operaContext,false)}else{c.oncontextmenu=(c._oldContextMenuHandler!=null?c._oldContextMenuHandler:null);c._oldContextMenuHandler=null}try{this.conf.ctx_zones[a]=null;delete this.conf.ctx_zones[a]}catch(g){}return true};dhtmlXMenuObject.prototype.isContextZone=function(a){if(a==document.body&&this.conf.ctx_zones["document.body."+this.idPrefix]!=null){return true}var c=false;if(this.conf.ctx_zones[a]!=null){if(this.conf.ctx_zones[a]==document.getElementById(a)){c=true}}return c};dhtmlXMenuObject.prototype._isContextMenuVisible=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}return(this.idPull["polygon_"+this.idPrefix+this.topId].style.display=="")};dhtmlXMenuObject.prototype._showContextMenu=function(c,g,a){this._clearAndHide();if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}window.clearTimeout(this.conf.tm_handler);this.idPull[this.idPrefix+this.topId]=new Array(c,g);this._showPolygon(this.idPrefix+this.topId,"bottom");this.callEvent("onContextMenu",[a])};dhtmlXMenuObject.prototype._hideContextMenu=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}this._clearAndHide();this._hidePolygon(this.idPrefix+this.topId)};dhtmlXMenuObject.prototype._doOnContextBeforeCall=function(l,n){this.conf.ctx_zoneid=n.id;this._clearAndHide();this._hideContextMenu();var j=(l.srcElement||l.target);var c=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML?l.offsetX:l.layerX);var a=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML?l.offsetY:l.layerY);var m=window.dhx4.absLeft(j)+c;var g=window.dhx4.absTop(j)+a;if(this.checkEvent("onBeforeContextMenu")){if(this.callEvent("onBeforeContextMenu",[n.id,l])){if(this.conf.ctx_autoshow){this._showContextMenu(m,g,n.id);this.callEvent("onAfterContextMenu",[n.id,l])}}}else{if(this.conf.ctx_autoshow){this._showContextMenu(m,g,n.id);this.callEvent("onAfterContextMenu",[n.id])}}};dhtmlXMenuObject.prototype.showContextMenu=function(a,c){this._showContextMenu(a,c,false)};dhtmlXMenuObject.prototype.hideContextMenu=function(){this._hideContextMenu()};dhtmlXMenuObject.prototype.setAutoShowMode=function(a){this.conf.ctx_autoshow=(a==true?true:false)};dhtmlXMenuObject.prototype.setAutoHideMode=function(a){this.conf.ctx_autohide=(a==true?true:false)};dhtmlXMenuObject.prototype.setContextMenuHideAllMode=function(a){this.conf.ctx_hideall=(a==true?true:false)};dhtmlXMenuObject.prototype.getContextMenuHideAllMode=function(){return this.conf.ctx_hideall};dhtmlXMenuObject.prototype._improveTerraceSkin=function(){for(var g in this.itemPull){if(this.itemPull[g].parent==this.idPrefix+this.topId&&this.idPull[g]!=null){var l=false;var j=false;if(this.idPull[g].parentNode.firstChild==this.idPull[g]){l=true}if(this.idPull[g].parentNode.lastChild==this.idPull[g]){j=true}for(var c in this.itemPull){if(this.itemPull[c].type=="separator"&&this.itemPull[c].parent==this.idPrefix+this.topId){if(this.idPull[g].nextSibling==this.idPull["separator_"+c]){j=true}if(this.idPull[g].previousSibling==this.idPull["separator_"+c]){l=true}}}this.idPull[g].style.borderLeftWidth=(l?"1px":"0px");this.idPull[g].style.borderTopLeftRadius=this.idPull[g].style.borderBottomLeftRadius=(l?"3px":"0px");this.idPull[g].style.borderTopRightRadius=this.idPull[g].style.borderBottomRightRadius=(j?"3px":"0px");this.idPull[g]._bl=l;this.idPull[g]._br=j}}};dhtmlXMenuObject.prototype._improveTerraceButton=function(c,a){if(a){this.idPull[c].style.borderBottomLeftRadius=(this.idPull[c]._bl?"3px":"0px");this.idPull[c].style.borderBottomRightRadius=(this.idPull[c]._br?"3px":"0px")}else{this.idPull[c].style.borderBottomLeftRadius="0px";this.idPull[c].style.borderBottomRightRadius="0px"}};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_menu=function(l,c,j,a,g){if(typeof(g)!="undefined"){l=g}else{l=document.createElement("DIV");l.className="dhx_cell_menu_"+(this.conf.borders?"def":"no_borders");l.appendChild(document.createElement("DIV"))}this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont]);this.conf.ofs_nodes.t.menu=true;this._updateIdx();return l};dhtmlXCellObject.prototype.attachMenu=function(a){if(this.dataNodes.menu){return}this.callEvent("_onBeforeContentAttach",["menu"]);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("menu").firstChild;this.dataNodes.menu=new dhtmlXMenuObject(a);this._adjustCont(this._idd);a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataNodes.menu};dhtmlXCellObject.prototype.detachMenu=function(){if(!this.dataNodes.menu){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;delete this.dataNodes.menu;this._detachObject("menu")};dhtmlXCellObject.prototype.showMenu=function(){this._mtbShowHide("menu","")};dhtmlXCellObject.prototype.hideMenu=function(){this._mtbShowHide("menu","none")};dhtmlXCellObject.prototype.getAttachedMenu=function(){return this.dataNodes.menu}}dhtmlXMenuObject.prototype.setItemEnabled=function(a){this._changeItemState(a,"enabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.setItemDisabled=function(a){this._changeItemState(a,"disabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.isItemEnabled=function(a){return(this.itemPull[this.idPrefix+a]!=null?(this.itemPull[this.idPrefix+a]["state"]=="enabled"):false)};dhtmlXMenuObject.prototype._changeItemState=function(m,l,c){var g=false;var a=this.idPrefix+m;if((this.itemPull[a]!=null)&&(this.idPull[a]!=null)){if(this.itemPull[a]["state"]!=l){this.itemPull[a]["state"]=l;if(this.itemPull[a]["parent"]==this.idPrefix+this.topId&&!this.conf.context){this.idPull[a].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[a]["state"]=="enabled"?"Normal":"Disabled")}else{this.idPull[a].className="sub_item"+(this.itemPull[a]["state"]=="enabled"?"":"_dis")}this._updateItemComplexState(this.idPrefix+m,this.itemPull[this.idPrefix+m]["complex"],false);this._updateItemImage(m,c);if((this.idPrefix+this.conf.last_click==a)&&(c!="TopLevel")){this._redistribSubLevelSelection(a,this.itemPull[a]["parent"])}if(c=="TopLevel"&&!this.conf.context){}}}return g};dhtmlXMenuObject.prototype.getItemText=function(a){return(this.itemPull[this.idPrefix+a]!=null?this.itemPull[this.idPrefix+a]["title"]:"")};dhtmlXMenuObject.prototype.setItemText=function(l,j){l=this.idPrefix+l;if((this.itemPull[l]!=null)&&(this.idPull[l]!=null)){this._clearAndHide();this.itemPull[l]["title"]=j;if(this.itemPull[l]["parent"]==this.idPrefix+this.topId&&!this.conf.context){var g=null;for(var a=0;a<this.idPull[l].childNodes.length;a++){try{if(this.idPull[l].childNodes[a].className=="top_level_text"){g=this.idPull[l].childNodes[a]}}catch(c){}}if(String(this.itemPull[l]["title"]).length==""||this.itemPull[l]["title"]==null){if(g!=null){g.parentNode.removeChild(g)}}else{if(!g){g=document.createElement("DIV");g.className="top_level_text";if(this.conf.rtl&&this.idPull[l].childNodes.length>0){this.idPull[l].insertBefore(g,this.idPull[l].childNodes[0])}else{this.idPull[l].appendChild(g)}}g.innerHTML=this.itemPull[l]["title"]}}else{var g=null;for(var a=0;a<this.idPull[l].childNodes[1].childNodes.length;a++){if(String(this.idPull[l].childNodes[1].childNodes[a].className||"")=="sub_item_text"){g=this.idPull[l].childNodes[1].childNodes[a]}}if(String(this.itemPull[l]["title"]).length==""||this.itemPull[l]["title"]==null){if(g){g.parentNode.removeChild(g);g=null;this.idPull[l].childNodes[1].innerHTML="&nbsp;"}}else{if(!g){g=document.createElement("DIV");g.className="sub_item_text";this.idPull[l].childNodes[1].innerHTML="";this.idPull[l].childNodes[1].appendChild(g)}g.innerHTML=this.itemPull[l]["title"]}}}};dhtmlXMenuObject.prototype.loadFromHTML=function(g,m,j){var c=this.conf.tags.item;this.conf.tags.item="div";var l=(typeof(g)=="string"?document.getElementById(g):g);var a=this._xmlToJson(l,this.idPrefix+this.topId);this._initObj(a);this.conf.tags.item=c;if(m){l.parentNode.removeChild(l)}l=objOd=null;if(onload!=null){if(typeof(j)=="function"){j()}else{if(typeof(window[j])=="function"){window[j]()}}}};dhtmlXMenuObject.prototype.hideItem=function(a){this._changeItemVisible(a,false)};dhtmlXMenuObject.prototype.showItem=function(a){this._changeItemVisible(a,true)};dhtmlXMenuObject.prototype.isItemHidden=function(c){var a=null;if(this.idPull[this.idPrefix+c]!=null){a=(this.idPull[this.idPrefix+c].style.display=="none")}return a};dhtmlXMenuObject.prototype._changeItemVisible=function(g,c){var a=this.idPrefix+g;if(this.itemPull[a]==null){return}if(this.itemPull[a]["type"]=="separator"){a="separator_"+a}if(this.idPull[a]==null){return}this.idPull[a].style.display=(c?"":"none");this._redefineComplexState(this.itemPull[this.idPrefix+g]["parent"])};dhtmlXMenuObject.prototype.setUserData=function(g,a,c){this.userData[this.idPrefix+g+"_"+a]=c};dhtmlXMenuObject.prototype.getUserData=function(c,a){return(this.userData[this.idPrefix+c+"_"+a]!=null?this.userData[this.idPrefix+c+"_"+a]:null)};dhtmlXMenuObject.prototype.setOpenMode=function(a){this.conf.mode=(a=="win"?"win":"web")};dhtmlXMenuObject.prototype.setWebModeTimeout=function(a){this.conf.tm_sec=(!isNaN(a)?a:400)};dhtmlXMenuObject.prototype.getItemImage=function(c){var a=new Array(null,null);c=this.idPrefix+c;if(this.itemPull[c]["type"]=="item"){a[0]=this.itemPull[c]["imgen"];a[1]=this.itemPull[c]["imgdis"]}return a};dhtmlXMenuObject.prototype.setItemImage=function(g,a,c){if(this.itemPull[this.idPrefix+g]["type"]!="item"){return}this.itemPull[this.idPrefix+g]["imgen"]=a;this.itemPull[this.idPrefix+g]["imgdis"]=c;this._updateItemImage(g,this._getItemLevelType(g))};dhtmlXMenuObject.prototype.clearItemImage=function(a){this.setItemImage(a,"","")};dhtmlXMenuObject.prototype.setVisibleArea=function(c,a,j,g){this.conf.v_enabled=true;this.conf.v.x1=c;this.conf.v.x2=a;this.conf.v.y1=j;this.conf.v.y2=g};dhtmlXMenuObject.prototype.setTooltip=function(c,a){c=this.idPrefix+c;if(!(this.itemPull[c]!=null&&this.idPull[c]!=null)){return}this.idPull[c].title=(a.length>0?a:null);this.itemPull[c]["tip"]=a};dhtmlXMenuObject.prototype.getTooltip=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["tip"]};dhtmlXMenuObject.prototype.setTopText=function(a){if(this.conf.context){return}if(this._topText==null){this._topText=document.createElement("DIV");this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.rtl?"left":(this.conf.align=="left"?"right":"left"));this.base.appendChild(this._topText)}this._topText.innerHTML=a};dhtmlXMenuObject.prototype.setAlign=function(a){if(this.conf.align==a){return}if(a=="left"||a=="right"){this.conf.align=a;if(this.cont){this.cont.className=(this.conf.align=="right"?"align_right":"align_left")}if(this._topText!=null){this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.align=="left"?"right":"left")}}};dhtmlXMenuObject.prototype.setHref=function(g,a,c){if(this.itemPull[this.idPrefix+g]==null){return}this.itemPull[this.idPrefix+g]["href_link"]=a;if(c!=null){this.itemPull[this.idPrefix+g]["href_target"]=c}};dhtmlXMenuObject.prototype.clearHref=function(a){if(this.itemPull[this.idPrefix+a]==null){return}delete this.itemPull[this.idPrefix+a]["href_link"];delete this.itemPull[this.idPrefix+a]["href_target"]};dhtmlXMenuObject.prototype.getCircuit=function(c){var a=new Array(c);while(this.getParentId(c)!=this.topId){c=this.getParentId(c);a[a.length]=c}return a.reverse()};dhtmlXMenuObject.prototype._getCheckboxState=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["checked"]};dhtmlXMenuObject.prototype._setCheckboxState=function(c,a){if(this.itemPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["checked"]=a};dhtmlXMenuObject.prototype._updateCheckboxImage=function(c){if(this.idPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["imgen"]="chbx_"+(this._getCheckboxState(c)?"1":"0");this.itemPull[this.idPrefix+c]["imgdis"]=this.itemPull[this.idPrefix+c]["imgen"];try{this.idPull[this.idPrefix+c].childNodes[(this.conf.rtl?2:0)].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+c]["imgen"]}catch(a){}};dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(j,a,c){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+j]==null){return}var g=this._getCheckboxState(j);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[j,g,this.conf.ctx_zoneid,c])){this.setCheckboxState(j,!g)}}else{this.setCheckboxState(j,!g)}if(this.checkEvent("onClick")){this.callEvent("onClick",[j])}};dhtmlXMenuObject.prototype.setCheckboxState=function(c,a){this._setCheckboxState(c,a);this._updateCheckboxImage(c)};dhtmlXMenuObject.prototype.getCheckboxState=function(a){return this._getCheckboxState(a)};dhtmlXMenuObject.prototype.addCheckbox=function(o,j,q,r,s,a,l){if(this.conf.context&&j==this.topId){}else{if(this.itemPull[this.idPrefix+j]==null){return}if(o=="child"&&this.itemPull[this.idPrefix+j]["type"]!="item"){return}}var m="chbx_"+(a?"1":"0");var g=m;if(o=="sibling"){var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+this.getParentId(j);this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;this._renderSublevelItem(c,this.getItemPosition(j))}else{var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+j;this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(c,q-1);this._redefineComplexState(n)}};dhtmlXMenuObject.prototype.setHotKey=function(m,a){m=this.idPrefix+m;if(!(this.itemPull[m]!=null&&this.idPull[m]!=null)){return}if(this.itemPull[m]["parent"]==this.idPrefix+this.topId&&!this.conf.context){return}if(this.itemPull[m]["complex"]){return}var c=this.itemPull[m]["type"];if(!(c=="item"||c=="checkbox"||c=="radio")){return}var l=null;try{if(this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0].className=="sub_item_hk"){l=this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0]}}catch(j){}if(a.length==0){this.itemPull[m]["hotkey_backup"]=this.itemPull[m]["hotkey"];this.itemPull[m]["hotkey"]="";if(l!=null){l.parentNode.removeChild(l)}}else{this.itemPull[m]["hotkey"]=a;this.itemPull[m]["hotkey_backup"]=null;if(l==null){l=document.createElement("DIV");l.className="sub_item_hk";var g=this.idPull[m].childNodes[this.conf.rtl?0:2];while(g.childNodes.length>0){g.removeChild(g.childNodes[0])}g.appendChild(l)}l.innerHTML=a}};dhtmlXMenuObject.prototype.getHotKey=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["hotkey"]};dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon=function(a){var g=this._getSubItemToDeselectByPolygon(a);for(var c=0;c<this.conf.opened_poly.length;c++){if(this.conf.opened_poly[c]!=a){this._hidePolygon(this.conf.opened_poly[c])}}for(var c=0;c<g.length;c++){if(this.idPull[g[c]]!=null&&this.itemPull[g[c]]["state"]=="enabled"){this.idPull[g[c]].className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Item_Normal"}}};dhtmlXMenuObject.prototype._checkArrowsState=function(j){var c=this.idPull["polygon_"+j].childNodes[1];var g=this.idPull["arrowup_"+j];var a=this.idPull["arrowdown_"+j];if(c.scrollTop==0){g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp_Disabled"}else{g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp"+(g.over?"_Over":"")}if(c.scrollTop+c.offsetHeight<c.scrollHeight){a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown"+(a.over?"_Over":"")}else{a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown_Disabled"}c=g=a=null};dhtmlXMenuObject.prototype._addUpArrow=function(j){var c=this;var g=document.createElement("DIV");g.pId=this.idPrefix+j;g.id="arrowup_"+this.idPrefix+j;g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp";g.over=false;g.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.oncontextmenu=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.onmouseover=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler)}c._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Over";this.over=true;c._canScrollUp=true;c._doScrollUp(this.pId,true)};g.onmouseout=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler);c.conf.tm_handler=window.setTimeout(function(){c._clearAndHide()},c.conf.tm_sec,"JavaScript")}this.over=false;c._canScrollUp=false;if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp";window.clearTimeout(c.conf.of_utm)};g.onclick=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+j];a.childNodes[0].appendChild(g);this.idPull[g.id]=g;a=g=null};dhtmlXMenuObject.prototype._addDownArrow=function(j){var c=this;var g=document.createElement("DIV");g.pId=this.idPrefix+j;g.id="arrowdown_"+this.idPrefix+j;g.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown";g.over=false;g.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.oncontextmenu=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.onmouseover=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler)}c._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Over";this.over=true;c._canScrollDown=true;c._doScrollDown(this.pId,true)};g.onmouseout=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler);c.conf.tm_handler=window.setTimeout(function(){c._clearAndHide()},c.conf.tm_sec,"JavaScript")}this.over=false;c._canScrollDown=false;if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown";window.clearTimeout(c.conf.of_dtm)};g.onclick=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+j];a.childNodes[2].appendChild(g);this.idPull[g.id]=g;a=g=null};dhtmlXMenuObject.prototype._removeUpArrow=function(c){var a="arrowup_"+this.idPrefix+c;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeDownArrow=function(c){var a="arrowdown_"+this.idPrefix+c;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeArrow=function(a){var c=this.idPull[a];c.onselectstart=null;c.oncontextmenu=null;c.onmouseover=null;c.onmouseout=null;c.onclick=null;if(c.parentNode){c.parentNode.removeChild(c)}c=null;this.idPull[a]=null;try{delete this.idPull[a]}catch(g){}};dhtmlXMenuObject.prototype._isArrowExists=function(a){if(this.idPull["arrowup_"+a]!=null&&this.idPull["arrowdown_"+a]!=null){return true}return false};dhtmlXMenuObject.prototype._doScrollUp=function(m,j){var a=this.idPull["polygon_"+m].childNodes[1];if(this._canScrollUp&&a.scrollTop>0){var g=false;var l=a.scrollTop-this.conf.of_ustep;if(l<0){g=true;l=0}a.scrollTop=l;if(!g){var c=this;this.conf.of_utm=window.setTimeout(function(){c._doScrollUp(m,false);c=null},this.conf.of_utime)}else{j=true}}else{this._canScrollUp=false;this._checkArrowsState(m)}if(j){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._doScrollDown=function(m,j){var a=this.idPull["polygon_"+m].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var g=false;var l=a.scrollTop+this.conf.of_dstep;if(l+a.offsetHeight>=a.scrollHeight){g=true;l=a.scrollHeight-a.offsetHeight}a.scrollTop=l;if(!g){var c=this;this.conf.of_dtm=window.setTimeout(function(){c._doScrollDown(m,false);c=null},this.conf.of_dtime)}else{j=true}}else{this._canScrollDown=false;this._checkArrowsState(m)}if(j){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._countPolygonItems=function(m){var j=0;for(var c in this.itemPull){var g=this.itemPull[c]["parent"];var l=this.itemPull[c]["type"];if(g==this.idPrefix+m&&(l=="item"||l=="radio"||l=="checkbox")){j++}}return j};dhtmlXMenuObject.prototype.setOverflowHeight=function(j){if(j==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&j<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&j>0){this.conf.overflow_limit=j;return}if(this.conf.overflow_limit>0&&j<=0){for(var g in this.itemPull){if(this._isArrowExists(g)){var c=String(g).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+g].childNodes[1].style.height=""}}this.conf.overflow_limit=0;return}};dhtmlXMenuObject.prototype._getRadioImgObj=function(g){try{var a=this.idPull[this.idPrefix+g].childNodes[(this.conf.rtl?2:0)].childNodes[0]}catch(c){var a=null}return a};dhtmlXMenuObject.prototype._setRadioState=function(j,g){var c=this._getRadioImgObj(j);if(c!=null){var a=this.itemPull[this.idPrefix+j];a.checked=g;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;c.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(j,a,c){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+j]["group"]==null){return}var g=this.itemPull[this.idPrefix+j]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[g,this.getRadioChecked(g),j,this.conf.ctx_zoneid,c])){this.setRadioChecked(g,j)}}else{this.setRadioChecked(g,j)}if(this.checkEvent("onClick")){this.callEvent("onClick",[j])}};dhtmlXMenuObject.prototype.getRadioChecked=function(j){var m=null;for(var g=0;g<this.radio[j].length;g++){var l=this.radio[j][g].replace(this.idPrefix,"");var a=this._getRadioImgObj(l);if(a!=null){var c=(a.className).match(/rdbt_1$/gi);if(c!=null){m=l}}}return m};dhtmlXMenuObject.prototype.setRadioChecked=function(c,j){if(this.radio[c]==null){return}for(var a=0;a<this.radio[c].length;a++){var g=this.radio[c][a].replace(this.idPrefix,"");this._setRadioState(g,(g==j))}};dhtmlXMenuObject.prototype.addRadioButton=function(q,l,r,s,u,v,a,m){if(this.conf.context&&l==this.topId){}else{if(this.itemPull[this.idPrefix+l]==null){return}if(q=="child"&&this.itemPull[this.idPrefix+l]["type"]!="item"){return}}var g=this.idPrefix+(s!=null?s:this._genStr(24));var n="rdbt_"+(a?"1":"0");var c=n;if(q=="sibling"){var o=this.idPrefix+this.getParentId(l);this._addItemIntoGlobalStrorage(g,o,u,"radio",m,n,c);this._renderSublevelItem(g,this.getItemPosition(l))}else{var o=this.idPrefix+l;this._addItemIntoGlobalStrorage(g,o,u,"radio",m,n,c);if(this.idPull["polygon_"+o]==null){this._renderSublevelPolygon(o,o)}this._renderSublevelItem(g,r-1);this._redefineComplexState(o)}var j=(v!=null?v:this._genStr(24));this.itemPull[g]["group"]=j;if(this.radio[j]==null){this.radio[j]=new Array()}this.radio[j][this.radio[j].length]=g;if(a==true){this.setRadioChecked(j,String(g).replace(this.idPrefix,""))}};dhtmlXMenuObject.prototype.serialize=function(){var a="<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return a};dhtmlXMenuObject.prototype._readLevel=function(j){var l="";for(var q in this.itemPull){if(this.itemPull[q]["parent"]==j){var c="";var g="";var s="";var o=String(this.itemPull[q]["id"]).replace(this.idPrefix,"");var n="";var r=(this.itemPull[q]["title"]!=""?' text="'+this.itemPull[q]["title"]+'"':"");var m="";if(this.itemPull[q]["type"]=="item"){if(this.itemPull[q]["imgen"]!=""){c=' img="'+this.itemPull[q]["imgen"]+'"'}if(this.itemPull[q]["imgdis"]!=""){g=' imgdis="'+this.itemPull[q]["imgdis"]+'"'}if(this.itemPull[q]["hotkey"]!=""){s="<hotkey>"+this.itemPull[q]["hotkey"]+"</hotkey>"}}if(this.itemPull[q]["type"]=="separator"){n=' type="separator"'}else{if(this.itemPull[q]["state"]=="disabled"){m=' enabled="false"'}}if(this.itemPull[q]["type"]=="checkbox"){n=' type="checkbox"'+(this.itemPull[q]["checked"]?' checked="true"':"")}if(this.itemPull[q]["type"]=="radio"){n=' type="radio" group="'+this.itemPull[q]["group"]+'" '+(this.itemPull[q]["checked"]?' checked="true"':"")}l+="<item id='"+o+"'"+r+n+c+g+m+">";l+=s;if(this.itemPull[q]["complex"]){l+=this._readLevel(q)}l+="</item>"}}return l};dhtmlXMenuObject.prototype.enableEffect=function(g,l,j){this._menuEffect=(g=="opacity"||g=="slide"||g=="slide+"?g:false);this._pOpStyleIE=(navigator.userAgent.search(/MSIE\s[678]\.0/gi)>=0);for(var c in this.idPull){if(c.search(/polygon/)===0){this._pOpacityApply(c,(this._pOpStyleIE?100:1));this.idPull[c].style.height=""}}this._pOpMax=(typeof(l)=="undefined"?100:l)/(this._pOpStyleIE?1:100);this._pOpStyleName=(this._pOpStyleIE?"filter":"opacity");this._pOpStyleValue=(this._pOpStyleIE?"progid:DXImageTransform.Microsoft.Alpha(Opacity=#)":"#");this._pSlSteps=(this._pOpStyleIE?10:20);this._pSlTMTimeMax=j||50};dhtmlXMenuObject.prototype._showPolygonEffect=function(a){this._pShowHide(a,true)};dhtmlXMenuObject.prototype._hidePolygonEffect=function(a){this._pShowHide(a,false)};dhtmlXMenuObject.prototype._pOpacityApply=function(a,c){this.idPull[a].style[this._pOpStyleName]=String(this._pOpStyleValue).replace("#",c||this.idPull[a]._op)};dhtmlXMenuObject.prototype._pShowHide=function(a,c){if(!this.idPull){return}if(this.idPull[a]._tmShow!=null){if((this.idPull[a]._step_h>0&&c==true)||(this.idPull[a]._step_h<0&&c==false)){return}window.clearTimeout(this.idPull[a]._tmShow);this.idPull[a]._tmShow=null;this.idPull[a]._max_h=null}if(c==false&&(this.idPull[a].style.visibility=="hidden"||this.idPull[a].style.display=="none")){return}if(c==true&&this.idPull[a].style.display=="none"){this.idPull[a].style.visibility="hidden";this.idPull[a].style.display=""}if(this.idPull[a]._max_h==null){this.idPull[a]._max_h=parseInt(this.idPull[a].offsetHeight);this.idPull[a]._h=(c==true?0:this.idPull[a]._max_h);this.idPull[a]._step_h=Math.round(this.idPull[a]._max_h/this._pSlSteps)*(c==true?1:-1);if(this.idPull[a]._step_h==0){return}this.idPull[a]._step_tm=Math.round(this._pSlTMTimeMax/this._pSlSteps);if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[a].op_tm=this.idPull[a]._step_tm;this.idPull[a].op_step=(this._pOpMax/this._pSlSteps)*(c==true?1:-1);if(this._pOpStyleIE){this.idPull[a].op_step=Math.round(this.idPull[a].op_step)}this.idPull[a]._op=(c==true?0:this._pOpMax);this._pOpacityApply(a)}else{this.idPull[a]._op=(this._pOpStyleIE?100:1);this._pOpacityApply(a)}if(this._menuEffect.search(/slide/)===0){this.idPull[a].style.height="0px"}this.idPull[a].style.visibility="visible"}this._pEffectSet(a,this.idPull[a]._h+this.idPull[a]._step_h)};dhtmlXMenuObject.prototype._pEffectSet=function(g,c){if(!this.idPull){return}if(this.idPull[g]._tmShow){window.clearTimeout(this.idPull[g]._tmShow)}this.idPull[g]._h=Math.max(0,Math.min(c,this.idPull[g]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=this.idPull[g]._h+"px"}c+=this.idPull[g]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[g]._op+this.idPull[g].op_step));this._pOpacityApply(g)}if((this.idPull[g]._step_h>0&&c<=this.idPull[g]._max_h)||(this.idPull[g]._step_h<0&&c>=0)){var a=this;this.idPull[g]._tmShow=window.setTimeout(function(){a._pEffectSet(g,c)},this.idPull[g]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=""}if(this.idPull[g]._step_h<0){this.idPull[g].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=(this.idPull[g]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(g)}this.idPull[g]._tmShow=null;this.idPull[g]._h=null;this.idPull[g]._max_h=null;this.idPull[g]._step_tm=null}};function dhtmlXRibbon(j){var g=this,c,a;this.conf={type:"ribbon",icons_path:(j&&j.icons_path)?j.icons_path:"",arrows_mode:(j&&j.arrows_mode)?j.arrows_mode:null,skin:"dhx_skyblue"};this._eventHandlers={};this._base=null;this._items={};this._tabbar=null;this.childIds=[];if(typeof(j)=="string"){a=j}else{if(j&&j.tagName){a=j}else{if(j&&j.parent){if(j.parent.tagName||typeof(j.parent)=="string"){a=j.parent}}}}this._doOnHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseover)=="function"){if(g.items[m.type].mouseover(m,g,o)!=true){return false}}if(!/dhxrb_highlight0/.test(l.className)){l.className+=" dhxrb_highlight0"}};this._doOffHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseout)=="function"){if(g.items[m.type].mouseout(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}if(/dhxrb_highlight0/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight0/,"")}};this._doOnHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].mousedown)=="function"){if(g.items[m.type].mousedown(m,g,o)!=true){return false}}if(!/dhxrb_highlight1/.test(l.className)){l.className+=" dhxrb_highlight1"}};this._doOffHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseup)=="function"){if(g.items[m.type].mouseup(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}};this._doOnClick=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].click)=="function"){g.items[m.type].click(m,g,o)}};this._doOnFocus=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].focus)=="function"){g.items[m.type].focus(m,g,o)}};this._doOnBlur=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].blur)=="function"){g.items[m.type].blur(m,g,o)}};this._doOnChange=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].change)=="function"){g.items[m.type].change(m,g,o)}};this._doOnKeydown=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].keydown)=="function"){g.items[m.type].keydown(m,g,o)}};this._tabCustomApi={enable:function(o,n){var m=null,l=null;n=n||false;if(n!=true){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.enable(m.childIds[l])}}return g._tabOriginalApi.enable.apply(this,[o])},disable:function(o,n){var m=null,l=null;if(n!=false){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.disable(m.childIds[l])}}return g._tabOriginalApi.disable.apply(this,[o])},close:function(n){var m=g._items[this._idd],l;g._removeTab(m);g._tabOriginalApi.close.apply(this,[n]);for(l in g._tabOriginalApi){this[l]=null}}};this._attachEventTabbar=function(){this._tabbar.attachEvent("onSelect",function(){return g.callEvent("onSelect",arguments)});this._tabbar.attachEvent("onTabClick",function(){return g.callEvent("onTabClick",arguments)});this._tabbar.attachEvent("onTabClose",function(){return g.callEvent("onTabClose",arguments)})};if(typeof(a)=="string"){this._base=document.getElementById(a)}else{if(a&&a.tagName){this._base=a}else{this._base=document.createElement("div");this._base._dhx_remove=true;if(document.body.firstChild){document.body.insertBefore(this._base,document.body.firstChild)}else{document.body.appendChild(this._base)}}}c=dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||dhx4.skinDetect("dhtmlxribbon")||"dhx_skyblue";if(typeof(j)=="object"&&j.skin){c=j.skin}this.setSkin(c);dhx4._eventable(this);dhx4._enableDataLoading(this,"_renderData","_xmlToJson","ribbon",{struct:true});this.attachEvent("_onHeightChanged",function(){this.conf.inited=true});this._base.className+=" dhxrb_without_tabbar";this._base.innerHTML="<div class='dhxrb_background_area'></div>";if(j!=null){if(j.json){this.loadStruct(j.json,j.onload)}else{if(j.xml){this.loadStruct(j.xml,j.onload)}else{this._renderData(j)}}}this.unload=function(){var m=null,l=[];for(m in this.childIds){m=parseInt(m);l.push(this.childIds[m])}dhx4._enableDataLoading(this,null,null,null,"clear");dhx4._eventable(this,"clear");for(m in l){m=parseInt(m);if(this._items[l[m]].type=="tab"){this.tabs(l[m]).close(false)}else{this.removeItem(l[m])}}if(this._tabbar){this._tabbar.unload();this._tabbar=null}this._base.innerHTML="";if(this._base._dhx_remove){this._base.parentNode.removeChild(this._base)}else{this._base.className=this._base.className.replace(/\s?(dhtmlx|dhxrb)(\S*)/ig,"")}for(m in this){this[m]=null}g=null}}dhtmlXRibbon.prototype.setSizes=function(){if(this._tabbar!=null&&typeof(this.setSizes)=="function"){this._tabbar.setSizes()}};dhtmlXRibbon.prototype._renderData=function(c){var a=this._base.firstChild;if(c!=null){this.conf.icons_path=c.icons_path||this.conf.icons_path;if(c.tabs instanceof Array){this._base.className=this._base.className.replace(/\s?dhxrb_without_tabbar/i,"");a.className="dhxrb_with_tabbar";this._tabbar=new dhtmlXTabBar(a);this._attachEventTabbar();this._tabbar.setSkin(this.conf.skin);if(this.conf.arrows_mode!=null){this._tabbar.setArrowsMode(this.conf.arrows_mode)}this.childIds=this._appendTabs(c.tabs)}else{if(c.items instanceof Array){if(!/\s?dhxrb_without_tabbar/i.test(this._base.className)){this._base.className+=" dhxrb_without_tabbar"}if(/\s?dhxrb_background_area/i.test(a.className)){a.className="dhxrb_background_area"}a.innerHTML="<div class='dhxrb_g_area'></div>";this.childIds=this._appendBlocks(c.items,a.firstChild)}}this.callEvent("_onHeightChanged",[])}};dhtmlXRibbon.prototype._xmlToJson=function(c){var a=c.lastChild||null,j={},g=[];if(a&&a.tagName=="ribbon"){g=this._convertXmlNodeListIntoObject(a.childNodes)}if(g[0]&&g[0].type&&g[0].type.toLowerCase()=="block"){j.items=g}else{j.tabs=g}return j};dhtmlXRibbon.prototype._convertXmlNodeListIntoObject=function(c){var g,a,m=[],j;a=c.length;for(g=0;g<a;g++){j=this._covertXmlNodeToObject(c[g]);if(j){m.push(j)}}return m};dhtmlXRibbon.prototype._covertXmlNodeToObject=function(j){if(!j||!j.tagName||!(j.tagName.toLowerCase()=="item"||j.tagName.toLowerCase()=="tab")){return null}var g,a,c=j.attributes,m={};a=c.length;for(g=0;g<a;g++){switch(c[g].name){case"isbig":m.isbig=dhx4.s2b(c[g].value);break;case"state":m.state=dhx4.s2b(c[g].value);break;default:m[c[g].name]=c[g].value}}if(j.childNodes.length){if(j.getAttribute("type")=="buttonCombo"||j.getAttribute("type")=="buttonSelect"){m.data=j}else{if(j.tagName.toLowerCase()=="tab"){m.items=this._convertXmlNodeListIntoObject(j.childNodes)}else{m.list=this._convertXmlNodeListIntoObject(j.childNodes)}}}return m};dhtmlXRibbon.prototype._appendTabs=function(m){var c,a,g,j=[];a=m.length;for(c=0;c<a;c++){g=this._addTab(m[c]);if(m[c].items instanceof Array){g.childIds=this._appendBlocks(m[c].items,g.base,g)}j.push(g.id)}return j};dhtmlXRibbon.prototype._addTab=function(g){var a,j,c={conf:{active:false,text:"",width:null,position:null,disable:false},base:document.createElement("div"),type:"tab",childIds:[]};for(a in g){if(a=="items"){continue}c.conf[a]=g[a]}if(!g.id){c.id=dhx4.newId()}else{c.id=g.id}while(this._items[c.id]){c.id=dhx4.newId()}this._tabbar.addTab(c.id,c.conf.text,c.conf.width,c.conf.position,c.conf.active);c.base.className="dhxrb_g_area";c.base._dhx_ribbonId=c.id;this.tabs(c.id).attachObject(c.base);this._changeApiForTab(this.tabs(c.id));this._items[c.id]=c;return c};dhtmlXRibbon.prototype._changeApiForTab=function(c){var a;for(a in this._tabOriginalApi){this._tabOriginalApi[a]=this._tabOriginalApi[a]||c[a];c[a]=this._tabCustomApi[a]}};dhtmlXRibbon.prototype._tabOriginalApi={enable:null,disable:null,close:null};dhtmlXRibbon.prototype._appendBlocks=function(a,u,g){var n,j,o,m,r,c,s=[];g=g||null;j=a.length;for(n=0;n<j;n++){if(typeof(a[n])=="object"&&a[n].type=="block"){o=this._addBlock(a[n],u);if(a[n].list&&(a[n].list instanceof Array)){m=a[n].list;r=m.length;for(c=0;c<r;c++){this._addItem(o.id,null,null,m[c])}}if(g!=null){o.parentId=g.id}if(o.conf.disable){this.disable(o.id)}s.push(o.id)}}return s};dhtmlXRibbon.prototype._addBlock=function(m,j){var g,a,n,c;n={conf:{text:"",text_pos:"bottom",type:"block",mode:"cols",disable:false},type:"block",childIds:[],base:document.createElement("div"),contForItems:document.createElement("div"),contForText:document.createElement("div")};for(c in m){if(c=="list"||c=="type"||c=="id"){continue}n.conf[c]=m[c]}if(!m.id){n.id=dhx4.newId()}else{n.id=m.id}while(this._items[n.id]){n.id=dhx4.newId()}n.base.className="dhxrb_block_base";j.appendChild(n.base);n.contForItems.className="dhxrb_block_items";n.contForText.className="dhxrb_block_label";n.base.appendChild(n.contForItems);if(n.conf.text){n.contForText.innerHTML=n.conf.text;if(n.conf.text_pos=="top"){n.base.insertBefore(n.contForText,n.contForItems)}else{n.base.appendChild(n.contForText)}}n.base._dhx_ribbonId=n.id;this._items[n.id]=n;return n};dhtmlXRibbon.prototype._addItem=function(g,c,q,n){var l=this._items[g],a,m,s=null,o=this,j;if(n.type!="newLevel"&&!this.items[n.type]){return null}if(n.type=="newLevel"){this._addNewLevel(l)}else{if(l.type=="group"){a=document.createElement("div");a.className="dhxrb_in_group";l.base.appendChild(a)}else{if(n.isbig){a=document.createElement("div");a.className="dhxrb_big_button";l.contForItems.appendChild(a)}else{m=this._getContainerForSmallItem(l);a=document.createElement("div");a.className=(l.conf.mode=="rows")?"dhxrb_in_row":"dhxrb_3rows_button";m.appendChild(a)}}}if(a){this._attachEventForItem(a);j={icons_path:n.icons_path||this.conf.icons_path,skin:this.conf.skin};for(var r in n){j[r]=n[r]}if(!j.id){j.id=dhx4.newId()}while(this._items[j.id]){j.id=dhx4.newId()}s=(this.items[j.type]&&this.items[j.type].render)?this.items[j.type].render(a,j):null}if(s!=null){this._items[s.id]=s;s.parentId=l.id;l.childIds.push(s.id);a._dhx_ribbonId=s.id;if(j.onclick&&(typeof(j.onclick)=="function")){this._eventHandlers[s.id]=this._eventHandlers[s.id]||{};this._eventHandlers[s.id]["onclick"]=j.onclick}s.callEvent=function(){o.callEvent.apply(o,arguments)};s._callHandler=function(){o._callHandler.apply(o,arguments)};if(this.items[j.type]&&typeof(this.items[j.type].callAfterInit)=="function"){this.items[j.type].callAfterInit.apply(this,[s])}}return s};dhtmlXRibbon.prototype._callHandler=function(c,a){if(this._eventHandlers[c]&&this._eventHandlers[c].onclick){this._eventHandlers[c].onclick.apply(this,a)}};dhtmlXRibbon.prototype.items={};dhtmlXRibbon.prototype.items.button={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",img:null,imgdis:null,isbig:false,disable:false,skin:a.skin}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="<img class='dhxrb_image"+((j.conf.img)?"'":" dhxrb_invisible'")+" src='"+((j.conf.img)?j.conf.icons_path+j.conf.img:"")+"' /><div class='dhxrb_label_button'>"+j.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}return j},getText:function(a){return a.conf.text},setText:function(c,g){var a=c.base.childNodes[1];c.conf.text=g;a.innerHTML=g},setImage:function(c,a){c.conf.img=a;if(c.conf.disable==false){c.base.childNodes[0].src=c.conf.icons_path+c.conf.img}},setImageDis:function(c,a){c.conf.imgdis=a;if(c.conf.disable==true){c.base.childNodes[0].src=c.conf.icons_path+c.conf.imgdis}},mousedown:function(a,g,c){return true},click:function(a,g,c){if(c.button!=0){return false}g._callHandler(a.id,[a.id]);a.callEvent("onClick",[a.id]);return false},disable:function(c){var g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.imgdis){g.src=c.conf.icons_path+c.conf.imgdis;if(/\s?dhxrb_invisible/i.test(g.className)){g.className=g.className.replace(/\s?dhxrb_invisible/i,"")}}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.img){g.src=c.conf.icons_path+c.conf.img}else{if(!/\s?dhxrb_invisible/i.test(g.className)){g.className+=" dhxrb_invisible"}}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true}};dhtmlXRibbon.prototype.items.buttonTwoState={click:function(a,g,c){return false},afterRender:function(a){if(a.conf.state){this.setState(a,a.conf.state)}},mouseover:function(a){if(!/dhxrb_highlight0/.test(a.base.className)){a.base.className+=" dhxrb_highlight0"}return false},mouseout:function(a){if(/dhxrb_highlight0/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight0/,"")}return false},mousedown:function(a,g,c){g._callHandler(a.id,[a.id,!a.conf.state]);this.setState(a,!a.conf.state,true);return false},mouseup:function(a){return false},setState:function(a,c,g){g=g||false;c=dhx4.s2b(c);if(c){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}a.conf.state=c;if(g){a.callEvent("onStateChange",[a.id,a.conf.state])}},getState:function(a){return(a.conf.state==true)}};dhtmlXRibbon.prototype.items.buttonSegment={click:function(a,g,c){return false},mousedown:function(a,g,c){this.setState(a,g,true);return false},callAfterInit:function(a){if(a.conf.state||dhtmlXRibbon.prototype.items.buttonSegment._getSelectedNeighbor(a,this)==null){if(a.conf.state){a.conf.state=false}dhtmlXRibbon.prototype.items.buttonSegment.setState(a,this,false)}},afterRender:function(){},setState:function(a,l,j){j=j||false;var g=null,c=dhx4.s2b(a.conf.state);if(c==false){g=this._getSelectedNeighbor(a,l);if(g!=null){this._unSelect(g)}if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}a.conf.state=true;if(j){l._callHandler(a.id,[a.id,(g?g.id:null)]);l.callEvent("onStateChange",[a.id,(g?g.id:null)])}}},remove:function(g,n){var l=dhx4.s2b(g.conf.state),m=null,a=0,c=n._items[g.parentId],j;if(l){while(c.childIds[a]&&m==null){j=n._items[c.childIds[a]];if(j.type=="buttonSegment"&&j!=g){m=j}a++}if(m){this.setState(m,n)}}},_unSelect:function(a){var c=dhx4.s2b(a.conf.state);if(c){if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}a.conf.state=false}},_getSelectedNeighbor:function(j,o){var g=o._items[j.parentId],c,a,n,m=null;a=g.childIds.length;for(c=0;c<a;c++){n=o._items[g.childIds[c]];if(n.type=="buttonSegment"&&n.conf.state){m=n;break}}return m}};dhtmlXRibbon.prototype.items.buttonSelect={itemCollection:[],_isAttachedEventInWindow:false,afterRender:function(c){var a=c.base.childNodes[1];a.innerHTML+="<span class='dhxrb_arrow'>&nbsp;</span>";c.menu=null;this.itemCollection.push(c);this._attachEventToWindow();a=null},setText:function(a,g){var c=a.base.childNodes[1].lastChild;a.conf.text=g;a.base.childNodes[1].innerHTML=g;a.base.childNodes[1].appendChild(c)},setOptionText:function(a,g,c){if(a.menu!=null){a.menu.setItemText(g,c)}else{this._loopThroughItems(a.conf.items,g,c,false)}},getOptionText:function(a,c){if(a.menu!=null){return a.menu.getItemText(c)}return this._loopThroughItems(a.conf.items,c,null,true)},_loopThroughItems:function(a,m,l,j){for(var g=0;g<a.length;g++){if(a[g].id==m){if(j!=true){a[g].text=l;return true}else{return a[g].text}}if(a[g].items!=null){var c=this._loopThroughItems(a[g].items,m,l,j);if(c!=null){return c}}}return null},_attachEventToWindow:function(){if(this._isAttachedEventInWindow==false){if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._hideAllMenus,false)}else{document.body.attachEvent("onmousedown",this._hideAllMenus)}this._isAttachedEventInWindow=true}},_detachEventFromWindow:function(){if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousedown",this._hideAllMenus,false)}else{document.body.detachEvent("onmousedown",this._hideAllMenus)}this._isAttachedEventInWindow=false},_hideAllMenus:function(l){l=l||event;var g=l.target||l.srcElement;var a=true;while(g!=null&&a==true){if(g.className!=null&&/SubLevelArea_Polygon/i.test(g.className)){a=false}else{g=g.parentNode}}if(a==false){return}var c=dhtmlXRibbon.prototype.items.buttonSelect.itemCollection;for(var n in c){var j=c[n];if(j.menu instanceof dhtmlXMenuObject){if(j._skipHiding){j._skipHiding=false}else{dhtmlXRibbon.prototype.items.buttonSelect.hideMenu(j)}}}},mousedown:function(a,g,c){a._skipHiding=true;this.showMenu(a);return false},mouseup:function(a){return false},click:function(){},setState:function(){},showMenu:function(c){var a=dhx4.absLeft(c.base),g=dhx4.absTop(c.base)+c.base.offsetHeight;if(!(c.menu instanceof dhtmlXMenuObject)){c.menu=new dhtmlXMenuObject({parent:c.base,icons_path:c.conf.icons_path,context:true,items:c.conf.items,skin:c.conf.skin});if(c.conf.data){c.menu.loadStruct(c.conf.data);delete c.conf.data}c.menu.setAutoHideMode(false);c.menu.attachEvent("onHide",function(j){if(j==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnHideMenu(c)}});c.menu.attachEvent("onShow",function(j){if(j==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnShowMenu(c)}});c.menu.attachEvent("onClick",function(j){c.callEvent("onClick",[j,c.id])});c.base.oncontextmenu=function(){return false};dhtmlXRibbon.prototype.items.buttonSelect.showMenu(c)}else{c.menu.showContextMenu(a,g)}},hideMenu:function(a){if(a.menu instanceof dhtmlXMenuObject){a.menu.hideContextMenu()}},remove:function(c){var g,a;if(c.menu instanceof dhtmlXMenuObject){c.menu.unload();c.menu=null}c.base.oncontextmenu=null;g=dhtmlXRibbon.prototype._indexOf(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection,c);if(g!=-1){dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.splice(g,1)}if(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.length==0){this._detachEventFromWindow()}},setSkin:function(a,c){if(a.menu instanceof dhtmlXMenuObject){a.menu.setSkin(c)}},_doOnHideMenu:function(a){if(a._skipHiding){a._skipHiding=false}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}},_doOnShowMenu:function(a){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}};dhtmlXRibbon.prototype.items.group={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{disable:false,skin:a.skin},childIds:[]};c.className="dhxrb_group";for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}return j},callAfterInit:function(m){this._detachEventFromItem(m.base);var j,a,n=m.conf.list,o,g,c;a=(n)?n.length:0;for(j=0;j<a;j++){o=this._addItem(m.id,null,null,n[j]);if(o==null){continue}g=o.base.childNodes[1];if(g&&!g.innerHTML&&!/\s?dhxrb_label_hide/i.test(g.className)){g.className+=" dhxrb_label_hide"}}dhtmlXRibbon.prototype.items.group.normalize(m);if(m.conf.disable){this.disable(m.id)}n=undefined},normalize:function(o){var a=o.base.children;var g=a.length,c=false,q=0;var j,n;for(var m=0;m<g;m++){if(!/dhxrb_separator_group/i.test(a[m].className)){if(/dhxrb_item_hide/i.test(a[m].className)){q++;continue}}if((Math.ceil((m-q)/2)-Math.floor((m-q)/2))==0){if(/dhxrb_separator_group/i.test(a[m].className)){a[m].parentNode.removeChild(a[m]);c=true;break}}else{if(!/dhxrb_separator_group/i.test(a[m].className)){j=document.createElement("div");j.className="dhxrb_separator_groupp";o.base.insertBefore(j,a[m]);c=true;break}}}if(c){this.normalize(o)}else{n=o.base.lastChild;if(n&&/dhxrb_separator_group/i.test(n.className)){n.parentNode.removeChild(n)}}},hideChild:function(c,j){var a=dhtmlXRibbon.prototype._indexOf(c.base.children,j.base);if(a==0){a++}else{if(a!=-1){a--}else{return}}var g=c.base.children[a];if(g&&/dhxrb_separator_group/i.test(g.className)){g.parentNode.removeChild(g)}},showChild:function(a){this.normalize(a)}};dhtmlXRibbon.prototype.items.input={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",img:null,imgdis:null,isbig:false,disable:false,skin:a.skin,value:""}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="<input type='text' class='dhxrb_input'><div class='dhxrb_label_button'>"+j.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}if(j.conf.width){this.setWidth(j,j.conf.width)}if(j.conf.value){this.setValue(j,j.conf.value)}return j},callAfterInit:function(c){var a=c.base.childNodes[0];this._detachEventFromItem(c.base);this._attachEventsToInput(a)},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,change:function(c){var a=c.base.childNodes[0];c.conf.value=a.value},keydown:function(c,j,g){if(g.keyCode==13){var a=c.base.childNodes[0];c.conf.value=a.value;j.callEvent("onEnter",[c.id,c.conf.value])}},remove:function(c,g){var a=c.base.childNodes[0];g._detachEventsFromInput(a)},getValue:function(c){var a=c.base.childNodes[0],g;g=a.value;a=undefined;return g},setValue:function(c,g){var a=c.base.childNodes[0],g;a.value=g;c.conf.value=g},setWidth:function(c,g){var a=c.base.childNodes[0];a.style.width=parseInt(g)+"px"},disable:function(g){var c=g.base.childNodes[0],a=g.base.childNodes[1];c.disabled=true;if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(g){var c=g.base.childNodes[0],a=g.base.childNodes[1];c.disabled=false;if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},getInput:function(a){return a.base.childNodes[0]}};dhtmlXRibbon.prototype.getInput=function(c){var a=this._items[c];if(a==null||a.type!="input"){return null}return this.items[a.type].getInput(a)};dhtmlXRibbon.prototype.items.checkbox={render:function(c,a){var g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",disable:false,checked:false}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="<div class='dhxrb_checkbox'></div><div class='dhxrb_label_checkbox'>"+j.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.checked){this.check(j)}return j},callAfterInit:function(a){if(a.conf.disable){this.disable(a.id)}},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,mousedown:function(a){return false},mouseup:function(a){return false},click:function(a,g,c){if(c.button!=0){return false}if(a.type=="checkbox"){if(a.conf.checked){this.uncheck(a,true)}else{this.check(a,true)}}},check:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=true;if(!/\s?dhxrb_checked/i.test(a.base.className)){a.base.className+=" dhxrb_checked"}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},uncheck:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=false;if(/\s?dhxrb_checked/i.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_checked/i,"")}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},isChecked:function(a){if(a.type!="checkbox"){return false}return(a.conf.checked==true)},disable:function(a){return true},enable:function(a){return true}};dhtmlXRibbon.prototype.items.text={render:function(a,j){var g={base:a,id:j.id,type:j.type,conf:{text:""}};for(var c in j){if(c=="id"||c=="type"){continue}g.conf[c]=j[c]}a.innerHTML="<div class='dhxrb_item_text'>"+g.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(g)}return g},callAfterInit:function(a){this._detachEventFromItem(a.base)},getText:function(a){return a.conf.text},setText:function(a,c){a.conf.text=c;a.base.innerHTML=c}};dhtmlXRibbon.prototype.items.buttonCombo={render:function(a,c){var g,j,l={};j={base:a,id:c.id,type:c.type,conf:{text:"",text_pos:"right",width:140,skin:c.skin,callEvent:true}};for(g in c){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=c[g]}for(g in j.conf){if(g=="text"||g=="text_pos"||g=="disable"||g=="data"){continue}l[g]=j.conf[g]}j.base.className+=" dhxrb_buttoncombo_cont";j.base.innerHTML="<div class='dhxrb_buttoncombo'></div><div class='dhxrb_label_button'>"+j.conf.text+"</div>";l.parent=j.base.firstChild;j.combo=new dhtmlXCombo(l);j.combo.setSkin(l.skin);j.combo.attachEvent("onChange",function(m,n){j._callHandler(j.id,[m,n]);if(j.conf.callEvent==true){j.callEvent("onSelectOption",[j.id,m,n])}j.conf.callEvent=true});if(j.conf.data){j.combo.load(j.conf.data);delete j.conf.data}if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}return j},callAfterInit:function(a){this._detachEventFromItem(a.base)},disable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.combo instanceof dhtmlXCombo){a.combo.unload();a.combo=null}},getValue:function(a){var c=null;if(a.combo instanceof dhtmlXCombo){c=a.combo.getSelectedValue()}return c},setValue:function(a,c,g){if(a.combo instanceof dhtmlXCombo){a.conf.callEvent=g;a.combo.setComboValue(c)}},setSkin:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setSkin(c)}}};dhtmlXRibbon.prototype.items.slider={render:function(a,l){var g,j,c={};j={base:a,id:l.id,type:l.type,conf:{text:"",text_pos:"right",size:150,vertical:false,min:0,max:99,value:0,step:1,margin:10,disabled:false,enableTooltip:false}};for(g in l){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=l[g]}for(g in j.conf){if(g=="text"||g=="text_pos"||g=="isbig"){continue}c[g]=j.conf[g]}j.base.innerHTML="<center><div class='dhxrb_slider'></div></center><div class='dhxrb_label_button'>"+j.conf.text+"</div>";c.parent=j.base.firstChild.firstChild;j.slider=new dhtmlXSlider(c);if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}j.slider.attachEvent("onChange",function(m){j._callHandler(j.id,[m]);j.callEvent("onValueChange",[j.id,m])});return j},callAfterInit:function(a){this._detachEventFromItem(a.base)},setSkin:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setSkin(c)}},disable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.slider instanceof dhtmlXSlider){a.slider.unload();a.slider=null}},getValue:function(a){var c=null;if(a.slider instanceof dhtmlXSlider){c=a.slider.getValue()}return c},setValue:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setValue(c)}}};dhtmlXRibbon.prototype.items._extends=function(g,c){var a;for(a in c){g[a]=g[a]||c[a]}return g};dhtmlXRibbon.prototype._addNewLevel=function(g){var c,a;if(g.conf.mode=="rows"){c=g.contForItems.lastChild;if(c&&/dhxrb_block_rows/i.test(c.className)&&(c.childNodes.length<3)){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}else{c=document.createElement("div");c.className="dhxrb_block_rows";g.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{var a=document.createElement("div");a.className="dhxrb_3rows_block";g.contForItems.appendChild(a)}};dhtmlXRibbon.prototype._attachEventForItem=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("mouseover",this._doOnHighlight0,false);a.addEventListener("mouseout",this._doOffHighlight0,false);a.addEventListener("mousedown",this._doOnHighlight1,false);a.addEventListener("mouseup",this._doOffHighlight1,false);a.addEventListener("click",this._doOnClick,false)}else{a.attachEvent("onmouseover",this._doOnHighlight0);a.attachEvent("onmouseout",this._doOffHighlight0);a.attachEvent("onmousedown",this._doOnHighlight1);a.attachEvent("onmouseup",this._doOffHighlight1);a.attachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._detachEventFromItem=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("mouseover",this._doOnHighlight0,false);a.removeEventListener("mouseout",this._doOffHighlight0,false);a.removeEventListener("mousedown",this._doOnHighlight1,false);a.removeEventListener("mouseup",this._doOffHighlight1,false);a.removeEventListener("click",this._doOnClick,false)}else{a.detachEvent("onmouseover",this._doOnHighlight0);a.detachEvent("onmouseout",this._doOffHighlight0);a.detachEvent("onmousedown",this._doOnHighlight1);a.detachEvent("onmouseup",this._doOffHighlight1);a.detachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._attachEventsToInput=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",this._doOnFocus,false);a.addEventListener("blur",this._doOnBlur,false);a.addEventListener("change",this._doOnChange,false);a.addEventListener("keydown",this._doOnKeydown,false)}else{a.attachEvent("onfocus",this._doOnFocus);a.attachEvent("onblur",this._doOnBlur);a.attachEvent("onchange",this._doOnChange);a.attachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._detachEventsFromInput=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",this._doOnFocus,false);a.removeEventListener("blur",this._doOnBlur,false);a.removeEventListener("change",this._doOnChange,false);a.removeEventListener("keydown",this._doOnKeydown,false)}else{a.detachEvent("onfocus",this._doOnFocus);a.detachEvent("onblur",this._doOnBlur);a.detachEvent("onchange",this._doOnChange);a.detachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._getContainerForSmallItem=function(g){var c=g.contForItems.lastChild,a=null;if(g.conf.mode=="rows"){if(c&&/\s?dhxrb_block_rows/i.test(c.className)){a=c.lastChild;if(!a){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{c=document.createElement("div");c.className="dhxrb_block_rows";g.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{if(c&&/dhxrb_3rows_block/i.test(c.className)&&(c.childNodes.length<3)){a=c}else{a=document.createElement("div");a.className="dhxrb_3rows_block";g.contForItems.appendChild(a)}}return a};dhtmlXRibbon.prototype._findItemByNode=function(a){while(a&&!a._dhx_ribbonId){a=a.parentNode}return a};dhtmlXRibbon.prototype._indexOf=function(a,j){var g,c;c=a.length;for(g=0;g<c;g++){if(a[g]==j){return g}}return -1};dhtmlXRibbon.prototype._removeItem=function(g){var a,j=-1,c=this._items[g.parentId];if(g.type=="group"){this._removeGroup(g);return}delete this._items[g.id];a=g.base.parentNode;this._detachEventFromItem(g.base);a.removeChild(g.base);if(c.type=="block"){if(a!=c.contForItems&&a.childNodes.length==0){a.parentNode.removeChild(a)}}else{if(c.type=="group"){dhtmlXRibbon.prototype.items.group.normalize(c)}}j=this._indexOf(c.childIds,g.id);if(j!=-1){c.childIds.splice(j,1)}if(this.items[g.type]&&(typeof(this.items[g.type].remove)=="function")){this.items[g.type].remove(g,this)}};dhtmlXRibbon.prototype._removeGroup=function(j){var c=[],l,g=this._items[j.parentId],a=j.base.parentNode;for(l in j.childIds){l=parseInt(l);c.push(this._items[j.childIds[l]])}for(l in c){l=parseInt(l);this._removeItem(c[l])}delete this._items[j.id];if(j.base.parentNode){a.removeChild(j.base)}if(a.childNodes.length==0){a.parentNode.removeChild(a)}l=this._indexOf(g.childIds,j.id);if(l!=-1){g.childIds.splice(l,1)}if(this.items[j.type]&&(typeof(this.items[j.type].remove)=="function")){this.items[j.type].remove(j)}};dhtmlXRibbon.prototype._removeBlock=function(j){var a=[],g,c;for(g in j.childIds){g=parseInt(g);a.push(this._items[j.childIds[g]])}for(g in a){g=parseInt(g);this._removeItem(a[g])}delete this._items[j.id];j.base.parentNode.removeChild(j.base);if(j.parentId){c=this._items[j.parentId]}else{c=this}g=this._indexOf(c.childIds,j.id);if(g!=-1){c.childIds.splice(g,1)}};dhtmlXRibbon.prototype._removeTab=function(c,a){var j=[],g;for(g in c.childIds){g=parseInt(g);j.push(this._items[c.childIds[g]])}for(g in j){g=parseInt(g);this._removeBlock(j[g])}delete this._items[c.id];g=this._indexOf(this.childIds,c.id);if(g!=-1){this.childIds.splice(g,1)}};dhtmlXRibbon.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXRibbon.prototype._setSkinForItems=function(g){var a,c;for(a in this._items){c=this._items[a];c.conf.skin=g;if(dhtmlXRibbon.prototype.items[c.type]&&typeof(dhtmlXRibbon.prototype.items[c.type].setSkin)=="function"){dhtmlXRibbon.prototype.items[c.type].setSkin(c,g)}}c=undefined,a=undefined};dhtmlXRibbon.prototype._setBlockText=function(a,c){a.conf.text=c;a.contForText.innerHTML=c;if(!c&&(c!=0)&&a.contForText.parentNode){a.contForText.parentNode.removeChild(a.contForText)}else{if(!a.contForText.parentNode){if(a.conf.text_pos=="top"){a.base.insertBefore(a.contForText,a.contForItems)}else{a.base.appendChild(a.contForText)}}}};dhtmlXRibbon.prototype.hide=function(g){var c=this._items[g];if(this.items[c.type]&&(typeof(this.items[c.type].hide)=="function")){if(this.items[c.type].hide(c)!=true){return}}if(c.type=="tab"){return}else{if(!/\s?dhxrb_item_hide/i.test(c.base.className)){c.base.className+=" dhxrb_item_hide"}}var a=this._items[c.parentId];if(a&&this.items[a.type]&&(typeof(this.items[a.type].hideChild)=="function")){this.items[a.type].hideChild(a,c)}};dhtmlXRibbon.prototype.show=function(g){var c=this._items[g];if(this.items[c.type]&&(typeof(this.items[c.type].show)=="function")){if(this.items[c.type].show(c)!=true){return}}if(c.type=="tab"){return}else{if(/\s?dhxrb_item_hide/i.test(c.base.className)){c.base.className=c.base.className.replace(/\s?dhxrb_item_hide/i,"")}}var a=this._items[c.parentId];if(a&&this.items[a.type]&&(typeof(this.items[a.type].showChild)=="function")){this.items[a.type].showChild(a,c)}};dhtmlXRibbon.prototype.check=function(g,c){c=dhx4.s2b(c);var a=this._items[g];if(a&&!a.conf.checked&&typeof(this.items[a.type].check)=="function"){this.items[a.type].check(a);if(c){this.callEvent("onCheck",[a.id,a.conf.checked])}}};dhtmlXRibbon.prototype.uncheck=function(g,c){c=dhx4.s2b(c);var a=this._items[g];if(a&&a.conf.checked&&typeof(this.items[a.type].uncheck)=="function"){this.items[a.type].uncheck(a);if(c){this.callEvent("onCheck",[a.id,a.conf.checked])}}};dhtmlXRibbon.prototype.isChecked=function(c){var a=this._items[c];if(a&&typeof(this.items[a.type].isChecked)=="function"){return this.items[a.type].isChecked(a)}};dhtmlXRibbon.prototype.disable=function(j,c){var g=this._items[j],a;if(this.items[g.type]&&(typeof(this.items[g.type].disable)=="function")){if(this.items[g.type].disable(g)!=true){return}}if(g.type=="tab"){return}else{if(g.type=="block"||g.type=="group"){for(a in g.childIds){a=parseInt(a);this.disable(g.childIds[a])}}}if(!/\s?dhxrb_item_disable/i.test(g.base.className)){g.base.className+=" dhxrb_item_disable"}g.conf.disable=true};dhtmlXRibbon.prototype.enable=function(j,c){var g=this._items[j],a;if(this.items[g.type]&&(typeof(this.items[g.type].enable)=="function")){if(this.items[g.type].enable(g)!=true){return}}if(g.type=="tab"){return}else{if(g.type=="block"||g.type=="group"){for(a in g.childIds){a=parseInt(a);this.enable(g.childIds[a])}}}if(/\s?dhxrb_item_disable/i.test(g.base.className)){g.base.className=g.base.className.replace(/\s?dhxrb_item_disable/i,"")}g.conf.disable=false};dhtmlXRibbon.prototype.isEnabled=function(c){var a=this._items[c];if(this.items[a.type]&&typeof(this.items[a.type].isEnabled)=="function"){return this.items[a.type].isEnabled(a)}if(a.type=="tab"){return}else{return a.conf.disable!=true}};dhtmlXRibbon.prototype.isVisible=function(c){var a=this._items[c];if(this.items[a.type]&&(typeof(this.items[a.type].isVisible)=="function")){return this.items[a.type].isVisible(a)}if(a.type=="tab"){return}else{return !/\s?dhxrb_item_hide/i.test(a.base.className)}};dhtmlXRibbon.prototype.setItemState=function(j,c,g){c=dhx4.s2b(c);g=dhx4.s2b(g);var a=this._items[j];if(a&&(typeof(this.items[a.type].setState)=="function")){switch(a.type){case"buttonSegment":this.items[a.type].setState(a,this,g);break;default:this.items[a.type].setState(a,c,g)}}};dhtmlXRibbon.prototype.getItemState=function(c){var a=this._items[c];if(a&&(typeof(this.items[a.type].getState)=="function")){switch(a.type){case"buttonTwoState":case"buttonSegment":return this.items[a.type].getState(a);break}}return null};dhtmlXRibbon.prototype.setIconPath=function(a){this.conf.icons_path=a};dhtmlXRibbon.prototype.removeItem=function(c){var a=this._items[c];switch(a.type){case"tab":break;case"block":this._removeBlock(a);break;case"group":this._removeGroup(a);break;default:this._removeItem(a)}};dhtmlXRibbon.prototype.setSkin=function(l){l=(typeof(l)=="string")?l.toLowerCase():"";if(this._skinCollection[l]!=true){return}var g,c=-1,a,j="dhtmlxribbon";g=this._base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,j+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=j+"_"+l;this._base.className=g.join(" ");this.conf.skin=l;if(this._tabbar!=null){this._tabbar.setSkin(l)}this._setSkinForItems(l)};dhtmlXRibbon.prototype.tabs=function(a){if(this._tabbar instanceof dhtmlXTabBar){return this._tabbar.tabs(a)}else{return undefined}};dhtmlXRibbon.prototype.getItemType=function(c){var a=this._items[c];if(a){return a.type}else{return undefined}};dhtmlXRibbon.prototype.getValue=function(g){var a=this._items[g],c=undefined;if(a&&this.items[a.type]&&typeof(this.items[a.type].getValue)=="function"){c=this.items[a.type].getValue(a)}return c};dhtmlXRibbon.prototype.setValue=function(j,c,g){var a=this._items[j];g=(g===false?false:true);if(a&&this.items[a.type]&&typeof(this.items[a.type].setValue)=="function"){this.items[a.type].setValue(a,c,g)}};dhtmlXRibbon.prototype.getItemText=function(c){var a=this._items[c];if(!a){return null}else{if(a.type=="tab"){return this.tabs(a.id).getText()}else{if(a.type=="block"){return this.items.button.getText(a)}else{if(this.items[a.type]&&typeof(this.items[a.type].getText)=="function"){return this.items[a.type].getText(a)}else{return null}}}}};dhtmlXRibbon.prototype.setItemText=function(g,c){var a=this._items[g];if(!a){return}else{if(a.type=="tab"){this.tabs(a.id).setText(c)}else{if(a.type=="block"){this._setBlockText(a,c)}else{if(this.items[a.type]&&typeof(this.items[a.type].setText)=="function"){this.items[a.type].setText(a,c)}}}}};dhtmlXRibbon.prototype.setItemOptionText=function(j,g,c){var a=this._items[j];if(a.type=="buttonSelect"){this.items[a.type].setOptionText(a,g,c)}};dhtmlXRibbon.prototype.getItemOptionText=function(g,c){var a=this._items[g];if(a.type=="buttonSelect"){return this.items[a.type].getOptionText(a,c)}return null};dhtmlXRibbon.prototype.setItemImage=function(g,a){var c=this._items[g];if(c!=null&&this.items[c.type]!=null&&typeof(this.items[c.type].setImage)=="function"){this.items[c.type].setImage(c,a)}};dhtmlXRibbon.prototype.setItemImageDis=function(g,a){var c=this._items[g];if(c!=null&&this.items[c.type]!=null&&typeof(this.items[c.type].setImageDis)=="function"){this.items[c.type].setImageDis(c,a)}};(function(){var a=dhtmlXRibbon.prototype.items;a.buttonTwoState=a._extends(a.buttonTwoState,a.button);a.buttonSelect=a._extends(a.buttonSelect,a.buttonTwoState);a.buttonSegment=a._extends(a.buttonSegment,a.buttonTwoState)})();if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_ribbon=function(l,c,j,a,g){if(typeof(g)!="undefined"){l=g}else{l=document.createElement("DIV");l.className="dhx_cell_ribbon_"+(this.conf.borders?"def":"no_borders");l.appendChild(document.createElement("DIV"))}this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.ribbon=true;this._updateIdx();this._adjustCont(this._idd);return l};dhtmlXCellObject.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.callEvent("_onBeforeContentAttach",["ribbon"]);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("ribbon").firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c._adjustCont(c._idd)});this._adjustCont();a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataNodes.ribbon};dhtmlXCellObject.prototype.detachRibbon=function(){if(!this.dataNodes.ribbon){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;delete this.dataNodes.ribbon;this._detachObject("ribbon")};dhtmlXCellObject.prototype.showRibbon=function(){this._mtbShowHide("ribbon","")};dhtmlXCellObject.prototype.hideRibbon=function(){this._mtbShowHide("ribbon","none")};dhtmlXCellObject.prototype.getAttachedRibbon=function(){return this.dataNodes.ribbon}}function dhtmlXToolbarObject(c,g){var a=this;this.conf={skin:(g||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtoolbar")||"dhx_skyblue"),align:"left",align_autostart:"left",icons_path:"",iconSize:18,sel_ofs_x:0,sel_ofs_y:0,xml_autoload:null,items_autoload:null};if(typeof(c)=="object"&&c!=null&&typeof(c.tagName)=="undefined"){if(c.icons_path!=null||c.icon_path!=null){this.conf.icons_path=(c.icons_path||c.icon_path)}if(c.icons_size!=null){this.conf.icons_size_autoload=c.icons_size}if(c.json!=null){this.conf.json_autoload=c.json}if(c.xml!=null){this.conf.xml_autoload=c.xml}if(c.onload!=null){this.conf.onload_autoload=c.onload}if(c.onclick!=null||c.onClick!=null){this.conf.auto_onclick=(c.onclick||c.onClick)}if(c.items!=null){this.conf.items_autoload=c.items}if(c.skin!=null){this.conf.skin=c.skin}if(c.align!=null){this.conf.align_autostart=c.align}c=c.parent}this.cont=(typeof(c)!="object")?document.getElementById(c):c;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}c=null;this.cont.dir="ltr";this.base=document.createElement("DIV");this.base.className="dhxtoolbar_float_left";this.cont.appendChild(this.base);if(window.dhx4.isIPad){this.cont.ontouchstart=function(j){j=j||event;if((String(j.target.tagName||"").toLowerCase()=="input")){return true}if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(j){var l="";var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var m=0;m<j;m++){l+=n.charAt(Math.round(Math.random()*(n.length-1)))}return l};this.rootTypes=new Array("button","buttonSelect","buttonTwoState","separator","label","slider","text","buttonInput");this.idPrefix=this._genStr(12);window.dhx4._enableDataLoading(this,"_initObj","_xmlToJson","toolbar",{struct:true});window.dhx4._eventable(this);this._getObj=function(n,j){var l=null;for(var m=0;m<n.childNodes.length;m++){if(n.childNodes[m].tagName!=null){if(String(n.childNodes[m].tagName).toLowerCase()==String(j).toLowerCase()){l=n.childNodes[m]}}}return l};this._addImgObj=function(l){var j=document.createElement("IMG");if(l.childNodes.length>0){l.insertBefore(j,l.childNodes[0])}else{l.appendChild(j)}return j};this._setItemImage=function(n,l,j){if(j==true){n.imgEn=l}else{n.imgDis=l}if((!n.state&&j==true)||(n.state&&j==false)){return}var m=this._getObj(n.obj,"img");if(m==null){m=this._addImgObj(n.obj)}m.src=this.conf.icons_path+l};this._clearItemImage=function(m,j){if(j==true){m.imgEn=""}else{m.imgDis=""}if((!m.state&&j==true)||(m.state&&j==false)){return}var l=this._getObj(m.obj,"img");if(l!=null){l.parentNode.removeChild(l)}};this._setItemText=function(j,m){var l=this._getObj(j.obj,"div");if(m==null||m.length==0){if(l!=null){l.parentNode.removeChild(l)}return}if(l==null){l=document.createElement("DIV");l.className="dhxtoolbar_text";j.obj.appendChild(l)}l.innerHTML=m};this._getItemText=function(j){var l=this._getObj(j.obj,"div");if(l!=null){return l.innerHTML}return""};this._enableItem=function(l){if(l.state){return}l.state=true;if(this.objPull[l.id]["type"]=="buttonTwoState"&&this.objPull[l.id]["obj"]["pressed"]==true){l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.renderAs=l.obj.className}if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var j=this._getObj(l.obj,"img");if(l.imgEn!=""){if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+l.imgEn}else{if(j!=null){j.parentNode.removeChild(j)}}};this._disableItem=function(l){if(!l.state){return}l.state=false;l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[l.id]["type"]=="buttonTwoState"&&l.obj.pressed?"pres_":"")+"dis";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var j=this._getObj(l.obj,"img");if(l.imgDis!=""){if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+l.imgDis}else{if(j!=null){j.parentNode.removeChild(j)}}if(l.polygon!=null){if(l.polygon.style.display!="none"){window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(l.id,true)}}}this.anyUsed="none"};this.clearAll=function(){for(var j in this.objPull){this._removeItem(String(j).replace(this.idPrefix,""))}};this._doOnClick=function(j){if(a&&a.forEachItem){a.forEachItem(function(m){if(a.objPull[a.idPrefix+m]["type"]=="buttonSelect"){var l=a.objPull[a.idPrefix+m];if(l.arw._skip===true){l.arw._skip=false}else{if(l.polygon.style.display!="none"){l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.className=l.obj.renderAs;l.arw.className=String(l.obj.renderAs).replace("btn","arw");a.anyUsed="none";window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(l.id,true)}}}}})}};if(window.dhx4.isIPad){document.addEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousedown",this._doOnClick,false)}else{document.body.attachEvent("onmousedown",this._doOnClick)}}if(this.conf.icons_size_autoload!=null){this.setIconSize(this.conf.icons_size_autoload);this.conf.icons_size_autoload=null}if(this.conf.items_autoload!=null){this.loadStruct(this.conf.items_autoload,this.conf.onload_autoload);this.conf.items_autoload=null}else{if(this.conf.json_autoload!=null){this.loadStruct(this.conf.json_autoload,this.conf.onload_autoload);this.conf.json_autoload=null}else{if(this.conf.xml_autoload!=null){this.loadStruct(this.conf.xml_autoload,this.conf.onload_autoload);this.conf.xml_autoload=null}}}if(this.conf.align_autostart!=this.conf.align){this.setAlign(this.conf.align_autostart);this.conf.align_autostart=null}if(typeof(this.conf.auto_onclick)=="function"){this.attachEvent("onClick",this.conf.auto_onclick)}else{if(typeof(this.conf.auto_onclick)=="string"&&typeof(window[this.conf.auto_onclick])=="function"){this.attachEvent("onClick",window[this.conf.auto_onclick])}}return this}dhtmlXToolbarObject.prototype.addSpacer=function(g){var c=this.idPrefix+g;if(this._spacer!=null){if(this._spacer.idd==g){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var n=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(n==g||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=g;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var m=(this.objPull[c].arw!=null);while(a){var j=this.base.childNodes.length-1;if(m==true){if(this.base.childNodes[j]==this.objPull[c].arw){a=false}}if(this.base.childNodes[j].idd==g){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[j],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[j])}}}this._spacer.idd=g;this._fixSpacer();return}}else{var l=null;for(var j=0;j<this.base.childNodes.length;j++){if(this.base.childNodes[j]==this.objPull[this.idPrefix+g].obj){l=j;if(this.objPull[this.idPrefix+g].arw!=null){l=j+1}}}if(l!=null){this._spacer=document.createElement("DIV");this._spacer.className=(this.conf.align=="right"?" dhxtoolbar_float_left":" dhxtoolbar_float_right");this._spacer.dir="ltr";this._spacer.idd=g;while(this.base.childNodes.length>l+1){this._spacer.appendChild(this.base.childNodes[l+1])}this.cont.appendChild(this._spacer);this._fixSpacer()}}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.removeSpacer=function(){if(!this._spacer){return}while(this._spacer.childNodes.length>0){this.base.appendChild(this._spacer.childNodes[0])}this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._fixSpacer=function(){if(typeof(window.addEventListener)=="undefined"&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var a=this._spacer;window.setTimeout(function(){a.style.borderLeft="0px solid #a4bed4";a=null},1)}};dhtmlXToolbarObject.prototype.getType=function(g){var j=this.getParentId(g);if(j!=null){var c=null;var a=this.objPull[this.idPrefix+j]._listOptions[g];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+g]==null){return null}return this.objPull[this.idPrefix+g]["type"]}};dhtmlXToolbarObject.prototype.getTypeExt=function(c){var a=this.getType(c);if(a=="buttonSelectButton"||a=="buttonSelectSeparator"){if(a=="buttonSelectButton"){a="button"}else{a="separator"}return a}return null};dhtmlXToolbarObject.prototype.inArray=function(g,c){for(var a=0;a<g.length;a++){if(g[a]==c){return true}}return false};dhtmlXToolbarObject.prototype.getParentId=function(j){var l=null;for(var g in this.objPull){if(this.objPull[g]._listOptions){for(var c in this.objPull[g]._listOptions){if(c==j){l=String(g).replace(this.idPrefix,"")}}}}return l};dhtmlXToolbarObject.prototype._addItem=function(a,c){if(typeof(a.text)=="string"){a.text=window.dhx4.trim(a.text);if(a.text.length==0){a.text=null}}this._addItemToStorage(a,c);if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.addButton=function(l,j,c,a,g){this._addItem({id:l,type:"button",text:c,img:a,imgdis:g},j)};dhtmlXToolbarObject.prototype.addText=function(g,c,a){this._addItem({id:g,type:"text",text:a},c)};dhtmlXToolbarObject.prototype.addButtonSelect=function(j,o,v,a,c,r,n,x,l,m){var w=[];for(var g=0;g<a.length;g++){var s={};if(a[g] instanceof Array){s.id=a[g][0];s.type=(a[g][1]=="obj"?"button":"separator");s.text=(a[g][2]||null);s.img=(a[g][3]||null)}else{if(a[g] instanceof Object&&a[g]!=null&&typeof(a[g].id)!="undefined"&&typeof(a[g].type)!="undefined"){s.id=a[g].id;s.type=(a[g].type=="obj"?"button":"separator");s.text=a[g].text;s.img=a[g].img}}w.push(s)}this._addItem({id:j,type:"buttonSelect",text:v,img:c,imgdis:r,renderSelect:n,openAll:x,options:w,maxOpen:l,mode:m},o)};dhtmlXToolbarObject.prototype.addButtonTwoState=function(l,j,c,a,g){this._addItem({id:l,type:"buttonTwoState",img:a,imgdis:g,text:c},j)};dhtmlXToolbarObject.prototype.addSeparator=function(c,a){this._addItem({id:c,type:"separator"},a)};dhtmlXToolbarObject.prototype.addSlider=function(c,n,l,j,q,g,m,a,o){this._addItem({id:c,type:"slider",length:l,valueMin:j,valueMax:q,valueNow:g,textMin:m,textMax:a,toolTip:o},n)};dhtmlXToolbarObject.prototype.addInput=function(j,g,c,a){this._addItem({id:j,type:"buttonInput",value:c,width:a},g)};dhtmlXToolbarObject.prototype.forEachItem=function(g){for(var c in this.objPull){if(this.inArray(this.rootTypes,this.objPull[c]["type"])){g(this.objPull[c]["id"].replace(this.idPrefix,""))}}};(function(){var m="isVisible,enableItem,disableItem,isEnabled,setItemText,getItemText,setItemToolTip,getItemToolTip,getInput,setItemImage,setItemImageDis,clearItemImage,clearItemImageDis,setItemState,getItemState,setItemToolTipTemplate,getItemToolTipTemplate,setValue,getValue,setMinValue,getMinValue,setMaxValue,getMaxValue,setWidth,getWidth,setMaxOpen".split(",");var g=[false,"","",false,"","","","","","","","","",false,"","","",null,"",[null,null],"",[null,null],"",null];var c=function(n,o){return function(s,r,q){s=this.idPrefix+s;if(this.objPull[s][n]!=null){return this.objPull[s][n].call(this.objPull[s],r,q)}else{return o}}};for(var l=0;l<m.length;l++){var a=m[l];var j=g[l];dhtmlXToolbarObject.prototype[a]=c(a,j)}})();dhtmlXToolbarObject.prototype.showItem=function(a){a=this.idPrefix+a;if(this.objPull[a]!=null&&this.objPull[a].showItem!=null){this.objPull[a].showItem();if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}}};dhtmlXToolbarObject.prototype.hideItem=function(a){a=this.idPrefix+a;if(this.objPull[a]!=null&&this.objPull[a].hideItem!=null){this.objPull[a].hideItem();if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}}};dhtmlXToolbarObject.prototype.getPosition=function(a){return this._getPosition(a)};dhtmlXToolbarObject.prototype._getPosition=function(l,g){if(this.objPull[this.idPrefix+l]==null){return null}var j=null;var a=0;for(var c=0;c<this.base.childNodes.length;c++){if(this.base.childNodes[c].idd!=null){if(this.base.childNodes[c].idd==l){j=a}a++}}if(!j&&this._spacer!=null){for(var c=0;c<this._spacer.childNodes.length;c++){if(this._spacer.childNodes[c].idd!=null){if(this._spacer.childNodes[c].idd==l){j=a}a++}}}return j};dhtmlXToolbarObject.prototype.setPosition=function(a,c){this._setPosition(a,c)};dhtmlXToolbarObject.prototype._setPosition=function(l,j){if(this.objPull[this.idPrefix+l]==null){return}if(isNaN(j)){j=this.base.childNodes.length}if(j<0){j=0}var a=null;if(this._spacer){a=this._spacer.idd;this.removeSpacer()}var g=this.objPull[this.idPrefix+l];this.base.removeChild(g.obj);if(g.arw){this.base.removeChild(g.arw)}var c=this._getIdByPosition(j,true);if(c[0]==null){this.base.appendChild(g.obj);if(g.arw){this.base.appendChild(g.arw)}}else{this.base.insertBefore(g.obj,this.base.childNodes[c[1]]);if(g.arw){this.base.insertBefore(g.arw,this.base.childNodes[c[1]+1])}}if(a!=null){this.addSpacer(a)}};dhtmlXToolbarObject.prototype._getIdByPosition=function(m,c){var l=null;var a=0;var g=0;for(var j=0;j<this.base.childNodes.length;j++){if(this.base.childNodes[j]["idd"]!=null&&l==null){if((a++)==m){l=this.base.childNodes[j]["idd"]}}if(l==null){g++}}g=(l==null?null:g);return(c==true?new Array(l,g):l)};dhtmlXToolbarObject.prototype.removeItem=function(a){this._removeItem(a);if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._removeItem=function(l){var g=this.getType(l);l=this.idPrefix+l;var j=this.objPull[l];if(g=="button"){j.obj._doOnMouseOver=null;j.obj._doOnMouseOut=null;j.obj._doOnMouseUp=null;j.obj._doOnMouseUpOnceAnywhere=null;j.obj.onclick=null;j.obj.onmouseover=null;j.obj.onmouseout=null;j.obj.onmouseup=null;j.obj.onmousedown=null;j.obj.onselectstart=null;j.obj.renderAs=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.state=null;j.img=null;j.imgEn=null;j.imgDis=null;j.type=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemText=null;j.getItemText=null;j.setItemImage=null;j.clearItemImage=null;j.setItemImageDis=null;j.clearItemImageDis=null;j.setItemToolTip=null;j.getItemToolTip=null}if(g=="buttonTwoState"){j.obj._doOnMouseOver=null;j.obj._doOnMouseOut=null;j.obj.onmouseover=null;j.obj.onmouseout=null;j.obj.onmousedown=null;j.obj.onselectstart=null;j.obj.renderAs=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.state=null;j.img=null;j.imgEn=null;j.imgDis=null;j.type=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemText=null;j.getItemText=null;j.setItemImage=null;j.clearItemImage=null;j.setItemImageDis=null;j.clearItemImageDis=null;j.setItemToolTip=null;j.getItemToolTip=null;j.setItemState=null;j.getItemState=null}if(g=="buttonSelect"){for(var c in j._listOptions){this.removeListOption(l,c)}j._listOptions=null;if(j.polygon._ie6cover){document.body.removeChild(j.polygon._ie6cover);j.polygon._ie6cover=null}j.p_tbl.removeChild(j.p_tbody);j.polygon.removeChild(j.p_tbl);j.polygon.onselectstart=null;document.body.removeChild(j.polygon);j.p_tbody=null;j.p_tbl=null;j.polygon=null;j.obj.onclick=null;j.obj.onmouseover=null;j.obj.onmouseout=null;j.obj.onmouseup=null;j.obj.onmousedown=null;j.obj.onselectstart=null;j.obj.idd=null;j.obj.iddPrefix=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.arw.onclick=null;j.arw.onmouseover=null;j.arw.onmouseout=null;j.arw.onmouseup=null;j.arw.onmousedown=null;j.arw.onselectstart=null;j.arw.parentNode.removeChild(j.arw);j.arw=null;j.renderSelect=null;j.state=null;j.type=null;j.id=null;j.img=null;j.imgEn=null;j.imgDis=null;j.openAll=null;j._isListButton=null;j._separatorButtonSelectObject=null;j._buttonButtonSelectObject=null;j.setWidth=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemText=null;j.getItemText=null;j.setItemImage=null;j.clearItemImage=null;j.setItemImageDis=null;j.clearItemImageDis=null;j.setItemToolTip=null;j.getItemToolTip=null;j.addListOption=null;j.removeListOption=null;j.showListOption=null;j.hideListOption=null;j.isListOptionVisible=null;j.enableListOption=null;j.disableListOption=null;j.isListOptionEnabled=null;j.setListOptionPosition=null;j.getListOptionPosition=null;j.setListOptionImage=null;j.getListOptionImage=null;j.clearListOptionImage=null;j.setListOptionText=null;j.getListOptionText=null;j.setListOptionToolTip=null;j.getListOptionToolTip=null;j.forEachListOption=null;j.getAllListOptions=null;j.setListOptionSelected=null;j.getListOptionSelected=null}if(g=="buttonInput"){j.obj.childNodes[0].onkeydown=null;j.obj.removeChild(j.obj.childNodes[0]);j.obj.w=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setItemToolTip=null;j.getItemToolTip=null;j.setWidth=null;j.getWidth=null;j.setValue=null;j.getValue=null;j.setItemText=null;j.getItemText=null}if(g=="slider"){if(window.dhx4.isIPad){document.removeEventListener("touchmove",pen._doOnMouseMoveStart,false);document.removeEventListener("touchend",pen._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",j.pen._doOnMouseMoveStart,false);window.removeEventListener("mouseup",j.pen._doOnMouseMoveEnd,false)}else{document.body.detachEvent("onmousemove",j.pen._doOnMouseMoveStart);document.body.detachEvent("onmouseup",j.pen._doOnMouseMoveEnd)}}j.pen.allowMove=null;j.pen.initXY=null;j.pen.maxX=null;j.pen.minX=null;j.pen.nowX=null;j.pen.newNowX=null;j.pen.valueMax=null;j.pen.valueMin=null;j.pen.valueNow=null;j.pen._definePos=null;j.pen._detectLimits=null;j.pen._doOnMouseMoveStart=null;j.pen._doOnMouseMoveEnd=null;j.pen.onmousedown=null;j.obj.removeChild(j.pen);j.pen=null;j.label.tip=null;document.body.removeChild(j.label);j.label=null;j.obj.onselectstart=null;j.obj.idd=null;while(j.obj.childNodes.length>0){j.obj.removeChild(j.obj.childNodes[0])}j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.state=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.setItemToolTipTemplate=null;j.getItemToolTipTemplate=null;j.setMaxValue=null;j.setMinValue=null;j.getMaxValue=null;j.getMinValue=null;j.setValue=null;j.getValue=null;j.showItem=null;j.hideItem=null;j.isVisible=null}if(g=="separator"){j.obj.onselectstart=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.showItem=null;j.hideItem=null;j.isVisible=null}if(g=="text"){j.obj.onselectstart=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setWidth=null;j.setItemText=null;j.getItemText=null}g=null;j=null;this.objPull[this.idPrefix+l]=null;delete this.objPull[this.idPrefix+l]};(function(){var j="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",");var c=function(l){return function(s,n,m,r,q,o){s=this.idPrefix+s;if(this.objPull[s]==null){return}if(this.objPull[s]["type"]!="buttonSelect"){return}return this.objPull[s][l].call(this.objPull[s],n,m,r,q,o)}};for(var g=0;g<j.length;g++){var a=j[g];dhtmlXToolbarObject.prototype[a]=c(a)}})();dhtmlXToolbarObject.prototype._rtlParseBtn=function(c,a){return c+a};dhtmlXToolbarObject.prototype._separatorObject=function(a,g,c){this.id=a.idPrefix+g;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_sep";this.obj.style.display=(c.hidden!=null?"none":"");this.obj.idd=String(g);this.obj.title=(c.title||"");this.obj.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}};if(window.dhx4.isIPad){this.obj.ontouchstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};return this};dhtmlXToolbarObject.prototype._textObject=function(a,g,c){this.id=a.idPrefix+g;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_text";this.obj.style.display=(c.hidden!=null?"none":"");this.obj.idd=String(g);this.obj.title=(c.title||"");this.obj.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}};if(window.dhx4.isIPad){this.obj.ontouchstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}this.obj.innerHTML=(c.text||"");a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(j){this.obj.innerHTML=j};this.getItemText=function(){return this.obj.innerHTML};this.setWidth=function(j){this.obj.style.width=j+"px"};this.setItemToolTip=function(j){this.obj.title=j};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonObject=function(a,j,c){this.id=a.idPrefix+j;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img||"");this.imgDis=(c.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(c.hidden!=null?"none":"");this.obj.allowClick=false;this.obj.extAction=(c.action||null);this.obj.renderAs=this.obj.className;this.obj.idd=String(j);this.obj.title=(c.title||"");this.obj.pressed=false;this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"<img src='"+a.conf.icons_path+this.img+"'>":""),(c.text!=null?"<div class='dhxtoolbar_text'>"+c.text+"</div>":""));var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){this.allowClick=false;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(l){if(g.state==false){return}if(this.allowClick==false){return}l=l||event;var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m)}catch(l){}}if(a&&a.callEvent){a.callEvent("onClick",[m])}};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(g.state==false){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false}if(a.anyUsed!="none"){return}a.anyUsed=this.idd;this.className="dhx_toolbar_btn dhxtoolbar_btn_pres";this.pressed=true;this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){a.anyUsed="none";this._doOnMouseOut()};return false};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){if(g.state==false){return}if(a.anyUsed!="none"){if(a.anyUsed!=this.idd){return}}var l=a.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&l!="none"){a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(l){this._doOnMouseUp()}}this.obj._doOnMouseUp=function(){a.anyUsed="none";this.className=this.renderAs;this.pressed=false};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};a.base.appendChild(this.obj);this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(g,m,l){this.id=g.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.imgEn=(l.img||"");this.imgDis=(l.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(l.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!l.text||l.text.length==0){l.text="&nbsp;"}}else{this.openAll=(window.dhx4.s2b(l.openAll)==true);this.renderSelect=(l.renderSelect==null?true:window.dhx4.s2b(l.renderSelect))}this.maxOpen=(!isNaN(l.maxOpen?l.maxOpen:"")?l.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!g._sbw){var o=document.createElement("DIV");o.className="dhxtoolbar_maxopen_test";document.body.appendChild(o);var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test2";o.appendChild(n);g._sbw=o.offsetWidth-n.offsetWidth;o.removeChild(n);n=null;document.body.removeChild(o);o=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(l.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.title=(l.title||"");this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=g._rtlParseBtn((this.img!=""?"<img src='"+g.conf.icons_path+this.img+"'>":""),(l.text!=null?"<div class='dhxtoolbar_text'>"+l.text+"</div>":""));g.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="<div class='arwimg'>&nbsp;</div>";this.arw.title=this.obj.title;this.arw.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};g.base.appendChild(this.arw);var a=this;this.obj.onmouseover=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){a.obj.allowClick=false;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");a.callEvent=false};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll==true){}else{this.obj.onclick=function(n){n=n||event;if(!a.obj.allowClick){return}if(!a.state){return}if(g.anyUsed!="none"){return}var o=a.obj.idd.replace(g.idPrefix,"");if(a.obj.extAction){try{window[a.obj.extAction](o)}catch(n){}}g.callEvent("onClick",[o])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.allowClick=true;a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";a.callEvent=true};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");if(window.dhx4.isIPad&&a.callEvent){var o=a.obj.idd.replace(g.idPrefix,"");g.callEvent("onClick",[o])}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(q){q=q||event;var x=(this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling);if(x._skip){q=q||event;q.cancelBubble=true}else{x._skip=true}x=null;if(!a.state){return}if(g.anyUsed==a.obj.idd){a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");g.anyUsed="none";window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}}else{if(g.anyUsed!="none"){if(g.objPull[g.idPrefix+g.anyUsed]["type"]=="buttonSelect"){var w=g.objPull[g.idPrefix+g.anyUsed];if(w.polygon.style.display!="none"){w.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";w.obj.className=w.obj.renderAs;w.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(w.polygon._idd);w.polygon.style.display="none";if(w.polygon._ie6cover){w.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(w.id,true)}}}}a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";g.anyUsed=a.obj.idd;a.polygon.style.top="0px";a.polygon.style.visibility="hidden";a.polygon.style.zIndex=window.dhx4.zim.reserve(a.polygon._idd);a.polygon.style.display="";if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,false)}a._fixMaxOpenHeight(a.maxOpen||null);g._autoDetectVisibleArea();var r=window.dhx4.absTop(a.obj)+a.obj.offsetHeight+g.conf.sel_ofs_y;var u=a.polygon.offsetHeight;if(r+u>g.tY2){var s=(a.maxOpen!=null?Math.floor((g.tY2-r)/22):0);if(s>=1){a._fixMaxOpenHeight(s)}else{r=window.dhx4.absTop(a.obj)-u-g.conf.sel_ofs_y;if(r<0){r=0}}}a.polygon.style.top=r+"px";if(g.rtl){a.polygon.style.left=window.dhx4.absLeft(a.obj)+a.obj.offsetWidth-a.polygon.offsetWidth+g.conf.sel_ofs_x+"px"}else{var o=document.body.scrollLeft;var n=o+(window.innerWidth||document.body.clientWidth);var v=window.dhx4.absLeft(a.obj)+g.conf.sel_ofs_x;if(v+a.polygon.offsetWidth>n){v=window.dhx4.absLeft(a.arw)+a.arw.offsetWidth-a.polygon.offsetWidth}a.polygon.style.left=Math.max(v,5)+"px"}a.polygon.style.visibility="visible";if(a.polygon._ie6cover){a.polygon._ie6cover.style.left=a.polygon.style.left;a.polygon._ie6cover.style.top=a.polygon.style.top;a.polygon._ie6cover.style.width=a.polygon.offsetWidth+"px";a.polygon._ie6cover.style.height=a.polygon.offsetHeight+"px";a.polygon._ie6cover.style.display=""}}return false};this.arw.onclick=function(n){n=n||event;n.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true};if(this.openAll===true){this.obj.onclick=this.arw.onclick;this.obj.onmousedown=this.arw.onmousedown;this.obj.onmouseup=this.arw.onmouseup;if(window.dhx4.isIPad){this.obj.ontouchstart=this.arw.ontouchstart;this.obj.ontouchend=this.arw.ontouchend}}this.obj.iddPrefix=g.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(s){var r="auto";var q=false;if(s!==null){var o=0;for(var n in this._listOptions){o++}if(o>s){this._ph=22*s;r=this._ph+"px"}else{q=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!q&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+g._sbw+"px";this.polygon.style.height=r}};this._separatorButtonSelectObject=function(q,n,o){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};if(isNaN(o)){o=a.p_tbody.childNodes.length+1}else{if(o<1){o=1}}if(o>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[o-1])}this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td.appendChild(this.obj.sep);a._listOptions[q]=this.obj;return this};this._buttonButtonSelectObject=function(s,q,r){var o=true;if(typeof(q.enabled)!="undefined"){o=window.dhx4.s2b(q.enabled)}else{if(typeof(q.disabled)!="undefined"){o=window.dhx4.s2b(q.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=o;this.obj.tr.extAction=(q.action||null);this.obj.tr._selected=(q.selected!=null);this.obj.tr.className="tr_btn"+(this.obj.tr.en?(this.obj.tr._selected&&a.renderSelect?" tr_btn_selected":""):" tr_btn_disabled");this.obj.tr.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.tr.idd=String(s);if(isNaN(r)){r=a.p_tbody.childNodes.length+1}else{if(r<1){r=1}}if(r>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[r-1])}this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};if(g.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(q.img!=null){this.obj.td_a.innerHTML="<img class='btn_sel_img' src='"+g.conf.icons_path+q.img+"' border='0'>";this.obj.tr._img=q.img}else{this.obj.td_a.innerHTML="&nbsp;"}var n=(q.text!=null?q.text:(q.itemText||""));this.obj.td_b.innerHTML="<div class='btn_sel_text'>"+n+"</div>";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||(this._selected&&a.renderSelect)){return}this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(!this.en){return}if(this._selected&&a.renderSelect){if(String(this.className).search("tr_btn_selected")==-1){this.className="tr_btn tr_btn_selected"}}else{this.className="tr_btn"}};this.obj.tr[window.dhx4.isIPad?"ontouchend":"onclick"]=function(u){u=u||event;u.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(g.idPrefix,""));a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}g.anyUsed="none";var v=this.idd.replace(g.idPrefix,"");if(this.extAction){try{window[this.extAction](v)}catch(u){}}g.callEvent("onClick",[v])};a._listOptions[s]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+g.conf.skin+" dhxtoolbar_icons_"+g.conf.iconSize;this.polygon.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.polygon.onmousedown=function(n){n=n||event;n.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}n.cancelBubble=true;return false}}this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(l.options!=null){for(var j=0;j<l.options.length;j++){var c="_"+(l.options[j].type||"")+"ButtonSelectObject";if(l.options[j].id==null){l.options[j].id=g._genStr(24)}if(typeof(this[c])=="function"){new this[c](l.options[j].id,l.options[j])}}}document.body.appendChild(this.polygon);if(window.dhx4.isIE6){this.polygon._ie6cover=document.createElement("IFRAME");this.polygon._ie6cover.frameBorder=0;this.polygon._ie6cover.style.position="absolute";this.polygon._ie6cover.style.border="none";this.polygon._ie6cover.style.backgroundColor="#000000";this.polygon._ie6cover.style.filter="alpha(opacity=100)";this.polygon._ie6cover.style.display="none";this.polygon._ie6cover.setAttribute("src","javascript:false;");document.body.appendChild(this.polygon._ie6cover)}this.setWidth=function(n){this.obj.style.width=n-this.arw.offsetWidth+"px";this.polygon.style.width=this.obj.offsetWidth+this.arw.offsetWidth-2+"px";this.p_tbl.style.width=this.polygon.style.width};this.enableItem=function(){g._enableItem(this)};this.disableItem=function(){g._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display="";this.arw.style.display=""};this.hideItem=function(){this.obj.style.display="none";this.arw.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(n){g._setItemText(this,n)};this.getItemText=function(){return g._getItemText(this)};this.setItemImage=function(n){g._setItemImage(this,n,true)};this.clearItemImage=function(){g._clearItemImage(this,true)};this.setItemImageDis=function(n){g._setItemImage(this,n,false)};this.clearItemImageDis=function(){g._clearItemImage(this,false)};this.setItemToolTip=function(n){this.obj.title=n;this.arw.title=n};this.getItemToolTip=function(){return this.obj.title};this.addListOption=function(u,s,q,r,n){if(!(q=="button"||q=="separator")){return}var o={id:u,type:q,text:r,img:n};new this["_"+q+"ButtonSelectObject"](u,o,s)};this.removeListOption=function(q){if(!this._isListButton(q,true)){return}var n=this._listOptions[q];if(n.td_a!=null&&n.td_b!=null){n.td_a.onselectstart=null;n.td_b.onselectstart=null;while(n.td_a.childNodes.length>0){n.td_a.removeChild(n.td_a.childNodes[0])}while(n.td_b.childNodes.length>0){n.td_b.removeChild(n.td_b.childNodes[0])}n.tr.onselectstart=null;n.tr.onmouseover=null;n.tr.onmouseout=null;n.tr.onclick=null;while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.td_a=null;n.td_b=null;n.tr=null}else{n.sep.onselectstart=null;n.td.onselectstart=null;n.tr.onselectstart=null;while(n.td.childNodes.length>0){n.td.removeChild(n.td.childNodes[0])}while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.sep=null;n.td=null;n.tr=null}n=null;this._listOptions[q]=null;try{delete this._listOptions[q]}catch(o){}};this.showListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display=""};this.hideListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display="none"};this.isListOptionVisible=function(n){if(!this._isListButton(n,true)){return}return(this._listOptions[n].tr.style.display!="none")};this.enableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=true;this._listOptions[n].tr.className="tr_btn"+(this._listOptions[n].tr._selected&&g.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=false;this._listOptions[n].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.en};this.setListOptionPosition=function(q,o){if(!this._listOptions[q]||this.getListOptionPosition(q)==o||isNaN(o)){return}if(o<1){o=1}var n=this._listOptions[q].tr;this.p_tbody.removeChild(n);if(o>this.p_tbody.childNodes.length){this.p_tbody.appendChild(n)}else{this.p_tbody.insertBefore(n,this.p_tbody.childNodes[o-1])}n=null};this.getListOptionPosition=function(r){var o=-1;if(!this._listOptions[r]){return o}for(var n=0;n<this.p_tbody.childNodes.length;n++){if(this.p_tbody.childNodes[n]==this._listOptions[r].tr){o=n+1}}return o};this.setListOptionImage=function(r,n){if(!this._isListButton(r)){return}var q=this._listOptions[r].tr.childNodes[(g.rtl?1:0)];if(q.childNodes.length>0){q.childNodes[0].src=g.conf.icons_path+n}else{var o=document.createElement("IMG");o.className="btn_sel_img";o.src=g.conf.icons_path+n;q.appendChild(o)}q=null};this.getListOptionImage=function(q){if(!this._isListButton(q)){return}var o=this._listOptions[q].tr.childNodes[(g.rtl?1:0)];var n=null;if(o.childNodes.length>0){n=o.childNodes[0].src}o=null;return n};this.clearListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(g.rtl?1:0)];while(n.childNodes.length>0){n.removeChild(n.childNodes[0])}n.innerHTML="&nbsp;";n=null};this.setListOptionText=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML=n};this.getListOptionText=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.title=n};this.getListOptionToolTip=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.title};this.forEachListOption=function(o){for(var n in this._listOptions){o(n)}};this.getAllListOptions=function(){var o=new Array();for(var n in this._listOptions){o[o.length]=n}return o};this.setListOptionSelected=function(q){for(var n in this._listOptions){var o=this._listOptions[n];if(o.td_a!=null&&o.td_b!=null&&o.tr.en){if(n==q){o.tr._selected=true;o.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(o.tr._img){this.setItemImage(o.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(q))}}else{o.tr._selected=false;o.tr.className="tr_btn"}}o=null}};this.getListOptionSelected=function(){var o=null;for(var n in this._listOptions){if(this._listOptions[n].tr._selected==true){o=n}}return o};this._isListButton=function(o,n){if(this._listOptions[o]==null){return false}if(!n&&this._listOptions[o].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(n){this._ph=null;if(typeof(n)=="number"){this.maxOpen=n;this._maxOpenTest();return}this.maxOpen=null};if(l.width){this.setWidth(l.width)}if(this.mode=="select"&&typeof(l.selected)!="undefined"){this.setListOptionSelected(l.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(g,l,j){this.id=g.idPrefix+l;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(j.hidden!=null?"none":"");this.obj.idd=String(l);this.obj.w=(j.width!=null?j.width:100);this.obj.title=(j.title!=null?j.title:"");this.obj.innerHTML="<input class='dhxtoolbar_input' type='text' style='width:"+this.obj.w+"px;'"+(j.value!=null?" value='"+j.value+"'":"")+">";var c=g;var a=this;this.obj.childNodes[0].onkeydown=function(m){m=m||event;if(m.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};g.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return(!this.obj.childNodes[0].disabled)};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display!="none")};this.setValue=function(m){this.obj.childNodes[0].value=m};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(m){this.obj.w=m;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(m){this.obj.title=m};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(j.enabled)!="undefined"&&window.dhx4.s2b(j.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,j,c){this.id=a.idPrefix+j;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img!=null?c.img:"");this.imgDis=(c.imgdis!=null?c.imgdis:"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.pressed=(c.selected!=null);this.obj.extAction=(c.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):(this.state?"def":"dis"));this.obj.style.display=(c.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.idd=String(j);this.obj.title=(c.title||"");if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"<img src='"+a.conf.icons_path+this.img+"'>":""),(c.text!=null?"<div class='dhxtoolbar_text'>"+c.text+"</div>":""));a.base.appendChild(this.obj);var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(a.checkEvent("onBeforeStateChange")){if(!a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed])){return}}if(g.state==false){return}if(a.anyUsed!="none"){return}this.pressed=!this.pressed;this.className=(this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs);var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m,this.pressed)}catch(l){}}a.callEvent("onStateChange",[m,this.pressed]);return false};this.setItemState=function(l,n){if(this.obj.pressed!=l){if(l==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(n==true){var o=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](o,this.obj.pressed)}catch(m){}}a.callEvent("onStateChange",[o,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(j,m,l){this.id=j.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.len=(l.length!=null?Number(l.length):50);this.obj.innerHTML="<div class='dhxtoolbar_text'>"+(l.textMin||"")+"</div><div class='dhxtoolbar_sl_bg_l'></div><div class='dhxtoolbar_sl_bg_m' style='width:"+this.obj.len+"px;'></div><div class='dhxtoolbar_sl_bg_r'></div><div class='dhxtoolbar_text'>"+(l.textMax||"")+"</div>";j.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var g=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+j.conf.skin+(j.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(l.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(l.valueMin!=null?Number(l.valueMin):0);this.pen.valueMax=(l.valueMax!=null?Number(l.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(l.valueNow!=null?Number(l.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNow<this.pen.valueMin){this.pen.valueNow=this.pen.valueMin}this.pen._detectLimits=function(){this.minX=a.obj.childNodes[1].offsetLeft+2;this.maxX=a.obj.childNodes[3].offsetLeft-this.offsetWidth+1};this.pen._detectLimits();this.pen._definePos=function(){this.nowX=Math.round((this.valueNow-this.valueMin)*(this.maxX-this.minX)/(this.valueMax-this.valueMin)+this.minX);this.style.left=this.nowX+"px";this.newNowX=this.nowX};this.pen._definePos();this.pen.initXY=0;this.pen.allowMove=false;this.pen[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(n){if(a.state==false){return}n=n||event;this.initXY=(window.dhx4.isIPad?n.touches[0].clientX:n.clientX);this.newValueNow=this.valueNow;this.allowMove=true;this.className="dhxtoolbar_sl_pen dhxtoolbar_over";if(c.tip!=""){c.style.visibility="hidden";c.style.display="";c.innerHTML=c.tip.replace("%v",this.valueNow);c.style.left=Math.round(window.dhx4.absLeft(this)+this.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(this)-c.offsetHeight-3+"px";c.style.visibility="";c.style.zIndex=window.dhx4.zim.reserve(c._zi)}};this.pen._doOnMouseMoveStart=function(o){o=o||event;if(!g.allowMove){return}var n=(window.dhx4.isIPad?o.touches[0].clientX:o.clientX);var q=n-g.initXY;if(n<window.dhx4.absLeft(g)+Math.round(g.offsetWidth/2)&&g.nowX==g.minX){return}if(n>window.dhx4.absLeft(g)+Math.round(g.offsetWidth/2)&&g.nowX==g.maxX){return}g.newNowX=g.nowX+q;if(g.newNowX<g.minX){g.newNowX=g.minX}if(g.newNowX>g.maxX){g.newNowX=g.maxX}g.nowX=g.newNowX;g.style.left=g.nowX+"px";g.initXY=n;g.newValueNow=Math.round((g.valueMax-g.valueMin)*(g.newNowX-g.minX)/(g.maxX-g.minX)+g.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,g.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(g)+g.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(g)-c.offsetHeight-3+"px"}o.cancelBubble=true;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!g.allowMove){return}g.className="dhxtoolbar_sl_pen";g.allowMove=false;g.nowX=g.newNowX;g.valueNow=g.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}j.callEvent("onValueChange",[a.obj.idd.replace(j.idPrefix,""),g.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",g._doOnMouseMoveStart,false);document.addEventListener("touchend",g._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",g._doOnMouseMoveStart,false);window.addEventListener("mouseup",g._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",g._doOnMouseMoveStart);document.body.attachEvent("onmouseup",g._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state){return}this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state){return}this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setValue=function(n,o){n=Number(n);if(n<this.pen.valueMin){n=this.pen.valueMin}if(n>this.pen.valueMax){n=this.pen.valueMax}this.pen.valueNow=n;this.pen._definePos();if(o==true){j.callEvent("onValueChange",[this.obj.idd.replace(j.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(o,n){o=Number(o);if(o>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=n;this.obj.childNodes[0].style.display=(n.length>0?"":"none");this.pen.valueMin=o;if(this.pen.valueNow<this.pen.valueMin){this.pen.valueNow=this.pen.valueMin}this.pen._detectLimits();this.pen._definePos()};this.setMaxValue=function(o,n){o=Number(o);if(o<this.pen.valueMin){return}this.obj.childNodes[4].innerHTML=n;this.obj.childNodes[4].style.display=(n.length>0?"":"none");this.pen.valueMax=o;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var n=this.obj.childNodes[0].innerHTML;var o=this.pen.valueMin;return new Array(o,n)};this.getMaxValue=function(){var n=this.obj.childNodes[4].innerHTML;var o=this.pen.valueMax;return new Array(o,n)};this.setItemToolTipTemplate=function(n){this.label.tip=n};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var a=window.dhx4.screenDim();this.tX1=a.left;this.tX2=a.right;this.tY1=a.top;this.tY2=a.bottom};dhtmlXToolbarObject.prototype._initObj=function(c){for(var a=0;a<c.length;a++){this._addItemToStorage(c[a])}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._xmlToJson=function(s){var n=[];var y=s.getElementsByTagName("toolbar");if(y!=null&&y[0]!=null){y=y[0];var D=["id","type","hidden","title","text","enabled","img","imgdis","action","openAll","renderSelect","mode","maxOpen","width","value","selected","length","textMin","textMax","toolTip","valueMin","valueMax","valueNow"];var g=["id","type","enabled","disabled","action","selected","img","text"];for(var c=0;c<y.childNodes.length;c++){if(y.childNodes[c].tagName=="item"){var m={};for(var A=0;A<D.length;A++){var j=y.childNodes[c].getAttribute(D[A]);if(j!=null){m[D[A]]=j}}for(var x=0;x<y.childNodes[c].childNodes.length;x++){if(y.childNodes[c].childNodes[x].tagName=="item"&&m.type=="buttonSelect"){var C={};for(var A=0;A<g.length;A++){var j=y.childNodes[c].childNodes[x].getAttribute(g[A]);if(j!=null){C[g[A]]=j}}var v=y.childNodes[c].childNodes[x].getElementsByTagName("itemText");if(v!=null&&v[0]!=null){C.itemText=v[0].firstChild.nodeValue}var o=y.childNodes[c].childNodes[x].getElementsByTagName("userdata");for(var A=0;A<o.length;A++){if(!C.userdata){C.userdata={}}var a={};try{a.name=o[A].getAttribute("name")}catch(l){a.name=null}try{a.value=o[A].firstChild.nodeValue}catch(l){a.value=""}if(a.name!=null){C.userdata[a.name]=a.value}}if(m.options==null){m.options=[]}m.options.push(C)}if(y.childNodes[c].childNodes[x].tagName=="userdata"){if(m.userdata==null){m.userdata={}}var C={};try{C.name=y.childNodes[c].childNodes[x].getAttribute("name")}catch(l){C.name=null}try{C.value=y.childNodes[c].childNodes[x].firstChild.nodeValue}catch(l){C.value=""}if(C.name!=null){m.userdata[C.name]=C.value}}}n.push(m)}}}return n};dhtmlXToolbarObject.prototype._addItemToStorage=function(m,o){var n=(m.id||this._genStr(24));var j=(m.type||"");if(j=="spacer"){this.addSpacer(this._lastId)}else{this._lastId=n}if(j!=""&&this["_"+j+"Object"]!=null){if(j=="buttonSelect"){if(m.options!=null){for(var l=0;l<m.options.length;l++){if(m.options[l].type=="obj"){m.options[l].type="button"}if(m.options[l].type=="sep"){m.options[l].type="separator"}}}}if(j=="slider"){var g={tip_template:"toolTip",value_min:"valueMin",value_max:"valueMax",value_now:"valueNow",text_min:"textMin",text_max:"textMax"};for(var c in g){if(m[g[c]]==null&&m[c]!=null){m[g[c]]=m[c]}}}if(j=="buttonInput"){if(m.value==null&&m.text!=null){m.value=m.text}}if(j=="buttonTwoState"){if(typeof(m.selected)=="undefined"&&typeof(m.pressed)!="undefined"&&window.dhx4.s2b(m.pressed)){m.selected=true}}if(typeof(m.enabled)=="undefined"&&typeof(m.disabled)!="undefined"&&window.dhx4.s2b(m.disabled)){m.enabled=false}if(m.imgDis==null&&m.img_disabled!=null){m.imgdis=m.img_disabled}if((typeof(m.openAll)=="undefined"||m.openAll==null)&&this.conf.skin=="dhx_terrace"){m.openAll=true}this.objPull[this.idPrefix+n]=new this["_"+j+"Object"](this,n,m);this.objPull[this.idPrefix+n]["type"]=j;this.setPosition(n,o)}if(m.userdata!=null){for(var c in m.userdata){this.setUserData(n,c,m.userdata[c])}}if(m.options!=null){for(var l=0;l<m.options.length;l++){if(m.options[l].userdata!=null){for(var c in m.options[l].userdata){this.setListOptionUserData(m.id,m.options[l].id,c,m.options[l].userdata[c])}}}}};dhtmlXToolbarObject.prototype.setSkin=function(l,g){if(g===true){this.cont.className=this.cont.className.replace(/dhxtoolbar_icons_\d{1,}/,"dhxtoolbar_icons_"+this.conf.iconSize)}else{this.conf.skin=l;if(this.conf.skin=="dhx_skyblue"){this.conf.sel_ofs_y=1}if(this.conf.skin=="dhx_web"){this.conf.sel_ofs_y=1;this.conf.sel_ofs_x=1}if(this.conf.skin=="dhx_terrace"){this.conf.sel_ofs_y=-1;this.conf.sel_ofs_x=0}this.cont.className="dhx_toolbar_"+this.conf.skin+" dhxtoolbar_icons_"+this.conf.iconSize}for(var c in this.objPull){var j=this.objPull[c];if(j.type=="slider"){j.pen._detectLimits();j.pen._definePos();j.label.className="dhx_toolbar_slider_label_"+this.conf.skin}if(j.type=="buttonSelect"){j.polygon.className="dhx_toolbar_poly_"+this.conf.skin+" dhxtoolbar_icons_"+this.conf.iconSize}}if(l=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.setAlign=function(a){this.conf.align=(a=="right"?"right":"left");this.base.className=(a=="right"?"dhxtoolbar_float_right":"dhxtoolbar_float_left");if(this._spacer){this._spacer.className=(a=="right"?" dhxtoolbar_float_left":" dhxtoolbar_float_right")}};dhtmlXToolbarObject.prototype.setIconSize=function(a){this.conf.iconSize=({18:true,24:true,32:true,48:true}[a]?a:18);this.setSkin(this.conf.skin,true);this.callEvent("_onIconSizeChange",[this.conf.iconSize])};dhtmlXToolbarObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXToolbarObject.prototype.setUserData=function(g,a,c){g=this.idPrefix+g;if(this.objPull[g]!=null){if(this.objPull[g].userData==null){this.objPull[g].userData={}}this.objPull[g].userData[a]=c}};dhtmlXToolbarObject.prototype.getUserData=function(c,a){c=this.idPrefix+c;if(this.objPull[c]!=null&&this.objPull[c].userData!=null){return this.objPull[c].userData[a]||null}return null};dhtmlXToolbarObject.prototype._isListOptionExists=function(a,g){if(this.objPull[this.idPrefix+a]==null){return false}var c=this.objPull[this.idPrefix+a];if(c.type!="buttonSelect"){return false}if(c._listOptions[g]==null){return false}return true};dhtmlXToolbarObject.prototype.setListOptionUserData=function(a,l,c,j){if(!this._isListOptionExists(a,l)){return}var g=this.objPull[this.idPrefix+a]._listOptions[l];if(g.userData==null){g.userData={}}g.userData[c]=j};dhtmlXToolbarObject.prototype.getListOptionUserData=function(a,j,c){if(!this._isListOptionExists(a,j)){return null}var g=this.objPull[this.idPrefix+a]._listOptions[j];if(!g.userData){return null}return(g.userData[c]?g.userData[c]:null)};dhtmlXToolbarObject.prototype._improveTerraceSkin=function(){if(this.conf.terrace_radius==null){this.conf.terrace_radius="3px"}var g=[];var j={separator:true,text:true};var m=[this.base];if(this._spacer!=null){m.push(this._spacer)}for(var o=0;o<m.length;o++){g[o]=[];for(var c=0;c<m[o].childNodes.length;c++){if(m[o].childNodes[c].idd!=null&&m[o].childNodes[c].style.display!="none"){var n=this.idPrefix+m[o].childNodes[c].idd;if(this.objPull[n]!=null&&this.objPull[n].obj==m[o].childNodes[c]){g[o].push({a:n,type:this.objPull[n].type,node:this.objPull[n][this.objPull[n].type=="buttonSelect"?"arw":"obj"]})}}}m[o]=null}for(var o=0;o<g.length;o++){for(var c=0;c<g[o].length;c++){var r=g[o][c];var s=false;var l=false;if(!j[r.type]){if(c==g[o].length-1||(g[o][c+1]!=null&&j[g[o][c+1].type])){s=true}if(c==0||(c-1>=0&&g[o][c-1]!=null&&j[g[o][c-1].type])){l=true}}r.node.style.borderRightWidth=(s?"1px":"0px");r.node.style.borderTopRightRadius=r.node.style.borderBottomRightRadius=(s?this.conf.terrace_radius:"0px");if(r.type=="buttonSelect"){r.node.previousSibling.style.borderTopLeftRadius=r.node.previousSibling.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px");r.node.previousSibling._br=s;r.node.previousSibling._bl=l}else{r.node.style.borderTopLeftRadius=r.node.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px")}r.node._br=s;r.node._bl=l}}for(var o=0;o<g.length;o++){for(var c=0;c<g[o].length;c++){for(var n in g[o][c]){g[o][c][n]=null}g[o][c]=null}g[o]=null}g=m=null};dhtmlXToolbarObject.prototype._improveTerraceButtonSelect=function(g,c){var a=this.objPull[g];if(c==true){a.obj.style.borderBottomLeftRadius=(a.obj._bl?this.conf.terrace_radius:"0px");a.arw.style.borderBottomRightRadius=(a.obj._br?this.conf.terrace_radius:"0px")}else{a.obj.style.borderBottomLeftRadius="0px";a.arw.style.borderBottomRightRadius="0px"}a=null};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_toolbar=function(l,c,j,a,g){if(typeof(g)!="undefined"){l=g}else{l=document.createElement("DIV");l.className="dhx_cell_toolbar_"+(this.conf.borders?"def":"no_borders");l.appendChild(document.createElement("DIV"));l.firstChild.className="dhx_toolbar_base_18_dhx_skyblue"}this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.toolbar=true;this._updateIdx();return l};dhtmlXCellObject.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.callEvent("_onBeforeContentAttach",["toolbar"]);if(typeof(a)=="undefined"){a={}}else{if(typeof(a)=="string"){a={skin:a}}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("toolbar").firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this._adjustCont(this._idd);this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell._adjustCont()});a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataNodes.toolbar};dhtmlXCellObject.prototype.detachToolbar=function(){if(!this.dataNodes.toolbar){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;delete this.dataNodes.toolbar;this._detachObject("toolbar")};dhtmlXCellObject.prototype.showToolbar=function(){this._mtbShowHide("toolbar","")};dhtmlXCellObject.prototype.hideToolbar=function(){this._mtbShowHide("toolbar","none")};dhtmlXCellObject.prototype.getAttachedToolbar=function(){return this.dataNodes.toolbar}}function dhtmlXEditor(g,j){var c=this;this.conf={content:"",contentHTML:"",resizeTM:null,resizeTMTime:100,roMode:false,toolbar:false,iconsPath:"",evs:["focus","blur","keydown","keyup","keypress","mouseup","mousedown","click"]};this._doOnFocusChanged=null;this._doOnAccess=null;if(typeof(g)=="object"&&g!=null&&g.tagName==null){j=g.skin;if(g.content!=null){this.conf.content=g.content}if(g.contentHTML!=null){this.conf.contentHTML=g.contentHTML}if(g.iconsPath!=null){this.conf.iconsPath=g.iconsPath}if(g.toolbar!=null){this.conf.toolbar=window.dhx4.s2b(g.toolbar)}if(g.onFocusChanged!=null){this._doOnFocusChanged=g.onFocusChanged}if(g.onAccess!=null){this._doOnAccess=g.onAccess}g=g.parent}this.conf.skin=(j||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxeditor")||"dhx_skyblue");if(typeof(g)=="string"){g=document.getElementById(g)}this.base=g;this.base.className+=" dhxeditor_"+this.conf.skin;while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}var l=(window.dhx4.isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position"));if(!(l=="relative"||l=="absolute")){this.base.style.position="relative"}this.cell=new dhtmlXEditorCell(window.dhx4.newId(),this);this.base.appendChild(this.cell.cell);this.cBlock=document.createElement("DIV");this.cBlock.className="dhxcont_content_blocker";this.cBlock.style.display="none";this.base.appendChild(this.cBlock);this.editor=document.createElement("IFRAME");this.editor.className="dhxeditor_mainiframe";this.editor.frameBorder=0;if(window.dhx4.isOpera){this.editor.scrolling="yes"}this.setSizes();var a=this.editor;if(typeof(window.addEventListener)!="undefined"){a.onload=function(){for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.addEventListener(c.conf.evs[m],c._ev,false)}}}else{a.onreadystatechange=function(m){if(typeof(a.readyState)!="undefined"&&a.readyState=="complete"){try{for(var n=0;n<c.conf.evs.length;n++){a.contentWindow.document.body.attachEvent("on"+c.conf.evs[n],c._ev)}}catch(o){}}}}this._ev=function(n){n=n||event;var m=n.type;c.callEvent("onAccess",[m,n]);if(typeof(c._doOnAccess)=="function"){c._doOnAccess(m,n)}else{if(typeof(c._doOnAccess)=="string"&&typeof(window[c._doOnAccess])=="function"){window[c._doOnAccess](m,n)}}};this._focus=function(){if(window.dhx4.isIE){this.editor.contentWindow.document.body.focus()}else{this.editor.contentWindow.focus()}};this.cell.attachObject(this.editor);this.edWin=this.editor.contentWindow;this.edDoc=this.edWin.document;this._prepareContent=function(o,r){var n="";if(o===true&&this.getContent!=null){n=this.getContent()}var m=this.editor.contentWindow.document;m.open("text/html","replace");if(window.dhx4.isOpera){m.write("<html><head><style> html, body { overflow:auto;-webkit-overflow-scrolling: touch; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{if(window.dhx4.isKHTML){m.write("<html><head><style> html {overflow-x: auto;-webkit-overflow-scrolling: touch; overflow-y: auto;} body { overflow: auto; overflow-y: scroll;} html,body { padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{if(window.dhx4.isIE){m.write("<html><head><style> html {overflow-y: auto;} body {overflow-y: scroll;-webkit-overflow-scrolling: touch;} html,body { overflow-x: auto; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color: #ffffff; outline: none;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{m.write("<html><head><style> html,body { overflow-x: auto; overflow-y:-webkit-overflow-scrolling: touch; scroll; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(r!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}}}m.close();if(window.dhx4.isIE){m.contentEditable=(r!==true)}else{m.designMode=(r!==true?"On":"Off")}if(window.dhx4.isFF){try{m.execCommand("useCSS",false,true)}catch(q){}}if(o===true&&this.setContent!=null){this.setContent(n)}};this._prepareContent();this._doOnResize=function(){window.clearTimeout(c.conf.resizeTM);c.conf.resizeTM=window.setTimeout(function(){if(c.setSizes){c.setSizes()}},c.conf.resizeTMTime)};this._runCommand=function(o,r){if(this.conf.roMode===true){return}if(arguments.length<2){r=null}if(window.dhx4.isIE){this.edWin.focus()}try{var n=this.editor.contentWindow.document;n.execCommand(o,false,r)}catch(q){}if(window.dhx4.isIE){this.edWin.focus();var m=this;window.setTimeout(function(){m.edWin.focus();m=null},1)}};this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.clearFormatting=function(){this._runCommand("RemoveFormat");var m=this.getContent();m=m.replace(/<\/?h\d>/gi,"");this.setContent(m)};this._doOnClick=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnMouseDown=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnKeyUp=function(q){var o=q||window.event;var m=o.keyCode;var n=o.target||o.srcElement;if({37:1,38:1,39:1,40:1,13:1}[m]==1){c._showInfo(n)}};this._getParentByTag=function(m,o){o=o.toLowerCase();var n=m;do{if(o==""||n.nodeName.toLowerCase()==o){return n}}while(n=n.parentNode);return m};this._isStyleProperty=function(o,r,m,q){r=r.toLowerCase();var s=o;do{if((s.nodeName.toLowerCase()==r)&&(s.style[m]==q)){return true}}while(s=s.parentNode);return false};this._setStyleProperty=function(m,q){this.style[q]=false;var o=this._getParentByTag(m,q);if(o&&(o.tagName.toLowerCase()==q)){this.style[q]=true}if(q=="del"&&this._getParentByTag(m,"strike")&&this._getParentByTag(m,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(n){var n=(this._getSelectionBounds().end)?this._getSelectionBounds().end:n;if(!n||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var m=this.edWin.getComputedStyle(n,null);var o=((m.getPropertyValue("font-weight")==401)?700:m.getPropertyValue("font-weight"));this.style={fontStyle:m.getPropertyValue("font-style"),fontSize:m.getPropertyValue("font-size"),textDecoration:m.getPropertyValue("text-decoration"),fontWeight:o,fontFamily:m.getPropertyValue("font-family"),textAlign:m.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=m.getPropertyValue("font-style");this.style.vAlign=m.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(n,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(n,"span","textDecoration","underline")}}else{var m=n.currentStyle;this.style={fontStyle:m.fontStyle,fontSize:m.fontSize,textDecoration:m.textDecoration,fontWeight:m.fontWeight,fontFamily:m.fontFamily,textAlign:m.textAlign}}this._setStyleProperty(n,"h1");this._setStyleProperty(n,"h2");this._setStyleProperty(n,"h3");this._setStyleProperty(n,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(n,"del");this._setStyleProperty(n,"sub");this._setStyleProperty(n,"sup");this._setStyleProperty(n,"u")}this.callEvent("onFocusChanged",[this.style,m])}catch(q){return null}};this._getSelectionBounds=function(){var r,o,u,n;if(this.edWin.getSelection){var s=this.edWin.getSelection();r=s.getRangeAt(s.rangeCount-1);u=r.startContainer;n=r.endContainer;o=r.commonAncestorContainer;if(u.nodeName=="#text"){o=o.parentNode}if(u.nodeName=="#text"){u=u.parentNode}if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName=="#text"){n=n.parentNode}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}else{if(this.edWin.document.selection){r=this.edDoc.selection.createRange();if(!r.duplicate){return null}o=r.parentElement();var q=r.duplicate();var m=r.duplicate();q.collapse(true);m.moveToElementText(q.parentElement());m.setEndPoint("EndToStart",q);u=q.parentElement();q=r.duplicate();m=r.duplicate();m.collapse(false);q.moveToElementText(m.parentElement());q.setEndPoint("StartToEnd",m);n=m.parentElement();if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}}return null};this.getContent=function(){if(!this.edDoc.body){return""}else{if(window.dhx4.isFF){return this.editor.contentWindow.document.body.innerHTML.replace(/<\/{0,}br\/{0,}>\s{0,}$/gi,"")}if(window.dhx4.isIE&&this.edDoc.body.innerText.length==0){return""}return this.edDoc.body.innerHTML}};this.setContent=function(o){o=o||"";if(this.edDoc.body){var n=false;if(window.dhx4.isFF){var m=navigator.userAgent.match(/Firefox\/(\d*)/);n=(m!=null&&m[1]<28)}if(n){if(typeof(this.conf.ffTest)=="undefined"){this.editor.contentWindow.document.body.innerHTML="";this._runCommand("InsertHTML","test");this.conf.ffTest=(this.editor.contentWindow.document.body.innerHTML.length>0)}if(this.conf.ffTest){this.editor.contentWindow.document.body.innerHTML=o}else{this.editor.contentWindow.document.body.innerHTML="";if(o.length==0){o=" "}this._runCommand("InsertHTML",o)}}else{this.editor.contentWindow.document.body.innerHTML=o}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=o;this._onFirstLoad=function(){c.setContent(c.conf.firstLoadData);if(typeof(window.addEventListener)=="function"){c.edWin.removeEventListener("load",c._onFirstLoad,false)}else{c.edWin.detachEvent("onload",c._onFirstLoad)}c.conf.firstLoadData=null;c.conf.firstLoadEv=false;c._onFirstLoad=null};if(typeof(window.addEventListener)=="function"){this.edWin.addEventListener("load",this._onFirstLoad,false)}else{this.edWin.attachEvent("onload",this._onFirstLoad)}}}};this.setContentHTML=function(m){window.dhx4.ajax.get(m,function(n){if(n.xmlDoc.responseText!=null){c.setContent(n.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(m){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(m)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](m)}}});if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResize,false);this.edDoc.addEventListener("click",this._doOnClick,false);this.edDoc.addEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.addEventListener("mousedown",this._doOnMouseDown,false)}}else{window.attachEvent("onresize",this._doOnResize);this.edDoc.attachEvent("onclick",this._doOnClick);this.edDoc.attachEvent("onkeyup",this._doOnKeyUp)}this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResize,false);this.edDoc.removeEventListener("click",this._doOnClick,false);this.edDoc.removeEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.removeEventListener("mousedown",this._doOnMouseDown,false)}for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.removeEventListener(c.conf.evs[m],c._ev,false)}}else{window.detachEvent("onresize",this._doOnResize,false);this.edDoc.detachEvent("onclick",this._doOnClick);this.edDoc.detachEvent("onkeyup",this._doOnKeyUp);for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.document.body.detachEvent("on"+c.conf.evs[m],c._ev)}}this._doOnAccess=null;this._doOnFocusChanged=null;if(typeof(window.addEventListener)=="function"){this.editor.onload=null}else{this.editor.onreadystatechange=null}this.editor.parentNode.removeChild(this.editor);this.editor=null;this.edDoc=null;this.edWin=null;this.cell._unload();this.cell=null;this.tb=null;window.dhx4._eventable(this,"clear");this.cBlock.parentNode.removeChild(this.cBlock);this.cBlock=null;this.base.className=String(this.base.className).replace(new RegExp("\\s{0,}dhxeditor_"+this.conf.skin),"");while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.base=null;this._doOnClick=null;this._doOnKeyUp=null;this._doOnMouseDown=null;this._ev=null;this._focus=null;this._prepareContent=null;this._doOnResize=null;this.setIconsPath=null;this.init=null;this.setSizes=null;this._runCommand=null;this.applyBold=null;this.applyItalic=null;this.applyUnderscore=null;this.clearFormatting=null;this._showInfo=null;this._getSelectionBounds=null;this.getContent=null;this.setContent=null;this.setContentHTML=null;this.setReadonly=null;this.isReadonly=null;this.unload=null;c=a=null};if(this.conf.toolbar==true&&typeof(this.attachToolbar)=="function"&&typeof(window.dhtmlXToolbarObject)=="function"){this.attachToolbar(this.conf.iconsPath)}this.setIconsPath=function(m){this.conf.iconsPath=m};if(this.conf.content.length>0){this.setContent(this.conf.content);this.conf.content=""}else{if(this.conf.contentHTML.length>0){this.setContentHTML(this.conf.contentHTML);this.conf.contentHTML=""}}return this}dhtmlXEditor.prototype.setSizes=function(){this.cell._setSize(0,0,this.base.clientWidth,this.base.clientHeight);if(this.editor!=null){this.editor.style.left="5px";this.editor.style.width=this.base.clientWidth-5+"px"}};dhtmlXEditor.prototype.setReadonly=function(a){this.conf.roMode=(a===true);this._prepareContent(true,this.conf.roMode);this.cBlock.style.display=(this.conf.roMode?"":"none")};dhtmlXEditor.prototype.isReadonly=function(a){return(this.conf.roMode||false)};dhtmlXEditor.prototype.setSkin=function(a){this.base.className=String(this.base.className).replace(new RegExp("dhxeditor_"+this.conf.skin),"dhxeditor_"+a);this.conf.skin=this.cell.conf.skin=a;if(this.tb){this.cell.detachToolbar(a);this.tb=null;this.attachToolbar()}this.setSizes()};window.dhtmlXEditorCell=function(g,a){dhtmlXCellObject.apply(this,[g,"_editor"]);var c=this;this.editor=a;this.conf.skin=this.editor.conf.skin;this.attachEvent("_onCellUnload",function(){this._stbUnload();this.editor=null;c=null});this._stbInit();return this};dhtmlXEditorCell.prototype=new dhtmlXCellObject();dhtmlXEditorCell.prototype._stbInit=function(){var m=this;var l=document.createElement("DIV");l.className="dhx_cell_stb";this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);l.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var j={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var g in j){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;l.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var n=document.createElement("DIV");n.className="dhx_cell_stb_button btn_"+g;n._actv=g.charAt(0);n._cmd=j[g];c.appendChild(n);n.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};n.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}m.editor[this._cmd]();m.editor.callEvent("onToolbarClick",[this._actv])};n=c=null}l=null;this._stbUnload=function(){var a=this.cell.childNodes[this.conf.idx.stb];a.onselectstart=null;while(a.childNodes.length>0){a.lastChild.onmousedown=a.lastChild.onclick=null;a.lastChild.firstChild.onmousedown=a.lastChild.firstChild.onclick=null;a.lastChild.firstChild._actv=a.lastChild.firstChild._cmd=null;a.lastChild.removeChild(a.lastChild.firstChild);a.removeChild(a.lastChild)}a.parentNode.removeChild(a);a=m=null;this.conf.idx_data.stb=this.conf.ofs_nodes.t._getStbHeight=null;delete this.conf.ofs_nodes.t._getStbHeight;delete this.conf.idx_data.stb;this._updateIdx()};this.conf.ofs_nodes.t._getStbHeight="func";this.conf.idx_data.stb="dhx_cell_stb";this._updateIdx()};dhtmlXEditorCell.prototype._stbHide=function(){this.cell.childNodes[this.conf.idx.stb].style.display="none"};dhtmlXEditorCell.prototype._getStbHeight=function(){return this.cell.childNodes[this.conf.idx.stb].offsetHeight};dhtmlXCellObject.prototype.attachEditor=function(a){this.callEvent("_onBeforeContentAttach",["editor"]);var g=document.createElement("DIV");g.style.width="100%";g.style.height="100%";g.style.position="relative";g.style.overflow="hidden";this._attachObject(g);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=g;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);g=null;a.parent=null;a=null;if(typeof(window.dhtmlXPortalCell)!="undefined"&&this instanceof window.dhtmlXPortalCell){if(this.portal.conf.editor_ev==null){var j=this.portal.attachEvent("onBeforeDrag",function(l){if(this.cdata[l].dataType=="editor"){this.cdata[l].conf.editor_cont=this.cdata[l].dataObj.getContent()}return true});var c=this.portal.attachEvent("onDrop",function(l){if(this.cdata[l].dataType=="editor"){this.cdata[l].dataObj.setContent(this.cdata[l].conf.editor_cont);this.cdata[l].dataObj._prepareContent(true);this.cdata[l].conf.editor_cont=null}});this.portal.conf.editor_ev=[j,c]}this.conf.editor_ev=this.attachEvent("_onBeforeContentDetach",function(){this.detachEvent(this.conf.editor_ev);this.conf.editor_ev=null;if(this instanceof window.dhtmlXPortalCell){var m=false;for(var l in this.portal.cdata){if(this.portal.cdata[l]!=this&&this.portal.cdata[l].dataType=="editor"){m=true}}if(m==false){for(var n=0;n<this.portal.conf.editor_ev.length;n++){this.portal.detachEvent(this.portal.conf.editor_ev[n])}this.portal.conf.editor_ev=null}}})}this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXEditor.prototype.attachToolbar=function(c){if(this.tb!=null){return}if(c!=null){this.conf.iconsPath=c}this.cell._stbHide();this.tb=this.cell.attachToolbar({icons_path:this.conf.iconsPath+"/dhxeditor_"+String(this.conf.skin).replace(/^dhx_/,"")+"/",skin:this.conf.skin});this.setSizes();this._availFonts=new Array("Arial","Arial Narrow","Comic Sans MS","Courier","Georgia","Impact","Tahoma","Times New Roman","Verdana");this._initFont=this._availFonts[0];this._xmlFonts="";for(var m=0;m<this._availFonts.length;m++){var j=String(this._availFonts[m]).replace(/\s/g,"_");this._xmlFonts+='<item type="button" id="applyFontFamily:'+j+'"><itemText><![CDATA[<img src="'+this.tb.imagePath+"font_"+String(j).toLowerCase()+'.gif" border="0" style="/*margin-top:1px;margin-bottom:1px;*/width:110px;height:16px;">]]></itemText></item>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var g in this._availSizes){this._xmlSizes+='<item type="button" id="applyFontSize:'+g+":"+this._availSizes[g]+'" text="'+this._availSizes[g]+'"/>'}this.tbXML='<toolbar><item id="applyH1" type="buttonTwoState" img="h1.gif" imgdis="h4_dis.gif" title="H1"/><item id="applyH2" type="buttonTwoState" img="h2.gif" imgdis="h4_dis.gif" title="H2"/><item id="applyH3" type="buttonTwoState" img="h3.gif" imgdis="h4_dis.gif" title="H3"/><item id="applyH4" type="buttonTwoState" img="h4.gif" imgdis="h4_dis.gif" title="H4"/><item id="separ01" type="separator"/><item id="applyBold" type="buttonTwoState" img="bold.gif" imgdis="bold_dis.gif" title="Bold Text"/><item id="applyItalic" type="buttonTwoState" img="italic.gif" imgdis="italic_dis.gif" title="Italic Text"/><item id="applyUnderscore" type="buttonTwoState" img="underline.gif" imgdis="underline_dis.gif" title="Underscore Text"/><item id="applyStrikethrough" type="buttonTwoState" img="strike.gif" imgdis="strike_dis.gif" title="Strikethrough Text"/><item id="separ02" type="separator"/><item id="alignLeft" type="buttonTwoState" img="align_left.gif" imgdis="align_left_dis.gif" title="Left Alignment"/><item id="alignCenter" type="buttonTwoState" img="align_center.gif" imgdis="align_center_dis.gif" title="Center Alignment"/><item id="alignRight" type="buttonTwoState" img="align_right.gif" imgdis="align_right_dis.gif" title="Right Alignment"/><item id="alignJustify" type="buttonTwoState" img="align_justify.gif" title="Justified Alignment"/><item id="separ03" type="separator"/><item id="applySub" type="buttonTwoState" img="script_sub.gif" imgdis="script_sub.gif" title="Subscript"/><item id="applySuper" type="buttonTwoState" img="script_super.gif" imgdis="script_super_dis.gif" title="Superscript"/><item id="separ04" type="separator"/><item id="createNumList" type="button" img="list_number.gif" imgdis="list_number_dis.gif" title="Number List"/><item id="createBulList" type="button" img="list_bullet.gif" imgdis="list_bullet_dis.gif" title="Bullet List"/><item id="separ05" type="separator"/><item id="increaseIndent" type="button" img="indent_inc.gif" imgdis="indent_inc_dis.gif" title="Increase Indent"/><item id="decreaseIndent" type="button" img="indent_dec.gif" imgdis="indent_dec_dis.gif" title="Decrease Indent"/><item id="separ06" type="separator"/><item id="clearFormatting" type="button" img="clear.gif" title="Clear Formatting"/></toolbar>';this.tb.loadStruct(this.tbXML);this._checkAlign=function(a){this.tb.setItemState("alignCenter",false);this.tb.setItemState("alignRight",false);this.tb.setItemState("alignJustify",false);this.tb.setItemState("alignLeft",false);if(a){this.tb.setItemState(a,true)}};this._checkH=function(a){this.tb.setItemState("applyH1",false);this.tb.setItemState("applyH2",false);this.tb.setItemState("applyH3",false);this.tb.setItemState("applyH4",false);if(a){this.tb.setItemState(a,true)}};this._doOnFocusChanged=function(o){if(!o.h1&&!o.h2&&!o.h3&&!o.h4){var a=(String(o.fontWeight).search(/bold/i)!=-1)||(Number(o.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var n="alignLeft";if(String(o.textAlign).search(/center/)!=-1){n="alignCenter"}if(String(o.textAlign).search(/right/)!=-1){n="alignRight"}if(String(o.textAlign).search(/justify/)!=-1){n="alignJustify"}this.tb.setItemState(n,true);this._checkAlign(n);this.tb.setItemState("applyH1",o.h1);this.tb.setItemState("applyH2",o.h2);this.tb.setItemState("applyH3",o.h3);this.tb.setItemState("applyH4",o.h4);if(window._KHTMLrv){o.sub=(o.vAlign=="sub");o.sup=(o.vAlign=="super")}this.tb.setItemState("applyItalic",(o.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",o.del);this.tb.setItemState("applySub",o.sub);this.tb.setItemState("applySuper",o.sup);this.tb.setItemState("applyUnderscore",o.u)};this._doOnToolbarClick=function(n){var a=String(n).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[n])}}};this._doOnStateChange=function(n,a){this[n]();switch(n){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(n);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(n);break}this.callEvent("onToolbarClick",[n])};this._doOnBeforeStateChange=function(n,a){if((n=="alignLeft"||n=="alignCenter"||n=="alignRight"||n=="alignJustify")&&a==true){return false}return true};var l=this;this.tb.attachEvent("onClick",function(a){l._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(n,a){l._doOnStateChange(n,a)});this.tb.attachEvent("onBeforeStateChange",function(n,a){return l._doOnBeforeStateChange(n,a)});this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.applyStrikethrough=function(){this._runCommand("StrikeThrough")};this.alignLeft=function(){this._runCommand("JustifyLeft")};this.alignRight=function(){this._runCommand("JustifyRight")};this.alignCenter=function(){this._runCommand("JustifyCenter")};this.alignJustify=function(){this._runCommand("JustifyFull")};this.applySub=function(){this._runCommand("Subscript")};this.applySuper=function(){this._runCommand("Superscript")};this.applyH1=function(){this._runCommand("FormatBlock","<H1>")};this.applyH2=function(){this._runCommand("FormatBlock","<H2>")};this.applyH3=function(){this._runCommand("FormatBlock","<H3>")};this.applyH4=function(){this._runCommand("FormatBlock","<H4>")};this.createNumList=function(){this._runCommand("InsertOrderedList")};this.createBulList=function(){this._runCommand("InsertUnorderedList")};this.increaseIndent=function(){this._runCommand("Indent")};this.decreaseIndent=function(){this._runCommand("Outdent")};this.clearFormatting=function(){this._runCommand("RemoveFormat");this.tb.setItemState("applyBold",false);this.tb.setItemState("applyItalic",false);this.tb.setItemState("applyStrikethrough",false);this.tb.setItemState("applySub",false);this.tb.setItemState("applySuper",false);this.tb.setItemState("applyUnderscore",false);var a=this.getContent();a=a.replace(/<\/?h\d>/gi,"");this.setContent(a)}};dhtmlx.Group={_init:function(){dhtmlx.assert(this.data,"DataStore required for grouping");this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){if(this._settings.group){this.group(this._settings.group,false)}},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this._settings.sort){a.block();a.sort(this._settings.sort);a.unblock()}},this));this.data.attachEvent("onClearAll",dhtmlx.bind(function(){this.data._not_grouped_order=this.data._not_grouped_pull=null},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this._settings.sort=null},this))},_init_group_data_event:function(c,a){c.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false);this.block();this.clearAll();this.unblock()},a))},sum:function(c,a){c=dhtmlx.Template.setter(c);a=a||this.data;var g=0;a.each(function(j){g+=c(j)*1});return g},min:function(g,c){g=dhtmlx.Template.setter(g);c=c||this.data;var a=Infinity;c.each(function(j){if(g(j)*1<a){a=g(j)*1}});return a*1},max:function(g,c){g=dhtmlx.Template.setter(g);c=c||this.data;var a=-Infinity;c.each(function(j){if(g(j)*1>a){a=g(j)*1}});return a},_split_data_by:function(m){var o=function(s,r){s=dhtmlx.Template.setter(s);return s(r[0])};var q=dhtmlx.Template.setter(m.by);if(!m.map[q]){m.map[q]=[q,o]}var g={};var n=[];this.data.each(function(r){var s=q(r);if(!g[s]){n.push({id:s});g[s]=dhtmlx.toArray()}g[s].push(r)});for(var a in m.map){var l=(m.map[a][1]||o);if(typeof l!="function"){l=this[l]}for(var j=0;j<n.length;j++){n[j][a]=l.call(this,m.map[a][0],g[n[j].id])}}this.data._not_grouped_order=this.data.order;this.data._not_grouped_pull=this.data.pull;this.data.order=dhtmlx.toArray();this.data.pull={};for(var j=0;j<n.length;j++){var c=this.data.id(n[j]);this.data.pull[c]=n[j];this.data.order.push(c)}this.callEvent("onStoreUpdated",[])},group:function(a,c){this.ungroup(false);this._split_data_by(a);if(c!==false){this.data.callEvent("onStoreUpdated",[])}},ungroup:function(a){if(this.data._not_grouped_order){this.data.order=this.data._not_grouped_order;this.data.pull=this.data._not_grouped_pull;this.data._not_grouped_pull=this.data._not_grouped_order=null}if(a!==false){this.data.callEvent("onStoreUpdated",[])}},group_setter:function(a){dhtmlx.assert(typeof a=="object","Incorrect group value");dhtmlx.assert(a.by,"group.by is mandatory");dhtmlx.assert(a.map,"group.map is mandatory");return a},sort_setter:function(a){if(typeof a!="object"){a={by:a}}this._mergeSettings(a,{as:"string",dir:"asc"});return a}};dhtmlx.Date={Locale:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},time_part:function(a){return(a.valueOf()/1000-a.getTimezoneOffset()*60)%86400},week_start:function(c){var a=c.getDay();if(this.config.start_on_monday){if(a===0){a=6}else{a--}}return this.date_part(this.add(c,-1*a,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(c,g,j){var a=new Date(c.valueOf());switch(j){case"day":a.setDate(a.getDate()+g);break;case"week":a.setDate(a.getDate()+7*g);break;case"month":a.setMonth(a.getMonth()+g);break;case"year":a.setYear(a.getFullYear()+g);break;case"hour":a.setHours(a.getHours()+g);break;case"minute":a.setMinutes(a.getMinutes()+g);break;default:return dhtmlx.Date["add_"+j](c,g,j)}return a},to_fixed:function(a){if(a<10){return"0"+a}return a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(c,a){c=c.replace(/%[a-zA-Z]/g,function(g){switch(g){case"%d":return'"+dhtmlx.Date.to_fixed(date.getDate())+"';case"%m":return'"+dhtmlx.Date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+dhtmlx.Date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+dhtmlx.Date.Locale.day_short[date.getDay()]+"';case"%l":return'"+dhtmlx.Date.Locale.day_full[date.getDay()]+"';case"%M":return'"+dhtmlx.Date.Locale.month_short[date.getMonth()]+"';case"%F":return'"+dhtmlx.Date.Locale.month_full[date.getMonth()]+"';case"%h":return'"+dhtmlx.Date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+dhtmlx.Date.to_fixed(date.getHours())+"';case"%i":return'"+dhtmlx.Date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+dhtmlx.Date.to_fixed(date.getSeconds())+"';case"%W":return'"+dhtmlx.Date.to_fixed(dhtmlx.Date.getISOWeek(date))+"';default:return g}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(l,g){var m="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=l.match(/%[a-zA-Z]/g);for(var c=0;c<a.length;c++){switch(a[c]){case"%j":case"%d":m+="set[2]=temp["+c+"]||1;";break;case"%n":case"%m":m+="set[1]=(temp["+c+"]||1)-1;";break;case"%y":m+="set[0]=temp["+c+"]*1+(temp["+c+"]>50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":m+="set[3]=temp["+c+"]||0;";break;case"%i":m+="set[4]=temp["+c+"]||0;";break;case"%Y":m+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":m+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":m+="set[5]=temp["+c+"]||0;";break}}var j="set[0],set[1],set[2],set[3],set[4],set[5]";if(g){j=" Date.UTC("+j+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+m+" return new Date("+j+");")},getISOWeek:function(g){if(!g){return false}var c=g.getDay();if(c===0){c=7}var j=new Date(g.valueOf());j.setDate(g.getDate()+(4-c));var a=j.getFullYear();var m=Math.floor((j.getTime()-new Date(a,0,1).getTime())/86400000);var l=1+Math.floor(m/7);return l},getUTCISOWeek:function(a){return this.getISOWeek(a)}};dhtmlx.math={};dhtmlx.math._toHex=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(c,a){c=parseInt(c,10);str="";while(c>0){str=this._toHex[c%16]+str;c=Math.floor(c/16)}while(str.length<a){str="0"+str}return str};dhtmlx.math.hexToDec=function(a){return parseInt(a,16)};dhtmlx.math.toRgb=function(c){var l,j,a,m;if(typeof(c)!="string"){l=c[0];j=c[1];a=c[2]}else{if(c.indexOf("rgb")!=-1){m=c.substr(c.indexOf("(")+1,c.lastIndexOf(")")-c.indexOf("(")-1).split(",");l=m[0];j=m[1];a=m[2]}else{if(c.substr(0,1)=="#"){c=c.substr(1)}l=this.hexToDec(c.substr(0,2));j=this.hexToDec(c.substr(2,2));a=this.hexToDec(c.substr(4,2))}}l=(parseInt(l,10)||0);j=(parseInt(j,10)||0);a=(parseInt(a,10)||0);if(l<0||l>255){l=0}if(j<0||j>255){j=0}if(a<0||a>255){a=0}return[l,j,a]};dhtmlx.math.hsvToRgb=function(m,y,w){var l,o,j,c,x,a,n,u;l=Math.floor((m/60))%6;o=m/60-l;j=w*(1-y);c=w*(1-o*y);x=w*(1-(1-o)*y);a=0;n=0;u=0;switch(l){case 0:a=w;n=x;u=j;break;case 1:a=c;n=w;u=j;break;case 2:a=j;n=w;u=x;break;case 3:a=j;n=c;u=w;break;case 4:a=x;n=j;u=w;break;case 5:a=w;n=j;u=c;break}a=Math.floor(a*255);n=Math.floor(n*255);u=Math.floor(u*255);return[a,n,u]};dhtmlx.math.rgbToHsv=function(c,n,o){var l,j,q,a,u,x,m,w;l=c/255;j=n/255;q=o/255;var a=Math.min(l,j,q);var u=Math.max(l,j,q);m=0;x=u==0?0:(1-a/u);w=u;if(u==a){m=0}else{if(u==l&&j>=q){m=60*(j-q)/(u-a)+0}else{if(u==l&&j<q){m=60*(j-q)/(u-a)+360}else{if(u==j){m=60*(q-l)/(u-a)+120}else{if(u==q){m=60*(l-j)/(u-a)+240}}}}}return[m,x,w]};if(!dhtmlx.presets){dhtmlx.presets={}}dhtmlx.presets.chart={simple:{item:{borderColor:"#ffffff",color:"#2b7100",shadow:false,borderWidth:2},line:{color:"#8ecf03",width:2}},plot:{color:"#1293f8",item:{borderColor:"#636363",borderWidth:1,color:"#ffffff",type:"r",shadow:false},line:{color:"#1293f8",width:2}},diamond:{color:"#b64040",item:{borderColor:"#b64040",color:"#b64040",type:"d",radius:3,shadow:true},line:{color:"#ff9000",width:2}},point:{color:"#fe5916",disableLines:true,fill:false,disableItems:false,item:{color:"#feb916",borderColor:"#fe5916",radius:2,borderWidth:1,type:"r"},alpha:1},line:{line:{color:"#3399ff",width:2},item:{color:"#ffffff",borderColor:"#3399ff",radius:2,borderWidth:2,type:"d"},fill:false,disableItems:false,disableLines:false,alpha:1},area:{fill:"#3399ff",line:{color:"#3399ff",width:1},disableItems:true,alpha:0.2,disableLines:false},round:{item:{radius:3,borderColor:"#3f83ff",borderWidth:1,color:"#3f83ff",type:"r",shadow:false,alpha:0.6}},square:{item:{radius:3,borderColor:"#447900",borderWidth:2,color:"#69ba00",type:"s",shadow:false,alpha:1}},column:{color:"RAINBOW",gradient:false,width:45,radius:0,alpha:1,border:true},stick:{width:5,gradient:false,color:"#67b5c9",radius:2,alpha:1,border:false},alpha:{color:"#b9a8f9",width:70,gradient:"falling",radius:0,alpha:0.5,border:true}};dhtmlx.ui.Map=function(a){this.name="Map";this._id="map_"+dhtmlx.uid();this._key=a;this._map=[]};dhtmlx.ui.Map.prototype={addRect:function(g,c,a){this._createMapArea(g,"RECT",c,a)},addPoly:function(g,c,a){this._createMapArea(g,"POLY",c,a)},_createMapArea:function(l,c,j,g){var a="";if(arguments.length==4){a="userdata='"+g+"'"}this._map.push("<area "+this._key+"='"+l+"' shape='"+c+"' coords='"+j.join()+"' "+a+"></area>")},addSector:function(a,r,q,n,l,g,j,m){var o=[];o.push(n);o.push(Math.floor(l*j));for(var c=r;c<q;c+=Math.PI/18){o.push(Math.floor(n+g*Math.cos(c)));o.push(Math.floor((l+g*Math.sin(c))*j))}o.push(Math.floor(n+g*Math.cos(q)));o.push(Math.floor((l+g*Math.sin(q))*j));o.push(n);o.push(Math.floor(l*j));return this.addPoly(a,o,m)},render:function(a){var g=dhtmlx.html.create("DIV");g.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(g);var c=dhtmlx._isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";g.innerHTML="<map id='"+this._id+"' name='"+this._id+"'>"+this._map.join("\n")+"</map><img "+c+" class='dhx_map_img' usemap='#"+this._id+"' onmousedown='return false;'>";a._htmlmap=g;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(r,m,q,o,n,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var g=this._getLimits();var l=this._getLimits("h","xValue");if(!n){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}this._drawYAxis(this.canvases.y.getCanvas(),m,q,o,g.min,g.max);this._drawHXAxis(this.canvases.x.getCanvas(),m,q,o,l.min,l.max)}g={min:this._settings.yAxis.start,max:this._settings.yAxis.end};l={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(r,m,q,o,l,g);this._mapStart=q;for(var j=0;j<m.length;j++){this._drawScatterItem(r,a,q,o,c,l,g,m[j],n)}},_getScatterParams:function(a,j,g,c,n,m){var l={};l.totalHeight=c.y-g.y;l.totalWidth=c.x-g.x;this._calcScatterUnit(l,n.min,n.max,l.totalWidth,"X");this._calcScatterUnit(l,m.min,m.max,l.totalHeight,"Y");return l},_drawScatterItem:function(s,a,q,o,g,l,j,m,n){var c=this._calculateScatterItemPosition(g,o,q,l,m,"X");var r=this._calculateScatterItemPosition(g,q,o,j,m,"Y");this._drawItem(s,c,r,m,this._settings.label.call(this,m),n,a)},_calculateScatterItemPosition:function(g,o,n,a,l,c){var r=this._settings[c=="X"?"xValue":"value"].call(this,l);var j=g["valueFactor"+c];var s=(parseFloat(r||0)-a.min)*j;var q=g["unit"+c];var m=n[c.toLowerCase()]-(c=="X"?(-1):1)*Math.floor(q*s);if(s<0){m=n[c.toLowerCase()]}if(r>a.max){m=o[c.toLowerCase()]}if(r<a.min){m=n[c.toLowerCase()]}return m},_calcScatterUnit:function(m,g,a,c,j){var l=this._getRelativeValue(g,a);j=(j||"");m["relValue"+j]=l[0];m["valueFactor"+j]=l[1];m["unit"+j]=(m["relValue"+j]?c/m["relValue"+j]:10)}};dhtmlx.chart.radar={pvt_render_radar:function(c,j,a,m,g,l){this._renderRadarChart(c,j,a,m,g,l)},_renderRadarChart:function(v,l,s,r,q,a){if(!l.length){return}var n=this._getPieParameters(s,r);var o=(this._settings.radius?this._settings.radius:n.radius);var c=(this._settings.x?this._settings.x:n.x);var u=(this._settings.y?this._settings.y:n.y);var g=[];for(var j=0;j<l.length;j++){g.push(1)}var m=this._getRatios(g,l.length);this._mapStart=s;if(!q){this._drawRadarAxises(m,c,u,o,l)}this._drawRadarData(v,m,c,u,o,l,q,a)},_drawRadarData:function(D,u,o,n,l,O,E,N){var C,w,M,K,F,J,j,g,H,L,I,v,c,A,r,q,a,s,m;M=this._settings;F=M.yAxis.start;J=M.yAxis.end;m=this._getRelativeValue(F,J);v=m[0];s=(v?l/v:l/2);a=m[1];c=-Math.PI/2;C=w=c;H=[];g=0;for(K=0;K<O.length;K++){if(!q){A=M.value(O[K]);r=(parseFloat(A||0)-F)*a}else{r=q}L=Math.floor(s*r);A=M.value((K!=(O.length-1))?O[K+1]:O[0]);q=(parseFloat(A||0)-F)*a;I=Math.floor(s*q);C=w;w=((K!=(O.length-1))?(c+u[K]-0.0001):c);j=(g||this._getPositionByAngle(C,o,n,L));g=this._getPositionByAngle(w,o,n,I);H.push(j)}if(M.fill){this._fillRadarChart(D,H,O)}if(!M.disableLines){this._strokeRadarChart(D,H,O)}if(!M.disableItems){this._drawRadarItemMarkers(D,H,O,E,N)}H=null},_drawRadarItemMarkers:function(a,g,l,j,m){for(var c=0;c<g.length;c++){this._drawItem(a,g[c].x,g[c].y,l[c],this._settings.label.call(this,l),j,m)}},_fillRadarChart:function(a,j,m){var l,g;a.globalAlpha=this._settings.alpha.call(this,{});a.beginPath();for(var c=0;c<j.length;c++){a.fillStyle=this._settings.fill.call(this,m[c]);l=j[c];g=(j[c+1]||j[0]);if(!c){a.moveTo(l.x,l.y)}a.lineTo(g.x,g.y)}a.fill();a.globalAlpha=1},_strokeRadarChart:function(a,j,m){var l,g;for(var c=0;c<j.length;c++){l=j[c];g=(j[c+1]||j[0]);this._drawLine(a,l.x,l.y,g.x,g.y,this._settings.line.color.call(this,m[c]),this._settings.line.width)}},_drawRadarAxises:function(D,A,w,o,Q){var a=this._settings.yAxis;var l=this._settings.xAxis;var q=a.start;var n=a.end;var s=a.step;var E={};var P=this._configYAxis;if(typeof P.step=="undefined"||typeof P.start=="undefined"||typeof P.end=="undefined"){var u=this._getLimits();E=this._calculateScale(u.min,u.max);q=E.start;n=E.end;s=E.step;a.end=n;a.start=q}var K=[];var N,M,F;var O=0;var g=o*s/(n-q);var v,C;if(s<1){v=Math.min(this._log10(s),(q<=0?0:this._log10(q)));C=Math.pow(10,-v)}var L=[];if(!this.canvases.scale){this.canvases.scale=new dhtmlx.ui.Canvas(this._obj,"radar_scale")}var J=this.canvases.scale.getCanvas();for(N=n;N>=q;N-=s){if(E.fixNum){N=parseFloat((new Number(N)).toFixed(E.fixNum))}K.push(Math.floor(O*g)+0.5);if(C){N=Math.round(N*C)/C}var r=w-o+K[K.length-1];this.canvases.scale.renderTextAt("middle","left",A,r,a.template(N.toString()),"dhx_axis_item_y dhx_radar");if(D.length<2){this._drawScaleSector(J,"arc",A,w,o-K[K.length-1],-Math.PI/2,3*Math.PI/2,N);return}var m=-Math.PI/2;var I=m;var H;for(M=0;M<D.length;M++){if(N==n){L.push(I)}H=m+D[M]-0.0001;this._drawScaleSector(J,(P.lineShape||"line"),A,w,o-K[K.length-1],I,H,N,M,Q[N]);I=H}O++}for(N=0;N<L.length;N++){F=this._getPositionByAngle(L[N],A,w,o);if(l.lines.call(this,Q[N],N)){this._drawLine(J,A,w,F.x,F.y,(l?l.lineColor.call(this,Q[N]):"#cfcfcf"),1)}this._drawRadarScaleLabel(J,A,w,o,L[N],(l?l.template.call(this,Q[N]):"&nbsp;"))}},_drawScaleSector:function(v,n,u,r,m,c,a,l,g){var s,q;if(m<0){return false}s=this._getPositionByAngle(c,u,r,m);q=this._getPositionByAngle(a,u,r,m);var o=this._settings.yAxis;if(o.bg){v.beginPath();v.moveTo(u,r);if(n=="arc"){v.arc(u,r,m,c,a,false)}else{v.lineTo(s.x,s.y);v.lineTo(q.x,q.y)}v.fillStyle=o.bg(l,g);v.moveTo(u,r);v.fill();v.closePath()}if(o.lines.call(this,l)){v.lineWidth=1;v.beginPath();if(n=="arc"){v.arc(u,r,m,c,a,false)}else{v.moveTo(s.x,s.y);v.lineTo(q.x,q.y)}v.strokeStyle=o.lineColor.call(this,l);v.stroke()}},_drawRadarScaleLabel:function(A,q,n,c,o,v){var w=this.canvases.scale.renderText(0,0,v,"dhx_axis_radar_title",1);var g=w.scrollWidth;var u=w.offsetHeight;var s=0.001;var m=this._getPositionByAngle(o,q,n,c+5);var l=0,j=0;if(o<0||o>Math.PI){j=-u}if(o>Math.PI/2){l=-g}if(Math.abs(o+Math.PI/2)<s||Math.abs(o-Math.PI/2)<s){l=-g/2}else{if(Math.abs(o)<s||Math.abs(o-Math.PI)<s){j=-u/2}}w.style.top=m.y+j+"px";w.style.left=m.x+l+"px";w.style.width=g+"px";w.style.whiteSpace="nowrap"}};dhtmlx.chart.area={pvt_render_area:function(o,F,l,j,q,C){var s,A,u,r,m,y,n,E,D,x,w,c,v,a,g;y=this._calculateLineParams(o,F,l,j,q);A=this._settings;r=(A.eventRadius||Math.floor(y.cellWidth/2));if(F.length){n=[];x=(!A.offset?l.x:l.x+y.cellWidth*0.5);for(u=0;u<F.length;u++){m=F[u];D=this._getPointY(m,l,j,y);v=x+y.cellWidth*u;if(D){a=(typeof D=="object"?D.y0:D);if(u&&this._settings.fixOverflow){E=this._getPointY(F[u-1],l,j,y);if(E.out&&E.out==D.out){continue}w=y.cellWidth*(u-1)-0.5+x;c=(typeof E=="object"?E.y0:E);if(E.out){g=(E.out=="min"?j.y:l.y);n.push([this._calcOverflowX(w,v,c,a,g),g])}if(D.out){g=(D.out=="min"?j.y:l.y);n.push([this._calcOverflowX(w,v,c,a,g),g]);if(u==(F.length-1)&&g==l.y){n.push([v,l.y])}}}if(!D.out){n.push([v,a]);C.addRect(m.id,[v-r-l.x,a-r-l.y,v+r-l.x,a+r-l.y],q)}if(!A.yAxis){s=(!A.offset&&(u==F.length-1)?"left":"center");this.canvases[q].renderTextAt(false,s,v,a-A.labelOffset,A.label(m))}}}if(n.length){n.push([v,j.y]);n.push([n[0][0],j.y])}o.globalAlpha=this._settings.alpha.call(this,F[0]);o.fillStyle=this._settings.color.call(this,F[0]);o.beginPath();this._path(o,n);o.fill();if(A.border){o.lineWidth=A.borderWidth||1;if(A.borderColor){o.strokeStyle=A.borderColor.call(this,F[0])}else{this._setBorderStyles(o,o.fillStyle)}o.beginPath();this._path(o,n);o.stroke()}o.lineWidth=1;o.globalAlpha=1}}};dhtmlx.chart.stackedArea={pvt_render_stackedArea:function(r,I,c,a,s,F){var K,J,w,E,C,A,m,v,n,D,q,l,g,o;D=this._calculateLineParams(r,I,c,a,s);E=this._settings;v=(E.eventRadius||Math.floor(D.cellWidth/2));if(I.length){q=[];o=[];l=(!E.offset?c.x:c.x+D.cellWidth*0.5);var H=function(j,x){return s?(I[j].$startY?x-a.y+I[j].$startY:0):x};var u=function(j,M,L){var y=(L.y-M.y)/(L.x-M.x);return y*j+M.y-y*M.x};for(C=0;C<I.length;C++){n=I[C];if(!C){g=H(C,a.y);q.push([l,g])}else{l+=D.cellWidth}g=H(C,this._getPointY(n,c,a,D));o.push((isNaN(g)&&!C)?(I[C].$startY||a.y):g);if(g){q.push([l,g]);F.addRect(n.id,[l-v-c.x,g-v-c.y,l+v-c.x,g+v-c.y],s);if(!E.yAxis){w=(!E.offset&&m?"left":"center");this.canvases[s].renderTextAt(false,w,l,g-E.labelOffset,E.label(n))}}}q.push([l,H(C-1,a.y)]);if(s){for(C=I.length-2;C>0;C--){l-=D.cellWidth;g=I[C].$startY;if(g){q.push([l,g])}}}q.push([q[0][0],q[0][1]]);r.globalAlpha=this._settings.alpha.call(this,I[0]);r.fillStyle=this._settings.color.call(this,I[0]);r.beginPath();this._path(r,q);r.fill();for(C=0;C<I.length;C++){g=o[C];if(!g){if(C==I.length-1){g=I[C].$startY}for(A=C+1;A<I.length;A++){if(o[A]){K={x:c.x,y:o[0]};J={x:(c.x+D.cellWidth*A),y:o[A]};g=u(c.x+D.cellWidth*C,K,J);break}}}I[C].$startY=g}}}};dhtmlx.chart.spline={pvt_render_spline:function(r,J,l,g,s,I){var H,v,q,u,F,o,n,C,A,w,m,c,a;F=this._calculateLineParams(r,J,l,g,s);H=this._settings;this._mapStart=l;q=[];if(J.length){C=(H.offset?l.x+F.cellWidth*0.5:l.x);for(v=0;v<J.length;v++){m=this._getPointY(J[v],l,g,F);if(m){n=((!v)?C:F.cellWidth*v-0.5+C);q.push({x:n,y:m,index:v})}}o=this._getSplineParameters(q);for(v=0;v<q.length;v++){A=q[v].x;c=q[v].y;if(v<q.length-1){w=q[v+1].x;a=q[v+1].y;for(u=A;u<w;u++){var E=this._getSplineYPoint(u,A,v,o.a,o.b,o.c,o.d);if(E<l.y){E=l.y}if(E>g.y){E=g.y}var D=this._getSplineYPoint(u+1,A,v,o.a,o.b,o.c,o.d);if(D<l.y){D=l.y}if(D>g.y){D=g.y}this._drawLine(r,u,E,u+1,D,H.line.color(J[v]),H.line.width)}this._drawLine(r,w-1,this._getSplineYPoint(u,A,v,o.a,o.b,o.c,o.d),w,a,H.line.color(J[v]),H.line.width)}this._drawItem(r,A,c,J[q[v].index],H.label(J[q[v].index]),s,I)}}},_getSplineParameters:function(y){var l,C,A,D,x,w,r,q,o=[],j=[],g=y.length;for(l=0;l<g-1;l++){o[l]=y[l+1].x-y[l].x;j[l]=(y[l+1].y-y[l].y)/o[l]}C=[];A=[];C[0]=0;C[1]=2*(o[0]+o[1]);A[0]=0;A[1]=6*(j[1]-j[0]);for(l=2;l<g-1;l++){C[l]=2*(o[l-1]+o[l])-o[l-1]*o[l-1]/C[l-1];A[l]=6*(j[l]-j[l-1])-o[l-1]*A[l-1]/C[l-1]}D=[];D[g-1]=D[0]=0;for(l=g-2;l>=1;l--){D[l]=(A[l]-o[l]*D[l+1])/C[l]}x=[];w=[];r=[];q=[];for(l=0;l<g-1;l++){x[l]=y[l].y;w[l]=-o[l]*D[l+1]/6-o[l]*D[l]/3+(y[l+1].y-y[l].y)/o[l];r[l]=D[l]/2;q[l]=(D[l+1]-D[l])/(6*o[l])}return{a:x,b:w,c:r,d:q}},_getSplineYPoint:function(j,m,n,l,g,q,o){return l[n]+(j-m)*(g[n]+(j-m)*(q[n]+(j-m)*o[n]))}};dhtmlx.chart.barH={pvt_render_barH:function(A,N,m,l,C,M){var r,u,E,D,a,H,o,K,v,L,c,x,n,I,w,j,y,s,J,g,q;E=(l.y-m.y)/N.length;o=this._getLimits("h");K=o.max;v=o.min;j=l.x-m.x;q=!!this._settings.yAxis;if(!C){this._drawHScales(A,N,m,l,v,K,E)}if(q){K=parseFloat(this._settings.xAxis.end);v=parseFloat(this._settings.xAxis.start)}I=this._getRelativeValue(v,K);x=I[0];c=I[1];s=(x?j/x:10);if(!q){w=10;s=(x?(j-w)/x:10)}u=parseInt(this._settings.width,10);if((u*this._series.length+4)>E){u=E/this._series.length-4}r=Math.floor((E-u*this._series.length)/2);n=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));L=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){L=a;a=false}else{if(a){a=A.createLinearGradient(m.x,m.y,l.x,m.y);this._settings.gradient(a)}}if(!q){this._drawLine(A,m.x-0.5,m.y,m.x-0.5,l.y,"#000000",1)}for(H=0;H<N.length;H++){y=parseFloat(this._settings.value(N[H]||0));if(y>K){y=K}y-=v;y*=c;J=m.x;g=m.y+r+H*E+(u+1)*C;if((y<0&&this._settings.origin=="auto")||(this._settings.xAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt("middle","right",J+10,g+u/2+r,this._settings.label(N[H]));continue}if(y<0&&this._settings.origin!="auto"&&this._settings.origin>v){y=0}if(!q){y+=w/s}D=a||this._settings.color.call(this,N[H]);if(this._settings.border){this._drawBarHBorder(A,J,g,u,v,n,s,y,D)}A.globalAlpha=this._settings.alpha.call(this,N[H]);var F=this._drawBarH(A,l,J,g,u,v,n,s,y,D,a,L);if(L!=false){this._drawBarHGradient(A,J,g,u,v,n,s,y,D,L)}A.globalAlpha=1;if(F[3]==g){this.canvases[C].renderTextAt("middle","left",F[0]-5,F[3]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,F[3]-m.y,F[2]-m.x,F[3]+u-m.y],C)}else{this.canvases[C].renderTextAt("middle",false,F[2]+5,F[1]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,g-m.y,F[2]-m.x,F[3]-m.y],C)}}},_setBarHPoints:function(x,j,v,y,n,w,u,m,l){var c=0;if(n>w*u){var s=(n-w*u)/n;c=-Math.asin(s)+Math.PI/2}x.moveTo(j,v+m);var g=j+w*u-n-(n?0:m);if(n<w*u){x.lineTo(g,v+m)}var r=v+n;if(n&&n>0){x.arc(g,r,n-m,-Math.PI/2+c,0,false)}var q=v+y-n-(n?0:m);var a=g+n-(n?m:0);x.lineTo(a,q);if(n&&n>0){x.arc(g,q,n-m,0,Math.PI/2-c,false)}var o=v+y-m;x.lineTo(j,o);if(!l){x.lineTo(j,v+m)}return[a,o]},_drawHScales:function(g,n,m,l,o,c,j){var a=0;if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj)}a=this._drawHXAxis(this.canvases.x.getCanvas(),n,m,l,o,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),n,m,l,j,a)}},_drawHYAxis:function(u,l,q,n,g,a){if(!this._settings.yAxis){return}var m;var c=parseInt((a?a:q.x),10)-0.5;var r=n.y+0.5;var o=q.y;this._drawLine(u,c,r,c,o,this._settings.yAxis.color,1);for(var j=0;j<l.length;j++){var s=((this._settings.origin!="auto")&&(this._settings.view=="barH")&&(parseFloat(this._settings.value(l[j]))<this._settings.origin));m=o+g/2+j*g;this.canvases.y.renderTextAt("middle",(s?false:"left"),(s?c+5:c-5),m,this._settings.yAxis.template(l[j]),"dhx_axis_item_y",(s?0:c-10));if(this._settings.yAxis.lines.call(this,l[j])){this._drawLine(u,q.x,m,n.x,m,this._settings.yAxis.lineColor.call(this,l[j]),1)}}this._drawLine(u,q.x+0.5,o+0.5,n.x,o+0.5,this._settings.yAxis.lineColor.call(this,{}),1);this._setYAxisTitle(q,n)},_drawHXAxis:function(C,u,y,x,g,q){var n;var l={};var o=this._settings.xAxis;if(!o){return}var A=x.y+0.5;var j=y.x-0.5;var a=x.x-0.5;var s=y.x;this._drawLine(C,j,A,a,A,o.color,1);if(o.step){n=parseFloat(o.step)}if(typeof this._configXAxis.step=="undefined"||typeof this._configXAxis.start=="undefined"||typeof this._configXAxis.end=="undefined"){l=this._calculateScale(g,q);g=l.start;q=l.end;n=l.step;this._settings.xAxis.end=q;this._settings.xAxis.start=g;this._settings.xAxis.step=n}if(n===0){return}var m=(a-j)*n/(q-g);var w=0;for(var r=g;r<=q;r+=n){if(l.fixNum){r=parseFloat((new Number(r)).toFixed(l.fixNum))}var v=Math.floor(j+w*m)+0.5;if(!(r==g&&this._settings.origin=="auto")&&o.lines.call(this,r)){this._drawLine(C,v,A,v,y.y,this._settings.xAxis.lineColor.call(this,r),1)}if(r==this._settings.origin){s=v+1}this.canvases.x.renderTextAt(false,true,v,A+2,o.template(r.toString()),"dhx_axis_item_x");w++}this.canvases.x.renderTextAt(true,false,j,x.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",x.x-y.x);if(!o.lines.call(this,{})){this._drawLine(C,j,y.y-0.5,a,y.y-0.5,this._settings.xAxis.color,0.2)}return s},_correctBarHParams:function(o,l,g,m,n,q,j){var a=this._settings.yAxis;var c=l;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>j)){l+=(this._settings.origin-j)*n;c=l;m=m-(this._settings.origin-j);if(m<0){m*=(-1);o.translate(l,g+q);o.rotate(Math.PI);l=0.5;g=0}l+=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBarH:function(v,l,C,j,q,r,m,o,u,w,a,n){v.save();var s=this._correctBarHParams(v,C,j,u,o,q,r);v.fillStyle=w;v.beginPath();var x=this._setBarHPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(l.x,s.y0+(this._settings.border?1:0))}v.fill();v.restore();var g=s.y0;var c=(s.y0!=j?j:x[1]);var A=(s.y0!=j?(s.start-x[0]):s.start);var y=(s.y0!=j?s.start:x[0]);return[A,g,y,c]},_drawBarHBorder:function(q,c,n,r,l,j,o,m,g){q.save();var a=this._correctBarHParams(q,c,n,m,o,r,l);q.beginPath();this._setBorderStyles(q,g);q.globalAlpha=0.9;this._setBarHPoints(q,a.x0,a.y0,r,j,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarHGradient:function(s,g,q,u,n,m,r,o,j,a){s.save();var c=this._correctBarHParams(s,g,q,o,r,u,n);var l=this._setBarGradient(s,c.x0,c.y0+u,c.x0+r*c.value,c.y0,a,j,"x");s.fillStyle=l.gradient;s.beginPath();this._setBarHPoints(s,c.x0,c.y0+l.offset,u-l.offset*2,m,r,c.value,l.offset);s.fill();s.globalAlpha=1;s.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(D,Q,l,j,E,P){var O,w;var c;var x;var A=j.x-l.x;var o=!!this._settings.yAxis;var n=this._getStackedLimits(Q);O=n.max;w=n.min;var H=Math.floor((j.y-l.y)/Q.length);if(!E){this._drawHScales(D,Q,l,j,w,O,H)}if(o){O=parseFloat(this._settings.xAxis.end);w=parseFloat(this._settings.xAxis.start)}var L=this._getRelativeValue(w,O);x=L[0];c=L[1];var u=(x?A/x:10);if(!o){var y=10;u=(x?(A-y)/x:10)}var v=parseInt(this._settings.width,10);if((v+4)>H){v=H-4}var q=(H-v)/2;var m=0;var r=false;var a=this._settings.gradient;if(a){r=true}if(!o){this._drawLine(D,l.x-0.5,l.y,l.x-0.5,j.y,"#000000",1)}var N=0;var K=0;for(J=0;J<this._series.length;J++){if(J==E){K=N}if(this._series[J].view=="stackedBarH"){N++}}for(var J=0;J<Q.length;J++){if(!K){Q[J].$startX=l.x}var C=parseFloat(this._settings.value(Q[J]||0));if(C>O){C=O}C-=w;C*=c;var M=l.x;var g=l.y+q+J*H;if(!K){Q[J].$startX=M}else{M=Q[J].$startX}if(C<0||(this._settings.yAxis&&C===0)){this.canvases.y.renderTextAt("middle",true,M+10,g+v/2,this._settings.label(Q[J]));continue}if(!o){C+=y/u}var F=this._settings.color.call(this,Q[J]);D.globalAlpha=this._settings.alpha.call(this,Q[J]);D.fillStyle=this._settings.color.call(this,Q[J]);D.beginPath();var I=this._setBarHPoints(D,M,g,v,m,u,C,(this._settings.border?1:0));if(a&&!r){D.lineTo(l.x+A,g+(this._settings.border?1:0))}D.fill();if(r!=false){var s=this._setBarGradient(D,M,g+v,M,g,r,F,"x");D.fillStyle=s.gradient;D.beginPath();I=this._setBarHPoints(D,M,g,v,m,u,C,0);D.fill()}if(this._settings.border){this._drawBarHBorder(D,M,g,v,w,m,u,C,F)}D.globalAlpha=1;this.canvases[E].renderTextAt("middle",true,Q[J].$startX+(I[0]-Q[J].$startX)/2-1,g+(I[1]-g)/2,this._settings.label(Q[J]));P.addRect(Q[J].id,[Q[J].$startX-l.x,g-l.y,I[0]-l.x,I[1]-l.y],E);Q[J].$startX=I[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(y,M,j,g,A,L){var J,u;var a;var v;var w=g.y-j.y;var m=!!this._settings.yAxis;var K=!!this._settings.xAxis;var l=this._getStackedLimits(M);J=l.max;u=l.min;var D=Math.floor((g.x-j.x)/M.length);if(!A){this._drawScales(M,j,g,u,J,D)}if(m){J=parseFloat(this._settings.yAxis.end);u=parseFloat(this._settings.yAxis.start)}var H=this._getRelativeValue(u,J);v=H[0];a=H[1];var r=(v?w/v:10);var s=parseInt(this._settings.width,10);if(s+4>D){s=D-4}var n=Math.floor((D-s)/2);var o=(this._settings.gradient?this._settings.gradient:false);if(!K){this._drawLine(y,j.x,g.y+0.5,g.x,g.y+0.5,"#000000",1)}for(var F=0;F<M.length;F++){var x=parseFloat(this._settings.value(M[F]||0));if(!x){if(!A||!M[F].$startY){M[F].$startY=g.y}continue}if(!A){x-=u}x*=a;var I=j.x+n+F*D;var c=g.y;if(!A){M[F].$startY=c}else{c=M[F].$startY}if(c<(j.y+1)){continue}if(x<0||(this._settings.yAxis&&x===0)){this.canvases.y.renderTextAt(true,true,I+Math.floor(s/2),c,this._settings.label(M[F]));continue}var C=this._settings.color.call(this,M[F]);y.globalAlpha=this._settings.alpha.call(this,M[F]);y.fillStyle=this._settings.color.call(this,M[F]);y.beginPath();var E=this._setStakedBarPoints(y,I-(this._settings.border?0.5:0),c,s+(this._settings.border?0.5:0),r,x,0,j.y);y.fill();if(o){y.save();var q=this._setBarGradient(y,I,c,I+s,E[1],o,C,"y");y.fillStyle=q.gradient;y.beginPath();E=this._setStakedBarPoints(y,I+q.offset,c,s-q.offset*2,r,x,(this._settings.border?1:0),j.y);y.fill();y.restore()}if(this._settings.border){y.save();this._setBorderStyles(y,C);y.beginPath();this._setStakedBarPoints(y,I-0.5,c,s+1,r,x,0,j.y,1);y.stroke();y.restore()}y.globalAlpha=1;this.canvases[A].renderTextAt(false,true,I+Math.floor(s/2),(E[1]+(c-E[1])/2)-7,this._settings.label(M[F]));L.addRect(M[F].id,[I-j.x,E[1]-j.y,E[0]-j.x,(M[F].$startY||c)-j.y],A);M[F].$startY=(this._settings.border?(E[1]+1):E[1])}},_setStakedBarPoints:function(u,c,q,v,r,o,j,g,l){u.moveTo(c,q);var n=q-r*o+j;if(n<g){n=g}u.lineTo(c,n);var a=c+v;var m=n;u.lineTo(a,m);var s=c+v;u.lineTo(s,q);if(!l){u.lineTo(c,q)}return[s,m-2*j]}};dhtmlx.chart.line={pvt_render_line:function(n,C,l,j,o,y){var x,q,m,v,u,s,r,c,a,g,A,w;v=this._calculateLineParams(n,C,l,j,o);x=this._settings;if(C.length){u=(x.offset?l.x+v.cellWidth*0.5:l.x);m=[];for(q=0;q<C.length;q++){w=this._getPointY(C[q],l,j,v);if(w){r=((!q)?u:v.cellWidth*q-0.5+u);a=(typeof w=="object"?w.y0:w);if(q&&this._settings.fixOverflow){A=this._getPointY(C[q-1],l,j,v);if(A.out&&A.out==w.out){continue}s=v.cellWidth*(q-1)-0.5+u;c=(typeof A=="object"?A.y0:A);if(A.out){g=(A.out=="min"?j.y:l.y);m.push({x:this._calcOverflowX(s,r,c,a,g),y:g})}if(w.out){g=(w.out=="min"?j.y:l.y);m.push({x:this._calcOverflowX(s,r,c,a,g),y:g})}}if(!w.out){m.push({x:r,y:w,index:q})}}}this._mapStart=l;for(q=1;q<=m.length;q++){s=m[q-1].x;c=m[q-1].y;if(q<m.length){r=m[q].x;a=m[q].y;this._drawLine(n,s,c,r,a,x.line.color.call(this,C[q-1]),x.line.width);if(x.line&&x.line.shadow){n.globalAlpha=0.3;this._drawLine(n,s+2,c+x.line.width+8,r+2,a+x.line.width+8,"#eeeeee",x.line.width+3);n.globalAlpha=1}}if(typeof m[q-1].index!="undefined"){this._drawItem(n,s,c,C[m[q-1].index],x.label(C[m[q-1].index]),o,y,l)}}}},_calcOverflowX:function(c,a,j,g,l){return c+(l-j)*(a-c)/(g-j)},_drawItem:function(v,g,u,q,s,r,c){var j=this._settings.item;var o=parseInt(j.radius.call(this,q),10)||0;var n=this._mapStart;if(o){v.save();if(j.shadow){v.lineWidth=1;v.strokeStyle="#bdbdbd";v.fillStyle="#bdbdbd";var a=[0.1,0.2,0.3];for(var m=(a.length-1);m>=0;m--){v.globalAlpha=a[m];v.strokeStyle="#d0d0d0";v.beginPath();this._strokeChartItem(v,g,u+2*o/3,o+m+1,j.type);v.stroke()}v.beginPath();v.globalAlpha=0.3;v.fillStyle="#bdbdbd";this._strokeChartItem(v,g,u+2*o/3,o+1,j.type);v.fill()}v.restore();v.lineWidth=j.borderWidth;v.fillStyle=j.color.call(this,q);v.strokeStyle=j.borderColor.call(this,q);v.globalAlpha=j.alpha.call(this,q);v.beginPath();this._strokeChartItem(v,g,u,o+1,j.type);v.fill();v.stroke();v.globalAlpha=1}if(s){this.canvases[r].renderTextAt(false,true,g,u-o-this._settings.labelOffset,this._settings.label.call(this,q))}var l=(this._settings.eventRadius||o+1);c.addRect(q.id,[g-l-n.x,u-l-n.y,g+l-n.x,u+l-n.y],r)},_strokeChartItem:function(a,c,l,j,g){var m=[];c=parseInt(c,10);l=parseInt(l,10);if(g&&(g=="square"||g=="s")){j*=Math.sqrt(2)/2;m=[[c-j-a.lineWidth/2,l-j],[c+j,l-j],[c+j,l+j],[c-j,l+j],[c-j,l-j]]}else{if(g&&(g=="diamond"||g=="d")){var n=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);m=[[c,l-j],[c+j,l],[c,l+j],[c-j,l],[c+n,l-j-n]]}else{if(g&&(g=="triangle"||g=="t")){m=[[c,l-j],[c+Math.sqrt(3)*j/2,l+j/2],[c-Math.sqrt(3)*j/2,l+j/2],[c,l-j]]}else{m=[[c,l,j,0,Math.PI*2,true]]}}}this._path(a,m)},_getPointY:function(g,o,m,a){var n=a.minValue;var j=a.maxValue;var r=a.unit;var c=a.valueFactor;var q=this._settings.value(g);var s=(parseFloat(q||0)-n)*c;if(!this._settings.yAxis){s+=a.startValue/r}var l=m.y-r*s;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(q>j){l={y:o.y,y0:l,out:"max"}}else{if(s<0||q<n){l={y:m.y,y0:l,out:"min"}}}}else{if(q>j){l=o.y}if(s<0||q<n){l=m.y}}return l},_calculateLineParams:function(q,j,n,m,l){var c={};var r;c.totalHeight=m.y-n.y;c.cellWidth=(m.x-n.x)/((!this._settings.offset)?(j.length-1):j.length);var g=!!this._settings.yAxis;var a=(this._settings.view.indexOf("stacked")!=-1?this._getStackedLimits(j):this._getLimits());c.maxValue=a.max;c.minValue=a.min;if(!l){this._drawScales(j,n,m,c.minValue,c.maxValue,c.cellWidth)}if(g){c.maxValue=parseFloat(this._settings.yAxis.end);c.minValue=parseFloat(this._settings.yAxis.start)}var o=this._getRelativeValue(c.minValue,c.maxValue);r=o[0];c.valueFactor=o[1];c.unit=(r?c.totalHeight/r:10);c.startValue=0;if(!g){c.startValue=10;if(c.unit!=c.totalHeight){c.unit=(r?(c.totalHeight-c.startValue)/r:10)}}return c}};dhtmlx.chart.bar={pvt_render_bar:function(A,Q,l,j,C,P){var u,E,I,n,N,v,w,c,J,x,s,M,o,O=j.y-l.y;o=!!this._settings.yAxis;M=!!this._settings.xAxis;n=this._getLimits();N=n.max;v=n.min;E=(j.x-l.x)/Q.length;if(!C&&!(this._settings.origin!="auto"&&!o)){this._drawScales(Q,l,j,v,N,E)}if(o){N=parseFloat(this._settings.yAxis.end);v=parseFloat(this._settings.yAxis.start)}J=this._getRelativeValue(v,N);w=J[0];c=J[1];s=(w?O/w:w);if(!o&&!(this._settings.origin!="auto"&&M)){x=10;s=(w?(O-x)/w:x)}if(!C&&(this._settings.origin!="auto"&&!o)&&this._settings.origin>v){this._drawXAxis(A,Q,l,j,E,j.y-s*(this._settings.origin-v))}u=parseInt(this._settings.width,10);var L=0;var H=0;for(I=0;I<this._series.length;I++){if(I==C){H=L}if(this._series[I].view=="bar"){L++}}if(this._series&&(u*L+4)>E){u=parseInt(E/L-4,10)}var q=(E-u*L)/2;var m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));var r=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){r=a;a=false}else{if(a){a=A.createLinearGradient(0,j.y,0,l.y);this._settings.gradient(a)}}if(!M){this._drawLine(A,l.x,j.y+0.5,j.x,j.y+0.5,"#000000",1)}for(I=0;I<Q.length;I++){var y=parseFloat(this._settings.value(Q[I])||0);if(isNaN(y)){continue}if(y>N){y=N}y-=v;y*=c;var K=l.x+q+parseInt(I*E,10)+(u+1)*H;var g=j.y;if(y<0||(this._settings.yAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),g,this._settings.label(Q[I]));continue}if(!o&&!(this._settings.origin!="auto"&&M)){y+=x/s}var D=a||this._settings.color.call(this,Q[I]);A.globalAlpha=this._settings.alpha.call(this,Q[I]);var F=this._drawBar(A,l,K,g,u,v,m,s,y,D,a,r);if(r){this._drawBarGradient(A,K,g,u,v,m,s,y,D,r)}if(this._settings.border){this._drawBarBorder(A,K,g,u,v,m,s,y,D)}A.globalAlpha=1;if(F[0]!=K){this.canvases[C].renderTextAt(false,true,K+Math.floor(u/2),F[1],this._settings.label(Q[I]))}else{this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),F[3],this._settings.label(Q[I]))}P.addRect(Q[I].id,[K-l.x,F[3]-l.y,F[2]-l.x,F[1]-l.y],C)}},_correctBarParams:function(o,l,g,m,n,q,j){var a=this._settings.xAxis;var c=g;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>j)){g-=(this._settings.origin-j)*n;c=g;m=m-(this._settings.origin-j);if(m<0){m*=(-1);o.translate(l+q,g);o.rotate(Math.PI);l=0;g=0}g-=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBar:function(v,l,C,j,q,r,m,o,u,w,a,n){v.save();v.fillStyle=w;var s=this._correctBarParams(v,C,j,u,o,q,r);var x=this._setBarPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(s.x0+(this._settings.border?1:0),l.y)}v.fill();v.restore();var A=s.x0;var y=(s.x0!=C?C+x[0]:x[0]);var g=(s.x0!=C?(s.start-x[1]-s.y0):s.y0);var c=(s.x0!=C?s.start-s.y0:x[1]);return[A,g,y,c]},_drawBarBorder:function(q,c,n,r,l,j,o,m,g){var a;q.save();a=this._correctBarParams(q,c,n,m,o,r,l);this._setBorderStyles(q,g);this._setBarPoints(q,a.x0,a.y0,r,j,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarGradient:function(u,j,r,v,o,n,s,q,l,c){u.save();var g=this._correctBarParams(u,j,r,q,s,v,o);var m=this._setBarGradient(u,g.x0,g.y0,g.x0+v,g.y0-s*g.value+2,c,l,"y");var a=this._settings.border?1:0;u.fillStyle=m.gradient;this._setBarPoints(u,g.x0+m.offset,g.y0,v-m.offset*2,n,s,g.value,m.offset+a);u.fill();u.restore()},_setBarPoints:function(x,j,u,y,o,v,s,l,n){x.beginPath();var c=0;if(o>v*s){var m=(o-v*s)/o;if(m<=1&&m>=-1){c=-Math.acos(m)+Math.PI/2}}x.moveTo(j+l,u);var r=u-Math.floor(v*s)+o+(o?0:l);if(o<v*s){x.lineTo(j+l,r)}var g=j+o;if(o&&o>0){x.arc(g,r,o-l,-Math.PI+c,-Math.PI/2,false)}var a=j+y-o-l;var q=r-o+(o?l:0);x.lineTo(a,q);if(o&&o>0){x.arc(a,r,o-l,-Math.PI/2,0-c,false)}var w=j+y-l;x.lineTo(w,u);if(!n){x.lineTo(j+l,u)}return[w,q]}};dhtmlx.chart.pie={pvt_render_pie:function(c,j,a,m,g,l){this._renderPie(c,j,a,m,1,l,g)},_renderPie:function(s,F,l,j,D,E,u){if(!F.length){return}var v=this._getPieParameters(l,j);var n=(this._settings.radius?this._settings.radius:v.radius);if(n<0){return}var a=this._getValues(F);var m=this._getTotalValue(a);var o=this._getRatios(a,m);var C=(this._settings.x?this._settings.x:v.x);var g=(this._settings.y?this._settings.y:v.y);if(D==1&&this._settings.shadow){this._addShadow(s,C,g,n)}g=g/D;var r=-Math.PI/2;var x=[];s.scale(1,D);if(this._settings.gradient){var A=(D!=1?C+n/3:C);var c=(D!=1?g+n/3:g);this._showRadialGradient(s,C,g,n,A,c)}for(var y=0;y<F.length;y++){if(!a[y]){continue}s.strokeStyle=this._settings.lineColor.call(this,F[y]);s.beginPath();s.moveTo(C,g);x.push(r);alpha1=-Math.PI/2+o[y]-0.0001;s.arc(C,g,n,r,alpha1,false);s.lineTo(C,g);var w=this._settings.color.call(this,F[y]);s.fillStyle=w;s.fill();if(this._settings.pieInnerText){this._drawSectorLabel(C,g,5*n/6,r,alpha1,D,this._settings.pieInnerText(F[y],m),true)}if(this._settings.label){this._drawSectorLabel(C,g,n+this._settings.labelOffset,r,alpha1,D,this._settings.label(F[y]))}if(D!=1){this._createLowerSector(s,C,g,r,alpha1,n,true);s.fillStyle="#000000";s.globalAlpha=0.2;this._createLowerSector(s,C,g,r,alpha1,n,false);s.globalAlpha=1;s.fillStyle=w}E.addSector(F[y].id,r,alpha1,C-l.x,g-l.y/D,n,D,u);r=alpha1}s.globalAlpha=0.8;var q;for(y=0;y<x.length;y++){q=this._getPositionByAngle(x[y],C,g,n);this._drawLine(s,C,g,q.x,q.y,this._settings.lineColor.call(this,F[y]),2)}if(D==1){s.lineWidth=2;s.strokeStyle="#ffffff";s.beginPath();s.arc(C,g,n+1,0,2*Math.PI,false);s.stroke()}s.globalAlpha=1;s.scale(1,1/D)},_getValues:function(g){var a=[];for(var c=0;c<g.length;c++){a.push(parseFloat(this._settings.value(g[c])||0))}return a},_getTotalValue:function(a){var g=0;for(var c=0;c<a.length;c++){g+=a[c]}return g},_getRatios:function(c,a){var m;var l=[];var j=0;a=a||this._getTotalValue(c);for(var g=0;g<c.length;g++){m=c[g];l[g]=Math.PI*2*(a?((m+j)/a):(1/c.length));j+=m}return l},_getPieParameters:function(n,l){var j=l.x-n.x;var c=l.y-n.y;var g=n.x+j/2;var m=n.y+c/2;var a=Math.min(j/2,c/2);return{x:g,y:m,radius:a}},_createLowerSector:function(j,l,n,g,a,m,c){j.lineWidth=1;if(!((g<=0&&a>=0)||(g>=0&&a<=Math.PI)||(Math.abs(g-Math.PI)>0.003&&g<=Math.PI&&a>=Math.PI))){return}if(g<=0&&a>=0){g=0;c=false;this._drawSectorLine(j,l,n,m,g,a)}if(g<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(j,l,n,m,g,a)}var o=(this._settings.height||Math.floor(m/4))/this._settings.cant;j.beginPath();j.arc(l,n,m,g,a,false);j.lineTo(l+m*Math.cos(a),n+m*Math.sin(a)+o);j.arc(l,n+o,m,a,g,true);j.lineTo(l+m*Math.cos(g),n+m*Math.sin(g));j.fill();if(c){j.stroke()}},_drawSectorLine:function(g,j,m,l,c,a){g.beginPath();g.arc(j,m,l,c,a,false);g.stroke()},_addShadow:function(c,a,m,j){c.globalAlpha=0.5;var l=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var g=l.length-1;g>-1;g--){c.beginPath();c.fillStyle=l[g];c.arc(a+1,m+1,j+g,0,Math.PI*2,true);c.fill()}c.globalAlpha=1},_getGrayGradient:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},_showRadialGradient:function(g,c,n,a,j,l){g.beginPath();var m;if(typeof this._settings.gradient!="function"){m=g.createRadialGradient(j,l,a/4,c,n,a);m=this._getGrayGradient(m)}else{m=this._settings.gradient(m)}g.fillStyle=m;g.arc(c,n,a,0,Math.PI*2,true);g.fill();g.globalAlpha=0.7},_drawSectorLabel:function(E,c,j,A,w,F,v,a){var u=this.canvases[0].renderText(0,0,v,0,1);if(!u){return}var H=u.scrollWidth;u.style.width=H+"px";if(H>E){H=E}var C=(w-A<0.2?4:8);if(a){C=H/1.8}var g=A+(w-A)/2;j=j-(C-8)/2;var o=-C;var n=-8;var D="right";if(g>=Math.PI/2&&g<Math.PI||g<=3*Math.PI/2&&g>=Math.PI){o=-H-o+1;D="left"}var l=0;if(!a&&F<1&&(g>0&&g<Math.PI)){l=(this._settings.height||Math.floor(j/4))/F}var q=(c+Math.floor((j+l)*Math.sin(g)))*F+n;var r=E+Math.floor((j+C/2)*Math.cos(g))+o;var m=(w<Math.PI/2+0.01);var s=(A<Math.PI/2);if(s&&m){r=Math.max(r,E+3)}else{if(!s&&!m){r=Math.min(r,E-H)}else{if(!a&&(g>=Math.PI/2&&g<Math.PI||g<=3*Math.PI/2&&g>=Math.PI)){r+=H/3}}}u.style.top=q+"px";u.style.left=r+"px";u.style.width=H+"px";u.style.textAlign=D;u.style.whiteSpace="nowrap"}};dhtmlx.chart.pie3D={pvt_render_pie3D:function(c,j,a,m,g,l){this._renderPie(c,j,a,m,this._settings.cant,l)}};dhtmlx.chart.donut={pvt_render_donut:function(u,l,r,q,n,c){if(!l.length){return}this._renderPie(u,l,r,q,1,c);var j=this._settings;var m=this._getPieParameters(r,q);var a=(j.radius?j.radius:m.radius);var o=((j.innerRadius&&(j.innerRadius<a))?j.innerRadius:a/3);var g=(j.x?j.x:m.x);var s=(j.y?j.y:m.y);u.fillStyle="#ffffff";u.beginPath();u.arc(g,s,o,0,Math.PI*2,true);u.fill()}};dhtmlx.DataDriver.dhtmlxgrid={_grid_getter:"_get_cell_value",toObject:function(a){this._grid=a;return a},getRecords:function(a){return a.rowsBuffer},getDetails:function(g){var a={};for(var c=0;c<this._grid.getColumnsNum();c++){a["data"+c]=this._grid[this._grid_getter](g,c)}return a},getInfo:function(a){return{_size:0,_from:0}}};dhtmlx.ui.Canvas=function(c,g,l){this._canvas_labels=[];this._canvas_name=g;this._obj=c;var j=c.offsetWidth*(window.devicePixelRatio||1);var a=c.offsetHeight*(window.devicePixelRatio||1);var l=l||"";l+=";width:"+c.offsetWidth+"px;height:"+c.offsetHeight+"px;";this._prepareCanvas(g,l,j,a)};dhtmlx.ui.Canvas.prototype={_prepareCanvas:function(c,j,g,a){this._canvas=dhtmlx.html.create("canvas",{width:g,height:a,canvas_id:c,style:(j||"")});this._obj.appendChild(this._canvas);if(!this._canvas.getContext){if(dhtmlx._isIE){dhtmlx.require("thirdparty/excanvas/excanvas.js");G_vmlCanvasManager.init_(document);G_vmlCanvasManager.initElement(this._canvas)}else{dhtmlx.error("Canvas is not supported in the current browser")}}return this._canvas},getCanvas:function(c){var a=(this._canvas||this._prepareCanvas()).getContext(c||"2d");if(!this._webixDevicePixelRatio){this._webixDevicePixelRatio=true;a.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)}return a},_resizeCanvas:function(){if(this._canvas){var a=this._canvas.parentNode.offsetWidth;var c=this._canvas.parentNode.offsetHeight;this._canvas.setAttribute("width",a*(window.devicePixelRatio||1));this._canvas.setAttribute("height",c*(window.devicePixelRatio||1));this._canvas.style.width=a+"px";this._canvas.style.height=c+"px";this._webixDevicePixelRatio=false}},renderText:function(a,m,l,j,c){if(!l){return}var g=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(j?(" "+j):""),style:"left:"+a+"px; top:"+m+"px;"},l);this._obj.appendChild(g);this._canvas_labels.push(g);if(c){g.style.width=c+"px"}return g},renderTextAt:function(l,q,a,o,j,n,g){var m=this.renderText.call(this,a,o,j,n,g);if(m){if(l){if(l=="middle"){m.style.top=parseInt(o-m.offsetHeight/2,10)+"px"}else{m.style.top=o-m.offsetHeight+"px"}}if(q){if(q=="left"){m.style.left=a-m.offsetWidth+"px"}else{m.style.left=parseInt(a-m.offsetWidth/2,10)+"px"}}}return m},clearCanvas:function(a){var c=[],g;for(g=0;g<this._canvas_labels.length;g++){this._obj.removeChild(this._canvas_labels[g])}this._canvas_labels=[];if(!a&&this._obj._htmlmap){c=this._getMapAreas();while(c.length){c[0].parentNode.removeChild(c[0]);c.splice(0,1)}c=null;if(!this._obj._htmlmap.getElementsByTagName("AREA").length){this._obj._htmlmap.parentNode.removeChild(this._obj._htmlmap);this._obj._htmlmap=null}}this.getCanvas().clearRect(0,0,this._obj.offsetWidth*(window.devicePixelRatio||1),this._obj.offsetWidth*(window.devicePixelRatio||1))},toggleCanvas:function(){this._toggleCanvas(this._canvas.style.display=="none")},showCanvas:function(){this._toggleCanvas(true)},hideCanvas:function(){this._toggleCanvas(false)},_toggleCanvas:function(a){var c,g;for(g=0;g<this._canvas_labels.length;g++){this._canvas_labels[g].style.display=(a?"":"none")}if(this._obj._htmlmap){c=this._getMapAreas();for(g=0;g<c.length;g++){if(a){c[g].removeAttribute("disabled")}else{c[g].setAttribute("disabled","true")}}}this._canvas.style.display=(a?"":"none")},_getMapAreas:function(){var g=[],a,c;a=this._obj._htmlmap.getElementsByTagName("AREA");for(c=0;c<a.length;c++){if(a[c].getAttribute("userdata")==this._canvas_name){g.push(a[c])}}return g}};dhtmlXChart=function(a){this.name="Chart";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,true);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);for(var c in dhtmlx.chart){dhtmlx.extend(this,dhtmlx.chart[c])}if(a.preset){this.definePreset(a)}this._parseSettings(a,this.defaults);this._series=[this._settings];this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this));this.attachEvent("onLocateData",this._switchSerie)};dhtmlXChart.prototype={_id:"dhx_area_id",on_click:{dhx_chart_legend_item:function(m,n,l){var j=l.getAttribute("series_id");if(this.callEvent("onLegendClick",[m,j,l])){var g=this._settings;var c=g.legend.values;var a=(c&&(typeof c[j].toggle!="undefined"))?c[j].toggle:g.legend.toggle;if((typeof j!="undefined")&&this._series.length>1){if(a){if(l.className.indexOf("hidden")!=-1){this.showSeries(j)}else{this.hideSeries(j)}}}}}},on_dblclick:{},on_mouse_move:{},bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},resize:function(){for(var a in this.canvases){this.canvases[a]._resizeCanvas()}this.render()},view_setter:function(a){if(!dhtmlx.chart[a]){dhtmlx.error("Chart type extension is not loaded: "+a)}if(typeof this._settings.offset=="undefined"){this._settings.offset=!(a=="area"||a=="stackedArea")}if(a=="radar"&&!this._settings.yAxis){this.define("yAxis",{})}if(a=="scatter"){if(!this._settings.yAxis){this.define("yAxis",{})}if(!this._settings.xAxis){this.define("xAxis",{})}}return a},clearCanvas:function(){if(this.canvases&&typeof this.canvases=="object"){for(var a in this.canvases){this.canvases[a].clearCanvas()}}},render:function(){var g,c,j,l,a;if(!this.callEvent("onBeforeRender",[this.data])){return}if(this.canvases&&typeof this.canvases=="object"){for(c in this.canvases){this.canvases[c].clearCanvas()}}else{this.canvases={}}if(this._settings.legend){if(!this.canvases.legend){this.canvases.legend=new dhtmlx.ui.Canvas(this._obj,"legend")}this._drawLegend(this.data.getRange(),this._obj.offsetWidth)}g=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);l=new dhtmlx.ui.Map(this._id);a=this._settings;j=this._getChartData();for(c=0;c<this._series.length;c++){this._settings=this._series[c];if(!this.canvases[c]){this.canvases[c]=new dhtmlx.ui.Canvas(this._obj,c,"z-index:"+(2+c))}this["pvt_render_"+this._settings.view](this.canvases[c].getCanvas(),j,g.start,g.end,c,l)}l.render(this._obj);this._obj.lastChild.style.zIndex=1000;this._applyBounds(this._obj.lastChild,g);this.callEvent("onAfterRender",[]);this._settings=a},_applyBounds:function(g,c){var a={};a.left=c.start.x;a.top=c.start.y;a.width=c.end.x-c.start.x;a.height=c.end.y-c.start.y;for(var j in a){g.style[j]=a[j]+"px"}},_getChartData:function(){var j,n,g,l,m,r,a,o,q,c;l=this.data.getRange();j=(this._settings.view.toLowerCase().indexOf("barh")!=-1?"yAxis":"xAxis");n=this._settings[j];if(n&&n.units&&(typeof n.units=="object")){g=n.units;o=[];if(typeof g.start!="undefined"&&typeof g.end!="undefined"&&typeof g.next!="undefined"){a=g.start;while(a<=g.end){o.push(a);a=g.next.call(this,a)}}else{if(Object.prototype.toString.call(g)==="[object Array]"){o=g}}r=[];if(o.length){q=n.value;c={};for(m=0;m<l.length;m++){c[q(l[m])]=m}for(m=0;m<o.length;m++){if(typeof c[o[m]]!="undefined"){l[c[o[m]]].$unit=o[m];r.push(l[c[o[m]]])}else{r.push({$unit:o[m]})}}}return r}return l},value_setter:dhtmlx.Template.obj_setter,xValue_setter:dhtmlx.Template.obj_setter,yValue_setter:function(a){this.define("value",a)},alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,borderColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,gradient_setter:function(a){if((typeof(a)!="function")&&a&&(a===true)){a="light"}return a},colormap:{RAINBOW:function(a){var c=Math.floor(this.indexById(a.id)/this.dataCount()*1536);if(c==1536){c-=1}return this._rainbow[Math.floor(c/256)](c%256)}},color_setter:function(a){return this.colormap[a]||dhtmlx.Template.obj_setter(a)},fill_setter:function(a){return((!a||a==0)?false:dhtmlx.Template.obj_setter(a))},definePreset:function(a){this.define("preset",a.preset);delete a.preset},preset_setter:function(l){var g,c,j;this.defaults=dhtmlx.extend({},this.defaults);if(typeof dhtmlx.presets.chart[l]=="object"){j=dhtmlx.presets.chart[l];for(g in j){if(typeof j[g]=="object"){if(!this.defaults[g]||typeof this.defaults[g]!="object"){this.defaults[g]=dhtmlx.extend({},j[g])}else{this.defaults[g]=dhtmlx.extend({},this.defaults[g]);for(c in j[g]){this.defaults[g][c]=j[g][c]}}}else{this.defaults[g]=j[g]}}return l}return false},legend_setter:function(a){if(!a){if(this.legendObj){this.legendObj.innerHTML="";this.legendObj=null}return false}if(typeof(a)!="object"){a={template:a}}this._mergeSettings(a,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:(this._settings.view.toLowerCase().indexOf("stacked")!=-1?"":"hide"),marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3});a.template=dhtmlx.Template.setter(a.template);return a},defaults:{color:"RAINBOW",alpha:"1",label:false,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:30,labelWidth:100,line:{width:2,color:"#1293f8"},item:{radius:3,borderColor:"#636363",borderWidth:1,color:"#ffffff",alpha:1,type:"r",shadow:false},shadow:true,gradient:false,border:true,labelOffset:20,origin:"auto"},item_setter:function(a){if(typeof(a)!="object"){a={color:a,borderColor:a}}this._mergeSettings(a,dhtmlx.extend({},this.defaults.item));var g=["alpha","borderColor","color","radius"];for(var c=0;c<g.length;c++){a[g[c]]=dhtmlx.Template.setter(a[g[c]])}return a},line_setter:function(a){if(typeof(a)!="object"){a={color:a}}dhtmlx.extend(this.defaults.line,a);a=dhtmlx.extend({},this.defaults.line);a.color=dhtmlx.Template.setter(a.color);return a},padding_setter:function(a){if(typeof(a)!="object"){a={left:a,right:a,top:a,bottom:a}}this._mergeSettings(a,{left:50,right:20,top:35,bottom:40});return a},xAxis_setter:function(a){if(!a){return false}if(typeof(a)!="object"){a={template:a}}if(!a.value){a.value=a.template}this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",value:"{obj}",lines:true});var c=["lineColor","template","lines","value"];this._converToTemplate(c,a);this._configXAxis=dhtmlx.extend({},a);return a},yAxis_setter:function(a){this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",lines:true,bg:"#ffffff"});var c=["lineColor","template","lines","bg"];this._converToTemplate(c,a);this._configYAxis=dhtmlx.extend({},a);return a},_converToTemplate:function(a,c){for(var g=0;g<a.length;g++){c[a[g]]=dhtmlx.Template.setter(c[a[g]])}},_drawScales:function(l,j,g,n,a,c){var m=0;if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}m=this._drawYAxis(this.canvases.y.getCanvas(),l,j,g,n,a)}if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}this._drawXAxis(this.canvases.x.getCanvas(),l,j,g,c,m)}return m},_drawXAxis:function(v,m,s,r,j,q){var g=s.x-0.5;var u=parseInt((q?q:r.y),10)+0.5;var c=r.x;var n;var a=true;for(var l=0;l<m.length;l++){if(this._settings.offset===true){n=g+j/2+l*j}else{n=(l==m.length-1)?r.x:g+l*j;a=!!l}n=Math.ceil(n)-0.5;var o=((this._settings.origin!="auto")&&(this._settings.view=="bar")&&(parseFloat(this._settings.value(m[l]))<this._settings.origin));this._drawXAxisLabel(n,u,m[l],a,o);if((this._settings.offset||l)&&this._settings.xAxis.lines.call(this,m[l])){this._drawXAxisLine(v,n,r.y,s.y,m[l])}}this.canvases.x.renderTextAt(true,false,g,r.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",r.x-s.x);this._drawLine(v,g,u,c,u,this._settings.xAxis.color,1);if(!this._settings.xAxis.lines.call(this,{})||!this._settings.offset){return}this._drawLine(v,c+0.5,r.y,c+0.5,s.y+0.5,this._settings.xAxis.color,0.2)},_drawYAxis:function(x,E,m,l,o,n){var q;var v={};if(!this._settings.yAxis){return}var A=m.x-0.5;var j=l.y;var g=m.y;var w=l.y;if(this._settings.yAxis.step){q=parseFloat(this._settings.yAxis.step)}if(typeof this._configYAxis.step=="undefined"||typeof this._configYAxis.start=="undefined"||typeof this._configYAxis.end=="undefined"){v=this._calculateScale(o,n);o=v.start;n=v.end;q=v.step;this._settings.yAxis.end=n;this._settings.yAxis.start=o}this._setYAxisTitle(m,l);if(q===0){n=o;q=1}var a=(n==o?j-g:(j-g)*q/(n-o));var C=0;for(var y=o;y<=n;y+=q){if(v.fixNum){y=parseFloat((new Number(y)).toFixed(v.fixNum))}var D=Math.floor(j-C*a)+0.5;if(!(y==o&&this._settings.origin=="auto")&&this._settings.yAxis.lines.call(this,y)){this._drawLine(x,A,D,l.x,D,this._settings.yAxis.lineColor.call(this,y),1)}if(y==this._settings.origin){w=D}var r=y;if(q<1){var s=Math.min(this._log10(q),(o<=0?0:this._log10(o)));var u=Math.pow(10,-s);r=Math.round(y*u)/u;y=r}this.canvases.y.renderText(0,D-5,this._settings.yAxis.template(r.toString()),"dhx_axis_item_y",m.x-5);C++}this._drawLine(x,A,j+1,A,g,this._settings.yAxis.color,1);return w},_setYAxisTitle:function(g,c){var a="dhx_axis_title_y"+(dhtmlx._isIE&&dhtmlx._isIE!=9?" dhx_ie_filter":"");var j=this.canvases.y.renderTextAt("middle",false,0,parseInt((c.y-g.y)/2+g.y,10),this._settings.yAxis.title,a);if(j){j.style.left=(dhtmlx.env.transform?(j.offsetHeight-j.offsetWidth)/2:0)+"px"}},_calculateScale:function(r,c){if(this._settings.origin!="auto"&&this._settings.origin<r){r=this._settings.origin}var l,j,n;l=((c-r)/8)||1;var g=Math.floor(this._log10(l));var a=Math.pow(10,g);var m=l/a;m=(m>5?10:5);l=parseInt(m,10)*a;if(l>Math.abs(r)){j=(r<0?-l:0)}else{var s=Math.abs(r);var q=Math.floor(this._log10(s));var o=s/Math.pow(10,q);j=Math.ceil(o*10)/10*Math.pow(10,q)-l;if(s>1&&l>0.1){j=Math.ceil(j)}while(r<0?j<=r:j>=r){j-=l}if(r<0){j=-j-2*l}}n=j;while(n<c){n+=l;n=parseFloat((new Number(n)).toFixed(Math.abs(g)))}return{start:j,end:n,step:l,fixNum:Math.abs(g)}},_getLimits:function(c,n){var o,m;var l=((arguments.length&&c=="h")?this._configXAxis:this._configYAxis);n=n||"value";if(l&&(typeof l.end!="undefined")&&(typeof l.start!="undefined")&&l.step){o=parseFloat(l.end);m=parseFloat(l.start)}else{o=this.max(this._series[0][n]);m=(l&&(typeof l.start!="undefined"))?parseFloat(l.start):this.min(this._series[0][n]);if(this._series.length>1){for(var j=1;j<this._series.length;j++){var a=this.max(this._series[j][n]);var g=this.min(this._series[j][n]);if(a>o){o=a}if(g<m){m=g}}}}return{max:o,min:m}},_log10:function(c){var a="log";return Math.floor((Math[a](c)/Math.LN10))},_drawXAxisLabel:function(c,m,l,a,j){if(!this._settings.xAxis){return}var g=this.canvases.x.renderTextAt(j,a,c,m-(j?2:0),this._settings.xAxis.template(l));if(g){g.className+=" dhx_axis_item_x"}},_drawXAxisLine:function(c,a,j,g,l){if(!this._settings.xAxis||!this._settings.xAxis.lines){return}this._drawLine(c,a,j,a,g,this._settings.xAxis.lineColor.call(this,l),1)},_drawLine:function(a,j,n,g,l,c,m){a.strokeStyle=c;a.lineWidth=m;a.beginPath();a.moveTo(j,n);a.lineTo(g,l);a.stroke();a.lineWidth=1},_getRelativeValue:function(j,l){var g,a;var c=1;if(l!=j){g=l-j}else{g=j}return[g,c]},_rainbow:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}],addSeries:function(c){var a=this._settings;this._settings=dhtmlx.extend({},a);this._parseSettings(c,{});this._series.push(this._settings);this._settings=a},_switchSerie:function(j,a){var g;this._active_serie=a.getAttribute("userdata");if(!this._series[this._active_serie]){return}for(var c=0;c<this._series.length;c++){g=this._series[c].tooltip;if(g){g.disable()}}if(!a.getAttribute("disabled")){g=this._series[this._active_serie].tooltip;if(g){g.enable()}}},hideSeries:function(a){this.canvases[a].hideCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){this._settings.legend.values[a].$hidden=true}this._drawLegend()},showSeries:function(a){this.canvases[a].showCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){delete this._settings.legend.values[a].$hidden}this._drawLegend()},_setBorderStyles:function(a,c){var j,g;g=dhtmlx.math.toRgb(c);j=dhtmlx.math.rgbToHsv(g[0],g[1],g[2]);j[2]/=2;c="rgb("+dhtmlx.math.hsvToRgb(j[0],j[1],j[2])+")";a.strokeStyle=c;if(a.globalAlpha==1){a.globalAlpha=0.9}},_drawLegend:function(j,c){var l,r,A,s,m,u,a,o=0,n=0,w,q,g,v;j=j||[];c=c||this._obj.offsetWidth;w=this.canvases.legend.getCanvas();r=this._settings.legend;a=(this._settings.legend.layout!="x"?"width:"+r.width+"px":"");if(this.legendObj){this.legendObj.innerHTML="";this.legendObj.parentNode.removeChild(this.legendObj)}this.canvases.legend.clearCanvas(true);A=dhtmlx.html.create("DIV",{"class":"dhx_chart_legend",style:"left:"+o+"px; top:"+n+"px;"+a},"");if(r.padding){A.style.padding=r.padding+"px"}this.legendObj=A;this._obj.appendChild(A);m=[];if(!r.values){for(l=0;l<j.length;l++){m.push(this._drawLegendText(A,r.template(j[l])))}}else{for(l=0;l<r.values.length;l++){m.push(this._drawLegendText(A,r.values[l].text,(typeof r.values[l].id!="undefined"?typeof r.values[l].id:l),r.values[l].$hidden))}}u=A.offsetWidth;s=A.offsetHeight;if(u<this._obj.offsetWidth){if(r.layout=="x"&&r.align=="center"){o=(this._obj.offsetWidth-u)/2}if(r.align=="right"){o=this._obj.offsetWidth-u}if(r.margin&&r.align!="center"){o+=(r.align=="left"?1:-1)*r.margin}}if(s<this._obj.offsetHeight){if(r.valign=="middle"&&r.align!="center"&&r.layout!="x"){n=(this._obj.offsetHeight-s)/2}else{if(r.valign=="bottom"){n=this._obj.offsetHeight-s}}if(r.margin&&r.valign!="middle"){n+=(r.valign=="top"?1:-1)*r.margin}}A.style.left=o+"px";A.style.top=n+"px";w.save();for(l=0;l<m.length;l++){v=m[l];if(r.values&&r.values[l].$hidden){g=true;q=(r.values[l].disableColor?r.values[l].disableColor:"#d9d9d9")}else{g=false;q=(r.values?r.values[l].color:this._settings.color.call(this,j[l]))}this._drawLegendMarker(w,v.offsetLeft+o,v.offsetTop+n,q,v.offsetHeight,g,l)}w.restore();m=null},_drawLegendText:function(a,l,c,j){var g="";if(this._settings.legend.layout=="x"){g="float:left;"}var m=dhtmlx.html.create("DIV",{style:g+"padding-left:"+(10+this._settings.legend.marker.width)+"px","class":"dhx_chart_legend_item"+(j?" hidden":"")},l);if(arguments.length>2){m.setAttribute("series_id",c)}a.appendChild(m);return m},_drawLegendMarker:function(C,u,s,l,A,m,o){var c=[];var n=this._settings.legend.marker;var w=this._settings.legend.values;var r=(w&&w[o].markerType?w[o].markerType:n.type);if(l){C.fillStyle=l;C.strokeStyle=this._getDarkenColor(l,0.75)}C.beginPath();if(r=="round"||!n.radius){C.lineWidth=n.height;C.lineCap=r;u+=C.lineWidth/2+5;s+=A/2;C.moveTo(u,s);var a=u+n.width-n.height+1;C.lineTo(a,s)}else{if(r=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){C.beginPath();C.lineWidth=this._series[o].line.width;C.strokeStyle=m?l:this._series[o].line.color.call(this,{});var g=u+5;var v=s+A/2;C.moveTo(g,v);var a=g+n.width;C.lineTo(a,v);C.stroke()}var j=this._series[o].item;var q=parseInt(j.radius.call(this,{}),10)||0;if(q){C.beginPath();if(m){C.lineWidth=j.borderWidth;C.strokeStyle=l;C.fillStyle=l}else{C.lineWidth=j.borderWidth;C.fillStyle=j.color.call(this,{});C.strokeStyle=j.borderColor.call(this,{});C.globalAlpha=j.alpha.call(this,{})}C.beginPath();u+=n.width/2+5;s+=A/2;this._strokeChartItem(C,u,s,q+1,j.type);C.fill();C.stroke()}C.globalAlpha=1}else{C.lineWidth=1;u+=5;s+=parseInt(A/2-n.height/2,10);c=[[u+n.radius,s+n.radius,n.radius,Math.PI,3*Math.PI/2,false],[u+n.width-n.radius,s],[u+n.width-n.radius,s+n.radius,n.radius,-Math.PI/2,0,false],[u+n.width,s+n.height-n.radius],[u+n.width-n.radius,s+n.height-n.radius,n.radius,0,Math.PI/2,false],[u+n.radius,s+n.height],[u+n.radius,s+n.height-n.radius,n.radius,Math.PI/2,Math.PI,false],[u,s+n.radius]];this._path(C,c)}}C.stroke();C.fill()},_getDarkenColor:function(a,j){var g,c;c=dhtmlx.math.toRgb(a);g=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);g[2]=g[2]*j;return"rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")"},_getChartBounds:function(a,n){var q,g,o,c;q=this._settings.padding.left;g=this._settings.padding.top;o=a-this._settings.padding.right;c=n-this._settings.padding.bottom;if(this._settings.legend){var l=this._settings.legend;var m=this._settings.legend.width;var j=this._settings.legend.height;if(l.layout=="x"){if(l.valign=="center"){if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}else{if(l.valign=="bottom"){c-=j}else{g+=j}}}else{if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}}return{start:{x:q,y:g},end:{x:o,y:c}}},_getStackedLimits:function(m){var c,a,n,l,g;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){n=parseFloat(this._settings.yAxis.end);l=parseFloat(this._settings.yAxis.start)}else{for(c=0;c<m.length;c++){m[c].$sum=0;m[c].$min=Infinity;for(a=0;a<this._series.length;a++){g=parseFloat(this._series[a].value(m[c])||0);if(isNaN(g)){continue}if(this._series[a].view.toLowerCase().indexOf("stacked")!=-1){m[c].$sum+=g}if(g<m[c].$min){m[c].$min=g}}}n=-Infinity;l=Infinity;for(c=0;c<m.length;c++){if(m[c].$sum>n){n=m[c].$sum}if(m[c].$min<l){l=m[c].$min}}if(l>0){l=0}}return{max:n,min:l}},_setBarGradient:function(w,c,s,a,q,o,j,g){var r,l,n,m,v,u;if(o=="light"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}u=[[0,"#FFFFFF"],[0.9,j],[1,j]];l=2}else{if(o=="falling"||o=="rising"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}n=dhtmlx.math.toRgb(j);m=dhtmlx.math.rgbToHsv(n[0],n[1],n[2]);m[1]*=1/2;v="rgb("+dhtmlx.math.hsvToRgb(m[0],m[1],m[2])+")";if(o=="falling"){u=[[0,v],[0.7,j],[1,j]]}else{if(o=="rising"){u=[[0,j],[0.3,j],[1,v]]}}l=0}else{w.globalAlpha=0.37;l=0;if(g=="x"){r=w.createLinearGradient(c,q,c,s)}else{r=w.createLinearGradient(c,s,a,s)}u=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(r,u);return{gradient:r,offset:l}},_getPositionByAngle:function(g,c,l,j){g*=(-1);c=c+Math.cos(g)*j;l=l-Math.sin(g)*j;return{x:c,y:l}},_gradient:function(g,c){for(var a=0;a<c.length;a++){g.addColorStop(c[a][0],c[a][1])}},_path:function(a,g){var c,j;for(c=0;c<g.length;c++){j=(c?"lineTo":"moveTo");if(g[c].length>2){j="arc"}a[j].apply(a,g[c])}},_circle:function(c,a,j,g){c.arc(a,j,g,Math.PI*2,true)},_addMapRect:function(j,l,a,g,c){j.addRect(l,[a[0].x-g.x,a[0].y-g.y,a[1].x-g.x,a[1].y-g.y],c)}};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachChart=function(a){this.callEvent("_onBeforeContentAttach",["chart"]);var c=document.createElement("DIV");c.id="dhxChartObj_"+window.dhx4.newId();c.style.width="100%";c.style.height="100%";document.body.appendChild(c);this._attachObject(c);a.container=c.id;this.dataType="chart";this.dataObj=new dhtmlXChart(a);if(!this.dataObj.setSizes){this.dataObj.setSizes=function(){if(this.resize){this.resize()}else{this.render()}}}return this.dataObj}}dhtmlx.ui.pager=function(a){this.name="Pager";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this._parseSettings(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this._settings;this.refresh()};dhtmlx.ui.pager.prototype={_id:"dhx_p_id",on_click:{dhx_pager_item:function(a,c){this.select(c)}},select:function(a){switch(a){case"next":a=this._settings.page+1;break;case"prev":a=this._settings.page-1;break;case"first":a=0;break;case"last":a=this._settings.limit-1;break;default:break}if(a<0){a=0}if(a>=this.data.limit){a=this.data.limit-1}if(this.callEvent("onBeforePageChange",[this._settings.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),pages:function(g){var c="";if(g.page==-1){return""}g.min=g.page-Math.round((g.group-1)/2);g.max=g.min+g.group-1;if(g.min<0){g.max+=g.min*(-1);g.min=0}if(g.max>=g.limit){g.min-=Math.min(g.min,g.max-g.limit+1);g.max=g.limit-1}for(var a=(g.min||0);a<=g.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==g.page?"_selected":"")})}return c},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},refresh:function(){var a=this._settings;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit){a.page=Math.min(a.limit-1,a.page)}var c=a.page;if(c!=-1&&(c!=a.old_page)||(a.limit!=a.old_limit)){this.render();this.callEvent("onRefresh",[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.DataProcessor={_dp_init:function(c){var a="_methods";c[a]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(g){c.setUpdated(g,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(j,g){if(j.getUserData){j.getUserData(g,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(j){if(c._silent_mode){return true}var g=c.getState(j);if(g=="inserted"){c.setUpdated(j,false);return true}if(g=="deleted"){return false}if(g=="true_deleted"){return true}c.setUpdated(j,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(g){c.setUpdated(g,true,"updated")});this.attachEvent("onBindUpdate",function(g){window.setTimeout(function(){c.setUpdated(g.id,true,"updated")},1)});a="_getRowData";c[a]=function(n,g){var l=this.obj.data.get(n);var m={};for(var j in l){if(j.indexOf("_")===0){continue}m[j]=l[j]}return m};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(g,j){this.obj.setUserData(j,this.action_param,"true_deleted");this.obj.remove(j)});dhtmlx.compat("dataProcessor",c)},_dp_callback:function(a,c){this.obj.data.set(c,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(c)},setItemStyle:function(g,a){var c=this._locateHTML(g);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(g,a,c){if(g){this.data.get(g)[a]=c}else{this._userdata[a]=c}},getUserData:function(c,a){return c?this.data.get(c)[a]:this._userdata[a]}};(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor._dp_init})();dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var o="_dragged";var j=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(r,s,q){j.apply(this,arguments);if(!q){var u=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!u.from){u.from=this.dragStartObject}dhtmlx.DragControl._checkLand(r,s,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(s,q,r){if(!r){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=n.dragStartNode;dhtmlx.DragControl._stopDrag(s,true)}}c.apply(this,arguments)};var n=new dhtmlDragAndDropObject();var l=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){l.apply(this,arguments);var u=dhtmlx.DragControl._drag_context;if(!u){return}var s=[];var r=[];for(var q=0;q<u.source.length;q++){s[q]={idd:u.source[q]};r.push(u.source[q])}n.dragStartNode={parentNode:{},parentObject:{idd:s,id:(r.length==1?r[0]:r),treeNod:{object:u.from}}};n.dragStartNode.parentObject.treeNod[o]=s;n.dragStartObject=u.from};var m=dhtmlx.DragControl._checkLand;dhtmlx.DragControl._checkLand=function(r,s,q){m.apply(this,arguments);if(!this._last&&!q){r=n.checkLanding(r,s,true)}};var a=dhtmlx.DragControl._stopDrag;dhtmlx.DragControl._stopDrag=function(r,q){a.apply(this,arguments);if(n.lastLanding&&!q){n.stopDrag(r,false,true)}};var g=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(r){var s=null;if(r){s=g.apply(this,arguments)}if(!s){s=n.dragStartObject;var u=[];var v=s[o];for(var q=0;q<v.length;q++){u.push(v[q].idd||v[q].id)}dhtmlx.DragControl._drag_context.source=u}return s}}};dhtmlx.DataMove={_init:function(){dhtmlx.assert(this.data,"DataMove :: Component doesn't have DataStore")},copy:function(c,l,a,j){var g=this.get(c);if(!g){dhtmlx.log("Warning","Incorrect ID in DataMove::copy");return}if(a){dhtmlx.assert(a.externalData,"DataMove :: External object doesn't support operation");g=a.externalData(g)}a=a||this;return a.add(a.externalData(g,j),l)},move:function(g,n,c,m){if(g instanceof Array){for(var j=0;j<g.length;j++){var a=(c||this).indexById(this.move(g[j],n,c,g[j]));if(g[j+1]){n=a+(this.indexById(g[j+1])<a?0:1)}}return}nid=g;if(n<0){dhtmlx.log("Info","DataMove::move - moving outside of bounds is ignored");return}var l=this.get(g);if(!l){dhtmlx.log("Warning","Incorrect ID in DataMove::move");return}if(!c||c==this){this.data.move(this.indexById(g),n)}else{dhtmlx.assert(c.externalData,"DataMove :: External object doesn't support operation");nid=c.add(c.externalData(l,m),n);this.remove(g)}return nid},moveUp:function(c,a){return this.move(c,this.indexById(c)-(a||1))},moveDown:function(c,a){return this.moveUp(c,(a||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,g){var c=dhtmlx.extend({},a);c.id=g||dhtmlx.uid();c.$selected=c.$template=null;return c}};dhtmlx.DragControl={_drag_masters:dhtmlx.toArray(["dummy"]),addDrop:function(c,g,a){c=dhtmlx.toNode(c);c.dhx_drop=this._getCtrl(g);if(a){c.dhx_master=true}},_getCtrl:function(c){c=c||dhtmlx.DragControl;var a=this._drag_masters.find(c);if(a<0){a=this._drag_masters.length;this._drag_masters.push(c)}return a},addDrag:function(a,c){a=dhtmlx.toNode(a);a.dhx_drag=this._getCtrl(c);dhtmlx.event(a,"mousedown",this._preStart,a)},_preStart:function(a){if(dhtmlx.DragControl._active){dhtmlx.DragControl._preStartFalse();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl._active=this;dhtmlx.DragControl._start_pos={x:a.pageX,y:a.pageY};dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._startDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._preStartFalse);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.event(this,"scroll",dhtmlx.DragControl._preStartFalse);a.cancelBubble=true;return false},_preStartFalse:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_sc)},_startDrag:function(a){var c={x:a.pageX,y:a.pageY};if(Math.abs(c.x-dhtmlx.DragControl._start_pos.x)<5&&Math.abs(c.y-dhtmlx.DragControl._start_pos.y)<5){return}dhtmlx.DragControl._preStartFalse();if(!dhtmlx.DragControl.createDrag(a)){return}dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._moveDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._stopDrag);dhtmlx.DragControl._moveDrag(a)},_stopDrag:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);if(dhtmlx.DragControl._last){dhtmlx.DragControl.onDrop(dhtmlx.DragControl._active,dhtmlx.DragControl._last,this._landing,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl._active,dhtmlx.DragControl._last,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},_moveDrag:function(a){var c=dhtmlx.html.pos(a);dhtmlx.DragControl._html.style.top=c.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl._html.style.left=c.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl._skip){dhtmlx.DragControl._skip=false}else{dhtmlx.DragControl._checkLand((a.srcElement||a.target),a)}a.cancelBubble=true;return false},_checkLand:function(a,c){while(a&&a.tagName!="BODY"){if(a.dhx_drop){if(this._last&&(this._last!=a||a.dhx_master)){this.onDragOut(this._active,this._last,a,c)}if(!this._last||this._last!=a||a.dhx_master){this._last=null;this._landing=this.onDragIn(dhtmlx.DragControl._active,a,c);if(this._landing){this._last=a}return}return}a=a.parentNode}if(this._last){this._last=this._landing=this.onDragOut(this._active,this._last,null,c)}},sendSignal:function(a){dhtmlx.DragControl.active=(a=="start")},getMaster:function(a){return this._drag_masters[a.dhx_drag||a.dhx_drop]},getContext:function(a){return this._drag_context},createDrag:function(l){var g=dhtmlx.DragControl._active;var j=this._drag_masters[g.dhx_drag];var c;if(j.onDragCreate){c=j.onDragCreate(g,l);c.style.position="absolute";c.style.zIndex=dhtmlx.zIndex.drag;c.onmousemove=dhtmlx.DragControl._skip_mark}else{var m=dhtmlx.DragControl.onDrag(g,l);if(!m){return false}var c=document.createElement("DIV");c.innerHTML=m;c.className="dhx_drag_zone";c.onmousemove=dhtmlx.DragControl._skip_mark;document.body.appendChild(c)}dhtmlx.DragControl._html=c;return true},_skip_mark:function(){dhtmlx.DragControl._skip=true},destroyDrag:function(){var c=dhtmlx.DragControl._active;var g=this._drag_masters[c.dhx_drag];if(g&&g.onDragDestroy){g.onDragDestroy(c,dhtmlx.DragControl._html)}else{dhtmlx.html.remove(dhtmlx.DragControl._html)}dhtmlx.DragControl._landing=dhtmlx.DragControl._active=dhtmlx.DragControl._last=dhtmlx.DragControl._html=null},top:5,left:5,onDragIn:function(g,c,j){var a=this._drag_masters[c.dhx_drop];if(a.onDragIn&&a!=this){return a.onDragIn(g,c,j)}c.className=c.className+" dhx_drop_zone";return c},onDragOut:function(g,c,l,j){var a=this._drag_masters[c.dhx_drop];if(a.onDragOut&&a!=this){return a.onDragOut(g,c,l,j)}c.className=c.className.replace("dhx_drop_zone","");return null},onDrop:function(g,c,l,j){var a=this._drag_masters[c.dhx_drop];dhtmlx.DragControl._drag_context.from=dhtmlx.DragControl.getMaster(g);if(a.onDrop&&a!=this){return a.onDrop(g,c,l,j)}c.appendChild(g)},onDrag:function(c,g){var a=this._drag_masters[c.dhx_drag];if(a.onDrag&&a!=this){return a.onDrag(c,g)}dhtmlx.DragControl._drag_context={source:c,from:c};return"<div style='"+c.style.cssText+"'>"+c.innerHTML+"</div>"}};dhtmlx.DragItem={_init:function(){dhtmlx.assert(this.move,"DragItem :: Component doesn't have DataMove interface");dhtmlx.assert(this.locate,"DragItem :: Component doesn't have RenderStack interface");dhtmlx.assert(dhtmlx.DragControl,"DragItem :: DragControl is not included");if(!this._settings||this._settings.drag){dhtmlx.DragItem._initHandlers(this)}else{if(this._settings){this.drag_setter=function(a){if(a){this._initHandlers(this);delete this.drag_setter}return a}}}if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},_initHandlers:function(a){dhtmlx.DragControl.addDrop(a._obj,a,true);dhtmlx.DragControl.addDrag(a._obj,a)},onDragIn:function(j,g,l){var n=this.locate(l)||null;var c=dhtmlx.DragControl._drag_context;var m=dhtmlx.DragControl.getMaster(j);var a=(this._locateHTML(n)||this._obj);if(a==dhtmlx.DragControl._landing){return a}c.target=n;c.to=m;if(!this.callEvent("onBeforeDragIn",[c,l])){c.id=null;return null}dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(j,g,o,l){var m=this.locate(l)||null;if(o!=this._dataobj){m=null}var c=(this._locateHTML(m)||(o?dhtmlx.DragControl.getMaster(o)._obj:window.undefined));if(c==dhtmlx.DragControl._landing){return null}var a=dhtmlx.DragControl._drag_context;dhtmlx.html.removeCss(dhtmlx.DragControl._landing,"dhx_drag_over");a.target=a.to=null;this.callEvent("onDragOut",[a,l]);return null},onDrop:function(g,c,l,j){var a=dhtmlx.DragControl._drag_context;a.to=this;a.index=a.target?this.indexById(a.target):this.dataCount();a.new_id=dhtmlx.uid();if(!this.callEvent("onBeforeDrop",[a,j])){return}if(a.from==a.to){this.move(a.source,a.index)}else{if(a.from){a.from.move(a.source,a.index,a.to,a.new_id)}else{dhtmlx.error("Unsopported d-n-d combination")}}this.callEvent("onAfterDrop",[a,j])},onDrag:function(g,l){var m=this.locate(l);var j=[m];if(m){if(this.getSelected){var c=this.getSelected();if(dhtmlx.PowerArray.find.call(c,m)!=-1){j=c}}var a=dhtmlx.DragControl._drag_context={source:j,start:m};a.from=this;if(this.callEvent("onBeforeDrag",[a,l])){return a.html||this._toHTML(this.get(m))}}return null}};dhtmlx.EditAbility={_init:function(a){this._edit_id=null;this._edit_bind=null;dhtmlx.assert(this.data,"EditAbility :: Component doesn't have DataStore");dhtmlx.assert(this._locateHTML,"EditAbility :: Component doesn't have RenderStack");this.attachEvent("onEditKeyPress",function(g,j,c){if(g==13&&!c){this.stopEdit()}else{if(g==27){this.stopEdit(true)}}});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this._edit_id},edit:function(c){if(this.stopEdit(false,c)){if(!this.callEvent("onBeforeEditStart",[c])){return}var a=this.data.get(c);if(a.$template){return}a.$template="edit";this.data.refresh(c);this._edit_id=c;this._save_binding(c);this._edit_bind(true,a);this.callEvent("onAfterEditStart",[c])}},stopEdit:function(g,l){if(!this._edit_id){return true}if(this._edit_id==l){return false}var a={};if(!g){this._edit_bind(false,a)}else{a=null}if(!this.callEvent("onBeforeEditStop",[this._edit_id,a])){return false}var c=this.data.get(this._edit_id);c.$template=null;if(!g){this._edit_bind(false,c)}var j=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(j);this.callEvent("onAfterEditStop",[j,a]);return true},_save_binding:function(o){var a=this._locateHTML(o);var g="";var m="";var l=[];if(a){var j=a.getElementsByTagName("*");var n="";for(var c=0;c<j.length;c++){if(j[c].nodeType==1&&(n=j[c].getAttribute("bind"))){g+="els["+l.length+"].value="+n+";";m+=n+"=els["+l.length+"].value;";l.push(j[c]);j[c].className+=" dhx_allow_selection";j[c].onselectstart=this._block_native}}j=null}g=Function("obj","els",g);m=Function("obj","els",m);this._edit_bind=function(r,q){if(r){g(q,l);if(l.length&&l[0].select){l[0].select()}}else{m(q,l)}}},_block_native:function(a){(a||event).cancelBubble=true;return true}};dhtmlx.SelectionModel={_init:function(){this._selected=dhtmlx.toArray();dhtmlx.assert(this.data,"SelectionModel :: Component doesn't have DataStore");this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this._data_updated,this));this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._data_loaded,this));this.data.attachEvent("onAfterFilter",dhtmlx.bind(this._data_filtered,this));this.data.attachEvent("onIdChange",dhtmlx.bind(this._id_changed,this))},_id_changed:function(g,a){for(var c=this._selected.length-1;c>=0;c--){if(this._selected[c]==g){this._selected[c]=a}}},_data_filtered:function(){for(var a=this._selected.length-1;a>=0;a--){if(this.data.indexById(this._selected[a])<0){var g=this._selected[a]}var c=this.item(g);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[g])}},_data_updated:function(g,c,a){if(a=="delete"){this._selected.remove(g)}else{if(!this.data.dataCount()&&!this.data._filter_order){this._selected=dhtmlx.toArray()}}},_data_loaded:function(){if(this._settings.select){this.data.each(function(a){if(a.$selected){this.select(a.id)}},this)}},_select_mark:function(g,c,a){if(!a&&!this.callEvent("onBeforeSelect",[g,c])){return false}this.data.item(g).$selected=c;if(a){a.push(g)}else{if(c){this._selected.push(g)}else{this._selected.remove(g)}this._refresh_selection(g)}return true},select:function(j,g,a){if(!j){return this.selectAll()}if(j instanceof Array){for(var c=0;c<j.length;c++){this.select(j[c],g,a)}return}if(!this.data.exists(j)){dhtmlx.error("Incorrect id in select command: "+j);return}if(a&&this._selected.length){return this.selectAll(this._selected[this._selected.length-1],j)}if(!g&&(this._selected.length!=1||this._selected[0]!=j)){this._silent_selection=true;this.unselectAll();this._silent_selection=false}if(this.isSelected(j)){if(g){this.unselect(j)}return}if(this._select_mark(j,true)){this.callEvent("onAfterSelect",[j])}},unselect:function(a){if(!a){return this.unselectAll()}if(!this.isSelected(a)){return}this._select_mark(a,false)},selectAll:function(j,g){var a;var c=[];if(j||g){a=this.data.getRange(j||null,g||null)}else{a=this.data.getRange()}a.each(function(l){var m=this.data.item(l.id);if(!m.$selected){this._selected.push(l.id);this._select_mark(l.id,true,c)}return l.id},this);this._refresh_selection(c)},unselectAll:function(){var a=[];this._selected.each(function(c){this._select_mark(c,false,a)},this);this._selected=dhtmlx.toArray();this._refresh_selection(a)},isSelected:function(a){return this._selected.find(a)!=-1},getSelected:function(a){switch(this._selected.length){case 0:return a?[]:"";case 1:return a?[this._selected[0]]:this._selected[0];default:return([].concat(this._selected))}},_is_mass_selection:function(a){return a.length>100||a.length>this.data.dataCount/2},_refresh_selection:function(c){if(typeof c!="object"){c=[c]}if(!c.length){return}if(this._is_mass_selection(c)){this.data.refresh()}else{for(var a=0;a<c.length;a++){this.render(c[a],this.data.item(c[a]),"update")}}if(!this._silent_selection){this.callEvent("onSelectChange",[c])}}};dhtmlx.RenderStack={_init:function(){dhtmlx.assert(this.data,"RenderStack :: Component doesn't have DataStore");dhtmlx.assert(dhtmlx.Template,"dhtmlx.Template :: dhtmlx.Template is not accessible");this._html=document.createElement("DIV")},_toHTML:function(a){dhtmlx.assert((!a.$template||this.type["template_"+a.$template]),"RenderStack :: Unknown template: "+a.$template);this.callEvent("onItemRender",[a]);return this.type._item_start(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type._item_end},_toHTMLObject:function(a){this._html.innerHTML=this._toHTML(a);return this._html.firstChild},_locateHTML:function(a){if(this._htmlmap){return this._htmlmap[a]}this._htmlmap={};var g=this._dataobj.childNodes;for(var c=0;c<g.length;c++){var j=g[c].getAttribute(this._id);if(j){this._htmlmap[j]=g[c]}}return this._locateHTML(a)},locate:function(a){return dhtmlx.html.locate(a,this._id)},show:function(c){var a=this._locateHTML(c);if(a){this._dataobj.scrollTop=a.offsetTop-this._dataobj.offsetTop}},render:function(m,j,g,l){if(m){var a=this._locateHTML(m);switch(g){case"update":if(!a){return}var c=this._htmlmap[m]=this._toHTMLObject(j);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;case"delete":if(!a){return}dhtmlx.html.remove(a);delete this._htmlmap[m];break;case"add":var c=this._htmlmap[m]=this._toHTMLObject(j);dhtmlx.html.insertBefore(c,this._locateHTML(this.data.next(m)),this._dataobj);break;case"move":this.render(m,j,"delete");this.render(m,j,"add");break;default:dhtmlx.error("Unknown render command: "+g);break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._dataobj.innerHTML=this.data.getRange().map(this._toHTML,this).join("");this._htmlmap=null}}this.callEvent("onAfterRender",[])},pager_setter:function(c){this.attachEvent("onBeforeRender",function(){var j=this._settings.pager._settings;if(j.page==-1){return false}this.data.min=j.page*j.size;this.data.max=(j.page+1)*j.size-1;return true});var a=new dhtmlx.ui.pager(c);var g=dhtmlx.bind(function(){this.data.refresh()},this);a.attachEvent("onRefresh",g);this.data.attachEvent("onStoreUpdated",function(l){var j=this.dataCount();if(j!=a._settings.count){a._settings.count=j;if(a._settings.page==-1){a._settings.page=0}a.refresh()}});return a},height_setter:function(a){if(a=="auto"){this.attachEvent("onAfterRender",this._correct_height);dhtmlx.event(window,"resize",dhtmlx.bind(this._correct_height,this))}return a},_correct_height:function(){this._dataobj.style.overflow="hidden";this._dataobj.style.height="1px";var a=this._dataobj.scrollHeight;this._dataobj.style.height=a+"px";if(dhtmlx._isFF){var c=this._dataobj.scrollHeight;if(c!=a){this._dataobj.style.height=c+"px"}}this._obj.style.height=this._dataobj.style.height},_getDimension:function(){var a=this.type;var c=(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+c,y:a.height+c}},x_count_setter:function(c){var g=this._getDimension();var a=dhtmlx.$customScroll?0:18;this._dataobj.style.width=g.x*c+(this._settings.height!="auto"?a:0)+"px";return c},y_count_setter:function(a){var c=this._getDimension();this._dataobj.style.height=c.y*a+"px";return a}};dhtmlx.VirtualRenderStack={_init:function(){dhtmlx.assert(this.render,"VirtualRenderStack :: Object must use RenderStack first");this._htmlmap={};this._dataobj.style.overflowY="scroll";dhtmlx.event(this._dataobj,"scroll",dhtmlx.bind(this._render_visible_rows,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.data._unrendered_area=[];this.data.getIndexRange=this._getIndexRange},_locateHTML:function(a){return this._htmlmap[a]},show:function(g){range=this._getVisibleRange();var c=this.data.indexById(g);var a=Math.floor(c/range._dx)*range._y;this._dataobj.scrollTop=a},_getIndexRange:function(l,j){if(j!==0){j=Math.min((j||Infinity),this.dataCount()-1)}var a=dhtmlx.toArray();for(var c=(l||0);c<=j;c++){var g=this.item(this.order[c]);if(this.order.length>c){if(!g){this.order[c]=dhtmlx.uid();g={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(g.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(g)}}return a},render:function(m,j,g,l){if(m){var a=this._locateHTML(m);switch(g){case"update":if(!a){return}var c=this._htmlmap[m]=this._toHTMLObject(j);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;default:this._render_delayed();break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._htmlmap={};this._render_visible_rows(null,true);this._wait_for_render=false;this.callEvent("onAfterRender",[])}}},_render_delayed:function(){if(this._wait_for_render){return}this._wait_for_render=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)},_create_placeholder:function(a){var c=document.createElement("DIV");c.className="dhxdataview_placeholder";c.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";return c},_render_visible_rows:function(y,D){this.data._unrendered_area=[];var x=this._getVisibleRange();if(!this._dataobj.firstChild||D){this._dataobj.innerHTML="";this._dataobj.appendChild(this._create_placeholder(x._max));this._htmlrows=[this._dataobj.firstChild]}var j=Math.max(x._from,0);var w=(this.data.max||this.data.max===0)?this.data.max:Infinity;while(j<=x._height){while(this._htmlrows[j]&&this._htmlrows[j]._filled&&j<=x._height){j++}if(j>x._height){break}var n=j;while(!this._htmlrows[n]){n--}var a=this._htmlrows[n];var g=j*x._dx+(this.data.min||0);if(g>w){break}var l=Math.min(g+x._dx-1,w);var q=this._create_placeholder(x._y);var m=this.data.getIndexRange(g,l);if(!m.length){break}q.innerHTML=m.map(this._toHTML,this).join("");for(var u=0;u<m.length;u++){this._htmlmap[this.data.idByIndex(g+u)]=q.childNodes[u]}var v=parseInt(a.style.height,10);var C=(j-n)*x._y;var s=(v-C-x._y);dhtmlx.html.insertBefore(q,C?a.nextSibling:a,this._dataobj);this._htmlrows[j]=q;q._filled=true;if(C<=0&&s>0){a.style.height=s+"px";this._htmlrows[j+1]=a}else{if(C<0){dhtmlx.html.remove(a)}else{a.style.height=C+"px"}if(s>0){var o=this._htmlrows[j+1]=this._create_placeholder(s);dhtmlx.html.insertBefore(o,q.nextSibling,this._dataobj)}}j++}if(this.data._unrendered_area.length){var r=this.indexById(this.data._unrendered_area[0]);var c=this.indexById(this.data._unrendered_area.pop())+1;if(c>r){if(!this.callEvent("onDataRequest",[r,c-r])){return false}dhtmlx.assert(this.data.feed,"Data feed is missed");this.data.feed.call(this,r,c-r)}}if(dhtmlx._isIE){var A=this._getVisibleRange();if(A._from!=x._from){this._render_visible_rows()}}},_getVisibleRange:function(){var c=dhtmlx.$customScroll?0:18;var n=this._dataobj.scrollTop;var a=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-c;var o=this._dataobj.offsetHeight;var r=this.type;var j=this._getDimension();var s=Math.floor(a/j.x)||1;var g=Math.floor(n/j.y);var q=Math.ceil((o+n)/j.y)-1;var l=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var m=Math.ceil(l/s)*j.y;return{_from:g,_height:q,_top:n,_max:m,_y:j.y,_dx:s}}};dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this._parseSettings(a,{drag:false,edit:false,select:"multiselect",type:"default"});if(this._settings.height!="auto"&&!this._settings.renderAll){dhtmlx.extend(this,dhtmlx.VirtualRenderStack)}this.data.provideApi(this,true);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXDataView.prototype={bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(g,l){var j=this._locateHTML(g.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(j){j.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";j.style.backgroundRepeat="no-repeat";this._drag_marker=j}}if(j&&this._settings.auto_scroll){var a=j.offsetTop;var m=j.offsetHeight;var c=this._obj.scrollTop;var n=this._obj.offsetHeight;if(a-m>=0&&a-m*0.75<c){c=Math.max(a-m,0)}else{if(a+m/0.75>c+n){c=c+m}}this._obj.scrollTop=c}return true},_id:"dhx_f_id",on_click:{dhx_dataview_item:function(a,c){if(this.stopEdit(false,c)){if(this._settings.select){if(this._settings.select=="multiselect"){this.select(c,a.ctrlKey,a.shiftKey)}else{this.select(c)}}}}},on_dblclick:{dhx_dataview_item:function(a,c){if(this._settings.edit){this.edit(c)}}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachDataView=function(a){this.callEvent("_onBeforeContentAttach",["dataview"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(a)=="undefined"){a={}}c.id="DataViewObject_"+new Date().getTime();a.container=c.id;a.skin=this.conf.skin;this.dataType="dataview";this.dataObj=new dhtmlXDataView(a);this.dataObj.setSizes=function(){this.render()};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}function xmlPointer(a){this.d=a}xmlPointer.prototype={text:function(){if(!_isFF){return this.d.xml}var a=new XMLSerializer();return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return !!this.d},content:function(){return this.d.firstChild?(this.d.firstChild.wholeText||this.d.firstChild.data):""},each:function(j,n,m,l){var g=this.d.childNodes;var o=new xmlPointer();if(g.length){for(l=l||0;l<g.length;l++){if(g[l].tagName==j){o.d=g[l];if(n.apply(m,[o,l])==-1){return}}}}},get_all:function(){var g={};var c=this.d.attributes;for(var j=0;j<c.length;j++){g[c[j].name]=c[j].value}return g},sub:function(j){var g=this.d.childNodes;var m=new xmlPointer();if(g.length){for(var l=0;l<g.length;l++){if(g[l].tagName==j){m.d=g[l];return m}}}},up:function(a){return new xmlPointer(this.d.parentNode)},set:function(a,c){this.d.setAttribute(a,c)},clone:function(a){return new xmlPointer(this.d)},sub_exists:function(g){var c=this.d.childNodes;if(c.length){for(var j=0;j<c.length;j++){if(c[j].tagName==g){return true}}}return false},through:function(g,n,r,l,s){var o=this.d.childNodes;if(o.length){for(var j=0;j<o.length;j++){if(o[j].tagName==g&&o[j].getAttribute(n)!=null&&o[j].getAttribute(n)!=""&&(!r||o[j].getAttribute(n)==r)){var m=new xmlPointer(o[j]);l.apply(s,[m,j])}var q=this.d;this.d=o[j];this.through(g,n,r,l,s);this.d=q}}}};function dhtmlXTreeObject(m,j,c,a){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}}if(typeof(m)!="object"){this.parentObject=document.getElementById(m)}else{this.parentObject=m}this.parentObject.style.overflow="hidden";this._itim_dg=true;this.dlmtr=",";this.dropLower=false;this.enableIEImageFix(true);this.xmlstate=0;this.mytype="tree";this.smcheck=true;this.width=j;this.height=c;this.rootId=a;this.childCalc=null;this.def_img_x="18px";this.def_img_y="18px";this.def_line_img_x="18px";this.def_line_img_y="24px";this._dragged=new Array();this._selected=new Array();this.style_pointer="pointer";this._aimgs=true;this.htmlcA=" [";this.htmlcB="]";this.lWin=window;this.cMenu=0;this.mlitems=0;this.iconURL="";this.dadmode=0;this.slowParse=false;this.autoScroll=true;this.hfMode=0;this.nodeCut=new Array();this.XMLsource=0;this.XMLloadingWarning=0;this._idpull={};this._pullSize=0;this.treeLinesOn=true;this.tscheck=false;this.timgen=true;this.dpcpy=false;this._ld_id=null;this._oie_onXLE=[];this.imPath=window.dhx_globalImgPath||"";this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif");this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif");this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif");this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif");this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif");this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif");this.cutImg=new Array(0,0,0);this.cutImage="but_cut.gif";dhx4._eventable(this);this.dragger=new dhtmlDragAndDropObject();this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree=this._createSelf();this.allTree.appendChild(this.htmlNode.htmlNode);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}if(_isFF){this.allTree.childNodes[0].width="100%";this.allTree.childNodes[0].style.overflow="hidden"}var g=this;this.allTree.onselectstart=new Function("return false;");if(_isMacOS){this.allTree.oncontextmenu=function(n){return g._doContClick(n||window.event,true)}}this.allTree.onmousedown=function(n){return g._doContClick(n||window.event)};this.XMLLoader=this._parseXMLTree;if(_isIE){this.preventIECashing(true)}this.selectionBar=document.createElement("DIV");this.selectionBar.className="selectionBar";this.selectionBar.innerHTML="&nbsp;";this.selectionBar.style.display="none";this.allTree.appendChild(this.selectionBar);if(window.addEventListener){window.addEventListener("unload",function(){try{g.destructor()}catch(n){}},false)}if(window.attachEvent){window.attachEvent("onunload",function(){try{g.destructor()}catch(n){}})}this.setImagesPath=this.setImagePath;this.setIconsPath=this.setIconPath;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtree")||"dhx_skyblue");return this}dhtmlXTreeObject.prototype.setDataMode=function(a){this._datamode=a};dhtmlXTreeObject.prototype._doContClick=function(n,a){if(!a&&n.button!=2){if(this._acMenu){if(this._acMenu.hideContextMenu){this._acMenu.hideContextMenu()}else{this.cMenu._contextEnd()}}return true}var c=(_isIE?n.srcElement:n.target);while((c)&&(c.tagName!="BODY")){if(c.parentObject){break}c=c.parentNode}if((!c)||(!c.parentObject)){return true}var l=c.parentObject;if(!this.callEvent("onRightClick",[l.id,n])){(n.srcElement||n.target).oncontextmenu=function(r){(r||event).cancelBubble=true;return false}}this._acMenu=(l.cMenu||this.cMenu);if(this._acMenu){if(!(this.callEvent("onBeforeContextMenu",[l.id]))){return true}if(!_isMacOS){(n.srcElement||n.target).oncontextmenu=function(r){(r||event).cancelBubble=true;return false}}if(this._acMenu.showContextMenu){var j=window.document.documentElement;var g=window.document.body;var o=new Array((j.scrollLeft||g.scrollLeft),(j.scrollTop||g.scrollTop));if(_isIE){var q=n.clientX+o[0];var m=n.clientY+o[1]}else{var q=n.pageX;var m=n.pageY}this._acMenu.showContextMenu(q-1,m-1);this.contextID=l.id;n.cancelBubble=true;this._acMenu._skip_hide=true}else{c.contextMenuId=l.id;c.contextMenu=this._acMenu;c.a=this._acMenu._contextStart;c.a(c,n);c.a=null}return false}return true};dhtmlXTreeObject.prototype.enableIEImageFix=function(a){if(!a){this._getImg=function(c){return document.createElement((c==this.rootId)?"div":"img")};this._setSrc=function(g,c){g.src=c};this._getSrc=function(c){return c.src}}else{this._getImg=function(){var c=document.createElement("DIV");c.innerHTML="&nbsp;";c.className="dhx_bg_img_fix";return c};this._setSrc=function(g,c){g.style.backgroundImage="url("+c+")"};this._getSrc=function(c){var g=c.style.backgroundImage;return g.substr(4,g.length-5).replace(/(^")|("$)/g,"")}}};dhtmlXTreeObject.prototype.destructor=function(){for(var c in this._idpull){var g=this._idpull[c];if(!g){continue}g.parentObject=null;g.treeNod=null;g.childNodes=null;g.span=null;g.tr.nodem=null;g.tr=null;g.htmlNode.objBelong=null;g.htmlNode=null;this._idpull[c]=null}this.parentObject.innerHTML="";this.allTree.onselectstart=null;this.allTree.oncontextmenu=null;this.allTree.onmousedown=null;for(var c in this){this[c]=null}};function cObject(){return this}cObject.prototype=new Object;cObject.prototype.clone=function(){function a(){}a.prototype=this;return new a()};function dhtmlXTreeItemObject(m,c,g,a,j,l){this.htmlNode="";this.acolor="";this.scolor="";this.tr=0;this.childsCount=0;this.tempDOMM=0;this.tempDOMU=0;this.dragSpan=0;this.dragMove=0;this.span=0;this.closeble=1;this.childNodes=new Array();this.userData=new cObject();this.checkstate=0;this.treeNod=a;this.label=c;this.parentObject=g;this.actionHandler=j;this.images=new Array(a.imageArray[0],a.imageArray[1],a.imageArray[2]);this.id=a._globalIdStorageAdd(m,this);if(this.treeNod.checkBoxOff){this.htmlNode=this.treeNod._createItem(1,this,l)}else{this.htmlNode=this.treeNod._createItem(0,this,l)}this.htmlNode.objBelong=this;return this}dhtmlXTreeObject.prototype._globalIdStorageAdd=function(c,a){if(this._globalIdStorageFind(c,1,1)){c=c+"_"+(new Date()).valueOf();return this._globalIdStorageAdd(c,a)}this._idpull[c]=a;this._pullSize++;return c};dhtmlXTreeObject.prototype._globalIdStorageSub=function(a){if(this._idpull[a]){this._unselectItem(this._idpull[a]);this._idpull[a]=null;this._pullSize--}if((this._locker)&&(this._locker[a])){this._locker[a]=false}};dhtmlXTreeObject.prototype._globalIdStorageFind=function(n,a,g,l){var m=this._idpull[n];if(m){if((m.unParsed)&&(!g)){this.reParse(m,0)}if(this._srnd&&!m.htmlNode){this._buildSRND(m,g)}if((l)&&(this._edsbpsA)){for(var c=0;c<this._edsbpsA.length;c++){if(this._edsbpsA[c][2]==n){dhx4.callEvent("ongetItemError",["Requested item still in parsing process.",n]);return null}}}return m}if((this.slowParse)&&(n!=0)&&(!a)){return this.preParse(n)}else{return null}};dhtmlXTreeObject.prototype._getSubItemsXML=function(a){var c=[];a.each("item",function(g){c.push(g.get("id"))},this);return c.join(this.dlmtr)};dhtmlXTreeObject.prototype.enableSmartXMLParsing=function(a){this.slowParse=dhx4.s2b(a)};dhtmlXTreeObject.prototype.findXML=function(c,a,g){};dhtmlXTreeObject.prototype._getAllCheckedXML=function(c,a,j){var g=[];if(j==2){c.through("item","checked",-1,function(l){g.push(l.get("id"))},this)}if(j==1){c.through("item","id",null,function(l){if(l.get("checked")&&(l.get("checked")!=-1)){g.push(l.get("id"))}},this)}if(j==0){c.through("item","id",null,function(l){if(!l.get("checked")||l.get("checked")==0){g.push(l.get("id"))}},this)}if(g.length){return a+(a?this.dlmtr:"")+g.join(this.dlmtr)}if(a){return a}else{return""}};dhtmlXTreeObject.prototype._setSubCheckedXML=function(a,c){var g=a?"1":"";c.through("item","id",null,function(j){if(!j.get("disabled")||j.get("disabled")==0){j.set("checked",g)}},this)};dhtmlXTreeObject.prototype._getAllScraggyItemsXML=function(g,a){var j=[];var c=function(l){if(!l.sub_exists("item")){j.push(l.get("id"))}else{l.each("item",c,this)}};c(g);return j.join(",")};dhtmlXTreeObject.prototype._getAllFatItemsXML=function(g,a){var j=[];var c=function(l){if(!l.sub_exists("item")){return}j.push(l.get("id"));l.each("item",c,this)};c(g);return j.join(",")};dhtmlXTreeObject.prototype._getAllSubItemsXML=function(g,c,a){var c=[];a.through("item","id",null,function(j){c.push(j.get("id"))},this);return c.join(",")};dhtmlXTreeObject.prototype.reParse=function(g){var m=this;if(!this.parsCount){m.callEvent("onXLS",[m,g.id])}this.xmlstate=1;var j=g.unParsed;g.unParsed=0;this.XMLloadingWarning=1;var a=this.parsingOn;var o=this.waitUpdateXML;var q=this.parsedArray;this.parsedArray=new Array();this.waitUpdateXML=false;this.parsingOn=g.id;this.parsedArray=new Array();this.setCheckList="";this._parse(j,g.id,2);var r=this.setCheckList.split(this.dlmtr);for(var l=0;l<this.parsedArray.length;l++){g.htmlNode.childNodes[0].appendChild(this.parsedArray[l])}if(j.get("order")&&j.get("order")!="none"){this._reorderBranch(g,j.get("order"),true)}this.oldsmcheck=this.smcheck;this.smcheck=false;for(var c=0;c<r.length;c++){if(r[c]){this.setCheck(r[c],1)}}this.smcheck=this.oldsmcheck;this.parsingOn=a;this.waitUpdateXML=o;this.parsedArray=q;this.XMLloadingWarning=0;this._redrawFrom(this,g);if(this._srnd&&!g._sready){this.prepareSR(g.id)}this.xmlstate=0;return true};dhtmlXTreeObject.prototype.preParse=function(c){if(!c||!this._p){return null}var a=false;this._p.clone().through("item","id",c,function(j){this._globalIdStorageFind(j.up().get("id"));return a=true},this);if(a){var g=this._globalIdStorageFind(c,true,false);if(!g){dhx4.callEvent("ongetItemError",["The item "+c+" not operable. Seems you have non-unique|incorrect IDs in tree's XML.",c])}}return g};dhtmlXTreeObject.prototype._escape=function(a){switch(this.utfesc){case"none":return a;break;case"utf8":return encodeURIComponent(a);break;default:return escape(a);break}};dhtmlXTreeObject.prototype._drawNewTr=function(l,g){var j=document.createElement("tr");var c=document.createElement("td");var a=document.createElement("td");c.appendChild(document.createTextNode(" "));a.colSpan=3;a.appendChild(l);j.appendChild(c);j.appendChild(a);return j};dhtmlXTreeObject.prototype.loadXMLString=function(g,c){var a=this;if(!this.parsCount){this.callEvent("onXLS",[a,null])}this.xmlstate=1;this.XMLLoader({responseXML:dhx4.ajax.parse(g)},c)};dhtmlXTreeObject.prototype.loadXML=function(c,j){if(this._datamode&&this._datamode!="xml"){return this["load"+this._datamode.toUpperCase()](c,j)}var g=this;if(!this.parsCount){this.callEvent("onXLS",[g,this._ld_id])}this._ld_id=null;this.xmlstate=1;this.XMLLoader=this._parseXMLTree;var a=this;dhx4.ajax.get(c,function(l){a.XMLLoader(l.xmlDoc,j);a=null})};dhtmlXTreeObject.prototype._attachChildNode=function(o,m,j,q,E,D,C,r,g,v,w){if(v&&v.parentObject){o=v.parentObject}if(((o.XMLload==0)&&(this.XMLsource))&&(!this.XMLloadingWarning)){o.XMLload=1;this._loadDynXML(o.id)}var s=o.childsCount;var F=o.childNodes;if(w&&w.tr.previousSibling){if(w.tr.previousSibling.previousSibling){v=w.tr.previousSibling.nodem}else{r=r.replace("TOP","")+",TOP"}}if(v){var l,A;for(l=0;l<s;l++){if(F[l]==v){for(A=s;A!=l;A--){F[1+A]=F[A]}break}}l++;s=l}if(r){var x=r.split(",");for(var y=0;y<x.length;y++){switch(x[y]){case"TOP":if(o.childsCount>0){v=new Object;v.tr=o.childNodes[0].tr.previousSibling}o._has_top=true;for(l=s;l>0;l--){F[l]=F[l-1]}s=0;break}}}var u;if(!(u=this._idpull[m])||u.span!=-1){u=F[s]=new dhtmlXTreeItemObject(m,j,o,this,q,1);m=F[s].id;o.childsCount++}if(!u.htmlNode){u.label=j;u.htmlNode=this._createItem((this.checkBoxOff?1:0),u);u.htmlNode.objBelong=u}if(E){u.images[0]=E}if(D){u.images[1]=D}if(C){u.images[2]=C}var c=this._drawNewTr(u.htmlNode);if((this.XMLloadingWarning)||(this._hAdI)){u.htmlNode.parentNode.parentNode.style.display="none"}if((v)&&v.tr&&(v.tr.nextSibling)){o.htmlNode.childNodes[0].insertBefore(c,v.tr.nextSibling)}else{if(this.parsingOn==o.id){this.parsedArray[this.parsedArray.length]=c}else{o.htmlNode.childNodes[0].appendChild(c)}}if((v)&&(!v.span)){v=null}if(this.XMLsource){if((g)&&(g!=0)){u.XMLload=0}else{u.XMLload=1}}u.tr=c;c.nodem=u;if(o.itemId==0){c.childNodes[0].className="hiddenRow"}if((o._r_logic)||(this._frbtr)){this._setSrc(u.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0])}if(r){var x=r.split(",");for(var y=0;y<x.length;y++){switch(x[y]){case"SELECT":this.selectItem(m,false);break;case"CALL":this.selectItem(m,true);break;case"CHILD":u.XMLload=0;break;case"CHECKED":if(this.XMLloadingWarning){this.setCheckList+=this.dlmtr+m}else{this.setCheck(m,1)}break;case"HCHECKED":this._setCheck(u,"unsure");break;case"OPEN":u.openMe=1;break}}}if(!this.XMLloadingWarning){if((this._getOpenState(o)<0)&&(!this._hAdI)){this.openItem(o.id)}if(v){this._correctPlus(v);this._correctLine(v)}this._correctPlus(o);this._correctLine(o);this._correctPlus(u);if(o.childsCount>=2){this._correctPlus(F[o.childsCount-2]);this._correctLine(F[o.childsCount-2])}if(o.childsCount!=2){this._correctPlus(F[0])}if(this.tscheck){this._correctCheckStates(o)}if(this._onradh){if(this.xmlstate==1){var a=this.onXLE;this.onXLE=function(n){this._onradh(m);if(a){a(n)}}}else{this._onradh(m)}}}return u};dhtmlXTreeObject.prototype.enableContextMenu=function(a){if(a){this.cMenu=a}};dhtmlXTreeObject.prototype.setItemContextMenu=function(m,j){var a=m.toString().split(this.dlmtr);for(var g=0;g<a.length;g++){var c=this._globalIdStorageFind(a[g]);if(!c){continue}c.cMenu=j}};dhtmlXTreeObject.prototype.insertNewItem=function(j,o,r,g,n,m,l,c,a){var s=this._globalIdStorageFind(j);if(!s){return(-1)}var q=this._attachChildNode(s,o,r,g,n,m,l,c,a);if(!this._idpull[this.rootId].XMLload){this._idpull[this.rootId].XMLload=1}if((!this.XMLloadingWarning)&&(this.childCalc)){this._fixChildCountLabel(s)}return q};dhtmlXTreeObject.prototype.insertNewChild=function(j,o,q,g,n,m,l,c,a){return this.insertNewItem(j,o,q,g,n,m,l,c,a)};dhtmlXTreeObject.prototype._parseXMLTree=function(a,g){var c=new xmlPointer(dhx4.ajax.xmltop("tree",a));this._parse(c);this._p=c;if(g){g.call(this,a)}};dhtmlXTreeObject.prototype._parseItem=function(m,r,l,o){var g;if(this._srnd&&(!this._idpull[g=m.get("id")]||!this._idpull[g].span)){this._addItemSRND(r.id,g,m);return}var n=m.get_all();if((typeof(this.waitUpdateXML)=="object")&&(!this.waitUpdateXML[n.id])){this._parse(m,n.id,1);return}if((n.text===null)||(typeof(n.text)=="undefined")){n.text=m.sub("itemtext");if(n.text){n.text=n.text.content()}}var u=[];if(n.select){u.push("SELECT")}if(n.top){u.push("TOP")}if(n.call){this.nodeAskingCall=n.id}if(n.checked==-1){u.push("HCHECKED")}else{if(n.checked){u.push("CHECKED")}}if(n.open){u.push("OPEN")}if(this.waitUpdateXML){if(this._globalIdStorageFind(n.id)){var q=this.updateItem(n.id,n.text,n.im0,n.im1,n.im2,n.checked,n.child)}else{if(this.npl==0){u.push("TOP")}else{l=r.childNodes[this.npl]}var q=this._attachChildNode(r,n.id,n.text,0,n.im0,n.im1,n.im2,u.join(","),n.child,0,l);n.id=q.id;l=null}}else{var q=this._attachChildNode(r,n.id,n.text,0,n.im0,n.im1,n.im2,u.join(","),n.child,(o||0),l)}if(n.tooltip){q.span.parentNode.parentNode.title=n.tooltip}if(n.style){if(q.span.style.cssText){q.span.style.cssText+=(";"+n.style)}else{q.span.setAttribute("style",q.span.getAttribute("style")+"; "+n.style)}}if(n.radio){q._r_logic=true}if(n.nocheckbox){var s=q.span.parentNode.previousSibling.previousSibling;s.style.display="none";q.nocheckbox=true}if(n.disabled){if(n.checked!=null){this._setCheck(q,n.checked)}this.disableCheckbox(q,1)}q._acc=n.child||0;if(this.parserExtension){this.parserExtension._parseExtension.call(this,m,n,(r?r.id:0))}this.setItemColor(q,n.aCol,n.sCol);if(n.locked=="1"){this.lockItem(q.id,true,true)}if((n.imwidth)||(n.imheight)){this.setIconSize(n.imwidth,n.imheight,q)}if((n.closeable=="0")||(n.closeable=="1")){this.setItemCloseable(q,n.closeable)}var j="";if(n.topoffset){this.setItemTopOffset(q,n.topoffset)}if((!this.slowParse)||(typeof(this.waitUpdateXML)=="object")){if(m.sub_exists("item")){j=this._parse(m,n.id,1)}}else{if((!q.childsCount)&&m.sub_exists("item")){q.unParsed=m.clone()}m.each("userdata",function(a){this.setUserData(n.id,a.get("name"),a.content())},this)}if(j!=""){this.nodeAskingCall=j}m.each("userdata",function(a){this.setUserData(m.get("id"),a.get("name"),a.content())},this)};dhtmlXTreeObject.prototype._parse=function(g,m,a,c){if(this._srnd&&!this.parentObject.offsetHeight){var w=this;return window.setTimeout(function(){w._parse(g,m,a,c)},100)}if(!g.exists()){return}this.skipLock=true;if(!m){m=g.get("id");var u=g.get("dhx_security");if(u){dhtmlx.security_key=u}if(g.get("radio")){this.htmlNode._r_logic=true}this.parsingOn=m;this.parsedArray=new Array();this.setCheckList="";this.nodeAskingCall=""}var v=this._globalIdStorageFind(m);if(!v){return dhx4.callEvent("onDataStructureError",["XML refers to not existing parent"])}this.parsCount=this.parsCount?(this.parsCount+1):1;this.XMLloadingWarning=1;if((v.childsCount)&&(!c)&&(!this._edsbps)&&(!v._has_top)){var o=0}else{var o=0}this.npl=0;g.each("item",function(x,n){v.XMLload=1;this._parseItem(x,v,0,o);if((this._edsbps)&&(this.npl==this._edsbpsC)){this._distributedStart(g,n+1,m,a,v.childsCount);return -1}this.npl++},this,c);if(!a){g.each("userdata",function(n){this.setUserData(g.get("id"),n.get("name"),n.content())},this);v.XMLload=1;if(this.waitUpdateXML){this.waitUpdateXML=false;for(var l=v.childsCount-1;l>=0;l--){if(v.childNodes[l]._dmark){this.deleteItem(v.childNodes[l].id)}}}var r=this._globalIdStorageFind(this.parsingOn);for(var l=0;l<this.parsedArray.length;l++){v.htmlNode.childNodes[0].appendChild(this.parsedArray[l])}this.parsedArray=[];this.lastLoadedXMLId=m;this.XMLloadingWarning=0;var s=this.setCheckList.split(this.dlmtr);for(var j=0;j<s.length;j++){if(s[j]){this.setCheck(s[j],1)}}if((this.XMLsource)&&(this.tscheck)&&(this.smcheck)&&(v.id!=this.rootId)){if(v.checkstate===0){this._setSubChecked(0,v)}else{if(v.checkstate===1){this._setSubChecked(1,v)}}}this._redrawFrom(this,null,c);if(g.get("order")&&g.get("order")!="none"){this._reorderBranch(v,g.get("order"),true)}if(this.nodeAskingCall!=""){this.callEvent("onClick",[this.nodeAskingCall,this.getSelectedItemId()])}if(this._branchUpdate){this._branchUpdateNext(g)}}if(this.parsCount==1){this.parsingOn=null;if(this._srnd&&v.id!=this.rootId){this.prepareSR(v.id);if(this.XMLsource){this.openItem(v.id)}}g.through("item","open",null,function(n){this.openItem(n.get("id"))},this);if((!this._edsbps)||(!this._edsbpsA.length)){var q=this;window.setTimeout(function(){q.callEvent("onXLE",[q,m])},1);this.xmlstate=0}this.skipLock=false}this.parsCount--;var q=this;if(this._edsbps){window.setTimeout(function(){q._distributedStep(m)},this._edsbpsD)}if(!a&&this.onXLE){this.onXLE(this,m)}return this.nodeAskingCall};dhtmlXTreeObject.prototype._branchUpdateNext=function(a){a.each("item",function(j){var g=j.get("id");if(this._idpull[g]&&(!this._idpull[g].XMLload)){return}this._branchUpdate++;this.smartRefreshItem(j.get("id"),j)},this);this._branchUpdate--};dhtmlXTreeObject.prototype.checkUserData=function(c,g){if((c.nodeType==1)&&(c.tagName=="userdata")){var a=c.getAttribute("name");if((a)&&(c.childNodes[0])){this.setUserData(g,a,c.childNodes[0].data)}}};dhtmlXTreeObject.prototype._redrawFrom=function(o,c,n,g){if(!c){var l=o._globalIdStorageFind(o.lastLoadedXMLId);o.lastLoadedXMLId=-1;if(!l){return 0}}else{l=c}var m=0;for(var j=(n?n-1:0);j<l.childsCount;j++){if((!this._branchUpdate)||(this._getOpenState(l)==1)){if((!c)||(g==1)){l.childNodes[j].htmlNode.parentNode.parentNode.style.display=""}}if(l.childNodes[j].openMe==1){this._openItem(l.childNodes[j]);l.childNodes[j].openMe=0}o._redrawFrom(o,l.childNodes[j]);if(this.childCalc!=null){if((l.childNodes[j].unParsed)||((!l.childNodes[j].XMLload)&&(this.XMLsource))){if(l.childNodes[j]._acc){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+l.childNodes[j]._acc+this.htmlcB}else{l.childNodes[j].span.innerHTML=l.childNodes[j].label}}if((l.childNodes[j].childNodes.length)&&(this.childCalc)){if(this.childCalc==1){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+l.childNodes[j].childsCount+this.htmlcB}if(this.childCalc==2){var a=l.childNodes[j].childsCount-(l.childNodes[j].pureChilds||0);if(a){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+a+this.htmlcB}if(l.pureChilds){l.pureChilds++}else{l.pureChilds=1}}if(this.childCalc==3){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+l.childNodes[j]._acc+this.htmlcB}if(this.childCalc==4){var a=l.childNodes[j]._acc;if(a){l.childNodes[j].span.innerHTML=l.childNodes[j].label+this.htmlcA+a+this.htmlcB}}}else{if(this.childCalc==4){m++}}m+=l.childNodes[j]._acc;if(this.childCalc==3){m++}}}if((!l.unParsed)&&((l.XMLload)||(!this.XMLsource))){l._acc=m}o._correctLine(l);o._correctPlus(l);if((this.childCalc)&&(!c)){o._fixChildCountLabel(l)}};dhtmlXTreeObject.prototype._createSelf=function(){var a=document.createElement("div");a.className="containerTableStyle";a.style.width=this.width;a.style.height=this.height;this.parentObject.appendChild(a);return a};dhtmlXTreeObject.prototype._xcloseAll=function(c){if(c.unParsed){return}if(this.rootId!=c.id){if(!c.htmlNode){return}var j=c.htmlNode.childNodes[0].childNodes;var a=j.length;for(var g=1;g<a;g++){j[g].style.display="none"}this._correctPlus(c)}for(var g=0;g<c.childsCount;g++){if(c.childNodes[g].childsCount){this._xcloseAll(c.childNodes[g])}}};dhtmlXTreeObject.prototype._xopenAll=function(a){this._HideShow(a,2);for(var c=0;c<a.childsCount;c++){this._xopenAll(a.childNodes[c])}};dhtmlXTreeObject.prototype._correctPlus=function(c){if(!c.htmlNode){return}var g=c.htmlNode.childNodes[0].childNodes[0].childNodes[0].lastChild;var l=c.htmlNode.childNodes[0].childNodes[0].childNodes[2].childNodes[0];var a=this.lineArray;if((this.XMLsource)&&(!c.XMLload)){var a=this.plusArray;this._setSrc(l,this.iconURL+c.images[2]);if(this._txtimg){return(g.innerHTML="[+]")}}else{if((c.childsCount)||(c.unParsed)){if((c.htmlNode.childNodes[0].childNodes[1])&&(c.htmlNode.childNodes[0].childNodes[1].style.display!="none")){if(!c.wsign){var a=this.minusArray}this._setSrc(l,this.iconURL+c.images[1]);if(this._txtimg){return(g.innerHTML="[-]")}}else{if(!c.wsign){var a=this.plusArray}this._setSrc(l,this.iconURL+c.images[2]);if(this._txtimg){return(g.innerHTML="[+]")}}}else{this._setSrc(l,this.iconURL+c.images[0])}}var j=2;if(!c.treeNod.treeLinesOn){this._setSrc(g,this.imPath+a[3])}else{if(c.parentObject){j=this._getCountStatus(c.id,c.parentObject)}this._setSrc(g,this.imPath+a[j])}};dhtmlXTreeObject.prototype._correctLine=function(c){if(!c.htmlNode){return}var a=c.parentObject;if(a){if((this._getLineStatus(c.id,a)==0)||(!this.treeLinesOn)){for(var g=1;g<=c.childsCount;g++){if(!c.htmlNode.childNodes[0].childNodes[g]){break}c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundImage="";c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundRepeat=""}}else{for(var g=1;g<=c.childsCount;g++){if(!c.htmlNode.childNodes[0].childNodes[g]){break}c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundImage="url("+this.imPath+this.lineArray[5]+")";c.htmlNode.childNodes[0].childNodes[g].childNodes[0].style.backgroundRepeat="repeat-y"}}}};dhtmlXTreeObject.prototype._getCountStatus=function(c,a){if(a.childsCount<=1){if(a.id==this.rootId){return 4}else{return 0}}if(a.childNodes[0].id==c){if(a.id==this.rootId){return 2}else{return 1}}if(a.childNodes[a.childsCount-1].id==c){return 0}return 1};dhtmlXTreeObject.prototype._getLineStatus=function(c,a){if(a.childNodes[a.childsCount-1].id==c){return 0}return 1};dhtmlXTreeObject.prototype._HideShow=function(c,l){if((this.XMLsource)&&(!c.XMLload)){if(l==1){return}c.XMLload=1;this._loadDynXML(c.id);return}if(c.unParsed){this.reParse(c)}var j=c.htmlNode.childNodes[0].childNodes;var a=j.length;if(a>1){if(((j[1].style.display!="none")||(l==1))&&(l!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";nodestyle="none"}else{nodestyle=""}for(var g=1;g<a;g++){j[g].style.display=nodestyle}}this._correctPlus(c)};dhtmlXTreeObject.prototype._getOpenState=function(a){if(!a.htmlNode){return 0}var c=a.htmlNode.childNodes[0].childNodes;if(c.length<=1){return 0}if(c[1].style.display!="none"){return 1}else{return -1}};dhtmlXTreeObject.prototype.onRowClick2=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onDblClick",[this.parentObject.id,a])){return false}if((this.parentObject.closeble)&&(this.parentObject.closeble!="0")){a._HideShow(this.parentObject)}else{a._HideShow(this.parentObject,2)}if(a.checkEvent("onOpenEnd")){if(!a.xmlstate){a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])}else{a._oie_onXLE.push(a.onXLE);a.onXLE=a._epnFHe}}return false};dhtmlXTreeObject.prototype.onRowClick=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onOpenStart",[this.parentObject.id,a._getOpenState(this.parentObject)])){return 0}if((this.parentObject.closeble)&&(this.parentObject.closeble!="0")){a._HideShow(this.parentObject)}else{a._HideShow(this.parentObject,2)}if(a.checkEvent("onOpenEnd")){if(!a.xmlstate){a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])}else{a._oie_onXLE.push(a.onXLE);a.onXLE=a._epnFHe}}};dhtmlXTreeObject.prototype._epnFHe=function(c,g,a){if(g!=this.rootId){this.callEvent("onOpenEnd",[g,c.getOpenState(g)])}c.onXLE=c._oie_onXLE.pop();if(!a&&!c._oie_onXLE.length){if(c.onXLE){c.onXLE(c,g)}}};dhtmlXTreeObject.prototype.onRowClickDown=function(c){c=c||window.event;var a=this.parentObject.treeNod;a._selectItem(this.parentObject,c)};dhtmlXTreeObject.prototype.getSelectedItemId=function(){var c=new Array();for(var a=0;a<this._selected.length;a++){c[a]=this._selected[a].id}return(c.join(this.dlmtr))};dhtmlXTreeObject.prototype._selectItem=function(m,n){if(this.checkEvent("onSelect")){this._onSSCFold=this.getSelectedItemId()}if((!this._amsel)||(!n)||((!n.ctrlKey)&&(!n.metaKey)&&(!n.shiftKey))){this._unselectItems()}if((m.i_sel)&&(this._amsel)&&(n)&&(n.ctrlKey||n.metaKey)){this._unselectItem(m)}else{if((!m.i_sel)&&((!this._amselS)||(this._selected.length==0)||(this._selected[0].parentObject==m.parentObject))){if((this._amsel)&&(n)&&(n.shiftKey)&&(this._selected.length!=0)&&(this._selected[this._selected.length-1].parentObject==m.parentObject)){var j=this._getIndex(this._selected[this._selected.length-1]);var g=this._getIndex(m);if(g<j){var q=j;j=g;g=q}for(var l=j;l<=g;l++){if(!m.parentObject.childNodes[l].i_sel){this._markItem(m.parentObject.childNodes[l])}}}else{this._markItem(m)}}}if(this.checkEvent("onSelect")){var o=this.getSelectedItemId();if(o!=this._onSSCFold){this.callEvent("onSelect",[o])}}};dhtmlXTreeObject.prototype._markItem=function(a){if(a.scolor){a.span.style.color=a.scolor}a.span.className="selectedTreeRow";a.i_sel=true;this._selected[this._selected.length]=a};dhtmlXTreeObject.prototype.getIndexById=function(c){var a=this._globalIdStorageFind(c);if(!a){return null}return this._getIndex(a)};dhtmlXTreeObject.prototype._getIndex=function(a){var g=a.parentObject;for(var c=0;c<g.childsCount;c++){if(g.childNodes[c]==a){return c}}};dhtmlXTreeObject.prototype._unselectItem=function(c){if((c)&&(c.i_sel)){c.span.className="standartTreeRow";if(c.acolor){c.span.style.color=c.acolor}c.i_sel=false;for(var a=0;a<this._selected.length;a++){if(!this._selected[a].i_sel){this._selected.splice(a,1);break}}}};dhtmlXTreeObject.prototype._unselectItems=function(){for(var a=0;a<this._selected.length;a++){var c=this._selected[a];c.span.className="standartTreeRow";if(c.acolor){c.span.style.color=c.acolor}c.i_sel=false}this._selected=new Array()};dhtmlXTreeObject.prototype.onRowSelect=function(j,g,m){j=j||window.event;var c=this.parentObject;if(g){c=g.parentObject}var a=c.treeNod;var l=a.getSelectedItemId();if((!j)||(!j.skipUnSel)){a._selectItem(c,j)}if(!m){if(c.actionHandler){c.actionHandler(c.id,l)}else{a.callEvent("onClick",[c.id,l])}}};dhtmlXTreeObject.prototype._correctCheckStates=function(l){if(!this.tscheck){return}if(!l){return}if(l.id==this.rootId){return}var g=l.childNodes;var c=0;var a=0;if(l.childsCount==0){return}for(var j=0;j<l.childsCount;j++){if(g[j].dscheck){continue}if(g[j].checkstate==0){c=1}else{if(g[j].checkstate==1){a=1}else{c=1;a=1;break}}}if((c)&&(a)){this._setCheck(l,"unsure")}else{if(c){this._setCheck(l,false)}else{this._setCheck(l,true)}}this._correctCheckStates(l.parentObject)};dhtmlXTreeObject.prototype.onCheckBoxClick=function(a){if(!this.treeNod.callEvent("onBeforeCheck",[this.parentObject.id,this.parentObject.checkstate])){return}if(this.parentObject.dscheck){return true}if(this.treeNod.tscheck){if(this.parentObject.checkstate==1){this.treeNod._setSubChecked(false,this.parentObject)}else{this.treeNod._setSubChecked(true,this.parentObject)}}else{if(this.parentObject.checkstate==1){this.treeNod._setCheck(this.parentObject,false)}else{this.treeNod._setCheck(this.parentObject,true)}}this.treeNod._correctCheckStates(this.parentObject.parentObject);return this.treeNod.callEvent("onCheck",[this.parentObject.id,this.parentObject.checkstate])};dhtmlXTreeObject.prototype._createItem=function(u,s,o){var v=document.createElement("table");v.cellSpacing=0;v.cellPadding=0;v.border=0;if(this.hfMode){v.style.tableLayout="fixed"}v.style.margin=0;v.style.padding=0;var n=document.createElement("tbody");var r=document.createElement("tr");var j=document.createElement("td");j.className="standartTreeImage";if(this._txtimg){var l=document.createElement("div");j.appendChild(l);l.className="dhx_tree_textSign"}else{var l=this._getImg(s.id);l.border="0";if(l.tagName=="IMG"){l.align="absmiddle"}j.appendChild(l);l.style.padding=0;l.style.margin=0;l.style.width=this.def_line_img_x}var g=document.createElement("td");var q=this._getImg(this.cBROf?this.rootId:s.id);q.checked=0;this._setSrc(q,this.imPath+this.checkArray[0]);q.style.width="18px";q.style.height="18px";if(!u){g.style.display="none"}g.appendChild(q);if((!this.cBROf)&&(q.tagName=="IMG")){q.align="absmiddle"}q.onclick=this.onCheckBoxClick;q.treeNod=this;q.parentObject=s;if(!window._KHTMLrv){g.width="20px"}else{g.width="16px"}var c=document.createElement("td");c.className="standartTreeImage";var m=this._getImg(this.timgen?s.id:this.rootId);m.onmousedown=this._preventNsDrag;m.ondragstart=this._preventNsDrag;m.border="0";if(this._aimgs){m.parentObject=s;if(m.tagName=="IMG"){m.align="absmiddle"}m.onclick=this.onRowSelect}if(!o){this._setSrc(m,this.iconURL+this.imageArray[0])}c.appendChild(m);m.style.padding=0;m.style.margin=0;if(this.timgen){c.style.width=m.style.width=this.def_img_x;m.style.height=this.def_img_y}else{m.style.width="0px";m.style.height="0px";if(_isOpera||window._KHTMLrv){c.style.display="none"}}var a=document.createElement("td");a.className="standartTreeRow";s.span=document.createElement("span");s.span.className="standartTreeRow";if(this.mlitems){s.span.style.width=this.mlitems;s.span.style.display="block"}else{a.noWrap=true}if(dhx4.isIE8){a.style.width="99999px"}else{if(!window._KHTMLrv){a.style.width="100%"}}s.span.innerHTML=s.label;a.appendChild(s.span);a.parentObject=s;j.parentObject=s;a.onclick=this.onRowSelect;j.onclick=this.onRowClick;a.ondblclick=this.onRowClick2;if(this.ettip){r.title=s.label}if(this.dragAndDropOff){if(this._aimgs){this.dragger.addDraggableItem(c,this);c.parentObject=s}this.dragger.addDraggableItem(a,this)}s.span.style.paddingLeft="5px";s.span.style.paddingRight="5px";a.style.verticalAlign="";a.style.fontSize="10pt";a.style.cursor=this.style_pointer;r.appendChild(j);r.appendChild(g);r.appendChild(c);r.appendChild(a);n.appendChild(r);v.appendChild(n);if(this.ehlt||this.checkEvent("onMouseIn")||this.checkEvent("onMouseOut")){r.onmousemove=this._itemMouseIn;r[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut}return v};dhtmlXTreeObject.prototype.setImagePath=function(a){this.imPath=a;this.iconURL=a};dhtmlXTreeObject.prototype.setIconPath=function(a){this.iconURL=a};dhtmlXTreeObject.prototype._getLeafCount=function(j){var g=0;for(var c=0;c<j.childsCount;c++){if(j.childNodes[c].childsCount==0){g++}}return g};dhtmlXTreeObject.prototype._getChildCounterValue=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}if((a.unParsed)||((!a.XMLload)&&(this.XMLsource))){return a._acc}switch(this.childCalc){case 1:return a.childsCount;break;case 2:return this._getLeafCount(a);break;case 3:return a._acc;break;case 4:return a._acc;break}};dhtmlXTreeObject.prototype._fixChildCountLabel=function(m,j){if(this.childCalc==null){return}if((m.unParsed)||((!m.XMLload)&&(this.XMLsource))){if(m._acc){m.span.innerHTML=m.label+this.htmlcA+m._acc+this.htmlcB}else{m.span.innerHTML=m.label}return}switch(this.childCalc){case 1:if(m.childsCount!=0){m.span.innerHTML=m.label+this.htmlcA+m.childsCount+this.htmlcB}else{m.span.innerHTML=m.label}break;case 2:var l=this._getLeafCount(m);if(l!=0){m.span.innerHTML=m.label+this.htmlcA+l+this.htmlcB}else{m.span.innerHTML=m.label}break;case 3:if(m.childsCount!=0){var g=0;for(var c=0;c<m.childsCount;c++){if(!m.childNodes[c]._acc){m.childNodes[c]._acc=0}g+=m.childNodes[c]._acc*1}g+=m.childsCount*1;m.span.innerHTML=m.label+this.htmlcA+g+this.htmlcB;m._acc=g}else{m.span.innerHTML=m.label;m._acc=0}if((m.parentObject)&&(m.parentObject!=this.htmlNode)){this._fixChildCountLabel(m.parentObject)}break;case 4:if(m.childsCount!=0){var g=0;for(var c=0;c<m.childsCount;c++){if(!m.childNodes[c]._acc){m.childNodes[c]._acc=1}g+=m.childNodes[c]._acc*1}m.span.innerHTML=m.label+this.htmlcA+g+this.htmlcB;m._acc=g}else{m.span.innerHTML=m.label;m._acc=1}if((m.parentObject)&&(m.parentObject!=this.htmlNode)){this._fixChildCountLabel(m.parentObject)}break}};dhtmlXTreeObject.prototype.setChildCalcMode=function(a){switch(a){case"child":this.childCalc=1;break;case"leafs":this.childCalc=2;break;case"childrec":this.childCalc=3;break;case"leafsrec":this.childCalc=4;break;case"disabled":this.childCalc=null;break;default:this.childCalc=4}};dhtmlXTreeObject.prototype.setChildCalcHTML=function(c,a){this.htmlcA=c;this.htmlcB=a};dhtmlXTreeObject.prototype.setOnRightClickHandler=function(a){this.attachEvent("onRightClick",a)};dhtmlXTreeObject.prototype.setOnClickHandler=function(a){this.attachEvent("onClick",a)};dhtmlXTreeObject.prototype.setOnSelectStateChange=function(a){this.attachEvent("onSelect",a)};dhtmlXTreeObject.prototype.setXMLAutoLoading=function(a){this.XMLsource=a};dhtmlXTreeObject.prototype.setOnCheckHandler=function(a){this.attachEvent("onCheck",a)};dhtmlXTreeObject.prototype.setOnOpenHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(a){this.attachEvent("onOpenEnd",a)};dhtmlXTreeObject.prototype.setOnDblClickHandler=function(a){this.attachEvent("onDblClick",a)};dhtmlXTreeObject.prototype.openAllItems=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}this._xopenAll(a)};dhtmlXTreeObject.prototype.getOpenState=function(c){var a=this._globalIdStorageFind(c);if(!a){return""}return this._getOpenState(a)};dhtmlXTreeObject.prototype.closeAllItems=function(c){if(c===window.undefined){c=this.rootId}var a=this._globalIdStorageFind(c);if(!a){return 0}this._xcloseAll(a);this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};dhtmlXTreeObject.prototype.setUserData=function(j,c,g){var a=this._globalIdStorageFind(j,0,true);if(!a){return}if(c=="hint"){a.htmlNode.childNodes[0].childNodes[0].title=g}if(typeof(a.userData["t_"+c])=="undefined"){if(!a._userdatalist){a._userdatalist=c}else{a._userdatalist+=","+c}}a.userData["t_"+c]=g};dhtmlXTreeObject.prototype.getUserData=function(g,c){var a=this._globalIdStorageFind(g,0,true);if(!a){return}return a.userData["t_"+c]};dhtmlXTreeObject.prototype.getItemColor=function(g){var a=this._globalIdStorageFind(g);if(!a){return 0}var c=new Object();if(a.acolor){c.acolor=a.acolor}if(a.scolor){c.scolor=a.scolor}return c};dhtmlXTreeObject.prototype.setItemColor=function(g,c,j){if((g)&&(g.span)){var a=g}else{var a=this._globalIdStorageFind(g)}if(!a){return 0}else{if(a.i_sel){if(j){a.span.style.color=j}}else{if(c){a.span.style.color=c}}if(j){a.scolor=j}if(c){a.acolor=c}}};dhtmlXTreeObject.prototype.getItemText=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}return(a.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML)};dhtmlXTreeObject.prototype.getParentId=function(c){var a=this._globalIdStorageFind(c);if((!a)||(!a.parentObject)){return""}return a.parentObject.id};dhtmlXTreeObject.prototype.changeItemId=function(c,g){if(c==g){return}var a=this._globalIdStorageFind(c);if(!a){return 0}a.id=g;a.span.contextMenuId=g;this._idpull[g]=this._idpull[c];delete this._idpull[c]};dhtmlXTreeObject.prototype.doCut=function(){if(this.nodeCut){this.clearCut()}this.nodeCut=(new Array()).concat(this._selected);for(var a=0;a<this.nodeCut.length;a++){var c=this.nodeCut[a];c._cimgs=new Array();c._cimgs[0]=c.images[0];c._cimgs[1]=c.images[1];c._cimgs[2]=c.images[2];c.images[0]=c.images[1]=c.images[2]=this.cutImage;this._correctPlus(c)}};dhtmlXTreeObject.prototype.doPaste=function(g){var a=this._globalIdStorageFind(g);if(!a){return 0}for(var c=0;c<this.nodeCut.length;c++){if(this._checkPNodes(a,this.nodeCut[c])){continue}this._moveNode(this.nodeCut[c],a)}this.clearCut()};dhtmlXTreeObject.prototype.clearCut=function(){for(var a=0;a<this.nodeCut.length;a++){var c=this.nodeCut[a];c.images[0]=c._cimgs[0];c.images[1]=c._cimgs[1];c.images[2]=c._cimgs[2];this._correctPlus(c)}this.nodeCut=new Array()};dhtmlXTreeObject.prototype._moveNode=function(a,c){var m=this.dadmodec;if(m==1){var l=c;if(this.dadmodefix<0){while(true){l=this._getPrevNode(l);if((l==-1)){l=this.htmlNode;break}if((l.tr==0)||(l.tr.style.display=="")||(!l.parentObject)){break}}var j=l;var g=c}else{if((l.tr)&&(l.tr.nextSibling)&&(l.tr.nextSibling.nodem)&&(this._getOpenState(l)<1)){l=l.tr.nextSibling.nodem}else{l=this._getNextNode(l);if((l==-1)){l=this.htmlNode}}var g=l;var j=c}if(this._getNodeLevel(j,0)>this._getNodeLevel(g,0)){if(!this.dropLower){return this._moveNodeTo(a,j.parentObject)}else{if(g.id!=this.rootId){return this._moveNodeTo(a,g.parentObject,g)}else{return this._moveNodeTo(a,this.htmlNode,null)}}}else{return this._moveNodeTo(a,g.parentObject,g)}}else{return this._moveNodeTo(a,c)}};dhtmlXTreeObject.prototype._fixNodesCollection=function(o,m){var c=0;var j=0;var n=o.childNodes;var a=o.childsCount-1;if(m==n[a]){return}for(var l=0;l<a;l++){if(n[l]==n[a]){n[l]=n[l+1];n[l+1]=n[a]}}for(var l=0;l<a+1;l++){if(c){var g=n[l];n[l]=c;c=g}else{if(n[l]==m){c=n[l];n[l]=n[a]}}}};dhtmlXTreeObject.prototype._recreateBranch=function(m,o,l,a){var c;var q="";if(l){for(c=0;c<o.childsCount;c++){if(o.childNodes[c]==l){break}}if(c!=0){l=o.childNodes[c-1]}else{q="TOP";l=""}}var g=this._onradh;this._onradh=null;var n=this._attachChildNode(o,m.id,m.label,0,m.images[0],m.images[1],m.images[2],q,0,l);n._userdatalist=m._userdatalist;n.userData=m.userData.clone();if(m._attrs){n._attrs={};for(var j in m._attrs){n._attrs[j]=m._attrs[j]}}n.XMLload=m.XMLload;if(g){this._onradh=g;this._onradh(n.id)}if(m.treeNod.dpcpy){m.treeNod._globalIdStorageFind(m.id)}else{n.unParsed=m.unParsed}this._correctPlus(n);for(var c=0;c<m.childsCount;c++){this._recreateBranch(m.childNodes[c],n,0,1)}if((!a)&&(this.childCalc)){this._redrawFrom(this,o)}return n};dhtmlXTreeObject.prototype._moveNodeTo=function(u,w,s){if(u.treeNod._nonTrivialNode){return u.treeNod._nonTrivialNode(this,w,s,u)}if(this._checkPNodes(w,u)){return false}if(w.mytype){var n=(u.treeNod.lWin!=w.lWin)}else{var n=(u.treeNod.lWin!=w.treeNod.lWin)}if(!this.callEvent("onDrag",[u.id,w.id,(s?s.id:null),u.treeNod,w.treeNod])){return false}if((w.XMLload==0)&&(this.XMLsource)){w.XMLload=1;this._loadDynXML(w.id)}this.openItem(w.id);var g=u.treeNod;var q=u.parentObject.childsCount;var r=u.parentObject;if((n)||(g.dpcpy)){var j=u.id;u=this._recreateBranch(u,w,s);if(!g.dpcpy){g.deleteItem(j)}}else{var l=w.childsCount;var v=w.childNodes;if(l==0){w._open=true}g._unselectItem(u);v[l]=u;u.treeNod=w.treeNod;w.childsCount++;var o=this._drawNewTr(v[l].htmlNode);if(!s){w.htmlNode.childNodes[0].appendChild(o);if(this.dadmode==1){this._fixNodesCollection(w,s)}}else{w.htmlNode.childNodes[0].insertBefore(o,s.tr);this._fixNodesCollection(w,s);v=w.childNodes}}if((!g.dpcpy)&&(!n)){var a=u.tr;if((document.all)&&(navigator.appVersion.search(/MSIE\ 5\.0/gi)!=-1)){window.setTimeout(function(){a.parentNode.removeChild(a)},250)}else{u.parentObject.htmlNode.childNodes[0].removeChild(u.tr)}if((!s)||(w!=u.parentObject)){for(var m=0;m<r.childsCount;m++){if(r.childNodes[m].id==u.id){r.childNodes[m]=0;break}}}else{r.childNodes[r.childsCount-1]=0}g._compressChildList(r.childsCount,r.childNodes);r.childsCount--}if((!n)&&(!g.dpcpy)){u.tr=o;o.nodem=u;u.parentObject=w;if(g!=w.treeNod){if(u.treeNod._registerBranch(u,g)){return}this._clearStyles(u);this._redrawFrom(this,u.parentObject);if(this._onradh){this._onradh(u.id)}}this._correctPlus(w);this._correctLine(w);this._correctLine(u);this._correctPlus(u);if(s){this._correctPlus(s)}else{if(w.childsCount>=2){this._correctPlus(v[w.childsCount-2]);this._correctLine(v[w.childsCount-2])}}this._correctPlus(v[w.childsCount-1]);if(this.tscheck){this._correctCheckStates(w)}if(g.tscheck){g._correctCheckStates(r)}}if(q>1){g._correctPlus(r.childNodes[q-2]);g._correctLine(r.childNodes[q-2])}g._correctPlus(r);g._correctLine(r);this._fixChildCountLabel(w);g._fixChildCountLabel(r);this.callEvent("onDrop",[u.id,w.id,(s?s.id:null),g,w.treeNod]);return u.id};dhtmlXTreeObject.prototype._clearStyles=function(a){if(!a.htmlNode){return}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1];var c=j.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=false;if(a._aimgs){this.dragger.removeDraggableItem(j.nextSibling)}if(this.checkBoxOff){j.childNodes[0].style.display="";j.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(j.childNodes[0],this.imPath+this.checkArray[a.checkstate])}else{j.style.display="none"}j.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);if(this.dragAndDropOff){this.dragger.addDraggableItem(c,this)}if(this._aimgs){this.dragger.addDraggableItem(j.nextSibling,this)}c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;j.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var g=0;g<a.childsCount;g++){this._clearStyles(a.childNodes[g])}};dhtmlXTreeObject.prototype._registerBranch=function(c,a){if(a){a._globalIdStorageSub(c.id)}c.id=this._globalIdStorageAdd(c.id,c);c.treeNod=this;for(var g=0;g<c.childsCount;g++){this._registerBranch(c.childNodes[g],a)}return 0};dhtmlXTreeObject.prototype.enableThreeStateCheckboxes=function(a){this.tscheck=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setOnMouseInHandler=function(a){this.ehlt=true;this.attachEvent("onMouseIn",a)};dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(a){this.ehlt=true;this.attachEvent("onMouseOut",a)};dhtmlXTreeObject.prototype.enableMercyDrag=function(a){this.dpcpy=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableTreeImages=function(a){this.timgen=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableFixedMode=function(a){this.hfMode=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableCheckBoxes=function(c,a){this.checkBoxOff=dhx4.s2b(c);this.cBROf=(!(this.checkBoxOff||dhx4.s2b(a)))};dhtmlXTreeObject.prototype.setStdImages=function(a,g,c){this.imageArray[0]=a;this.imageArray[1]=g;this.imageArray[2]=c};dhtmlXTreeObject.prototype.enableTreeLines=function(a){this.treeLinesOn=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setImageArrays=function(j,a,m,l,g,c){switch(j){case"plus":this.plusArray[0]=a;this.plusArray[1]=m;this.plusArray[2]=l;this.plusArray[3]=g;this.plusArray[4]=c;break;case"minus":this.minusArray[0]=a;this.minusArray[1]=m;this.minusArray[2]=l;this.minusArray[3]=g;this.minusArray[4]=c;break}};dhtmlXTreeObject.prototype.openItem=function(c){this.skipLock=true;var a=this._globalIdStorageFind(c);if(!a){return 0}else{return this._openItem(a)}this.skipLock=false};dhtmlXTreeObject.prototype._openItem=function(a){var c=this._getOpenState(a);if((c<0)||(((this.XMLsource)&&(!a.XMLload)))){if(!this.callEvent("onOpenStart",[a.id,c])){return 0}this._HideShow(a,2);if(this.checkEvent("onOpenEnd")){if(this.onXLE==this._epnFHe){this._epnFHe(this,a.id,true)}if(!this.xmlstate||!this.XMLsource){this.callEvent("onOpenEnd",[a.id,this._getOpenState(a)])}else{this._oie_onXLE.push(this.onXLE);this.onXLE=this._epnFHe}}}else{if(this._srnd){this._HideShow(a,2)}}if(a.parentObject&&!this._skip_open_parent){this._openItem(a.parentObject)}};dhtmlXTreeObject.prototype.closeItem=function(c){if(this.rootId==c){return 0}this.skipLock=true;var a=this._globalIdStorageFind(c);if(!a){return 0}if(a.closeble){this._HideShow(a,1)}this.skipLock=false};dhtmlXTreeObject.prototype.getLevel=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}return this._getNodeLevel(a,0)};dhtmlXTreeObject.prototype.setItemCloseable=function(g,a){a=dhx4.s2b(a);if((g)&&(g.span)){var c=g}else{var c=this._globalIdStorageFind(g)}if(!c){return 0}c.closeble=a};dhtmlXTreeObject.prototype._getNodeLevel=function(a,c){if(a.parentObject){return this._getNodeLevel(a.parentObject,c+1)}return(c)};dhtmlXTreeObject.prototype.hasChildren=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}else{if((this.XMLsource)&&(!a.XMLload)){return true}else{return a.childsCount}}};dhtmlXTreeObject.prototype._getLeafCount=function(j){var g=0;for(var c=0;c<j.childsCount;c++){if(j.childNodes[c].childsCount==0){g++}}return g};dhtmlXTreeObject.prototype.setItemText=function(j,g,c){var a=this._globalIdStorageFind(j);if(!a){return 0}a.label=g;a.span.innerHTML=g;if(this.childCalc){this._fixChildCountLabel(a)}a.span.parentNode.parentNode.title=c||""};dhtmlXTreeObject.prototype.getItemTooltip=function(c){var a=this._globalIdStorageFind(c);if(!a){return""}return(a.span.parentNode.parentNode._dhx_title||a.span.parentNode.parentNode.title||"")};dhtmlXTreeObject.prototype.refreshItem=function(c){if(!c){c=this.rootId}var a=this._globalIdStorageFind(c);this.deleteChildItems(c);this._loadDynXML(c)};dhtmlXTreeObject.prototype.setItemImage2=function(j,a,l,g){var c=this._globalIdStorageFind(j);if(!c){return 0}c.images[1]=l;c.images[2]=g;c.images[0]=a;this._correctPlus(c)};dhtmlXTreeObject.prototype.setItemImage=function(g,a,j){var c=this._globalIdStorageFind(g);if(!c){return 0}if(j){c.images[1]=a;c.images[2]=j}else{c.images[0]=a}this._correctPlus(c)};dhtmlXTreeObject.prototype.getSubItems=function(g){var a=this._globalIdStorageFind(g,0,1);if(!a){return 0}if(a.unParsed){return(this._getSubItemsXML(a.unParsed))}var c="";for(i=0;i<a.childsCount;i++){if(!c){c=""+a.childNodes[i].id}else{c+=this.dlmtr+a.childNodes[i].id}}return c};dhtmlXTreeObject.prototype._getAllScraggyItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(j){j+=this.dlmtr+a}else{j=a}}}else{if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}}}return j};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){j+=this.dlmtr+a}}}return j};dhtmlXTreeObject.prototype._getAllSubItems=function(m,l,j){if(j){c=j}else{var c=this._globalIdStorageFind(m)}if(!c){return 0}l="";for(var g=0;g<c.childsCount;g++){if(!l){l=""+c.childNodes[g].id}else{l+=this.dlmtr+c.childNodes[g].id}var a=this._getAllSubItems(0,l,c.childNodes[g]);if(a){l+=this.dlmtr+a}}if(c.unParsed){l=this._getAllSubItemsXML(m,l,c.unParsed)}return l};dhtmlXTreeObject.prototype.selectItem=function(j,g,c){g=dhx4.s2b(g);var a=this._globalIdStorageFind(j);if((!a)||(!a.parentObject)){return 0}if(this.XMLloadingWarning){a.parentObject.openMe=1}else{this._openItem(a.parentObject)}var l=null;if(c){l=new Object;l.ctrlKey=true;if(a.i_sel){l.skipUnSel=true}}if(g){this.onRowSelect(l,a.htmlNode.childNodes[0].childNodes[0].childNodes[3],false)}else{this.onRowSelect(l,a.htmlNode.childNodes[0].childNodes[0].childNodes[3],true)}};dhtmlXTreeObject.prototype.getSelectedItemText=function(){var c=new Array();for(var a=0;a<this._selected.length;a++){c[a]=this._selected[a].span.innerHTML}return(c.join(this.dlmtr))};dhtmlXTreeObject.prototype._compressChildList=function(a,g){a--;for(var c=0;c<a;c++){if(g[c]==0){g[c]=g[c+1];g[c+1]=0}}};dhtmlXTreeObject.prototype._deleteNode=function(n,l,q){if((!l)||(!l.parentObject)){return 0}var a=0;var c=0;if(l.tr.nextSibling){a=l.tr.nextSibling.nodem}if(l.tr.previousSibling){c=l.tr.previousSibling.nodem}var m=l.parentObject;var g=m.childsCount;var o=m.childNodes;for(var j=0;j<g;j++){if(o[j].id==n){if(!q){m.htmlNode.childNodes[0].removeChild(o[j].tr)}o[j]=0;break}}this._compressChildList(g,o);if(!q){m.childsCount--}if(a){this._correctPlus(a);this._correctLine(a)}if(c){this._correctPlus(c);this._correctLine(c)}if(this.tscheck){this._correctCheckStates(m)}if(!q){this._globalIdStorageRecSub(l)}};dhtmlXTreeObject.prototype.setCheck=function(g,c){var a=this._globalIdStorageFind(g,0,1);if(!a){return}if(c==="unsure"){this._setCheck(a,c)}else{c=dhx4.s2b(c);if((this.tscheck)&&(this.smcheck)){this._setSubChecked(c,a)}else{this._setCheck(a,c)}}if(this.smcheck){this._correctCheckStates(a.parentObject)}};dhtmlXTreeObject.prototype._setCheck=function(a,g){if(!a){return}if(((a.parentObject._r_logic)||(this._frbtr))&&(g)){if(this._frbtrs){if(this._frbtrL){this.setCheck(this._frbtrL.id,0)}this._frbtrL=a}else{for(var c=0;c<a.parentObject.childsCount;c++){this._setCheck(a.parentObject.childNodes[c],0)}}}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if(g=="unsure"){a.checkstate=2}else{if(g){a.checkstate=1}else{a.checkstate=0}}if(a.dscheck){a.checkstate=a.dscheck}this._setSrc(j,this.imPath+((a.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[a.checkstate])};dhtmlXTreeObject.prototype.setSubChecked=function(g,c){var a=this._globalIdStorageFind(g);this._setSubChecked(c,a);this._correctCheckStates(a.parentObject)};dhtmlXTreeObject.prototype._setSubChecked=function(g,a){g=dhx4.s2b(g);if(!a){return}if(((a.parentObject._r_logic)||(this._frbtr))&&(g)){for(var c=0;c<a.parentObject.childsCount;c++){this._setSubChecked(0,a.parentObject.childNodes[c])}}if(a.unParsed){this._setSubCheckedXML(g,a.unParsed)}if(a._r_logic||this._frbtr){this._setSubChecked(g,a.childNodes[0])}else{for(var c=0;c<a.childsCount;c++){this._setSubChecked(g,a.childNodes[c])}}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if(g){a.checkstate=1}else{a.checkstate=0}if(a.dscheck){a.checkstate=a.dscheck}this._setSrc(j,this.imPath+((a.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[a.checkstate])};dhtmlXTreeObject.prototype.isItemChecked=function(c){var a=this._globalIdStorageFind(c);if(!a){return}return a.checkstate};dhtmlXTreeObject.prototype.deleteChildItems=function(l){var a=this._globalIdStorageFind(l);if(!a){return}var c=a.childsCount;for(var g=0;g<c;g++){this._deleteNode(a.childNodes[0].id,a.childNodes[0])}};dhtmlXTreeObject.prototype.deleteItem=function(g,a){if((!this._onrdlh)||(this._onrdlh(g))){var c=this._deleteItem(g,a);if(c){this._fixChildCountLabel(c)}}this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};dhtmlXTreeObject.prototype._deleteItem=function(m,c,l){c=dhx4.s2b(c);var a=this._globalIdStorageFind(m);if(!a){return}var g=this.getParentId(m);var j=a.parentObject;this._deleteNode(m,a,l);if(this._editCell&&this._editCell.id==m){this._editCell=null}this._correctPlus(j);this._correctLine(j);if((c)&&(g!=this.rootId)){this.selectItem(g,1)}return j};dhtmlXTreeObject.prototype._globalIdStorageRecSub=function(a){for(var c=0;c<a.childsCount;c++){this._globalIdStorageRecSub(a.childNodes[c]);this._globalIdStorageSub(a.childNodes[c].id)}this._globalIdStorageSub(a.id);var g=a;g.span=null;g.tr.nodem=null;g.tr=null;g.htmlNode=null};dhtmlXTreeObject.prototype.insertNewNext=function(o,s,r,g,m,l,j,c,a){var n=this._globalIdStorageFind(o);if((!n)||(!n.parentObject)){return(0)}var q=this._attachChildNode(0,s,r,g,m,l,j,c,a,n);if((!this.XMLloadingWarning)&&(this.childCalc)){this._fixChildCountLabel(n.parentObject)}return q};dhtmlXTreeObject.prototype.getItemIdByIndex=function(g,a){var c=this._globalIdStorageFind(g);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(g,a){var c=this._globalIdStorageFind(g);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.setDragHandler=function(a){this.attachEvent("onDrag",a)};dhtmlXTreeObject.prototype._clearMove=function(){if(this._lastMark){this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,"");this._lastMark=null}this.selectionBar.style.display="none";this.allTree.className=this.allTree.className.replace(" selectionBox","")};dhtmlXTreeObject.prototype.enableDragAndDrop=function(c,a){if(c=="temporary_disabled"){this.dADTempOff=false;c=true}else{this.dADTempOff=true}this.dragAndDropOff=dhx4.s2b(c);if(this.dragAndDropOff){this.dragger.addDragLanding(this.allTree,this)}if(arguments.length>1){this._ddronr=(!dhx4.s2b(a))}};dhtmlXTreeObject.prototype._setMove=function(l,g,n){if(l.parentObject.span){var j=dhx4.absTop(l);var c=dhx4.absTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if(this.dadmode==2){var m=n-j+(document.body.scrollTop||document.documentElement.scrollTop)-2-l.offsetHeight/2;if((Math.abs(m)-l.offsetHeight/6)>0){this.dadmodec=1;if(m<0){this.dadmodefix=0-l.offsetHeight}}else{this.dadmodec=0}}if(this.dadmodec==0){var a=l.parentObject.span;a.className+=" dragAndDropRow";this._lastMark=a}else{this._clearMove();this.selectionBar.style.top=(j-c+((parseInt(l.parentObject.span.parentNode.previousSibling.childNodes[0].style.height)||18)-1)+this.dadmodefix)+"px";this.selectionBar.style.left="5px";if(this.allTree.offsetWidth>20){this.selectionBar.style.width=(this.allTree.offsetWidth-(_isFF?30:25))+"px"}this.selectionBar.style.display=""}this._autoScroll(null,j,c)}};dhtmlXTreeObject.prototype._autoScroll=function(g,c,a){if(this.autoScroll){if(g){c=dhx4.absTop(g);a=dhx4.absTop(this.allTree)-this.allTree.scrollTop}if((c-a-parseInt(this.allTree.scrollTop))>(parseInt(this.allTree.offsetHeight)-50)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20}if((c-a)<(parseInt(this.allTree.scrollTop)+30)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20}}};dhtmlXTreeObject.prototype._createDragNode=function(l,j){if(!this.dADTempOff){return null}var g=l.parentObject;if(!this.callEvent("onBeforeDrag",[g.id,j])){return null}if(!g.i_sel){this._selectItem(g,j)}this._checkMSelectionLogic();var c=document.createElement("div");var m=new Array();if(this._itim_dg){for(var a=0;a<this._selected.length;a++){m[a]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[a].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[a].span.innerHTML+"</td></tr></table>"}}else{m=this.getSelectedItemText().split(this.dlmtr)}c.innerHTML=m.join("");c.style.position="absolute";c.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return c};dhtmlXTreeObject.prototype._focusNode=function(a){var c=dhx4.absTop(a.htmlNode)-dhx4.absTop(this.allTree);if((c>(this.allTree.offsetHeight-30))||(c<0)){this.allTree.scrollTop=c+this.allTree.scrollTop}};dhtmlXTreeObject.prototype._preventNsDrag=function(a){if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlXTreeObject.prototype._drag=function(n,o,a){if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}if(!a.parentObject){a=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];this.dadmodec=0}this._clearMove();var m=n.parentObject.treeNod;if((m)&&(m._clearMove)){m._clearMove("")}if((!this.dragMove)||(this.dragMove())){if((!m)||(!m._clearMove)||(!m._dragged)){var j=new Array(n.parentObject)}else{var j=m._dragged}var c=a.parentObject;for(var l=0;l<j.length;l++){var g=this._moveNode(j[l],c);if((this.dadmodec)&&(g!==false)){c=this._globalIdStorageFind(g,true,true)}if((g)&&(!this._sADnD)){this.selectItem(g,0,1)}}}if(m){m._dragged=new Array()}};dhtmlXTreeObject.prototype._dragIn=function(j,c,m,l){if(!this.dADTempOff){return 0}var n=c.parentObject;var a=j.parentObject;if((!a)&&(this._ddronr)){return}if(!this.callEvent("onDragIn",[n.id,a?a.id:null,n.treeNod,this])){if(a){this._autoScroll(j)}return 0}if(!a){this.allTree.className+=" selectionBox"}else{if(n.childNodes==null){this._setMove(j,m,l);return j}var q=n.treeNod;for(var g=0;g<q._dragged.length;g++){if(this._checkPNodes(a,q._dragged[g])){this._autoScroll(j);return 0}}this.selectionBar.parentNode.removeChild(this.selectionBar);a.span.parentNode.appendChild(this.selectionBar);this._setMove(j,m,l);if(this._getOpenState(a)<=0){var o=this;this._autoOpenId=a.id;this._autoOpenTimer=window.setTimeout(function(){o._autoOpenItem(null,o);o=null},1000)}}return j};dhtmlXTreeObject.prototype._autoOpenItem=function(c,a){a.openItem(a._autoOpenId)};dhtmlXTreeObject.prototype._dragOut=function(a){this._clearMove();if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}};dhtmlXTreeObject.prototype._getNextNode=function(a,c){if((!c)&&(a.childsCount)){return a.childNodes[0]}if(a==this.htmlNode){return -1}if((a.tr)&&(a.tr.nextSibling)&&(a.tr.nextSibling.nodem)){return a.tr.nextSibling.nodem}return this._getNextNode(a.parentObject,true)};dhtmlXTreeObject.prototype._lastChild=function(a){if(a.childsCount){return this._lastChild(a.childNodes[a.childsCount-1])}else{return a}};dhtmlXTreeObject.prototype._getPrevNode=function(a,c){if((a.tr)&&(a.tr.previousSibling)&&(a.tr.previousSibling.nodem)){return this._lastChild(a.tr.previousSibling.nodem)}if(a.parentObject){return a.parentObject}else{return -1}};dhtmlXTreeObject.prototype.findItem=function(a,g,c){var j=this._findNodeByLabel(a,g,(c?this.htmlNode:null));if(j){this.selectItem(j.id,true);this._focusNode(j);return j.id}else{return null}};dhtmlXTreeObject.prototype.findItemIdByLabel=function(a,g,c){var j=this._findNodeByLabel(a,g,(c?this.htmlNode:null));if(j){return j.id}else{return null}};dhtmlXTreeObject.prototype.findStrInXML=function(c,g,l){if(!c.childNodes&&c.item){return this.findStrInJSON(c,g,l)}if(!c.childNodes){return false}for(var a=0;a<c.childNodes.length;a++){if(c.childNodes[a].nodeType==1){var j=c.childNodes[a].getAttribute(g);if(!j&&c.childNodes[a].tagName=="itemtext"){j=c.childNodes[a].firstChild.data}if((j)&&(j.toLowerCase().search(l)!=-1)){return true}if(this.findStrInXML(c.childNodes[a],g,l)){return true}}}return false};dhtmlXTreeObject.prototype.findStrInJSON=function(c,g,l){for(var a=0;a<c.item.length;a++){var j=c.item[a].text;if((j)&&(j.toLowerCase().search(l)!=-1)){return true}if(c.item[a].item&&this.findStrInJSON(c.item[a],g,l)){return true}}return false};dhtmlXTreeObject.prototype._findNodeByLabel=function(a,l,j){var a=a.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");a=new RegExp(a.replace(/([\^\.\?\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if(!j){j=this._selected[0];if(!j){j=this.htmlNode}}var c=j;if(!l){if((j.unParsed)&&(this.findStrInXML(j.unParsed.d,"text",a))){this.reParse(j)}j=this._getNextNode(c);if(j==-1){j=this.htmlNode.childNodes[0]}}else{var g=this._getPrevNode(c);if(g==-1){g=this._lastChild(this.htmlNode)}if((g.unParsed)&&(this.findStrInXML(g.unParsed.d,"text",a))){this.reParse(g);j=this._getPrevNode(c)}else{j=g}if(j==-1){j=this._lastChild(this.htmlNode)}}while((j)&&(j!=c)){if((j.label)&&(j.label.search(a)!=-1)){return(j)}if(!l){if(j==-1){if(c==this.htmlNode){break}j=this.htmlNode.childNodes[0]}if((j.unParsed)&&(this.findStrInXML(j.unParsed.d,"text",a))){this.reParse(j)}j=this._getNextNode(j);if(j==-1){j=this.htmlNode}}else{var g=this._getPrevNode(j);if(g==-1){g=this._lastChild(this.htmlNode)}if((g.unParsed)&&(this.findStrInXML(g.unParsed.d,"text",a))){this.reParse(g);j=this._getPrevNode(j)}else{j=g}if(j==-1){j=this._lastChild(this.htmlNode)}}}return null};dhtmlXTreeObject.prototype.moveItem=function(o,c,q,a){var l=this._globalIdStorageFind(o);if(!l){return(0)}var m=null;switch(c){case"right":alert("Not supported yet");break;case"item_child":var g=(a||this)._globalIdStorageFind(q);if(!g){return(0)}m=(a||this)._moveNodeTo(l,g,0);break;case"item_sibling":var g=(a||this)._globalIdStorageFind(q);if(!g){return(0)}m=(a||this)._moveNodeTo(l,g.parentObject,g);break;case"item_sibling_next":var g=(a||this)._globalIdStorageFind(q);if(!g){return(0)}if((g.tr)&&(g.tr.nextSibling)&&(g.tr.nextSibling.nodem)){m=(a||this)._moveNodeTo(l,g.parentObject,g.tr.nextSibling.nodem)}else{m=(a||this)._moveNodeTo(l,g.parentObject)}break;case"left":if(l.parentObject.parentObject){m=this._moveNodeTo(l,l.parentObject.parentObject,l.parentObject)}break;case"up":var n=this._getPrevNode(l);if((n==-1)||(!n.parentObject)){return null}m=this._moveNodeTo(l,n.parentObject,n);break;case"up_strict":var n=this._getIndex(l);if(n!=0){m=this._moveNodeTo(l,l.parentObject,l.parentObject.childNodes[n-1])}break;case"down_strict":var n=this._getIndex(l);var j=l.parentObject.childsCount-2;if(n==j){m=this._moveNodeTo(l,l.parentObject)}else{if(n<j){m=this._moveNodeTo(l,l.parentObject,l.parentObject.childNodes[n+2])}}break;case"down":var n=this._getNextNode(this._lastChild(l));if((n==-1)||(!n.parentObject)){return}if(n.parentObject==l.parentObject){var n=this._getNextNode(n)}if(n==-1){m=this._moveNodeTo(l,l.parentObject)}else{if((n==-1)||(!n.parentObject)){return}m=this._moveNodeTo(l,n.parentObject,n)}break}if(_isIE&&_isIE<8){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}return m};dhtmlXTreeObject.prototype.setDragBehavior=function(c,a){this._sADnD=(!dhx4.s2b(a));switch(c){case"child":this.dadmode=0;break;case"sibling":this.dadmode=1;break;case"complex":this.dadmode=2;break}};dhtmlXTreeObject.prototype._loadDynXML=function(g,c){c=c||this.XMLsource;var a=(new Date()).valueOf();this._ld_id=g;if(this.xmlalb=="function"){if(c){c(this._escape(g))}}else{if(this.xmlalb=="name"){this.loadXML(c+this._escape(g))}else{if(this.xmlalb=="xmlname"){this.loadXML(c+this._escape(g)+".xml?uid="+a)}else{this.loadXML(c+dhtmlx.url(c)+"uid="+a+"&id="+this._escape(g))}}}};dhtmlXTreeObject.prototype.enableMultiselection=function(c,a){this._amsel=dhx4.s2b(c);this._amselS=dhx4.s2b(a)};dhtmlXTreeObject.prototype._checkMSelectionLogic=function(){var g=new Array();for(var c=0;c<this._selected.length;c++){for(var a=0;a<this._selected.length;a++){if((c!=a)&&(this._checkPNodes(this._selected[a],this._selected[c]))){g[g.length]=this._selected[a]}}}for(var c=0;c<g.length;c++){this._unselectItem(g[c])}};dhtmlXTreeObject.prototype._checkPNodes=function(c,a){if(this._dcheckf){return false}if(a==c){return 1}if(c.parentObject){return this._checkPNodes(c.parentObject,a)}else{return 0}};dhtmlXTreeObject.prototype.disableDropCheck=function(a){this._dcheckf=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableDistributedParsing=function(g,c,a){this._edsbps=dhx4.s2b(g);this._edsbpsA=new Array();this._edsbpsC=c||10;this._edsbpsD=a||250};dhtmlXTreeObject.prototype.getDistributedParsingState=function(){return(!((!this._edsbpsA)||(!this._edsbpsA.length)))};dhtmlXTreeObject.prototype.getItemParsingState=function(g){var c=this._globalIdStorageFind(g,true,true);if(!c){return 0}if(this._edsbpsA){for(var a=0;a<this._edsbpsA.length;a++){if(this._edsbpsA[a][2]==g){return -1}}}return 1};dhtmlXTreeObject.prototype._distributedStart=function(c,l,j,g,a){if(!this._edsbpsA){this._edsbpsA=new Array()}this._edsbpsA[this._edsbpsA.length]=[c,l,j,g,a]};dhtmlXTreeObject.prototype._distributedStep=function(j){var c=this;if((!this._edsbpsA)||(!this._edsbpsA.length)){c.XMLloadingWarning=0;return}var l=this._edsbpsA[0];this.parsedArray=new Array();this._parse(l[0],l[2],l[3],l[1]);var a=this._globalIdStorageFind(l[2]);this._redrawFrom(this,a,l[4],this._getOpenState(a));var g=this.setCheckList.split(this.dlmtr);for(var m=0;m<g.length;m++){if(g[m]){this.setCheck(g[m],1)}}this._edsbpsA=(new Array()).concat(this._edsbpsA.slice(1));if((!this._edsbpsA.length)){window.setTimeout(function(){if(c.onXLE){c.onXLE(c,j)}c.callEvent("onXLE",[c,j])},1);c.xmlstate=0}};dhtmlXTreeObject.prototype.enableTextSigns=function(a){this._txtimg=dhx4.s2b(a)};dhtmlXTreeObject.prototype.preventIECaching=function(a){dhx4.ajax.cache=!a};dhtmlXTreeObject.prototype.preventIECashing=dhtmlXTreeObject.prototype.preventIECaching;dhtmlXTreeObject.prototype.disableCheckbox=function(g,c){if(typeof(g)!="object"){var a=this._globalIdStorageFind(g,0,1)}else{var a=g}if(!a){return}a.dscheck=dhx4.s2b(c)?(((a.checkstate||0)%3)+3):((a.checkstate>2)?(a.checkstate-3):a.checkstate);this._setCheck(a);if(a.dscheck<3){a.dscheck=false}};dhtmlXTreeObject.prototype.smartRefreshBranch=function(c,a){this._branchUpdate=1;this.smartRefreshItem(c,a)};dhtmlXTreeObject.prototype.smartRefreshItem=function(j,g){var a=this._globalIdStorageFind(j);for(var c=0;c<a.childsCount;c++){a.childNodes[c]._dmark=true}this.waitUpdateXML=true;if(g&&g.exists){this._parse(g,j)}else{this._loadDynXML(j,g)}};dhtmlXTreeObject.prototype.refreshItems=function(c,g){var j=c.toString().split(this.dlmtr);this.waitUpdateXML=new Array();for(var a=0;a<j.length;a++){this.waitUpdateXML[j[a]]=true}this.loadXML((g||this.XMLsource)+dhtmlx.url(g||this.XMLsource)+"ids="+this._escape(c))};dhtmlXTreeObject.prototype.updateItem=function(n,m,j,g,c,l,o){var a=this._globalIdStorageFind(n);a.userData=new cObject();if(m){a.label=m}a.images=new Array(j||this.imageArray[0],g||this.imageArray[1],c||this.imageArray[2]);this.setItemText(n,m);if(l){this._setCheck(a,true)}if(o=="1"&&!this.hasChildren(n)){a.XMLload=0}this._correctPlus(a);a._dmark=false;return a};dhtmlXTreeObject.prototype.setDropHandler=function(a){this.attachEvent("onDrop",a)};dhtmlXTreeObject.prototype.setOnLoadingStart=function(a){this.attachEvent("onXLS",a)};dhtmlXTreeObject.prototype.setOnLoadingEnd=function(a){this.attachEvent("onXLE",a)};dhtmlXTreeObject.prototype.setXMLAutoLoadingBehaviour=function(a){this.xmlalb=a};dhtmlXTreeObject.prototype.enableSmartCheckboxes=function(a){this.smcheck=dhx4.s2b(a)};dhtmlXTreeObject.prototype.getXMLState=function(){return(this.xmlstate==1)};dhtmlXTreeObject.prototype.setItemTopOffset=function(m,j){var g;if(typeof(m)!="object"){g=this._globalIdStorageFind(m)}else{g=m}var l=g.span.parentNode.parentNode;g.span.style.paddingBottom="1px";for(var c=0;c<l.childNodes.length;c++){if(c!=0){if(_isIE){l.childNodes[c].style.height="18px";l.childNodes[c].style.paddingTop=parseInt(j)+"px"}else{l.childNodes[c].style.height=18+parseInt(j)+"px"}}else{var a=l.childNodes[c].firstChild;if(l.childNodes[c].firstChild.tagName!="DIV"){a=document.createElement("DIV");l.childNodes[c].insertBefore(a,l.childNodes[c].firstChild)}a.style.height=parseInt(j)+"px";if((g.parentObject.id!=this.rootId||g.parentObject.childNodes[0]!=g)&&this.treeLinesOn){a.style.backgroundImage="url("+this.imPath+this.lineArray[5]+")"}a.innerHTML="&nbsp;";a.style.overflow="hidden";if(parseInt(j)==0){l.childNodes[c].removeChild(a)}}if(!_isIE){l.childNodes[c].style.verticalAlign="bottom"}if(_isIE){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}}};dhtmlXTreeObject.prototype.setIconSize=function(j,c,l){if(l){if((l)&&(l.span)){var a=l}else{var a=this._globalIdStorageFind(l)}if(!a){return(0)}var g=a.span.parentNode.previousSibling.childNodes[0];if(j){g.style.width=j+"px";if(window._KHTMLrv){g.parentNode.style.width=j+"px"}}if(c){g.style.height=c+"px";if(window._KHTMLrv){g.parentNode.style.height=c+"px"}}}else{this.def_img_x=j;this.def_img_y=c}};dhtmlXTreeObject.prototype.getItemImage=function(l,j,c){var g=this._globalIdStorageFind(l);if(!g){return""}var a=g.images[j||0];if(c){a=this.iconURL+a}return a};dhtmlXTreeObject.prototype.enableRadioButtons=function(j,g){if(arguments.length==1){this._frbtr=dhx4.s2b(j);this.checkBoxOff=this.checkBoxOff||this._frbtr;return}var c=this._globalIdStorageFind(j);if(!c){return""}g=dhx4.s2b(g);if((g)&&(!c._r_logic)){c._r_logic=true;for(var a=0;a<c.childsCount;a++){this._setCheck(c.childNodes[a],c.childNodes[a].checkstate)}}if((!g)&&(c._r_logic)){c._r_logic=false;for(var a=0;a<c.childsCount;a++){this._setCheck(c.childNodes[a],c.childNodes[a].checkstate)}}};dhtmlXTreeObject.prototype.enableSingleRadioMode=function(a){this._frbtrs=dhx4.s2b(a)};dhtmlXTreeObject.prototype.openOnItemAdded=function(a){this._hAdI=!dhx4.s2b(a)};dhtmlXTreeObject.prototype.openOnItemAdding=function(a){this._hAdI=!dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableMultiLineItems=function(a){if(a===true){this.mlitems="100%"}else{this.mlitems=a}};dhtmlXTreeObject.prototype.enableAutoTooltips=function(a){this.ettip=dhx4.s2b(a)};dhtmlXTreeObject.prototype.clearSelection=function(a){if(a){this._unselectItem(this._globalIdStorageFind(a))}else{this._unselectItems()}};dhtmlXTreeObject.prototype.showItemSign=function(j,c){var a=this._globalIdStorageFind(j);if(!a){return 0}var g=a.span.parentNode.previousSibling.previousSibling.previousSibling;if(!dhx4.s2b(c)){this._openItem(a);a.closeble=false;a.wsign=true}else{a.closeble=true;a.wsign=false}this._correctPlus(a)};dhtmlXTreeObject.prototype.showItemCheckbox=function(l,j){if(!l){for(var c in this._idpull){this.showItemCheckbox(this._idpull[c],j)}}if(typeof(l)!="object"){l=this._globalIdStorageFind(l,0,0)}if(!l){return 0}l.nocheckbox=!dhx4.s2b(j);var g=l.span.parentNode.previousSibling.previousSibling.childNodes[0];g.parentNode.style.display=(!l.nocheckbox)?"":"none"};dhtmlXTreeObject.prototype.setListDelimeter=function(a){this.dlmtr=a};dhtmlXTreeObject.prototype.setEscapingMode=function(a){this.utfesc=a};dhtmlXTreeObject.prototype.enableHighlighting=function(a){this.ehlt=true;this.ehlta=dhx4.s2b(a)};dhtmlXTreeObject.prototype._itemMouseOut=function(){var c=this.childNodes[3].parentObject;var a=c.treeNod;a.callEvent("onMouseOut",[c.id]);if(c.id==a._l_onMSI){a._l_onMSI=null}if(!a.ehlta){return}c.span.className=c.span.className.replace("_lor","")};dhtmlXTreeObject.prototype._itemMouseIn=function(){var c=this.childNodes[3].parentObject;var a=c.treeNod;if(a._l_onMSI!=c.id){a.callEvent("onMouseIn",[c.id])}a._l_onMSI=c.id;if(!a.ehlta){return}c.span.className=c.span.className.replace("_lor","");c.span.className=c.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor")};dhtmlXTreeObject.prototype.enableActiveImages=function(a){this._aimgs=dhx4.s2b(a)};dhtmlXTreeObject.prototype.focusItem=function(c){var a=this._globalIdStorageFind(c);if(!a){return(0)}this._focusNode(a)};dhtmlXTreeObject.prototype.getAllSubItems=function(a){return this._getAllSubItems(a)};dhtmlXTreeObject.prototype.getAllChildless=function(){return this._getAllScraggyItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless;dhtmlXTreeObject.prototype._getAllScraggyItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(j){j+=this.dlmtr+a}else{j=a}}}else{if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}}}return j};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var j="";for(var c=0;c<g.childsCount;c++){if((g.childNodes[c].unParsed)||(g.childNodes[c].childsCount>0)){if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){j+=this.dlmtr+a}}}return j};dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)};dhtmlXTreeObject.prototype.getAllUnchecked=function(a){if(a){a=this._globalIdStorageFind(a)}return this._getAllChecked(a,"",0)};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)};dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var a=[this._getAllChecked("","",1)];var c=this._getAllChecked("","",2);if(c){a.push(c)}return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._getAllChecked=function(l,g,m){if(!l){l=this.htmlNode}if(l.checkstate==m){if(!l.nocheckbox){if(g){g+=this.dlmtr+l.id}else{g=""+l.id}}}var a=l.childsCount;for(var c=0;c<a;c++){g=this._getAllChecked(l.childNodes[c],g,m)}if(l.unParsed){g=this._getAllCheckedXML(l.unParsed,g,m)}if(g){return g}else{return""}};dhtmlXTreeObject.prototype.setItemStyle=function(j,g,c){var c=c||false;var a=this._globalIdStorageFind(j);if(!a){return 0}if(!a.span.style.cssText){a.span.setAttribute("style",a.span.getAttribute("style")+"; "+g)}else{a.span.style.cssText=c?g:a.span.style.cssText+";"+g}};dhtmlXTreeObject.prototype.enableImageDrag=function(a){this._itim_dg=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setOnDragIn=function(a){this.attachEvent("onDragIn",a)};dhtmlXTreeObject.prototype.enableDragAndDropScrolling=function(a){this.autoScroll=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setSkin=function(a){var c=this.parentObject.className.replace(/dhxtree_[^ ]*/gi,"");this.parentObject.className=c+" dhxtree_"+a;if(a=="dhx_terrace"||a=="dhx_web"){this.enableTreeLines(false)}};(function(){dhtmlx.extend_api("dhtmlXTreeObject",{_init:function(a){return[a.parent,(a.width||"100%"),(a.height||"100%"),(a.root_id||0)]},auto_save_selection:"enableAutoSavingSelected",auto_tooltip:"enableAutoTooltips",checkbox:"enableCheckBoxes",checkbox_3_state:"enableThreeStateCheckboxes",checkbox_smart:"enableSmartCheckboxes",context_menu:"enableContextMenu",distributed_parsing:"enableDistributedParsing",drag:"enableDragAndDrop",drag_copy:"enableMercyDrag",drag_image:"enableImageDrag",drag_scroll:"enableDragAndDropScrolling",editor:"enableItemEditor",hover:"enableHighlighting",images:"enableTreeImages",image_fix:"enableIEImageFix",image_path:"setImagePath",lines:"enableTreeLines",loading_item:"enableLoadingItem",multiline:"enableMultiLineItems",multiselect:"enableMultiselection",navigation:"enableKeyboardNavigation",radio:"enableRadioButtons",radio_single:"enableSingleRadioMode",rtl:"enableRTL",search:"enableKeySearch",smart_parsing:"enableSmartXMLParsing",smart_rendering:"enableSmartRendering",text_icons:"enableTextSigns",xml:"loadXML",skin:"setSkin"},{})})();dhtmlXTreeObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(j,m,c){var g=dhx4.ajax.xpath(".//item",j);var l=g[0].getAttribute("text");this.obj.insertNewItem(c,m,l,0,0,0,0,"CHILD")});a.attachEvent("updateCallback",function(j,m,c){var g=dhx4.ajax.xpath(".//item",j);var l=g[0].getAttribute("text");this.obj.setItemText(m,l);if(this.obj.getParentId(m)!=c){this.obj.moveItem(m,"item_child",c)}this.setUpdated(m,true,"updated")});a.attachEvent("deleteCallback",function(g,j,c){this.obj.setUserData(j,this.action_param,"true_deleted");this.obj.deleteItem(j,false)});a._methods=["setItemStyle","","changeItemId","deleteItem"];this.attachEvent("onEdit",function(c,g){if(c==3){a.setUpdated(g,true)}return true});this.attachEvent("onDrop",function(m,l,j,g,c){if(g==c){a.setUpdated(m,true)}});this._onrdlh=function(c){var g=a.getState(c);if(g=="inserted"){a.set_invalid(c,false);a.setUpdated(c,false);return true}if(g=="true_deleted"){a.setUpdated(c,false);return true}a.setUpdated(c,true,"deleted");return false};this._onradh=function(c){a.setUpdated(c,true,"inserted")};a._getRowData=function(l){var j={};var m=this.obj._globalIdStorageFind(l);var g=m.parentObject;var c=0;for(c=0;c<g.childsCount;c++){if(g.childNodes[c]==m){break}}j.tr_id=m.id;j.tr_pid=g.id;j.tr_order=c;j.tr_text=m.span.innerHTML;g=(m._userdatalist||"").split(",");for(c=0;c<g.length;c++){j[g[c]]=m.userData["t_"+g[c]]}return j}};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachTree=function(a){this.callEvent("_onBeforeContentAttach",["tree"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);this.dataType="tree";this.dataObj=new dhtmlXTreeObject(c,"100%","100%",(a||0));this.dataObj.setSkin(this.conf.skin);this.dataObj.allTree.childNodes[0].style.marginTop="2px";this.dataObj.allTree.childNodes[0].style.marginBottom="2px";c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXTreeObject.prototype.makeDraggable=function(c,a){if(typeof(c)!="object"){c=document.getElementById(c)}dragger=new dhtmlDragAndDropObject();dropper=new dhx_dragSomethingInTree();dragger.addDraggableItem(c,dropper);c.dragLanding=null;c.ondragstart=dropper._preventNsDrag;c.onselectstart=new Function("return false;");c.parentObject=new Object;c.parentObject.img=c;c.parentObject.treeNod=dropper;dropper._customDrop=a};dhtmlXTreeObject.prototype.makeDragable=dhtmlXTreeObject.prototype.makeDraggable;dhtmlXTreeObject.prototype.makeAllDraggable=function(c){var g=document.getElementsByTagName("div");for(var a=0;a<g.length;a++){if(g[a].getAttribute("dragInDhtmlXTree")){this.makeDragable(g[a],c)}}};function dhx_dragSomethingInTree(){this.lWin=window;this._createDragNode=function(c){var a=document.createElement("div");a.style.position="absolute";a.innerHTML=(c.innerHTML||c.value);a.className="dragSpanDiv";return a};this._preventNsDrag=function(a){(a||window.event).cancelBubble=true;if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};this._nonTrivialNode=function(c,g,a,j){if(this._customDrop){return this._customDrop(c,j.img.id,g.id,a?a.id:null)}var l=(j.img.getAttribute("image")||"");var n=j.img.id||"new";var m=(j.img.getAttribute("text")||(_isIE?j.img.innerText:j.img.textContent));c[a?"insertNewNext":"insertNewItem"](a?a.id:g.id,n,m,"",l,l,l)}}dhtmlXTreeObject.prototype.enableItemEditor=function(a){this._eItEd=dhx4.s2b(a);if(!this._eItEdFlag){this._edn_click_IE=true;this._edn_dblclick=true;this._ie_aFunc=this.aFunc;this._ie_dblclickFuncHandler=this.dblclickFuncHandler;this.setOnDblClickHandler(function(g,c){if(this._edn_dblclick){this._editItem(g,c)}return true});this.setOnClickHandler(function(g,c){this._stopEditItem(g,c);if((this.ed_hist_clcik==g)&&(this._edn_click_IE)){this._editItem(g,c)}this.ed_hist_clcik=g;return true});this._eItEdFlag=true}};dhtmlXTreeObject.prototype.setOnEditHandler=function(a){this.attachEvent("onEdit",a)};dhtmlXTreeObject.prototype.setEditStartAction=function(a,c){this._edn_click_IE=dhx4.s2b(a);this._edn_dblclick=dhx4.s2b(c)};dhtmlXTreeObject.prototype._stopEdit=function(c,m){if(this._editCell){this.dADTempOff=this.dADTempOffEd;if(this._editCell.id!=c){var j=true;if(!m){j=this.callEvent("onEdit",[2,this._editCell.id,this,this._editCell.span.childNodes[0].value])}else{j=false;this.callEvent("onEditCancel",[this._editCell.id,this._editCell._oldValue])}if(j===true){j=this._editCell.span.childNodes[0].value}else{if(j===false){j=this._editCell._oldValue}}var l=(j!=this._editCell._oldValue);this._editCell.span.innerHTML=j;this._editCell.label=this._editCell.span.innerHTML;var g=this._editCell.i_sel?"selectedTreeRow":"standartTreeRow";this._editCell.span.className=g;this._editCell.span.parentNode.className="standartTreeRow";this._editCell.span.style.paddingRight=this._editCell.span.style.paddingLeft="5px";this._editCell.span.onclick=this._editCell.span.ondblclick=function(){};var n=this._editCell.id;if(this.childCalc){this._fixChildCountLabel(this._editCell)}this._editCell=null;if(!m){this.callEvent("onEdit",[3,n,this,l])}if(this._enblkbrd){this.parentObject.lastChild.focus();this.parentObject.lastChild.focus()}}}};dhtmlXTreeObject.prototype._stopEditItem=function(c,a){this._stopEdit(c)};dhtmlXTreeObject.prototype.stopEdit=function(a){if(this._editCell){this._stopEdit(this._editCell.id+"_non",a)}};dhtmlXTreeObject.prototype.editItem=function(a){this._editItem(a,this)};dhtmlXTreeObject.prototype._editItem=function(l,a){if(this._eItEd){this._stopEdit();var g=this._globalIdStorageFind(l);if(!g){return}var j=this.callEvent("onEdit",[0,l,this,g.span.innerHTML]);if(j===true){j=(typeof g.span.innerText!="undefined"?g.span.innerText:g.span.textContent)}else{if(j===false){return}}this.dADTempOffEd=this.dADTempOff;this.dADTempOff=false;this._editCell=g;g._oldValue=j;g.span.innerHTML="<input type='text' class='intreeeditRow' />";g.span.style.paddingRight=g.span.style.paddingLeft="0px";g.span.onclick=g.span.ondblclick=function(m){(m||event).cancelBubble=true};g.span.childNodes[0].value=j;g.span.childNodes[0].onselectstart=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].onmousedown=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].focus();g.span.childNodes[0].focus();g.span.onclick=function(m){(m||event).cancelBubble=true;return false};g.span.className="";g.span.parentNode.className="";var c=this;g.span.childNodes[0].onkeydown=function(m){if(!m){m=window.event}if(m.keyCode==13){m.cancelBubble=true;c._stopEdit(window.undefined)}else{if(m.keyCode==27){c._stopEdit(window.undefined,true)}}(m||event).cancelBubble=true};this.callEvent("onEdit",[1,l,this])}};function jsonPointer(c,a){this.d=c;this.dp=a}jsonPointer.prototype={text:function(){var a=function(l){var j=[];for(var g=0;g<l.length;g++){j.push("{"+c(l[g])+"}")}return j.join(",")};var c=function(l){var j=[];for(var g in l){if(typeof(l[g])=="object"){if(g.length){j.push('"'+g+'":['+a(l[g])+"]")}else{j.push('"'+g+'":{'+c(l[g])+"}")}}else{j.push('"'+g+'":"'+l[g]+'"')}}return j.join(",")};return"{"+c(this.d)+"}"},get:function(a){return this.d[a]},exists:function(){return !!this.d},content:function(){return this.d.content},each:function(j,n,m){var g=this.d[j];var o=new jsonPointer();if(g){for(var l=0;l<g.length;l++){o.d=g[l];n.apply(m,[o,l])}}},get_all:function(){return this.d},sub:function(a){return new jsonPointer(this.d[a],this.d)},sub_exists:function(a){return !!this.d[a]},each_x:function(j,o,n,m,l){var g=this.d[j];var q=new jsonPointer(0,this.d);if(g){for(l=l||0;l<g.length;l++){if(g[l][o]){q.d=g[l];if(n.apply(m,[q,l])==-1){return}}}}},up:function(a){return new jsonPointer(this.dp,this.d)},set:function(a,c){this.d[a]=c},clone:function(a){return new jsonPointer(this.d,this.dp)},through:function(g,n,r,l,s){var o=this.d[g];if(o.length){for(var j=0;j<o.length;j++){if(o[j][n]!=null&&o[j][n]!=""&&(!r||o[j][n]==r)){var m=new jsonPointer(o[j],this.d);l.apply(s,[m,j])}var q=this.d;this.d=o[j];if(this.sub_exists(g)){this.through(g,n,r,l,s)}this.d=q}}}};dhtmlXTreeObject.prototype.loadJSArrayFile=function(file,callback){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=function(xml,callback){eval("var z="+xml.responseText);this.loadJSArray(z);if(callback){callback.call(this,xml)}};dhx4.ajax.get(file,function(obj){that.XMLLoader(obj.xmlDoc,callback)})};dhtmlXTreeObject.prototype.loadCSV=function(a,g){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var c=this;this.XMLLoader=function(j,l){this.loadCSVString(j.responseText);if(l){l.call(this,j)}};dhx4.ajax.get(a,function(j){c.XMLLoader(j.xmlDoc,g)})};dhtmlXTreeObject.prototype.loadJSArray=function(a,j){var m=[];for(var c=0;c<a.length;c++){if(!m[a[c][1]]){m[a[c][1]]=[]}m[a[c][1]].push({id:a[c][0],text:a[c][2]})}var l={id:this.rootId};var g=function(q,o){if(m[q.id]){q.item=m[q.id];for(var n=0;n<q.item.length;n++){o(q.item[n],o)}}};g(l,g);this.loadJSONObject(l,j)};dhtmlXTreeObject.prototype.loadCSVString=function(a,m){var o=[];var c=a.split("\n");for(var j=0;j<c.length;j++){var g=c[j].split(",");if(!o[g[1]]){o[g[1]]=[]}o[g[1]].push({id:g[0],text:g[2]})}var n={id:this.rootId};var l=function(s,r){if(o[s.id]){s.item=o[s.id];for(var q=0;q<s.item.length;q++){r(s.item[q],r)}}};l(n,l);this.loadJSONObject(n,m)};dhtmlXTreeObject.prototype.loadJSONObject=function(a,c){if(!this.parsCount){this.callEvent("onXLS",[this,null])}this.xmlstate=1;var g=new jsonPointer(a);this._parse(g);this._p=g;if(c){c()}};dhtmlXTreeObject.prototype.loadJSON=function(file,callback){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=function(xml,callback){try{eval("var t="+xml.responseText)}catch(e){dhx4.callEvent("onLoadXMLerror",["Incorrect JSON",(xml),this]);return}var p=new jsonPointer(t);this._parse(p);this._p=p;if(callback){callback.call(this,xml)}};dhx4.ajax.get(file,function(obj){that.XMLLoader(obj.xmlDoc,callback)})};dhtmlXTreeObject.prototype.serializeTreeToJSON=function(){var a=['{"id":"'+this.rootId+'", "item":['];var g=[];for(var c=0;c<this.htmlNode.childsCount;c++){g.push(this._serializeItemJSON(this.htmlNode.childNodes[c]))}a.push(g.join(","));a.push("]}");return a.join("")};dhtmlXTreeObject.prototype._serializeItemJSON=function(n){var a=[];if(n.unParsed){return(n.unParsed.text())}if(this._selected.length){var g=this._selected[0].id}else{g=""}var m=n.span.innerHTML;m=m.replace(/\"/g,'\\"',m);if(!this._xfullXML){a.push('{ "id":"'+n.id+'", '+(this._getOpenState(n)==1?' "open":"1", ':"")+(g==n.id?' "select":"1",':"")+' "text":"'+m+'"'+(((this.XMLsource)&&(n.XMLload==0))?', "child":"1" ':""))}else{a.push('{ "id":"'+n.id+'", '+(this._getOpenState(n)==1?' "open":"1", ':"")+(g==n.id?' "select":"1",':"")+' "text":"'+m+'", "im0":"'+n.images[0]+'", "im1":"'+n.images[1]+'", "im2":"'+n.images[2]+'" '+(n.acolor?(', "aCol":"'+n.acolor+'" '):"")+(n.scolor?(', "sCol":"'+n.scolor+'" '):"")+(n.checkstate==1?', "checked":"1" ':(n.checkstate==2?', "checked":"-1"':""))+(n.closeable?', "closeable":"1" ':"")+(((this.XMLsource)&&(n.XMLload==0))?', "child":"1" ':""))}if((this._xuserData)&&(n._userdatalist)){a.push(', "userdata":[');var l=n._userdatalist.split(",");var j=[];for(var c=0;c<l.length;c++){j.push('{ "name":"'+l[c]+'" , "content":"'+n.userData["t_"+l[c]]+'" }')}a.push(j.join(","));a.push("]")}if(n.childsCount){a.push(', "item":[');var j=[];for(var c=0;c<n.childsCount;c++){j.push(this._serializeItemJSON(n.childNodes[c]))}a.push(j.join(","));a.push("]\n")}a.push("}\n");return a.join("")};function dhtmlXTreeFromHTML(obj){if(typeof(obj)!="object"){obj=document.getElementById(obj)}var n=obj;var id=n.id;var cont="";for(var j=0;j<obj.childNodes.length;j++){if(obj.childNodes[j].nodeType=="1"){if(obj.childNodes[j].tagName=="XMP"){var cHead=obj.childNodes[j];for(var m=0;m<cHead.childNodes.length;m++){cont+=cHead.childNodes[m].data}}else{if(obj.childNodes[j].tagName.toLowerCase()=="ul"){cont=dhx_li2trees(obj.childNodes[j],new Array(),0)}}break}}obj.innerHTML="";var t=new dhtmlXTreeObject(obj,"100%","100%",0);var z_all=new Array();for(b in t){z_all[b.toLowerCase()]=b}var atr=obj.attributes;for(var a=0;a<atr.length;a++){if((atr[a].name.indexOf("set")==0)||(atr[a].name.indexOf("enable")==0)){var an=atr[a].name;if(!t[an]){an=z_all[atr[a].name]}t[an].apply(t,atr[a].value.split(","))}}if(typeof(cont)=="object"){t.XMLloadingWarning=1;for(var i=0;i<cont.length;i++){var n=t.insertNewItem(cont[i][0],cont[i][3],cont[i][1]);if(cont[i][2]){t._setCheck(n,cont[i][2])}}t.XMLloadingWarning=0;t.lastLoadedXMLId=0;t._redrawFrom(t)}else{t.loadXMLString("<tree id='0'>"+cont+"</tree>")}window[id]=t;var oninit=obj.getAttribute("oninit");if(oninit){eval(oninit)}return t}function dhx_init_trees(){var c=document.getElementsByTagName("div");for(var a=0;a<c.length;a++){if(c[a].className=="dhtmlxTree"){dhtmlXTreeFromHTML(c[a])}}}function dhx_li2trees(u,n,g){for(var o=0;o<u.childNodes.length;o++){var s=u.childNodes[o];if((s.nodeType==1)&&(s.tagName.toLowerCase()=="li")){var r="";var q=null;var a=s.getAttribute("checked");for(var m=0;m<s.childNodes.length;m++){var l=s.childNodes[m];if(l.nodeType==3){r+=l.data}else{if(l.tagName.toLowerCase()!="ul"){r+=dhx_outer_html(l)}else{q=l}}}n[n.length]=[g,r,a,(s.id||(n.length+1))];if(q){n=dhx_li2trees(q,n,(s.id||n.length))}}}return n}function dhx_outer_html(c){if(c.outerHTML){return c.outerHTML}var a=document.createElement("DIV");a.appendChild(c.cloneNode(true));a=a.innerHTML;return a}if(window.addEventListener){window.addEventListener("load",dhx_init_trees,false)}else{if(window.attachEvent){window.attachEvent("onload",dhx_init_trees)}}var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlx.extend((a||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(c){for(var a=0;a<this.length;a++){if(c==this[a]){return a}}return -1},_dhx_insertAt:function(g,c){this[this.length]=null;for(var a=this.length-1;a>=g;a--){this[a]=this[a-1]}this[g]=c},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,g){var c=this[a];this[a]=this[g];this[g]=c}};function dhtmlXGridObject(id){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(id){if(typeof(id)=="object"){this.entBox=id;if(!this.entBox.id){this.entBox.id="cgrid2_"+this.uid()}}else{this.entBox=document.getElementById(id)}}else{this.entBox=document.createElement("DIV");this.entBox.id="cgrid2_"+this.uid()}this.entBox.innerHTML="";dhx4._eventable(this);var self=this;this._wcorr=0;this.fontWidth=7;this.cell=null;this.row=null;this.iconURL="";this.editor=null;this._f2kE=true;this._dclE=true;this.combos=new Array(0);this.defVal=new Array(0);this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=true;this.xmlLoader=this.doLoadDetails;this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?(this.entBox.style.width||window.getComputedStyle(this.entBox,null)["width"]):(this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0))||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?(this.entBox.style.height||window.getComputedStyle(this.entBox,null)["height"]):(this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0))||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return false};var t_creator=function(name){var t=document.createElement("TABLE");t.cellSpacing=t.cellPadding=0;t.style.cssText="width:100%;table-layout:fixed;";t.className=name.substr(2);return t};this.obj=t_creator("c_obj");this.hdr=t_creator("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow="hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=new Array(0);this.sortImg=document.createElement("DIV");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=(_isIE&&(document.compatMode!="BackCompat")?22:20);this.imgURL=window.dhx_globalImgPath||"";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{if(self.destructor){self.destructor()}}catch(e){}});this.setSkin=function(name){this._srdh=window.dhx4.readFromCss("dhxgrid_rh_"+name)+4;this.skin_name=name;if(this._imgURL){this.setImagePath(this._imgURL)}var classname=this.entBox.className.split(" gridbox")[0];this.entBox.className=classname+" gridbox gridbox_"+name+(_isIE?" isIE":" isModern");this.skin_h_correction=0;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid());this._fixAlterCss();switch(name){case"dhx_terrace":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_skyblue":case"dhx_web":this.forceDivInHeader=true;break}if(_isIE&&this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)}this.setSizes()};if(_isIE){this.preventIECaching(true)}if(window.dhtmlDragAndDropObject){this.dragger=new dhtmlDragAndDropObject()}this._doOnScroll=function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll=function(e,mode){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr){this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft}if(mode){return}if(this._srnd){if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}this._dLoadTimer=window.setTimeout(function(){if(self._update_srnd_view){self._update_srnd_view()}},100)}};this.attachToObject=function(obj){obj.appendChild(this.globalBox?this.globalBox:this.entBox);this.setSizes()};this.init=function(fl){if((this.isTreeGrid())&&(!this._h2)){this._h2=this._createHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}if(!this.skin_name){this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxgrid")||"dhx_skyblue")}this.editStop();this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.cellWidthPX=[];this.cellWidthPC=[];if(this.hdr.rows.length>0){var temp=this.xmlFileUrl;this.clearAll(true);this.xmlFileUrl=temp}var hdrRow=this.hdr.insertRow(0);for(var i=0;i<this.hdrLabels.length;i++){hdrRow.appendChild(document.createElement("TH"));hdrRow.childNodes[i]._cellIndex=i;hdrRow.childNodes[i].style.height="0px"}if(_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined){hdrRow.style.position="absolute"}else{hdrRow.style.height="auto"}var hdrRow=this.hdr.insertRow(_isKHTML?2:1);hdrRow._childIndexes=new Array();var col_ex=0;for(var i=0;i<this.hdrLabels.length;i++){hdrRow._childIndexes[i]=i-col_ex;if((this.hdrLabels[i]==this.splitSign)&&(i!=0)){if(_isKHTML){hdrRow.insertCell(i-col_ex)}hdrRow.cells[i-col_ex-1].colSpan=(hdrRow.cells[i-col_ex-1].colSpan||1)+1;hdrRow.childNodes[i-col_ex-1]._cellIndex++;col_ex++;hdrRow._childIndexes[i]=i-col_ex;continue}hdrRow.insertCell(i-col_ex);hdrRow.childNodes[i-col_ex]._cellIndex=i;hdrRow.childNodes[i-col_ex]._cellIndexS=i;this.setColumnLabel(i,this.hdrLabels[i])}if(col_ex==0){hdrRow._childIndexes=null}this._cCount=this.hdrLabels.length;if(_isIE){window.setTimeout(function(){if(self.setSizes){self.setSizes()}},1)}if(!this.obj.firstChild){this.obj.appendChild(document.createElement("TBODY"))}var tar=this.obj.firstChild;if(!tar.firstChild){tar.appendChild(document.createElement("TR"));tar=tar.firstChild;if(_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined){tar.style.position="absolute"}else{tar.style.height="auto"}for(var i=0;i<this.hdrLabels.length;i++){tar.appendChild(document.createElement("TH"));tar.childNodes[i].style.height="0px"}}this._c_order=null;if(this.multiLine!=true){this.obj.className+=" row20px"}this.sortImg.style.position="absolute";this.sortImg.style.display="none";this.sortImg.className="dhxgrid_sort_desc";this.sortImg.defLeft=0;if(this.noHeader){this.hdrBox.style.display="none"}else{this.noHeader=false}if(this._ivizcol){this.setColHidden()}this.attachHeader();this.attachHeader(0,0,"_aFoot");this.setSizes();if(fl){this.parseXML()}this.obj.scrollTop=0;if(this.dragAndDropOff){this.dragger.addDragLanding(this.entBox,this)}if(this._initDrF){this._initD()}dhx4.callEvent("onGridCreated",[this])};this.setColumnSizes=function(gridWidth){var summ=0;var fcols=[];var fix=0;for(var i=0;i<this._cCount;i++){if((this.initCellWidth[i]=="*")&&!this._hrrar[i]){this._awdth=false;fcols.push(i);continue}if(this.cellWidthType=="%"){if(typeof this.cellWidthPC[i]=="undefined"){this.cellWidthPC[i]=this.initCellWidth[i]}var cwidth=(gridWidth*this.cellWidthPC[i]/100)||0;if(fix>0.5){cwidth++;fix--}var rwidth=this.cellWidthPX[i]=Math.floor(cwidth);var fix=fix+cwidth-rwidth}else{if(typeof this.cellWidthPX[i]=="undefined"){this.cellWidthPX[i]=this.initCellWidth[i]}}if(!this._hrrar[i]){summ+=this.cellWidthPX[i]*1}}if(fcols.length){var ms=Math.floor((gridWidth-summ)/fcols.length);if(ms<0){ms=1}for(var i=0;i<fcols.length;i++){var next=Math.max((this._drsclmW?(this._drsclmW[fcols[i]]||0):0),ms);this.cellWidthPX[fcols[i]]=next;summ+=next}if(gridWidth>summ){var last=fcols[fcols.length-1];this.cellWidthPX[last]=this.cellWidthPX[last]+(gridWidth-summ);summ=gridWidth}this._setAutoResize()}this.obj.style.width=summ+"px";this.hdr.style.width=summ+"px";if(this.ftr){this.ftr.style.width=summ+"px"}this.chngCellWidth();return summ};this.setSizes=function(){if((!this.hdr.rows[0])){return}var quirks=this.quirks=(_isIE&&document.compatMode=="BackCompat");var outerBorder=(this.entBox.offsetWidth-this.entBox.clientWidth)/2;if(!this.dontSetSizes){if(this.globalBox){var splitOuterBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var ow=this.globalBox.clientWidth;this.globalBox.style.width=this._delta_x;this.entBox.style.width=Math.max(0,(this.globalBox.clientWidth+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(ow!=this.globalBox.clientWidth){this._fake._correctSplit(this._fake.entBox.clientWidth)}}if(this._delta_y&&!this._realfake){this.globalBox.style.height=this._delta_y;this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden";this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(quirks?splitOuterBorder*2:0)+"px"}}else{if(this._delta_x){if(this.entBox.parentNode&&this.entBox.parentNode.tagName=="TD"){this.entBox.style.width="1px";this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-outerBorder*2+"px"}else{this.entBox.style.width=this._delta_x}}if(this._delta_y){this.entBox.style.height=this._delta_y}}}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth)){this._sizeTime=window.setTimeout(function(){if(self.setSizes){self.setSizes()}},250);return}var border_x=((!this._wthB)&&((this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);var border_y=((!this._wthB)&&((this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);if(this._sizeFix){border_x-=this._sizeFix;border_y-=this._sizeFix}var isVScroll=this.parentGrid?false:(this.objBox.scrollHeight>this.objBox.offsetHeight);var scrfix=dhtmlx.$customScroll?0:18;var gridWidth=this.entBox.clientWidth-(this.skin_h_correction||0)*(quirks?0:1)-border_x;var gridWidthActive=this.entBox.clientWidth-(this.skin_h_correction||0)-border_x;var gridHeight=this.entBox.clientHeight-border_y;var summ=this.setColumnSizes(gridWidthActive-(isVScroll?scrfix:0)-(this._correction_x||0));var isHScroll=this.parentGrid?false:((this.objBox.scrollWidth>this.objBox.offsetWidth)||(this.objBox.style.overflowX=="scroll"));var headerHeight=this.hdr.clientHeight;var footerHeight=this.ftr?this.ftr.clientHeight:0;var newWidth=gridWidth;var newHeight=gridHeight-headerHeight-footerHeight;if(this._awdth&&this._awdth[0]&&this._awdth[1]==99999){isHScroll=0}if(this._ahgr){if(this._ahgrMA){newHeight=this.entBox.parentNode.clientHeight-headerHeight-footerHeight}else{newHeight=this.obj.offsetHeight+(isHScroll?scrfix:0)+(this._correction_y||0)}if(this._ahgrM){if(this._ahgrF){newHeight=Math.min(this._ahgrM,newHeight+headerHeight+footerHeight)-headerHeight-footerHeight}else{newHeight=Math.min(this._ahgrM,newHeight)}}if(isVScroll&&newHeight>=this.obj.scrollHeight+(isHScroll?scrfix:0)){isVScroll=false;this.setColumnSizes(gridWidthActive-(this._correction_x||0))}}if((this._awdth)&&(this._awdth[0])){if(this.cellWidthType=="%"){this.cellWidthType="px"}if(this._fake){summ+=this._fake.entBox.clientWidth}var newWidth=Math.min(Math.max(summ+(isVScroll?scrfix:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this.objBox.style.overflowX=(!isVScroll&&this.objBox.scrollWidth<=newWidth)?"hidden":"auto";if(this._fake){newWidth-=this._fake.entBox.clientWidth}}newHeight=Math.max(0,newHeight);this._ff_size_delta=(this._ff_size_delta==0.1)?0.2:0.1;if(!_isFF){this._ff_size_delta=0}if(!this.dontSetSizes){this.entBox.style.width=Math.max(0,newWidth+(quirks?2:0)*outerBorder+this._ff_size_delta)+"px";this.entBox.style.height=newHeight+(quirks?2:0)*outerBorder+headerHeight+footerHeight+"px"}this.objBox.style.height=newHeight+((quirks&&!isVScroll)?2:0)*outerBorder+"px";this.hdrBox.style.height=headerHeight+"px";if(newHeight!=gridHeight){this.doOnScroll(0,!this._srnd)}var ext=this["setSizes_"+this.skin_name];if(ext){ext.call(this)}this.setSortImgPos();if(headerHeight!=this.hdr.clientHeight&&this._ahgr){this.setSizes()}this.callEvent("onSetSizes",[])};this.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;i<l;i++){this.hdr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px";this.obj.rows[0].childNodes[i].style.width=this.cellWidthPX[i]+"px";if(this.ftr){this.ftr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px"}}};this.setDelimiter=function(delim){this.delim=delim};this.setInitWidthsP=function(wp){this.cellWidthType="%";this.initCellWidth=wp.split(this.delim.replace(/px/gi,""));if(!arguments[1]){this._setAutoResize()}};this._setAutoResize=function(){if(this._realfake){return}var el=window;var self=this;dhtmlxEvent(window,"resize",function(){window.clearTimeout(self._resize_timer);if(self._setAutoResize){self._resize_timer=window.setTimeout(function(){if(self.setSizes){self.setSizes()}if(self._fake){self._fake._correctSplit()}},100)}})};this.setInitWidths=function(wp){this.cellWidthType="px";this.initCellWidth=wp.split(this.delim);if(_isFF){for(var i=0;i<this.initCellWidth.length;i++){if(this.initCellWidth[i]!="*"){this.initCellWidth[i]=parseInt(this.initCellWidth[i])}}}};this.enableMultiline=function(state){this.multiLine=dhx4.s2b(state)};this.enableMultiselect=function(state){this.selMultiRows=dhx4.s2b(state)};this.setImagePath=function(path){path=path.replace(/imgs\/dhxgrid_[a-z]*\/$/,"imgs/");this._imgURL=path;this.imgURL=path+"dhxgrid_"+(this.skin_name||"dhx_skyblue").replace("dhx_","")+"/";this.iconTree=this.imgURL+"tree/"};this.setImagesPath=this.setImagePath;this.setIconPath=function(path){this.iconURL=path};this.setIconsPath=this.setIconPath;this.changeCursorState=function(ev){var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}if(!el){return}if((el.tagName=="TD")&&(this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return el.style.cursor="default"}var check=(ev.layerX||0)+(((!_isIE)&&(ev.target.tagName=="DIV"))?el.offsetLeft:0);if((el.offsetWidth-(ev.offsetX||(parseInt(this.getPosition(el,this.hdrBox))-check)*-1))<(_isOpera?20:10)){el.style.cursor="E-resize"}else{el.style.cursor="default"}if(_isOpera){this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this.startColResize=function(ev){if(this.resized){this.stopColResize()}this.resized=null;var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}var x=ev.clientX;var tabW=this.hdr.offsetWidth;var startW=parseInt(el.offsetWidth);if(el.tagName=="TD"&&el.style.cursor!="default"){if((this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return}self._old_d_mm=document.body.onmousemove;self._old_d_mu=document.body.onmouseup;document.body.onmousemove=function(e){if(self){self.doColResize(e||window.event,el,startW,x,tabW)}};document.body.onmouseup=function(){if(self){self.stopColResize()}}}};this.stopColResize=function(){document.body.onmousemove=self._old_d_mm||"";document.body.onmouseup=self._old_d_mu||"";this.setSizes();this.doOnScroll(0,1);this.callEvent("onResizeEnd",[this])};this.doColResize=function(ev,el,startW,x,tabW){el.style.cursor="E-resize";this.resized=el;var fcolW=startW+(ev.clientX-x);var wtabW=tabW+(ev.clientX-x);if(!(this.callEvent("onResize",[el._cellIndex,fcolW,this]))){return}if(_isIE){this.objBox.scrollLeft=this.hdrBox.scrollLeft}var result=false;if(el.colSpan>1){var a_sizes=new Array();for(var i=0;i<el.colSpan;i++){a_sizes[i]=Math.round(fcolW*this.hdr.rows[0].childNodes[el._cellIndexS+i].offsetWidth/el.offsetWidth)}for(var i=0;i<el.colSpan;i++){result=this._setColumnSizeR(el._cellIndexS+i*1,a_sizes[i])}}else{result=this._setColumnSizeR(el._cellIndex,fcolW)}this.doOnScroll(0,1);this.setSizes();if(this._fake&&this._awdth){this._fake._correctSplit()}return result};this._setColumnSizeR=function(ind,fcolW){if(fcolW>((this._drsclmW&&!this._notresize)?(this._drsclmW[ind]||10):10)){this.obj.rows[0].childNodes[ind].style.width=fcolW+"px";this.hdr.rows[0].childNodes[ind].style.width=fcolW+"px";if(this.ftr){this.ftr.rows[0].childNodes[ind].style.width=fcolW+"px"}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=fcolW}else{var gridWidth=parseInt(this.entBox.offsetWidth);if(this.objBox.scrollHeight>this.objBox.offsetHeight){gridWidth-=17}var pcWidth=Math.round(fcolW/gridWidth*100);this.cellWidthPC[ind]=pcWidth}if(this.sortImg.style.display!="none"){this.setSortImgPos()}}else{return false}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!dhx4.s2b(state)){this.sortImg.style.display="none";this.fldSorted=this.r_fldSorted=null;return}if(order=="asc"){this.sortImg.className="dhxgrid_sort_asc"}else{this.sortImg.className="dhxgrid_sort_desc"}this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[ind];var r=this.hdr.rows[row||1];if(!r){return}for(var i=0;i<r.childNodes.length;i++){if(r.childNodes[i]._cellIndexS==ind){this.r_fldSorted=r.childNodes[i];return this.setSortImgPos()}}return this.setSortImgState(state,ind,order,(row||1)+1)};this.setSortImgPos=function(ind,mode,hRowInd,el){if(this._hrrar&&this._hrrar[this.r_fldSorted?this.r_fldSorted._cellIndex:ind]){return}if(!el){if(!ind){var el=this.r_fldSorted}else{var el=this.hdr.rows[hRowInd||0].cells[ind]}}if(el!=null){var pos=this.getPosition(el,this.hdrBox);var wdth=el.offsetWidth;this.sortImg.style.left=Number(pos[0]+wdth-13)+"px";this.sortImg.defLeft=parseInt(this.sortImg.style.left);this.sortImg.style.top=Number(pos[1]+5)+"px";if((!this.useImagesInHeader)&&(!mode)){this.sortImg.style.display="inline"}this.sortImg.style.left=this.sortImg.defLeft+"px"}};this.setActive=function(fl){if(arguments.length==0){var fl=true}if(fl==true){if(globalActiveDHTMLGridObject&&(globalActiveDHTMLGridObject!=this)){globalActiveDHTMLGridObject.editStop();globalActiveDHTMLGridObject.callEvent("onBlur",[globalActiveDHTMLGridObject])}globalActiveDHTMLGridObject=this;this.isActive=true}else{this.isActive=false;this.callEvent("onBlur",[this])}};this._doClick=function(ev){var selMethod=0;var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(!el||!el.parentNode||!el.parentNode.idd){return}var fl=true;if(this.markedCells){var markMethod=0;if(ev.shiftKey||ev.metaKey){markMethod=1}if(ev.ctrlKey){markMethod=2}this.doMark(el,markMethod);return true}if(this.selMultiRows!=false){if(ev.shiftKey&&this.row!=null&&this.selectedRows.length){selMethod=1}if(ev.ctrlKey||ev.metaKey){selMethod=2}}return this.doClick(el,fl,selMethod,false)};this._doContClick=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if((!el)||(typeof(el.parentNode.idd)=="undefined")){this.callEvent("onEmptyClick",[ev]);return true}if(ev.button==2||(_isMacOS&&ev.ctrlKey)){if(!this.callEvent("onRightClick",[el.parentNode.idd,el._cellIndex,ev])){var z=function(e){(e||event).cancelBubble=true;return false};(ev.srcElement||ev.target).oncontextmenu=z;return z(ev)}if(this._ctmndx){if(!(this.callEvent("onBeforeContextMenu",[el.parentNode.idd,el._cellIndex,this]))){return true}if(_isIE){ev.srcElement.oncontextmenu=function(){event.cancelBubble=true;return false}}if(this._ctmndx.showContextMenu){var dEl0=window.document.documentElement;var dEl1=window.document.body;var corrector=new Array((dEl0.scrollLeft||dEl1.scrollLeft),(dEl0.scrollTop||dEl1.scrollTop));if(_isIE){var x=ev.clientX+corrector[0];var y=ev.clientY+corrector[1]}else{var x=ev.pageX;var y=ev.pageY}this._ctmndx.showContextMenu(x-1,y-1);this.contextID=this._ctmndx.contextMenuZoneId=el.parentNode.idd+"_"+el._cellIndex;this._ctmndx._skip_hide=true}else{el.contextMenuId=el.parentNode.idd+"_"+el._cellIndex;el.contextMenu=this._ctmndx;el.a=this._ctmndx._contextStart;el.a(el,ev);el.a=null}ev.cancelBubble=true;return false}}else{if(this._ctmndx){if(this._ctmndx.hideContextMenu){this._ctmndx.hideContextMenu()}else{this._ctmndx._contextEnd()}}}return true};this.doClick=function(el,fl,selMethod,show){if(!this.selMultiRows){selMethod=0}var psid=this.row?this.row.idd:0;this.setActive(true);if(!selMethod){selMethod=0}if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"")}if(el.tagName=="TD"){if(this.checkEvent("onSelectStateChanged")){var initial=this.getSelectedId()}var prow=this.row;if(selMethod==1){var elRowIndex=this.rowsCol._dhx_find(el.parentNode);var lcRowIndex=this.rowsCol._dhx_find(this.lastClicked);if(elRowIndex>lcRowIndex){var strt=lcRowIndex;var end=elRowIndex}else{var strt=elRowIndex;var end=lcRowIndex}for(var i=0;i<this.rowsCol.length;i++){if((i>=strt&&i<=end)){if(this.rowsCol[i]&&(!this.rowsCol[i]._sRow)){if(this.rowsCol[i].className.indexOf("rowselected")==-1&&(this.callEvent("onBeforeSelect",[this.rowsCol[i].idd,psid,el._cellIndex]))){this.rowsCol[i].className+=" rowselected";this.selectedRows[this.selectedRows.length]=this.rowsCol[i]}}else{this.clearSelection();return this.doClick(el,fl,0,show)}}}}else{if(selMethod==2){if(el.parentNode.className.indexOf("rowselected")!=-1){el.parentNode.className=el.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode));var skipRowSelection=true;show=false}}}this.editStop();if(typeof(el.parentNode.idd)=="undefined"){return true}if((!skipRowSelection)&&(!el.parentNode._sRow)){if(this.callEvent("onBeforeSelect",[el.parentNode.idd,psid,el._cellIndex])){if(this.getSelectedRowId()!=el.parentNode.idd){if(selMethod==0){this.clearSelection()}this.cell=el;if((prow==el.parentNode)&&(this._chRRS)){fl=false}this.row=el.parentNode;this.row.className+=" rowselected";if(this.selectedRows._dhx_find(this.row)==-1){this.selectedRows[this.selectedRows.length]=this.row}}else{this.cell=el;this.row=el.parentNode}}else{fl=false}}if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1){this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"}if(selMethod!=1){if(!this.row){return}}this.lastClicked=el.parentNode;var rid=this.row.idd;var cid=this.cell;if(fl&&typeof(rid)!="undefined"&&cid&&!skipRowSelection){self.onRowSelectTime=setTimeout(function(){if(self.callEvent){self.callEvent("onRowSelect",[rid,cid._cellIndex])}},100)}else{this.callEvent("onRowSelectRSOnly",[rid])}if(this.checkEvent("onSelectStateChanged")){var afinal=this.getSelectedId();if(initial!=afinal){this.callEvent("onSelectStateChanged",[afinal,initial])}}if(skipRowSelection){return false}}this.isActive=true;if(show!==false&&this.cell&&this.cell.parentNode.idd){this.moveToVisible(this.cell)}};this.selectAll=function(){this.clearSelection();var coll=this.rowsBuffer;if(this.pagingOn){coll=this.rowsCol}for(var i=0;i<coll.length;i++){this.render_row(i).className+=" rowselected"}this.selectedRows=dhtmlxArray([].concat(coll));if(this.selectedRows.length){this.row=this.selectedRows[0];this.cell=this.row.cells[0]}if((this._fake)&&(!this._realfake)){this._fake.selectAll()}};this.selectCell=function(r,cInd,fl,preserve,edit,show){if(!fl){fl=false}if(typeof(r)!="object"){r=this.render_row(r)}if(!r||r==-1){return null}if(r._childIndexes){var c=r.childNodes[r._childIndexes[cInd]]}else{var c=r.childNodes[cInd]}if(!c){c=r.childNodes[0]}if(!this.markedCells){if(preserve){this.doClick(c,fl,3,show)}else{this.doClick(c,fl,0,show)}}else{this.doMark(c,preserve?2:0)}if(edit){this.editCell()}};this.moveToVisible=function(cell_obj,onlyVScroll){if(this.pagingOn){var newPage=Math.floor(this.getRowIndex(cell_obj.parentNode.idd)/this.rowsBufferOutSize)+1;if(newPage!=this.currentPage){this.changePage(newPage)}}try{if(cell_obj.offsetHeight){var distance=cell_obj.offsetLeft+cell_obj.offsetWidth+20;var scrollLeft=0;if(distance>(this.objBox.offsetWidth+this.objBox.scrollLeft)){if(cell_obj.offsetLeft>this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-(this.objBox.offsetWidth-cell_obj.offsetWidth)+5}}else{if(cell_obj.offsetLeft<this.objBox.scrollLeft){distance-=cell_obj.offsetWidth*2/3;if(distance<this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-5}}}if((scrollLeft)&&(!onlyVScroll)){this.objBox.scrollLeft=scrollLeft}}if(!cell_obj.offsetHeight){var mask=this._realfake?this._fake.rowsAr[cell_obj.parentNode.idd]:cell_obj.parentNode;distance=this.rowsBuffer._dhx_find(mask)*this._srdh}else{distance=cell_obj.offsetTop}var distancemax=distance+cell_obj.offsetHeight+38;if(distancemax>(this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop=distance}else{if(distance<this.objBox.scrollTop){var scrollTop=distance-5}}if(scrollTop){this.objBox.scrollTop=scrollTop}}catch(er){}};this.editCell=function(){if(this.editor&&this.cell==this.editor.cell){return}this.editStop();if((this.isEditable!=true)||(!this.cell)){return false}var c=this.cell;if(c.parentNode._locked){return false}this.editor=this.cells4(c);if(this.editor!=null){if(this.editor.isDisabled()){this.editor=null;return false}if(this.callEvent("onEditCell",[0,this.row.idd,this.cell._cellIndex])!=false&&this.editor.edit){this._Opera_stop=(new Date).valueOf();c.className+=" editable";this.editor.edit();this.callEvent("onEditCell",[1,this.row.idd,this.cell._cellIndex])}else{this.editor=null}}};this.editStop=function(mode){if(_isOpera){if(this._Opera_stop){if((this._Opera_stop*1+50)>(new Date).valueOf()){return}this._Opera_stop=null}}if(this.editor&&this.editor!=null){this.editor.cell.className=this.editor.cell.className.replace("editable","");if(mode){var t=this.editor.val;this.editor.detach();this.editor.setValue(t);this.editor=null;this.callEvent("onEditCancel",[this.row.idd,this.cell._cellIndex,t]);return}if(this.editor.detach()){this.cell.wasChanged=true}var g=this.editor;if(g==null){return}this.editor=null;var z=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,g.getValue(),g.val]);if((typeof(z)=="string")||(typeof(z)=="number")){g[g.setImage?"setLabel":"setValue"](z)}else{if(!z){g[g.setImage?"setLabel":"setValue"](g.val)}}if(this._ahgr&&this.multiLine){this.setSizes()}}};this._nextRowCell=function(row,dir,pos){row=this._nextRow((this._groups?this.rowsCol:this.rowsBuffer)._dhx_find(row),dir);if(!row){return null}return row.childNodes[row._childIndexes?row._childIndexes[pos]:pos]};this._getNextCell=function(acell,dir,i){acell=acell||this.cell;var arow=acell.parentNode;if(this._tabOrder){i=this._tabOrder[acell._cellIndex];if(typeof i!="undefined"){if(i<0){acell=this._nextRowCell(arow,dir,Math.abs(i)-1)}else{acell=arow.childNodes[i]}}}else{var i=acell._cellIndex+dir;if(i>=0&&i<this._cCount){if(arow._childIndexes){i=arow._childIndexes[acell._cellIndex]+dir}acell=arow.childNodes[i]}else{acell=this._nextRowCell(arow,dir,(dir==1?0:(this._cCount-1)))}}if(!acell){if((dir==1)&&this.tabEnd){this.tabEnd.focus();this.tabEnd.focus();this.setActive(false)}if((dir==-1)&&this.tabStart){this.tabStart.focus();this.tabStart.focus();this.setActive(false)}return null}if(acell.style.display!="none"&&(!this.smartTabOrder||!this.cells(acell.parentNode.idd,acell._cellIndex).isDisabled())){return acell}return this._getNextCell(acell,dir)};this._nextRow=function(ind,dir){var r=this.render_row(ind+dir);if(!r||r==-1){return null}if(r&&r.style.display=="none"){return this._nextRow(ind+dir,dir)}return r};this.scrollPage=function(dir){if(!this.rowsBuffer.length){return}var master=this._realfake?this._fake:this;var new_ind=Math.floor((master._r_select||this.getRowIndex(this.row.idd)||0)+(dir)*this.objBox.offsetHeight/(this._srdh||20));if(new_ind<0){new_ind=0}if(new_ind>=this.rowsBuffer.length){new_ind=this.rowsBuffer.length-1}if(this._srnd&&!this.rowsBuffer[new_ind]){this.objBox.scrollTop+=Math.floor((dir)*this.objBox.offsetHeight/(this._srdh||20))*(this._srdh||20);if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}master._r_select=new_ind}else{this.selectCell(new_ind,this.cell._cellIndex,true,false,false,(this.multiLine||this._srnd));if(!this.multiLine&&!this._srnd&&!this._realfake){this.objBox.scrollTop=this.getRowById(this.getRowId(new_ind)).offsetTop;if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}}master._r_select=null}};this.doKey=function(ev){if(!ev){return true}if((ev.target||ev.srcElement).value!==window.undefined){var zx=(ev.target||ev.srcElement);if(zx.className!="dhxcombo_input"&&((!zx.parentNode)||(zx.parentNode.className.indexOf("editable")==-1))){return true}}if((globalActiveDHTMLGridObject)&&(this!=globalActiveDHTMLGridObject)){return globalActiveDHTMLGridObject.doKey(ev)}if(this.isActive==false){return true}if(this._htkebl){return true}if(!this.callEvent("onKeyPress",[ev.keyCode,ev.ctrlKey,ev.shiftKey,ev])){return false}var code="k"+ev.keyCode+"_"+(ev.ctrlKey?1:0)+"_"+(ev.shiftKey?1:0);if(this.cell){if(this._key_events[code]){if(false===this._key_events[code].call(this)){return true}if(ev.preventDefault){ev.preventDefault()}ev.cancelBubble=true;return false}if(this._key_events.k_other){this._key_events.k_other.call(this,ev)}}return true};this.selectRow=function(r,fl,preserve,show){if(typeof(r)!="object"){r=this.render_row(r)}this.selectCell(r,0,fl,preserve,false,show)};this.wasDblClicked=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(el){var rowId=el.parentNode.idd;return this.callEvent("onRowDblClicked",[rowId,el._cellIndex,ev])}};this._onHeaderClick=function(e,el){var that=this.grid;el=el||that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");if(this.grid.resized==null){if(!(this.grid.callEvent("onHeaderClick",[el._cellIndexS,(e||window.event)]))){return false}that.sortField(el._cellIndexS,false,el)}this.grid.resized=null};this.deleteSelectedRows=function(){var num=this.selectedRows.length;if(num==0){return}var tmpAr=this.selectedRows;this.selectedRows=dhtmlxArray();for(var i=num-1;i>=0;i--){var node=tmpAr[i];if(!this.deleteRow(node.idd,node)){this.selectedRows[this.selectedRows.length]=node}else{if(node==this.row){var ind=i}}}if(ind){try{if(ind+1>this.rowsCol.length){ind--}this.selectCell(ind,0,true)}catch(er){this.row=null;this.cell=null}}};this.getSelectedRowId=function(){var selAr=new Array(0);var uni={};for(var i=0;i<this.selectedRows.length;i++){var id=this.selectedRows[i].idd;if(uni[id]){continue}selAr[selAr.length]=id;uni[id]=true}if(selAr.length==0){return null}else{return selAr.join(this.delim)}};this.getSelectedCellIndex=function(){if(this.cell!=null){return this.cell._cellIndex}else{return -1}};this.getColWidth=function(ind){return parseInt(this.cellWidthPX[ind])};this.setColWidth=function(ind,value){if(value=="*"){this.initCellWidth[ind]="*"}else{if(this._hrrar[ind]){return}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=parseInt(value)}else{this.cellWidthPC[ind]=parseInt(value)}}this.setSizes()};this.getRowIndex=function(row_id){for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]&&this.rowsBuffer[i].idd==row_id){return i}}return -1};this.getRowId=function(ind){return this.rowsBuffer[ind]?this.rowsBuffer[ind].idd:this.undefined};this.setRowId=function(ind,row_id){this.changeRowId(this.getRowId(ind),row_id)};this.changeRowId=function(oldRowId,newRowId){if(oldRowId==newRowId){return}var row=this.rowsAr[oldRowId];row.idd=newRowId;if(this.UserData[oldRowId]){this.UserData[newRowId]=this.UserData[oldRowId];this.UserData[oldRowId]=null}if(this._h2&&this._h2.get[oldRowId]){this._h2.get[newRowId]=this._h2.get[oldRowId];this._h2.get[newRowId].id=newRowId;delete this._h2.get[oldRowId]}this.rowsAr[oldRowId]=null;this.rowsAr[newRowId]=row;for(var i=0;i<row.childNodes.length;i++){if(row.childNodes[i]._code){row.childNodes[i]._code=this._compileSCL(row.childNodes[i]._val,row.childNodes[i])}}if(this._mat_links&&this._mat_links[oldRowId]){var a=this._mat_links[oldRowId];delete this._mat_links[oldRowId];for(var c in a){for(var i=0;i<a[c].length;i++){this._compileSCL(a[c][i].original,a[c][i])}}}this.callEvent("onRowIdChange",[oldRowId,newRowId])};this.setColumnIds=function(ids){this.columnIds=ids.split(this.delim)};this.setColumnId=function(ind,id){this.columnIds[ind]=id};this.getColIndexById=function(id){for(var i=0;i<this.columnIds.length;i++){if(this.columnIds[i]==id){return i}}};this.getColumnId=function(cin){return this.columnIds[cin]};this.getColumnLabel=function(cin,ind,hdr){var z=(hdr||this.hdr).rows[(ind||0)+1];for(var i=0;i<z.cells.length;i++){if(z.cells[i]._cellIndexS==cin){return(_isIE?z.cells[i].innerText:z.cells[i].textContent)}}return""};this.getColLabel=this.getColumnLabel;this.getFooterLabel=function(cin,ind){return this.getColumnLabel(cin,ind,this.ftr)};this.setRowTextBold=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="bold"}};this.setRowTextStyle=function(row_id,styleString){var r=this.getRowById(row_id);if(!r){return}for(var i=0;i<r.childNodes.length;i++){var pfix=r.childNodes[i]._attrs.style||"";if((this._hrrar)&&(this._hrrar[i])){pfix="display:none;"}if(_isIE){r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}else{r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}}};this.setRowColor=function(row_id,color){var r=this.getRowById(row_id);for(var i=0;i<r.childNodes.length;i++){r.childNodes[i].bgColor=color}};this.setCellTextStyle=function(row_id,ind,styleString){var r=this.getRowById(row_id);if(!r){return}var cell=r.childNodes[r._childIndexes?r._childIndexes[ind]:ind];if(!cell){return}var pfix="";if((this._hrrar)&&(this._hrrar[ind])){pfix="display:none;"}if(_isIE){cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}else{cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}};this.setRowTextNormal=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="normal"}};this.doesRowExist=function(row_id){if(this.getRowById(row_id)!=null){return true}else{return false}};this.getColumnsNum=function(){return this._cCount};this.moveRowUp=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,-1)}var rInd=this.rowsCol._dhx_find(r);if((r.previousSibling)&&(rInd!=0)){r.parentNode.insertBefore(r,r.previousSibling);this.rowsCol._dhx_swapItems(rInd,rInd-1);this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd-1);if(this._cssEven){this._fixAlterCss(rInd-1)}}};this.moveRowDown=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,1)}var rInd=this.rowsCol._dhx_find(r);if(r.nextSibling){this.rowsCol._dhx_swapItems(rInd,rInd+1);if(r.nextSibling.nextSibling){r.parentNode.insertBefore(r,r.nextSibling.nextSibling)}else{r.parentNode.appendChild(r)}this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd+1);if(this._cssEven){this._fixAlterCss(rInd)}}};this.getCombo=function(col_ind){if(!this.combos[col_ind]){this.combos[col_ind]=new dhtmlXGridComboObject()}return this.combos[col_ind]};this.setUserData=function(row_id,name,value){if(!row_id){row_id="gridglobaluserdata"}if(!this.UserData[row_id]){this.UserData[row_id]=new Hashtable()}this.UserData[row_id].put(name,value)};this.getUserData=function(row_id,name){if(!row_id){row_id="gridglobaluserdata"}this.getRowById(row_id);var z=this.UserData[row_id];return(z?z.get(name):"")};this.setEditable=function(fl){this.isEditable=dhx4.s2b(fl)};this.selectRowById=function(row_id,multiFL,show,call){if(!call){call=false}this.selectCell(this.getRowById(row_id),0,call,multiFL,false,show)};this.clearSelection=function(){this.editStop();for(var i=0;i<this.selectedRows.length;i++){var r=this.rowsAr[this.selectedRows[i].idd];if(r){r.className=r.className.replace(/rowselected/g,"")}}this.selectedRows=dhtmlxArray();this.row=null;if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"");this.cell=null}this.callEvent("onSelectionCleared",[])};this.copyRowContent=function(from_row_id,to_row_id){var frRow=this.getRowById(from_row_id);if(!this.isTreeGrid()){for(var i=0;i<frRow.cells.length;i++){this.cells(to_row_id,i).setValue(this.cells(from_row_id,i).getValue())}}else{this._copyTreeGridRowContent(frRow,from_row_id,to_row_id)}if(!_isIE){this.getRowById(from_row_id).cells[0].height=frRow.cells[0].offsetHeight}};this.setFooterLabel=function(c,label,ind){return this.setColumnLabel(c,label,ind,this.ftr)};this.setColumnLabel=function(c,label,ind,hdr){var z=(hdr||this.hdr).rows[ind||1];var col=(z._childIndexes?z._childIndexes[c]:c);if(!z.cells[col]){return}if(!this.useImagesInHeader){var hdrHTML="<div class='hdrcell'>";if(label.indexOf("img:[")!=-1){var imUrl=label.replace(/.*\[([^>]+)\].*/,"$1");label=label.substr(label.indexOf("]")+1,label.length);hdrHTML+="<img width='18px' height='18px' align='absmiddle' src='"+imUrl+"' hspace='2'>"}hdrHTML+=label;hdrHTML+="</div>";z.cells[col].innerHTML=hdrHTML;if(this._hstyles[col]){z.cells[col].style.cssText=this._hstyles[col]}}else{z.cells[col].style.textAlign="left";z.cells[col].innerHTML="<img src='"+label+"'>";var a=new Image();a.src=""+label.replace(/(\.[a-z]+)/,".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=a;var b=new Image();b.src=""+label.replace(/(\.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]=b}if((label||"").indexOf("#")!=-1){var t=label.match(/(^|{)#([^}]+)(}|$)/);if(t){var tn="_in_header_"+t[2];if(this[tn]){this[tn]((this.forceDivInHeader?z.cells[col].firstChild:z.cells[col]),col,label.split(t[0]))}}}};this.setColLabel=function(a,b,ind,c){return this.setColumnLabel(a,b,(ind||0)+1,c)};this.clearAll=function(header){if(!this.obj.rows[0]){return}if(this._h2){this._h2=this._createHierarchy();if(this._fake){if(this._realfake){this._h2=this._fake._h2}else{this._fake._h2=this._h2}}}this.limit=this._limitC=0;this.editStop(true);if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}if(this._dload){this.objBox.scrollTop=0;this.limit=this._limitC||0;this._initDrF=true}var len=this.rowsCol.length;len=this.obj.rows.length;for(var i=len-1;i>0;i--){var t_r=this.obj.rows[i];t_r.parentNode.removeChild(t_r)}if(header){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(var i=this.hdr.rows.length-1;i>=0;i--){var t_r=this.hdr.rows[i];t_r.parentNode.removeChild(t_r)}if(this.ftr){this.ftr.parentNode.removeChild(this.ftr);this.ftr=null}this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.row=null;this.cell=null;this.rowsCol=dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd){this.xmlFileUrl=""}if(this.pagingOn){this.changePage(1)}if(this._contextCallTimer){window.clearTimeout(this._contextCallTimer)}if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;this.setSortImgState(false);this.setSizes();this.callEvent("onClearAll",[])};this.sortField=function(ind,repeatFl,r_el){if(this.getRowsNum()==0){return false}var el=this.hdr.rows[0].cells[ind];if(!el){return}if(el.tagName=="TH"&&(this.fldSort.length-1)>=el._cellIndex&&this.fldSort[el._cellIndex]!="na"){var data=this.getSortingState();var sortType=(data[0]==ind&&data[1]=="asc")?"des":"asc";if(!this.callEvent("onBeforeSorting",[ind,this.fldSort[ind],sortType])){return}this.sortImg.className="dhxgrid_sort_"+(sortType=="asc"?"asc":"desc");if(this.useImagesInHeader){var cel=this.hdr.rows[1].cells[el._cellIndex].firstChild;if(this.fldSorted!=null){var celT=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;celT.src=celT.src.replace(/(\.asc\.)|(\.des\.)/,".")}cel.src=cel.src.replace(/(\.[a-z]+)$/,"."+sortType+"$1")}this.sortRows(el._cellIndex,this.fldSort[el._cellIndex],sortType);this.fldSorted=el;this.r_fldSorted=r_el;var c=this.hdr.rows[1];var c=r_el.parentNode;var real_el=c._childIndexes?c._childIndexes[el._cellIndex]:el._cellIndex;this.setSortImgPos(false,false,false,r_el)}};this.setCustomSorting=function(func,col){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[col]=(typeof(func)=="string")?eval(func):func;this.fldSort[col]="cus"};this.enableHeaderImages=function(fl){this.useImagesInHeader=fl};this.setHeader=function(hdrStr,splitSign,styles){if(typeof(hdrStr)!="object"){var arLab=this._eSplit(hdrStr)}else{arLab=[].concat(hdrStr)}var arWdth=new Array(0);var arTyp=new dhtmlxArray(0);var arAlg=new Array(0);var arVAlg=new Array(0);var arSrt=new Array(0);for(var i=0;i<arLab.length;i++){arWdth[arWdth.length]=Math.round(100/arLab.length);arTyp[arTyp.length]="ed";arAlg[arAlg.length]="left";arVAlg[arVAlg.length]="middle";arSrt[arSrt.length]="na"}this.splitSign=splitSign||"#cspan";this.hdrLabels=arLab;this.cellWidth=arWdth;if(!this.initCellWidth.length){this.setInitWidthsP(arWdth.join(this.delim),true)}this.cellType=arTyp;this.cellAlign=arAlg;this.cellVAlign=arVAlg;this.fldSort=arSrt;this._hstyles=styles||[]};this._eSplit=function(str){if(![].push){return str.split(this.delim)}var a="r"+(new Date()).valueOf();var z=this.delim.replace(/([\|\+\*\^])/g,"\\$1");return(str||"").replace(RegExp(z,"g"),a).replace(RegExp("\\\\"+a,"g"),this.delim).split(a)};this.getColType=function(cInd){return this.cellType[cInd]};this.getColTypeById=function(cID){return this.cellType[this.getColIndexById(cID)]};this.setColTypes=function(typeStr){this.cellType=dhtmlxArray(typeStr.split(this.delim));this._strangeParams=new Array();for(var i=0;i<this.cellType.length;i++){if((this.cellType[i].indexOf("[")!=-1)){var z=this.cellType[i].split(/[\[\]]+/g);this.cellType[i]=z[0];this.defVal[i]=z[1];if(z[1].indexOf("=")==0){this.cellType[i]="math";this._strangeParams[i]=z[0]}}if(!window["eXcell_"+this.cellType[i]]){dhx4.callEvent("onConfigurationError",["Incorrect cell type: "+this.cellType[i],this,this.cellType[i]])}}};this.setColSorting=function(sortStr){this.fldSort=sortStr.split(this.delim);var check={str:1,"int":1,date:1};for(var i=0;i<this.fldSort.length;i++){if((!check[this.fldSort[i]])&&(typeof(window[this.fldSort[i]])=="function")){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[i]=window[this.fldSort[i]];this.fldSort[i]="cus"}}};this.setColAlign=function(alStr){this.cellAlign=alStr.split(this.delim);for(var i=0;i<this.cellAlign.length;i++){this.cellAlign[i]=this.cellAlign[i]._dhx_trim()}};this.setColVAlign=function(valStr){this.cellVAlign=valStr.split(this.delim)};this.setNoHeader=function(fl){this.noHeader=dhx4.s2b(fl)};this.showRow=function(rowID){this.getRowById(rowID);if(this._h2){this.openItem(this._h2.get[rowID].parent.id)}var c=this.getRowById(rowID).childNodes[0];while(c&&c.style.display=="none"){c=c.nextSibling}if(c){this.moveToVisible(c,true)}};this.setStyle=function(ss_header,ss_grid,ss_selCell,ss_selRow){this.ssModifier=[ss_header,ss_grid,ss_selCell,ss_selCell,ss_selRow];var prefs=["#"+this.entBox.id+" table.hdr td","#"+this.entBox.id+" table.obj td","#"+this.entBox.id+" table.obj tr.rowselected td.cellselected","#"+this.entBox.id+" table.obj td.cellselected","#"+this.entBox.id+" table.obj tr.rowselected td"];var index=0;while(!_isIE){try{var temp=document.styleSheets[index].cssRules.length}catch(e){index++;continue}break}for(var i=0;i<prefs.length;i++){if(this.ssModifier[i]){if(_isIE){document.styleSheets[0].addRule(prefs[i],this.ssModifier[i])}else{document.styleSheets[index].insertRule(prefs[i]+(" { "+this.ssModifier[i]+" }"),document.styleSheets[index].cssRules.length)}}}};this.setColumnColor=function(clr){this.columnColor=clr.split(this.delim)};this.enableAlterCss=function(cssE,cssU,perLevel,levelUnique){if(cssE||cssU){this.attachEvent("onGridReconstructed",function(){this._fixAlterCss();if(this._fake){this._fake._fixAlterCss()}})}this._cssSP=perLevel;this._cssSU=levelUnique;this._cssEven=cssE;this._cssUnEven=cssU};this._fixAlterCss=function(ind){if(this._h2&&(this._cssSP||this._cssSU)){return this._fixAlterCssTGR(ind)}if(!this._cssEven&&!this._cssUnEven){return}ind=ind||0;var j=ind;for(var i=ind;i<this.rowsCol.length;i++){if(!this.rowsCol[i]){continue}if(this.rowsCol[i].style.display!="none"){if(this.rowsCol[i]._cntr){j=1;continue}if(this.rowsCol[i].className.indexOf("rowselected")!=-1){if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" rowselected "+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" rowselected "+(this.rowsCol[i]._css||"")}}else{if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" "+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" "+(this.rowsCol[i]._css||"")}}j++}}};this.clearChangedState=function(){for(var i=0;i<this.rowsCol.length;i++){var row=this.rowsCol[i];if(row&&row.childNodes){var cols=row.childNodes.length;for(var j=0;j<cols;j++){row.childNodes[j].wasChanged=false}}}};this.getChangedRows=function(and_added){var res=new Array();this.forEachRow(function(id){var row=this.rowsAr[id];if(row.tagName!="TR"){return}var cols=row.childNodes.length;if(and_added&&row._added){res[res.length]=row.idd}else{for(var j=0;j<cols;j++){if(row.childNodes[j].wasChanged){res[res.length]=row.idd;break}}}});return res.join(this.delim)};this._sUDa=false;this._sAll=false;this.setSerializationLevel=function(userData,fullXML,config,changedAttr,onlyChanged,asCDATA){this._sUDa=userData;this._sAll=fullXML;this._sConfig=config;this._chAttr=changedAttr;this._onlChAttr=onlyChanged;this._asCDATA=asCDATA};this.setSerializableColumns=function(list){if(!list){this._srClmn=null;return}this._srClmn=(list||"").split(",");for(var i=0;i<this._srClmn.length;i++){this._srClmn[i]=dhx4.s2b(this._srClmn[i])}};this._serialise=function(rCol,inner,closed){this.editStop();var out=[];var close="</"+this.xml.s_row+">";if(this.isTreeGrid()){this._h2.forEachChildF(0,function(el){var temp=this._serializeRow(this.render_row_tree(-1,el.id));out.push(temp);if(temp){return true}else{return false}},this,function(){out.push(close)})}else{for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]){if(this._chAttr&&this.rowsBuffer[i]._locator){continue}var temp=this._serializeRow(this.render_row(i));out.push(temp);if(temp){out.push(close)}}}}return[out.join("")]};this._serializeRow=function(r,i){var out=[];var ra=this.xml.row_attrs;var ca=this.xml.cell_attrs;out.push("<"+this.xml.s_row);out.push(" id='"+r.idd+"'");if((this._sAll)&&this.selectedRows._dhx_find(r)!=-1){out.push(" selected='1'")}if(this._h2&&this._h2.get[r.idd].state=="minus"){out.push(" open='1'")}if(ra.length){for(var i=0;i<ra.length;i++){out.push(" "+ra[i]+"='"+r._attrs[ra[i]]+"'")}}out.push(">");if(this._sUDa&&this.UserData[r.idd]){keysAr=this.UserData[r.idd].getKeys();for(var ii=0;ii<keysAr.length;ii++){out.push("<userdata name='"+keysAr[ii]+"'>"+(this._asCDATA?"<![CDATA[":"")+this.UserData[r.idd].get(keysAr[ii])+(this._asCDATA?"]]>":"")+"</userdata>")}}var changeFl=false;for(var jj=0;jj<this._cCount;jj++){if((!this._srClmn)||(this._srClmn[jj])){var zx=this.cells3(r,jj);out.push("<cell");if(ca.length){for(var i=0;i<ca.length;i++){out.push(" "+ca[i]+"='"+zx.cell._attrs[ca[i]]+"'")}}zxVal=zx[this._agetm]();if(this._asCDATA){zxVal="<![CDATA["+zxVal+"]]>"}if((this._ecspn)&&(zx.cell.colSpan)&&zx.cell.colSpan>1){out.push(' colspan="'+zx.cell.colSpan+'" ')}if(this._chAttr){if(zx.wasChanged()){out.push(' changed="1"');changeFl=true}}else{if((this._onlChAttr)&&(zx.wasChanged())){changeFl=true}}if(this._sAll&&this.cellType[jj]=="tree"){out.push((this._h2?(" image='"+this._h2.get[r.idd].image+"'"):"")+">"+zxVal+"</cell>")}else{out.push(">"+zxVal+"</cell>")}if((this._ecspn)&&(zx.cell.colSpan)){for(var u=0;u<zx.cell.colSpan-1;u++){out.push("<cell/>");jj++}}}}if((this._onlChAttr)&&(!changeFl)&&(!r._added)){return""}return out.join("")};this._serialiseConfig=function(){var out="<head>";for(var i=0;i<this.hdr.rows[0].cells.length;i++){if(this._srClmn&&!this._srClmn[i]){continue}var sort=this.fldSort[i];if(sort=="cus"){sort=this._customSorts[i].toString();sort=sort.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}out+="<column width='"+this.getColWidth(i)+"' align='"+this.cellAlign[i]+"' type='"+this.cellType[i]+"' sort='"+(sort||"na")+"' color='"+this.columnColor[i]+"'"+(this.columnIds[i]?(" id='"+this.columnIds[i]+"'"):"")+">";if(this._asCDATA){out+="<![CDATA["+this.getColumnLabel(i)+"]]>"}else{out+=this.getColumnLabel(i)}var z=this.getCombo(i);if(z){for(var j=0;j<z.keys.length;j++){out+="<option value='"+z.keys[j]+"'>"+z.values[j]+"</option>"}}out+="</column>"}return out+="</head>"};this.serialize=function(){var out='<?xml version="1.0"?><rows>';if(this._mathSerialization){this._agetm="getMathValue"}else{this._agetm="getValue"}if(this._sUDa&&this.UserData.gridglobaluserdata){var keysAr=this.UserData.gridglobaluserdata.getKeys();for(var i=0;i<keysAr.length;i++){out+="<userdata name='"+keysAr[i]+"'>"+this.UserData.gridglobaluserdata.get(keysAr[i])+"</userdata>"}}if(this._sConfig){out+=this._serialiseConfig()}out+=this._serialise();out+="</rows>";return out};this.getPosition=function(oNode,pNode){if(!pNode){var pos=dhx4.getOffset(oNode);return[pos.left,pos.top]}pNode=pNode||document.body;var oCurrentNode=oNode;var iLeft=0;var iTop=0;while((oCurrentNode)&&(oCurrentNode!=pNode)){iLeft+=oCurrentNode.offsetLeft-oCurrentNode.scrollLeft;iTop+=oCurrentNode.offsetTop-oCurrentNode.scrollTop;oCurrentNode=oCurrentNode.offsetParent}if(pNode==document.body){if(_isIE){iTop+=document.body.offsetTop||document.documentElement.offsetTop;iLeft+=document.body.offsetLeft||document.documentElement.offsetLeft}else{if(!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop}}}return[iLeft,iTop]};this.getFirstParentOfType=function(obj,tag){while(obj&&obj.tagName!=tag&&obj.tagName!="BODY"){obj=obj.parentNode}return obj};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.hdrBox.onscroll=function(){if(this._try_header_sync){return}this._try_header_sync=true;if(Math.abs(this.grid.objBox.scrollLeft-this.scrollLeft)>1){this.grid.objBox.scrollLeft=this.scrollLeft}this._try_header_sync=false};if((!_isOpera)||(_OperaRv>8.5)){this.hdr.onmousemove=function(e){this.grid.changeCursorState(e||window.event)};this.hdr.onmousedown=function(e){return this.grid.startColResize(e||window.event)}}this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(e){(e||event).cancelBubble=true};this.obj.onclick=function(e){if(this.grid._doClick(e||window.event)!==false){if(this.grid._sclE){this.grid.editCell(e||window.event)}else{this.grid.editStop()}}(e||event).cancelBubble=true};if(_isMacOS){this.entBox.oncontextmenu=function(e){e.cancelBubble=true;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}var that=this.grid;if(that._realfake){that=that._fake}return that._doContClick(e||window.event)}}else{this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.entBox.oncontextmenu=function(e){if(this.grid._ctmndx){(e||event).cancelBubble=true}return !this.grid._ctmndx}}this.obj.ondblclick=function(e){if(!this.grid.wasDblClicked(e||window.event)){return false}if(this.grid._dclE){var row=this.grid.getFirstParentOfType((_isIE?event.srcElement:e.target),"TR");if(row==this.grid.row){this.grid.editCell(e||window.event)}}(e||event).cancelBubble=true;if(_isOpera){return false}};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){self._onHeaderClick.apply({grid:self},[null,self.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown){dhtmlxEvent(document,"keydown",function(e){if(globalActiveDHTMLGridObject){return globalActiveDHTMLGridObject.doKey(e||window.event)}});document.body._dhtmlxgrid_onkeydown=true}dhtmlxEvent(document.body,"click",function(){if(self.editStop){self.editStop()}if(self.isActive){self.setActive(false)}});if(this.entBox.style.height.toString().indexOf("%")!=-1){this._delta_y=this.entBox.style.height}if(this.entBox.style.width.toString().indexOf("%")!=-1){this._delta_x=this.entBox.style.width}if(this._delta_x||this._delta_y){this._setAutoResize()}this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}if(dhtmlx.skin){this.setSkin(dhtmlx.skin)}return this}dhtmlXGridObject.prototype={getRowAttribute:function(c,a){return this.getRowById(c)._attrs[a]},setRowAttribute:function(g,a,c){this.getRowById(g)._attrs[a]=c},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(m,g){var c=dhx4.s2b(g);var l=this.getRowById(m);if(!l){return}if(l.expand===""){this.collapseKids(l)}if((g)&&(l.style.display!="none")){l.style.display="none";var j=this.selectedRows._dhx_find(l);if(j!=-1){l.className=l.className.replace("rowselected","");for(var a=0;a<l.childNodes.length;a++){l.childNodes[a].className=l.childNodes[a].className.replace(/cellselected/g,"")}this.selectedRows._dhx_removeAt(j)}this.callEvent("onGridReconstructed",[])}if((!g)&&(l.style.display=="none")){l.style.display="";this.callEvent("onGridReconstructed",[])}this.callEvent("onRowHide",[m,g]);this.setSizes()},setColumnHidden:function(g,c){if(!this.hdr.rows.length){if(!this._ivizcol){this._ivizcol=[]}return this._ivizcol[g]=c}if((this.fldSorted)&&(this.fldSorted.cellIndex==g)&&(c)){this.sortImg.style.display="none"}var a=dhx4.s2b(c);if(a){if(!this._hrrar){this._hrrar=new Array()}else{if(this._hrrar[g]){return}}this._hrrar[g]="display:none;";this._hideShowColumn(g,"none")}else{if((!this._hrrar)||(!this._hrrar[g])){return}this._hrrar[g]="";this._hideShowColumn(g,"")}if((this.fldSorted)&&(this.fldSorted.cellIndex==g)&&(!c)){this.sortImg.style.display="inline"}this.setSortImgPos();this.callEvent("onColumnHidden",[g,c])},isColumnHidden:function(a){if((this._hrrar)&&(this._hrrar[a])){return true}return false},setColumnsVisibility:function(c){if(c){this._ivizcol=c.split(this.delim)}if(this.hdr.rows.length&&this._ivizcol){for(var a=0;a<this._ivizcol.length;a++){this.setColumnHidden(a,this._ivizcol[a])}}},_fixHiddenRowsAll:function(q,g,a,c,n){n=n||"_cellIndex";var o=q.rows.length;for(var m=0;m<o;m++){var r=q.rows[m].childNodes;if(r.length!=this._cCount){for(var l=0;l<r.length;l++){if(r[l][n]==g){r[l].style[a]=c;break}}}else{r[g].style[a]=c}}},_hideShowColumn:function(l,j){var a=l;if(this.hdr.rows[1]&&(this.hdr.rows[1]._childIndexes)&&(this.hdr.rows[1]._childIndexes[l]!=l)){a=this.hdr.rows[1]._childIndexes[l]}if(j=="none"){this.hdr.rows[0].cells[l]._oldWidth=this.hdr.rows[0].cells[l].style.width||(this.initCellWidth[l]+"px");this.hdr.rows[0].cells[l]._oldWidthP=this.cellWidthPC[l];this.obj.rows[0].cells[l].style.width="0px";var c={rows:[this.obj.rows[0]]};this.forEachRow(function(m){if(this.rowsAr[m].tagName=="TR"){c.rows.push(this.rowsAr[m])}});this._fixHiddenRowsAll(c,l,"display","none");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(l,"none")}if((_isOpera&&_OperaRv<9)||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,l,"display","none","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],l,"display","none")}this._fixHiddenRowsAll(this.hdr,l,"whiteSpace","nowrap","_cellIndexS");if(!this.cellWidthPX.length&&!this.cellWidthPC.length){this.cellWidthPX=[].concat(this.initCellWidth)}if(this.cellWidthPX[l]){this.cellWidthPX[l]=0}if(this.cellWidthPC[l]){this.cellWidthPC[l]=0}}else{if(this.hdr.rows[0].cells[l]._oldWidth){var g=this.hdr.rows[0].cells[l];if(_isOpera||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,l,"display","","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],l,"display","")}var c={rows:[this.obj.rows[0]]};this.forEachRow(function(m){if(this.rowsAr[m].tagName=="TR"){c.rows.push(this.rowsAr[m])}});this._fixHiddenRowsAll(c,l,"display","");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(l,"")}this._fixHiddenRowsAll(this.hdr,l,"whiteSpace","normal","_cellIndexS");if(g._oldWidthP){this.cellWidthPC[l]=g._oldWidthP}if(g._oldWidth){this.cellWidthPX[l]=parseInt(g._oldWidth)}}}this.setSizes();if((!_isIE)&&(!_isFF)){this.obj.border=1;this.obj.border=0}},enableColSpan:function(a){this._ecspn=dhx4.s2b(a)},enableRowsHover:function(c,a){this._unsetRowHover(false,true);this._hvrCss=a;if(dhx4.s2b(c)){if(!this._elmnh){this.obj._honmousemove=this.obj.onmousemove;this.obj.onmousemove=this._setRowHover;if(_isIE){this.obj.onmouseleave=this._unsetRowHover}else{this.obj.onmouseout=this._unsetRowHover}this._elmnh=true}}else{if(this._elmnh){this.obj.onmousemove=this.obj._honmousemove;if(_isIE){this.obj.onmouseleave=null}else{this.obj.onmouseout=null}this._elmnh=false}}},enableEditEvents:function(c,g,a){this._sclE=dhx4.s2b(c);this._dclE=dhx4.s2b(g);this._f2kE=dhx4.s2b(a)},enableLightMouseNavigation:function(a){if(dhx4.s2b(a)){if(!this._elmn){this.entBox._onclick=this.entBox.onclick;this.entBox.onclick=function(){return true};this.obj._onclick=this.obj.onclick;this.obj.onclick=function(g){var j=this.grid.getFirstParentOfType(g?g.target:event.srcElement,"TD");if(!j){return}this.grid.editStop();this.grid.doClick(j);this.grid.editCell();(g||event).cancelBubble=true};this.obj._onmousemove=this.obj.onmousemove;this.obj.onmousemove=this._autoMoveSelect;this._elmn=true}}else{if(this._elmn){this.entBox.onclick=this.entBox._onclick;this.obj.onclick=this.obj._onclick;this.obj.onmousemove=this.obj._onmousemove;this._elmn=false}}},_unsetRowHover:function(g,j){if(j){that=this}else{that=this.grid}if((that._lahRw)&&(that._lahRw!=j)){for(var a=0;a<that._lahRw.childNodes.length;a++){that._lahRw.childNodes[a].className=that._lahRw.childNodes[a].className.replace(that._hvrCss,"")}that._lahRw=null}},_setRowHover:function(g){var j=this.grid.getFirstParentOfType(g?g.target:event.srcElement,"TD");if(j&&j.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0,j);j=j.parentNode;if(!j.idd||j.idd=="__filler__"){return}for(var a=0;a<j.childNodes.length;a++){j.childNodes[a].className+=" "+this.grid._hvrCss}this.grid._lahRw=j}this._honmousemove(g)},_autoMoveSelect:function(a){if(!this.grid.editor){var g=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(g.parentNode.idd){this.grid.doClick(g,true,0)}}this._onmousemove(a)},enableDistributedParsing:function(g,a,c){if(dhx4.s2b(g)){this._ads_count=a||10;this._ads_time=c||250}else{this._ads_count=0}},destructor:function(){this.editStop(true);if(this._sizeTime){this._sizeTime=window.clearTimeout(this._sizeTime)}this.entBox.className=(this.entBox.className||"").replace(/gridbox.*/,"");if(this.formInputs){for(var g=0;g<this.formInputs.length;g++){this.parentForm.removeChild(this.formInputs[g])}}var c;for(var g=0;g<this.rowsCol.length;g++){if(this.rowsCol[g]){this.rowsCol[g].grid=null}}for(g in this.rowsAr){if(this.rowsAr[g]){this.rowsAr[g]=null}}this.rowsCol=new dhtmlxArray();this.rowsAr={};this.entBox.innerHTML="";var j=function(){};this.entBox.onclick=this.entBox.onmousedown=this.entBox.onbeforeactivate=this.entBox.onbeforedeactivate=this.entBox.onbeforedeactivate=this.entBox.onselectstart=j;this.setSizes=this._update_srnd_view=this.callEvent=j;this.entBox.grid=this.objBox.grid=this.hdrBox.grid=this.obj.grid=this.hdr.grid=null;if(this._fake){this.globalBox.innerHTML="";this._fake.setSizes=this._fake._update_srnd_view=this._fake.callEvent=j;this.globalBox.onclick=this.globalBox.onmousedown=this.globalBox.onbeforeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onselectstart=j}for(c in this){if((this[c])&&(this[c].m_obj)){this[c].m_obj=null}this[c]=null}if(this==globalActiveDHTMLGridObject){globalActiveDHTMLGridObject=null}return null},getSortingState:function(){var a=new Array();if(this.fldSorted){a[0]=this.fldSorted._cellIndex;a[1]=(this.sortImg.className=="dhxgrid_sort_desc"?"des":"asc")}return a},enableAutoHeight:function(g,c,a){this._ahgr=dhx4.s2b(g);this._ahgrF=dhx4.s2b(a);this._ahgrM=c||null;if(arguments.length==1){this.objBox.style.overflowY=g?"hidden":"auto"}if(c=="auto"){this._ahgrM=null;this._ahgrMA=true;this._setAutoResize()}},enableStableSorting:function(a){this._sst=dhx4.s2b(a);this.rowsCol.stablesort=function(n){var m=this.length-1;for(var l=0;l<this.length-1;l++){for(var g=0;g<m;g++){if(n(this[g],this[g+1])>0){var c=this[g];this[g]=this[g+1];this[g+1]=c}}m--}}},enableKeyboardSupport:function(a){this._htkebl=!dhx4.s2b(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(a){},enableTooltips:function(c){this._enbTts=c.split(",");for(var a=0;a<this._enbTts.length;a++){this._enbTts[a]=dhx4.s2b(this._enbTts[a])}},enableResizing:function(c){this._drsclmn=c.split(",");for(var a=0;a<this._drsclmn.length;a++){this._drsclmn[a]=dhx4.s2b(this._drsclmn[a])}},setColumnMinWidth:function(a,c){if(arguments.length==2){if(!this._drsclmW){this._drsclmW=new Array()}this._drsclmW[c]=a}else{this._drsclmW=a.split(",")}},enableCellIds:function(a){this._enbCid=dhx4.s2b(a)},lockRow:function(a,g){var c=this.getRowById(a);if(c){c._locked=dhx4.s2b(g);if((this.cell)&&(this.cell.parentNode.idd==a)){this.editStop()}}},_getRowArray:function(l){var j=new Array();for(var g=0;g<l.childNodes.length;g++){var c=this.cells3(l,g);j[g]=c.getValue()}return j},setDateFormat:function(c,a){this._dtmask=c;this._dtmask_inc=a},setNumberFormat:function(o,g,l,n){var j=o.replace(/[^0\,\.]*/g,"");var a=j.indexOf(".");if(a>-1){a=j.length-a-1}var c=j.indexOf(",");if(c>-1){c=j.length-a-2-c}if(typeof l!="string"){l=this.i18n.decimal_separator}if(typeof n!="string"){n=this.i18n.group_separator}var q=o.split(j)[0];var m=o.split(j)[1];this._maskArr[g]=[a,c,q,m,l,n]},_aplNFb:function(l,j){var c=this._maskArr[j];if(!c){return l}var g=parseFloat(l.toString().replace(/[^0-9]*/g,""));if(l.toString().substr(0,1)=="-"){g=g*-1}if(c[0]>0){g=g/Math.pow(10,c[0])}return g},_aplNF:function(n,m){var g=this._maskArr[m];if(!g){return n}var o=(parseFloat(n)<0?"-":"")+g[2];n=Math.abs(Math.round(parseFloat(n)*Math.pow(10,g[0]>0?g[0]:0))).toString();n=(n.length<g[0]?Math.pow(10,g[0]+1-n.length).toString().substr(1,g[0]+1)+n.toString():n).split("").reverse();n[g[0]]=(n[g[0]]||"0")+g[4];if(g[1]>0){for(var l=(g[0]>0?0:1)+g[0]+g[1];l<n.length;l+=g[1]){n[l]+=g[5]}}return o+n.reverse().join("")+g[3]},_launchCommands:function(a){for(var l=0;l<a.length;l++){var g=new Array();for(var c=0;c<a[l].childNodes.length;c++){if(a[l].childNodes[c].nodeType==1){g[g.length]=a[l].childNodes[c].firstChild.data}}this[a[l].getAttribute("command")].apply(this,g)}},_parseHead:function(m){var l=dhx4.ajax.xpath("./head",m);if(l.length){var n=dhx4.ajax.xpath("./column",l[0]);var o=dhx4.ajax.xpath("./settings",l[0]);var D="setInitWidths";var x=false;if(o[0]){for(var q=0;q<o[0].childNodes.length;q++){switch(o[0].childNodes[q].tagName){case"colwidth":if(o[0].childNodes[q].firstChild&&o[0].childNodes[q].firstChild.data=="%"){D="setInitWidthsP"}break;case"splitat":x=(o[0].childNodes[q].firstChild?o[0].childNodes[q].firstChild.data:false);break}}}this._launchCommands(dhx4.ajax.xpath("./beforeInit/call",l[0]));if(n.length>0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var w=["","width","type","align","sort","color","format","hidden","id"];var v=["",D,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var C=0;C<n.length;C++){for(var A=1;A<w.length;A++){a[A].push(n[C].getAttribute(w[A]))}a[0].push((n[C].firstChild?n[C].firstChild.data:"").replace(/^\s*((\s\S)*.+)\s*$/gi,"$1"))}this.setHeader(a[0]);for(var C=0;C<v.length;C++){if(v[C]){this[v[C]](a[C].join(this.delim))}}for(var C=0;C<n.length;C++){if((this.cellType[C].indexOf("co")==0)||(this.cellType[C]=="clist")){var r=dhx4.ajax.xpath("./option",n[C]);if(r.length){var y=new Array();if(this.cellType[C]=="clist"){for(var A=0;A<r.length;A++){y[y.length]=r[A].firstChild?r[A].firstChild.data:""}this.registerCList(C,y)}else{var E=this.getCombo(C);for(var A=0;A<r.length;A++){E.put(r[A].getAttribute("value"),r[A].firstChild?r[A].firstChild.data:"")}}}}else{if(a[6][C]){if((this.cellType[C].toLowerCase().indexOf("calendar")!=-1)||(this.fldSort[C]=="date")){this.setDateFormat(a[6][C])}else{this.setNumberFormat(a[6][C],C)}}}}this.init();var g=a[7].join(this.delim);if(this.setColHidden&&g.replace(/,/g,"")!=""){this.setColHidden(g)}if((x)&&(this.splitAt)){this.splitAt(x)}}this._launchCommands(dhx4.ajax.xpath("./afterInit/call",l[0]))}var c=dhx4.ajax.xpath("//rows/userdata",m);if(c.length>0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var A=0;A<c.length;A++){var F="";for(var u=0;u<c[A].childNodes.length;u++){F+=c[A].childNodes[u].nodeValue}this.UserData.gridglobaluserdata.put(c[A].getAttribute("name"),F)}}},getCheckedRows:function(a){var c=new Array();this.forEachRowA(function(j){var g=this.cells(j,a);if(g.changeState&&g.getValue()!=0){c.push(j)}},true);return c.join(",")},checkAll:function(){var c=arguments.length?arguments[0]:1;for(var a=0;a<this.getColumnsNum();a++){if(this.getColType(a)=="ch"){this.setCheckedRows(a,c)}}},uncheckAll:function(){this.checkAll(0)},setCheckedRows:function(c,a){this.forEachRowA(function(g){if(this.cells(g,c).isCheckbox()){this.cells(g,c).setValue(a)}})},_drawTooltip:function(l){var m=this.grid.getFirstParentOfType(l?l.target:event.srcElement,"TD");if(!m||((this.grid.editor)&&(this.grid.editor.cell==m))){return true}var j=m.parentNode;if(!j.idd||j.idd=="__filler__"){return}var g=(l?l.target:event.srcElement);if(j.idd==window.unknown){return true}if(!this.grid.callEvent("onMouseOver",[j.idd,m._cellIndex,(l||window.event)])){return true}if((this.grid._enbTts)&&(!this.grid._enbTts[m._cellIndex])){if(g.title){g.title=""}return true}if(m._cellIndex>=this.grid._cCount){return}var a=this.grid.cells3(j,m._cellIndex);if(!a||!a.cell||!a.cell._attrs){return}if(g._title){a.cell.title=""}if(!a.cell._attrs.title){g._title=true}if(a){g.title=a.cell._attrs.title||(a.getTitle?a.getTitle():(a.getValue()||"").toString().replace(/<[^>]*>/gi,""))}return true},enableCellWidthCorrection:function(a){if(_isFF){this._wcorr=parseInt(a)}},getAllRowIds:function(g){var a=[];for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]){a.push(this.rowsBuffer[c].idd)}}return a.join(g||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},setColspan:function(g,y,l){if(!this._ecspn){return}var a=this.getRowById(g);if((a._childIndexes)&&(a.childNodes[a._childIndexes[y]])){var s=a._childIndexes[y];var o=a.childNodes[s];var q=o.colSpan;o.colSpan=1;if((q)&&(q!=1)){for(var v=1;v<q;v++){var x=document.createElement("TD");if(o.nextSibling){a.insertBefore(x,o.nextSibling)}else{a.appendChild(x)}a._childIndexes[y+v]=s+v;x._cellIndex=y+v;x.style.textAlign=this.cellAlign[v];x.style.verticalAlign=this.cellVAlign[v];o=x;this.cells3(a,y+v).setValue("")}}for(var w=y*1+1*q;w<a._childIndexes.length;w++){a._childIndexes[w]+=(q-1)*1}}if((l)&&(l>1)){if(a._childIndexes){var s=a._childIndexes[y]}else{var s=y;a._childIndexes=new Array();for(var w=0;w<a.childNodes.length;w++){a._childIndexes[w]=w}}a.childNodes[s].colSpan=l;for(var w=1;w<l;w++){a._childIndexes[a.childNodes[s+1]._cellIndex]=s;a.removeChild(a.childNodes[s+1])}var u=a.childNodes[a._childIndexes[y]]._cellIndex;for(var w=u*1+1*l;w<a._childIndexes.length;w++){a._childIndexes[w]-=(l-1)}}},preventIECaching:function(a){dhx4.ajax.cache=!a},enableColumnAutoSize:function(a){this._eCAS=dhx4.s2b(a)},_onHeaderDblClick:function(g){var c=this.grid;var a=c.getFirstParentOfType(_isIE?event.srcElement:g.target,"TD");if(!c._eCAS){return false}c.adjustColumnSize(a._cellIndexS)},adjustColumnSize:function(r,c){if(this._hrrar&&this._hrrar[r]){return}this._notresize=true;var g=0;this._setColumnSizeR(r,20);for(var o=1;o<this.hdr.rows.length;o++){var u=this.hdr.rows[o];u=u.childNodes[(u._childIndexes)?u._childIndexes[r]:r];if((u)&&((!u.colSpan)||(u.colSpan<2))&&u._cellIndex==r){if((u.childNodes[0])&&(u.childNodes[0].className=="hdrcell")){u=u.childNodes[0]}g=Math.max(g,u.scrollWidth)}}var n=this.obj.rows.length;var s=0;var w=this.cellType._dhx_find("tree");for(var q=1;q<n;q++){var v=this.obj.rows[q];if(!this.rowsAr[v.idd]){continue}if(v._childIndexes&&v._childIndexes[r]!=r||!v.childNodes[r]){continue}s=(v.childNodes[r].innerText||v.childNodes[r].textContent||"").length*this.fontWidth;if(this._h2&&r==w){s+=this._h2.get[v.idd].level*22}if(s>g){g=s}}g+=20+(c||0);this._setColumnSizeR(r,g);this._notresize=false;this.setSizes()},detachHeader:function(a,g){g=g||this.hdr;var c=g.rows[a+1];if(c){c.parentNode.removeChild(c)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,j,c){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(j)=="string"){j=j.split(this.delim)}c=c||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,j],this[(c=="_aHead")?"hdr":"ftr"])}else{if(this[c]){for(var g=0;g<this[c].length;g++){this.attachHeader.apply(this,this[c][g])}}}}else{if(!this[c]){this[c]=new Array()}this[c][this[c].length]=[a,j,c]}},_createHRow:function(g,s){if(!s){if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}var o=document.createElement("DIV");o.className="c_ftr".substr(2);this.entBox.appendChild(o);var x=document.createElement("TABLE");x.cellPadding=x.cellSpacing=0;if(!_isIE||_isIE==8){x.width="100%";x.style.paddingRight="20px"}x.style.marginRight="20px";x.style.tableLayout="fixed";o.appendChild(x);x.appendChild(document.createElement("TBODY"));this.ftr=s=x;var n=x.insertRow(0);var a=((this.hdrLabels.length<=1)?g[0].length:this.hdrLabels.length);for(var l=0;l<a;l++){n.appendChild(document.createElement("TH"));n.childNodes[l]._cellIndex=l}if(_isIE&&_isIE<8){n.style.position="absolute"}else{n.style.height="auto"}}var m=g[1];var o=document.createElement("TR");s.rows[0].parentNode.appendChild(o);for(var l=0;l<g[0].length;l++){if(g[0][l]=="#cspan"){var q=o.cells[o.cells.length-1];q.colSpan=(q.colSpan||1)+1;continue}if((g[0][l]=="#rspan")&&(s.rows.length>1)){var A=s.rows.length-2;var y=false;var q=null;while(!y){var q=s.rows[A];for(var c=0;c<q.cells.length;c++){if(q.cells[c]._cellIndex==l){y=c+1;break}}A--}q=q.cells[y-1];q.rowSpan=(q.rowSpan||1)+1;continue}var r=document.createElement("TD");r._cellIndex=r._cellIndexS=l;if(this._hrrar&&this._hrrar[l]&&!_isIE){r.style.display="none"}if(typeof g[0][l]=="object"){r.appendChild(g[0][l])}else{if(this.forceDivInHeader){r.innerHTML="<div class='hdrcell'>"+(g[0][l]||"&nbsp;")+"</div>"}else{r.innerHTML=(g[0][l]||"&nbsp;")}if((g[0][l]||"").indexOf("#")!=-1){var x=g[0][l].match(/(^|{)#([^}]+)(}|$)/);if(x){var u="_in_header_"+x[2];if(this[u]){this[u]((this.forceDivInHeader?r.firstChild:r),l,g[0][l].split(x[0]))}}}}if(m){r.style.cssText=m[l]}o.appendChild(r)}var v=s;if(_isKHTML){if(s._kTimer){window.clearTimeout(s._kTimer)}s._kTimer=window.setTimeout(function(){s.rows[1].style.display="none";window.setTimeout(function(){s.rows[1].style.display=""},1)},500)}},attachFooter:function(a,c){this.attachHeader(a,c,"_aFoot")},setCellExcellType:function(g,a,c){this.changeCellType(this.getRowById(g),a,c)},changeCellType:function(g,j,c){c=c||this.cellType[j];var l=this.cells3(g,j);var a=l.getValue();l.cell._cellType=c;var l=this.cells3(g,j);l.setValue(a)},setRowExcellType:function(g,c){var j=this.rowsAr[g];for(var a=0;a<j.childNodes.length;a++){this.changeCellType(j,a,c)}},setColumnExcellType:function(a,g){for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]&&this.rowsBuffer[c].tagName=="TR"){this.changeCellType(this.rowsBuffer[c],a,g)}}if(this.cellType[a]=="math"){this._strangeParams[c]=g}else{this.cellType[a]=g}},forEachRow:function(g){for(var c in this.rowsAr){if(this.rowsAr[c]&&this.rowsAr[c].idd){g.apply(this,[this.rowsAr[c].idd])}}},forEachRowA:function(g){for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]){g.call(this,this.render_row(c).idd)}}},forEachCell:function(g,c){var j=this.getRowById(g);if(!j){return}for(var a=0;a<this._cCount;a++){c(this.cells3(j,a),a)}},enableAutoWidth:function(g,a,c){this._awdth=[dhx4.s2b(g),parseInt(a||99999),parseInt(c||0)];if(arguments.length==1){this.objBox.style.overflowX=g?"hidden":"auto"}},updateFromXML:function(a,j,c,g){if(typeof j=="undefined"){j=true}this._refresh_mode=[true,j,c];this.load(a,g)},_refreshFromXML:function(j){if(this._f_rowsBuffer){this.filterBy(0,"")}reset=false;if(window.eXcell_tree){eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue;eXcell_tree.prototype.setValue=function(v){var u=this.grid._h2.get[this.cell.parentNode.idd];if(u&&this.cell.parentNode.valTag){this.setLabel(v)}else{this.setValueX(v)}}}var s=this.cellType._dhx_find("tree");var m=dhx4.ajax.xmltop("rows",j);var l=m.getAttribute("parent")||0;var o={};if(this._refresh_mode[2]){if(s!=-1){this._h2.forEachChild(l,function(u){o[u.id]=true},this)}else{this.forEachRow(function(u){o[u]=true})}}var r=dhx4.ajax.xpath("//row",m);for(var g=0;g<r.length;g++){var q=r[g];var a=q.getAttribute("id");o[a]=false;var l=q.parentNode.getAttribute("id")||l;if(this.rowsAr[a]&&this.rowsAr[a].tagName!="TR"){if(this._h2){this._h2.get[a].buff.data=q}else{this.rowsBuffer[this.getRowIndex(a)].data=q}this.rowsAr[a]=q}else{if(this.rowsAr[a]){this._process_xml_row(this.rowsAr[a],q,-1);this._postRowProcessing(this.rowsAr[a],true);if(this._fake&&this._fake.rowsAr[a]){this._fake._process_xml_row(this._fake.rowsAr[a],q,-1)}}else{if(this._refresh_mode[1]){var n={idd:a,data:q,_parser:this._process_xml_row,_locator:this._get_xml_data};var c=this.rowsBuffer.length;if(this._refresh_mode[1]=="top"){this.rowsBuffer.unshift(n);c=0}else{this.rowsBuffer.push(n)}if(this._h2){reset=true;(this._h2.add(a,(q.parentNode.getAttribute("id")||q.parentNode.getAttribute("parent")))).buff=this.rowsBuffer[this.rowsBuffer.length-1]}else{if(this._srnd){reset=true}}this.rowsAr[a]=q;q=this.render_row(c);this._insertRowAt(q,c?-1:0)}}}}if(this._refresh_mode[2]){for(a in o){if(o[a]&&this.rowsAr[a]){this.deleteRow(a)}}}this._refresh_mode=null;if(window.eXcell_tree){eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX}if(reset){if(this._h2){this._renderSort()}else{this.render_dataset()}}if(this._f_rowsBuffer){this._f_rowsBuffer=null;this.filterByAll()}},getCustomCombo:function(g,c){var a=this.cells(g,c).cell;if(!a._combo){a._combo=new dhtmlXGridComboObject()}return a._combo},setTabOrder:function(c){var j=c.split(this.delim);this._tabOrder=[];var a=this._cCount||c.length;for(var g=0;g<a;g++){j[g]={c:parseInt(j[g]),ind:g}}j.sort(function(m,l){return(m.c>l.c?1:-1)});for(var g=0;g<a;g++){if(!j[g+1]||(typeof j[g].c=="undefined")){this._tabOrder[j[g].ind]=(j[0].ind+1)*-1}else{this._tabOrder[j[g].ind]=j[g+1].ind}}},i18n:{loading:"Loading",decimal_separator:".",group_separator:","},_key_events:{k13_1_0:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a+1],this.cell._cellIndex,true)},k13_0_1:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a-1],this.cell._cellIndex,true)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[(this.row?this.row.idd:null),(this.cell?this.cell._cellIndex:null)]);this._still_active=true},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",[true])){return true}var a=this._getNextCell(null,1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab",[false])){return false}var a=this._getNextCell(null,-1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}},k113_0_0:function(){if(this._f2kE){this.editCell()}},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||(a.changeState()===false)){return false}},k27_0_0:function(){this.editStop(true)},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k37_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.collapseKids(this.row)}else{return false}},k39_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.expandKids(this.row)}else{return false}},k40_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{if(!this.row.idd){return}var a=Math.max((c._r_select||0),this.getRowIndex(this.row.idd));var g=this._nextRow(a,1);if(g){c._r_select=null;this.selectCell(g,this.cell._cellIndex,true);if(c.pagingOn){c.showRow(g.idd)}}else{if(!this.callEvent("onLastRow",[])){return false}this._key_events.k34_0_0.apply(this,[]);if(this.pagingOn&&this.rowsCol[a+1]){this.selectCell(a+1,0,true)}}}this._still_active=true},k38_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{if(!this.row.idd){return}var a=this.getRowIndex(this.row.idd)+1;if(a!=-1&&(!this.pagingOn||(a!=1))){var g=this._nextRow(a-1,-1);this.selectCell(g,this.cell._cellIndex,true);if(c.pagingOn&&g){c.showRow(g.idd)}}else{this._key_events.k33_0_0.apply(this,[])}}this._still_active=true}},_build_master_row:function(){var g=document.createElement("DIV");var c=["<table><tr>"];for(var a=0;a<this._cCount;a++){c.push("<td></td>")}c.push("</tr></table>");g.innerHTML=c.join("");this._master_row=g.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var g=this._master_row.cloneNode(true);for(var c=0;c<g.childNodes.length;c++){g.childNodes[c]._cellIndex=c;if(this._enbCid){g.childNodes[c].id="c_"+a+"_"+c}if(this.dragAndDropOff){this.dragger.addDraggableItem(g.childNodes[c],this)}}g.idd=a;g.grid=this;return g},_process_jsarray_row:function(c,g){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,(this._c_order?this._swapColumns(g):g));return c},_get_jsarray_data:function(c,a){return c[a]},_process_json_row:function(a,c){c=this._c_order?this._swapColumns(c.data):c.data;return this._process_some_row(a,c)},_process_some_row:function(c,g){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,g);return c},_get_json_data:function(c,a){return c.data[a]},_process_js_row:function(g,j){var a=[];for(var c=0;c<this.columnIds.length;c++){a[c]=j[this.columnIds[c]];if(!a[c]&&a[c]!==0){a[c]=""}}this._process_some_row(g,a);g._attrs=j;return g},_get_js_data:function(c,a){return c[this.columnIds[a]]},_process_csv_row:function(c,g){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,(this._c_order?this._swapColumns(g.split(this.csv.cell)):g.split(this.csv.cell)));return c},_get_csv_data:function(c,a){return c.split(this.csv.cell)[a]},_process_store_row:function(m,l){var a=[];for(var g=0;g<this.columnIds.length;g++){a[g]=l[this.columnIds[g]]}for(var c=0;c<m.childNodes.length;c++){m.childNodes[c]._attrs={}}m._attrs=l;this._fillRow(m,a)},_process_xml_row:function(a,n){var v=dhx4.ajax.xpath(this.xml.cell,n);var s=[];a._attrs=this._xml_attrs(n);if(this._ud_enabled){var u=dhx4.ajax.xpath("./userdata",n);for(var m=u.length-1;m>=0;m--){var q="";for(var g=0;g<u[m].childNodes.length;g++){q+=u[m].childNodes[g].nodeValue}this.setUserData(a.idd,u[m].getAttribute("name"),q)}}for(var g=0;g<v.length;g++){var l=v[this._c_order?this._c_order[g]:g];if(!l){continue}var c=a._childIndexes?a._childIndexes[g]:g;var o=l.getAttribute("type");if(a.childNodes[c]){if(o){a.childNodes[c]._cellType=o}a.childNodes[c]._attrs=this._xml_attrs(l)}if(!l.getAttribute("xmlcontent")){if(l.firstChild){l=l.firstChild.data}else{l=""}}s.push(l)}for(g<v.length;g<a.childNodes.length;g++){a.childNodes[g]._attrs={}}if(a.parentNode&&a.parentNode.tagName=="row"){a._attrs.parent=a.parentNode.getAttribute("idd")}this._fillRow(a,s);return a},_get_xml_data:function(c,a){c=c.firstChild;while(true){if(!c){return""}if(c.tagName=="cell"){a--}if(a<0){break}c=c.nextSibling}return(c.firstChild?c.firstChild.data:"")},_fillRow:function(j,m){if(this.editor&&this.editor.parentNode&&this.editor.parentNode.idd==j.idd){this.editStop()}for(var c=0;c<j.childNodes.length;c++){if((c<m.length)||(this.defVal[c])){var g=j.childNodes[c]._cellIndex;var l=m[g];var a=this.cells4(j.childNodes[c]);if((this.defVal[g])&&((l=="")||(typeof(l)=="undefined"))){l=this.defVal[g]}if(a){a.setValue(l)}}else{j.childNodes[c].innerHTML="&nbsp;";j.childNodes[c]._clearCell=true}}return j},_postRowProcessing:function(m,o){if(m._attrs["class"]){m._css=m.className=m._attrs["class"]}if(m._attrs.locked){m._locked=true}if(m._attrs.bgColor){m.bgColor=m._attrs.bgColor}var n=0;for(var g=0;g<m.childNodes.length;g++){var q=m.childNodes[g];var l=q._cellIndex;var j=q._attrs.style||m._attrs.style;if(j){q.style.cssText+=";"+j}if(q._attrs["class"]){q.className=q._attrs["class"]}j=q._attrs.align||this.cellAlign[l];if(j){q.align=j}q.vAlign=q._attrs.valign||this.cellVAlign[l];var a=q._attrs.bgColor||this.columnColor[l];if(a){q.bgColor=a}if(q._attrs.colspan&&!o){this.setColspan(m.idd,g+n,q._attrs.colspan);n+=(q._attrs.colspan-1)}if(this._hrrar&&this._hrrar[l]&&!o){q.style.display="none"}}this.callEvent("onRowCreated",[m.idd,m,null])},load:function(a,g,c){this.callEvent("onXLS",[this]);if(arguments.length==2&&typeof g!="function"){c=g;g=null}c=c||"xml";if(!this.xmlFileUrl){this.xmlFileUrl=a}this._data_type=c;this.xmlLoader=this.doLoadDetails;var j=this;this.xmlLoader=function(l){if(!j.callEvent){return}j["_process_"+c](l.xmlDoc);if(!j._contextCallTimer){j.callEvent("onXLE",[j,0,0,l.xmlDoc])}if(g){g();g=null}};return dhx4.ajax.get(a,this.xmlLoader)},loadXMLString:function(c,a){this.parse({responseXML:dhx4.ajax.parse(c)},a,"xml")},loadXML:function(a,c){this.load(a,c,"xml")},parse:function(g,c,a){if(arguments.length==2&&typeof c!="function"){a=c;c=null}a=a||"xml";this._data_type=a;if(a=="xml"&&typeof g=="string"){g={responseXML:dhx4.ajax.parse(g)}}this["_process_"+a](g);if(!this._contextCallTimer){this.callEvent("onXLE",[this,0,0,g])}if(c){c()}},xml:{top:"rows",row:"./row",cell:"./cell",s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"\n",cell:","},_xml_attrs:function(c){var g={};if(c.attributes.length){for(var a=0;a<c.attributes.length;a++){g[c.attributes[a].name]=c.attributes[a].value}}return g},_process_xml:function(q){if(this._refresh_mode){return this._refreshFromXML(q)}this._parsing=true;var m=dhx4.ajax.xmltop(this.xml.top,q);if(m.tagName!=this.xml.top){return}var o=m.getAttribute("dhx_security");if(o){dhtmlx.security_key=o}this._parseHead(m);var r=dhx4.ajax.xpath(this.xml.row,m);var l=parseInt(m.getAttribute("pos")||0);var n=parseInt(m.getAttribute("total_count")||0);if(!this.pagingOn){var n=Math.min(n,32000000/this._srdh)}var j=false;if(n&&n!=this.rowsBuffer.length){if(!this.rowsBuffer[n-1]){if(this.rowsBuffer.length){j=true}this.rowsBuffer[n-1]=null}if(n<this.rowsBuffer.length){this.rowsBuffer.splice(n,this.rowsBuffer.length-n);j=true}}if(this.isTreeGrid()){return this._process_tree_xml(m)}for(var c=0;c<r.length;c++){if(this.rowsBuffer[c+l]){continue}var a=r[c].getAttribute("id")||(c+l+1);this.rowsBuffer[c+l]={idd:a,data:r[c],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[a]=r[c]}this.callEvent("onDataReady",[]);if(j&&this._srnd){var g=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=g}else{this.render_dataset()}this._parsing=false},_process_jsarray:function(data){this._parsing=true;data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}for(var i=0;i<data.length;i++){var id=i+1;this.rowsBuffer.push({idd:id,data:data[i],_parser:this._process_jsarray_row,_locator:this._get_jsarray_data});this.rowsAr[id]=data[i]}this.render_dataset();this._parsing=false},_process_csv:function(j){this._parsing=true;j=j.responseText||j;j=j.replace(/\r/g,"");j=j.split(this.csv.row);if(this._csvHdr){this.clearAll();var g=j.splice(0,1)[0].split(this.csv.cell);if(!this._csvAID){g.splice(0,1)}this.setHeader(g.join(this.delim));this.init()}for(var c=0;c<j.length;c++){if(!j[c]&&c==j.length-1){continue}if(this._csvAID){var l=c+1;this.rowsBuffer.push({idd:l,data:j[c],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var a=j[c].split(this.csv.cell);var l=a.splice(0,1)[0];this.rowsBuffer.push({idd:l,data:a,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[l]=j[c]}this.render_dataset();this._parsing=false},_process_js:function(a){return this._process_json(a,"js")},_process_json:function(data,mode){this._parsing=true;var data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}if(mode=="js"){if(data.data){data=data.data}for(var i=0;i<data.length;i++){var row=data[i];var id=row.id||(i+1);this.rowsBuffer.push({idd:id,data:row,_parser:this._process_js_row,_locator:this._get_js_data});this.rowsAr[id]=data[i]}}else{for(var i=0;i<data.rows.length;i++){var id=data.rows[i].id;this.rowsBuffer.push({idd:id,data:data.rows[i],_parser:this._process_json_row,_locator:this._get_json_data});this.rowsAr[id]=data.rows[i]}}if(data.dhx_security){dhtmlx.security_key=data.dhx_security}this.callEvent("onDataReady",[]);this.render_dataset();this._parsing=false},render_dataset:function(j,a){if(this._srnd){if(this._fillers){return this._update_srnd_view()}a=Math.min((this._get_view_size()+(this._srnd_pr||0)),this.rowsBuffer.length)}if(this.pagingOn){j=Math.max((j||0),(this.currentPage-1)*this.rowsBufferOutSize);a=Math.min(this.currentPage*this.rowsBufferOutSize,this.rowsBuffer.length)}else{j=j||0;a=a||this.rowsBuffer.length}for(var g=j;g<a;g++){var m=this.render_row(g);if(m==-1){if(this.xmlFileUrl){if(this.callEvent("onDynXLS",[g,(this._dpref?this._dpref:(a-g))])){this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+g+"&count="+(this._dpref?this._dpref:(a-g)),this._data_type)}}a=g;break}if(!m.parentNode||!m.parentNode.tagName){this._insertRowAt(m,g);if(m._attrs.selected||m._attrs.select){this.selectRow(m,m._attrs.call?true:false,true);m._attrs.selected=m._attrs.select=null}}if(this._ads_count&&g-j==this._ads_count){var l=this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){l._contextCallTimer=null;l.render_dataset(g,a);if(!l._contextCallTimer){if(l._context_parsing){l.callEvent("onXLE",[])}else{l._fixAlterCss()}l.callEvent("onDistributedEnd",[]);l._context_parsing=false}},this._ads_time)}}if(this._ads_count&&g==a){this.callEvent("onDistributedEnd",[])}if(this._srnd&&!this._fillers){var c=this.rowsBuffer.length-a;this._fillers=[];if(this._fake&&!this._realfake){this._fake._fillers=[]}while(c>0){var o=(_isIE||window._FFrv)?Math.min(c,50000):c;var n=this._add_filler(a,o);if(n){this._fillers.push(n)}c-=o;a+=o}}this.setSizes()},render_row:function(c){if(!this.rowsBuffer[c]){return -1}if(this.rowsBuffer[c]._parser){var a=this.rowsBuffer[c];if(this.rowsAr[a.idd]&&this.rowsAr[a.idd].tagName=="TR"){return this.rowsBuffer[c]=this.rowsAr[a.idd]}var g=this._prepareRow(a.idd);this.rowsBuffer[c]=g;this.rowsAr[a.idd]=g;a._parser.call(this,g,a.data);this._postRowProcessing(g);return g}return this.rowsBuffer[c]},_get_cell_value:function(c,a,g){if(c._locator){if(this._c_order){a=this._c_order[a]}return c._locator.call(this,c.data,a)}return this.cells3(c,a)[g?g:"getValue"]()},sortRows:function(g,m,c){this.editStop();c=(c||"asc").toLowerCase();m=(m||this.fldSort[g]);g=g||0;if(this.isTreeGrid()){this.sortTreeRows(g,m,c)}else{var a={};var l=this.cellType[g];var n="getValue";if(l=="link"){n="getContent"}if(l=="dhxCalendar"||l=="dhxCalendarA"){n="getDate"}for(var j=0;j<this.rowsBuffer.length;j++){a[this.rowsBuffer[j].idd]=this._get_cell_value(this.rowsBuffer[j],g,n)}this._sortRows(g,m,c,a)}this.callEvent("onAfterSorting",[g,m,c])},_sortCore:function(g,m,c,a,l){var j="sort";if(this._sst){l.stablesort=this.rowsCol.stablesort;j="stablesort"}if(m.length>4){m=window[m]}if(m=="cus"){var n=this._customSorts[g];l[j](function(q,o){return n(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(typeof(m)=="function"){l[j](function(q,o){return m(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(m=="str"){l[j](function(q,o){if(c=="asc"){return a[q.idd]>a[o.idd]?1:(a[q.idd]<a[o.idd]?-1:0)}else{return a[q.idd]<a[o.idd]?1:(a[q.idd]>a[o.idd]?-1:0)}})}else{if(m=="int"){l[j](function(r,q){var o=parseFloat(a[r.idd]);o=isNaN(o)?-99999999999999:o;var s=parseFloat(a[q.idd]);s=isNaN(s)?-99999999999999:s;if(c=="asc"){return o-s}else{return s-o}})}else{if(m=="date"){l[j](function(r,q){var o=Date.parse(a[r.idd])||(Date.parse("01/01/1900"));var s=Date.parse(a[q.idd])||(Date.parse("01/01/1900"));if(c=="asc"){return o-s}else{return s-o}})}}}}}},_sortRows:function(g,j,c,a){this._sortCore(g,j,c,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(g){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var j=a.removeChild(a.childNodes[0],true);if(_isKHTML){for(var c=a.parentNode.childNodes.length-1;c>=0;c--){if(a.parentNode.childNodes[c].tagName=="TR"){a.parentNode.removeChild(a.parentNode.childNodes[c],true)}}}else{if(_isIE){for(var c=a.childNodes.length-1;c>=0;c--){a.childNodes[c].removeNode(true)}}else{a.innerHTML=""}}a.appendChild(j);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!g){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(c,j){if(!j){j=this.getRowById(c)}if(!j){return}this.editStop();if(!this._realfake){if(this.callEvent("onBeforeRowDeleted",[c])==false){return false}}var a=0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake){a=this._h2.get[c].parent.id;this._removeTrGrRow(j)}else{if(j.parentNode){j.parentNode.removeChild(j)}var m=this.rowsCol._dhx_find(j);if(m!=-1){this.rowsCol._dhx_removeAt(m)}for(var g=0;g<this.rowsBuffer.length;g++){if(this.rowsBuffer[g]&&this.rowsBuffer[g].idd==c){this.rowsBuffer._dhx_removeAt(g);m=g;break}}}this.rowsAr[c]=null;for(var g=0;g<this.selectedRows.length;g++){if(this.selectedRows[g].idd==c){this.selectedRows._dhx_removeAt(g)}}if(this._srnd){for(var g=0;g<this._fillers.length;g++){var l=this._fillers[g];if(!l){continue}if(l[0]>=m){this._update_fillers(g,0,-1)}else{if(l[0]+l[1]>m){this._update_fillers(g,-1,0)}}}this._update_srnd_view()}if(this.pagingOn){this.changePage()}if(!this._realfake){this.callEvent("onAfterRowDeleted",[c,a])}this.callEvent("onGridReconstructed",[]);if(this._ahgr){this.setSizes()}return true},_addRow:function(n,o,c){if(c==-1||typeof c=="undefined"){c=this.rowsBuffer.length}if(typeof o=="string"){o=o.split(this.delim)}var q=this._prepareRow(n);q._attrs={};for(var g=0;g<q.childNodes.length;g++){q.childNodes[g]._attrs={}}this.rowsAr[q.idd]=q;if(this._h2){this._h2.get[q.idd].buff=q}this._fillRow(q,o);this._postRowProcessing(q);if(this._skipInsert){this._skipInsert=false;return this.rowsAr[q.idd]=q}if(this.pagingOn){this.rowsBuffer._dhx_insertAt(c,q);this.rowsAr[q.idd]=q;return q}if(this._fillers){this.rowsCol._dhx_insertAt(c,null);this.rowsBuffer._dhx_insertAt(c,q);if(this._fake){this._fake.rowsCol._dhx_insertAt(c,null)}this.rowsAr[q.idd]=q;var r=false;for(var l=0;l<this._fillers.length;l++){var m=this._fillers[l];if(m&&m[0]<=c&&(m[0]+m[1])>=c){m[1]=m[1]+1;var a=m[2].firstChild.style.height=parseInt(m[2].firstChild.style.height)+this._srdh+"px";r=true;if(this._fake){this._fake._fillers[l][1]++;this._fake._fillers[l][2].firstChild.style.height=a}}if(m&&m[0]>c){m[0]=m[0]+1;if(this._fake){this._fake._fillers[l][0]++}}}if(!r){this._fillers.push(this._add_filler(c,1,(c==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:(this.rowsCol[1])}:this.rowsCol[c-1])))}return q}this.rowsBuffer._dhx_insertAt(c,q);return this._insertRowAt(q,c)},addRow:function(a,j,g){var c=this._addRow(a,j,g);if(!this.dragContext){this.callEvent("onRowAdded",[a])}if(this.pagingOn){this.changePage(this.currentPage)}if(this._srnd){this._update_srnd_view()}c._added=true;if(this._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return c},_insertRowAt:function(g,j,c){this.rowsAr[g.idd]=g;if(this._skipInsert){this._skipInsert=false;return g}if((j<0)||((!j)&&(parseInt(j)!==0))){j=this.rowsCol.length}else{if(j>this.rowsCol.length){j=this.rowsCol.length}}if(this._cssEven){var a=g.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(g.idd):j)%2==1){g.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(g.idd)):"")}else{g.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(g.idd)):"")}}if(!c){if((j==(this.obj.rows.length-1))||(!this.rowsCol[j])){if(_isKHTML){this.obj.appendChild(g)}else{this.obj.firstChild.appendChild(g)}}else{this.rowsCol[j].parentNode.insertBefore(g,this.rowsCol[j])}}this.rowsCol._dhx_insertAt(j,g);this.callEvent("onRowInserted",[g,j]);return g},getRowById:function(g){var c=this.rowsAr[g];if(c){if(c.tagName!="TR"){for(var a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].idd==g){return this.render_row(a)}}if(this._h2){return this.render_row(null,c.idd)}}return c}return null},cellById:function(c,a){return this.cells(c,a)},cells:function(j,g){if(arguments.length==0){return this.cells4(this.cell)}else{var l=this.getRowById(j)}var a=(l._childIndexes?l.childNodes[l._childIndexes[g]]:l.childNodes[g]);if(!a&&l._childIndexes){a=l.firstChild||{}}return this.cells4(a)},cellByIndex:function(c,a){return this.cells2(c,a)},cells2:function(j,g){var l=this.render_row(j);var a=(l._childIndexes?l.childNodes[l._childIndexes[g]]:l.childNodes[g]);if(!a&&l._childIndexes){a=l.firstChild||{}}return this.cells4(a)},cells3:function(g,c){var a=(g._childIndexes?g.childNodes[g._childIndexes[c]]:g.childNodes[c]);return this.cells4(a)},cells4:function(a){var c=window["eXcell_"+(a._cellType||this.cellType[a._cellIndex])];if(c){return new c(a)}},cells5:function(a,g){var g=g||(a._cellType||this.cellType[a._cellIndex]);if(!this._ecache[g]){if(!window["eXcell_"+g]){var c=eXcell_ro}else{var c=window["eXcell_"+g]}this._ecache[g]=new c(a)}this._ecache[g].cell=a;return this._ecache[g]},dma:function(a){if(!this._ecache){this._ecache={}}if(a&&!this._dma){this._dma=this.cells4;this.cells4=this.cells5}else{if(!a&&this._dma){this.cells4=this._dma;this._dma=null}}},getRowsNum:function(){return this.rowsBuffer.length},enableEditTabOnly:function(a){if(arguments.length>0){this.smartTabOrder=dhx4.s2b(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(l,a){var c=this;this.tabStart=(typeof(l)=="object")?l:document.getElementById(l);var g=this.tabStart.onkeydown;this.tabStart.onkeydown=function(n){if(g){g.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&!m.shiftKey){m.cancelBubble=true;c.selectCell(0,0,0,0,1);if(c.smartTabOrder&&c.cells2(0,0).isDisabled()){c._key_events.k9_0_0.call(c)}this.blur();return false}};if(_isOpera){this.tabStart.onkeypress=this.tabStart.onkeydown}this.tabEnd=(typeof(a)=="object")?a:document.getElementById(a);var j=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(n){if(j){j.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&m.shiftKey){m.cancelBubble=true;c.selectCell((c.getRowsNum()-1),(c.getColumnCount()-1),0,0,1);if(c.smartTabOrder&&c.cells2((c.getRowsNum()-1),(c.getColumnCount()-1)).isDisabled()){c._key_events.k9_0_1.call(c)}this.blur();return false}};if(_isOpera){this.tabEnd.onkeypress=this.tabEnd.onkeydown}},uid:function(){if(!this._ui_seed){this._ui_seed=(new Date()).valueOf()}return this._ui_seed++},clearAndLoad:function(){var a=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=a;this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){var a=(this.currentPage-1)*this.rowsBufferOutSize;return[this.currentPage,a,Math.min(a+this.rowsBufferOutSize,this.rowsBuffer.length),this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.rowsBuffer.length]}};(function(){function j(n,o){this[n]=o}function m(n,o){this[n].call(this,o)}function g(n,o){this[n].call(this,o.join(this.delim))}function a(n,r){for(var q=0;q<r.length;q++){if(typeof r[q]=="object"){var s=this.getCombo(q);for(var o in r[q]){s.put(o,r[q][o])}}}}function l(n,w,r){var y=1;var v=[];function x(C,A,D){if(!v[A]){v[A]=[]}if(typeof D=="object"){D.toString=function(){return this.text}}v[A][C]=D}for(var s=0;s<w.length;s++){if(typeof(w[s])=="object"&&w[s].length){for(var q=0;q<w[s].length;q++){x(s,q,w[s][q])}}else{x(s,0,w[s])}}for(var s=0;s<v.length;s++){for(var q=0;q<v[0].length;q++){var u=v[s][q];v[s][q]=(u||"").toString()||"&nbsp;";if(u&&u.colspan){for(var o=1;o<u.colspan;o++){x(q+o,s,"#cspan")}}if(u&&u.rowspan){for(var o=1;o<u.rowspan;o++){x(q,s+o,"#rspan")}}}}this.setHeader(v[0]);for(var s=1;s<v.length;s++){this.attachHeader(v[s])}}var c=[{name:"label",def:"&nbsp;",operation:"setHeader",type:l},{name:"id",def:"",operation:"columnIds",type:j},{name:"width",def:"*",operation:"setInitWidths",type:g},{name:"align",def:"left",operation:"cellAlign",type:j},{name:"valign",def:"middle",operation:"cellVAlign",type:j},{name:"sort",def:"na",operation:"fldSort",type:j},{name:"type",def:"ro",operation:"setColTypes",type:g},{name:"options",def:"",operation:"",type:a}];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(n){return[n.parent]},image_path:"setImagePath",columns:"columns",rows:"rows",headers:"headers",skin:"setSkin",smart_rendering:"enableSmartRendering",css:"enableAlterCss",auto_height:"enableAutoHeight",save_hidden:"enableAutoHiddenColumnsSaving",save_cookie:"enableAutoSaving",save_size:"enableAutoSizeSaving",auto_width:"enableAutoWidth",block_selection:"enableBlockSelection",csv_id:"enableCSVAutoID",csv_header:"enableCSVHeader",cell_ids:"enableCellIds",colspan:"enableColSpan",column_move:"enableColumnMove",context_menu:"enableContextMenu",distributed:"enableDistributedParsing",drag:"enableDragAndDrop",drag_order:"enableDragOrder",tabulation:"enableEditTabOnly",header_images:"enableHeaderImages",header_menu:"enableHeaderMenu",keymap:"enableKeyboardSupport",mouse_navigation:"enableLightMouseNavigation",markers:"enableMarkedCells",math_editing:"enableMathEditing",math_serialization:"enableMathSerialization",drag_copy:"enableMercyDrag",multiline:"enableMultiline",multiselect:"enableMultiselect",save_column_order:"enableOrderSaving",hover:"enableRowsHover",rowspan:"enableRowspan",smart:"enableSmartRendering",save_sorting:"enableSortingSaving",stable_sorting:"enableStableSorting",undo:"enableUndoRedo",csv_cell:"setCSVDelimiter",date_format:"setDateFormat",drag_behavior:"setDragBehavior",editable:"setEditable",without_header:"setNoHeader",submit_changed:"submitOnlyChanged",submit_serialization:"submitSerialization",submit_selected:"submitOnlySelected",submit_id:"submitOnlyRowID",xml:"load"},{columns:function(s){for(var n=0;n<c.length;n++){var r=[];for(var o=0;o<s.length;o++){r[o]=s[o][c[n].name]||c[n].def}var q=c[n].type||m;q.call(this,c[n].operation,r,s)}this.init()},rows:function(n){},headers:function(o){for(var n=0;n<o.length;n++){this.attachHeader(o[n])}}})})();dhtmlXGridObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(c,j){if(this.obj._h2){this.obj.addRow(j,g,null,parent)}else{this.obj.addRow(j,[],0)}var g=this.obj.getRowById(j);if(g){this.obj._process_xml_row(g,c.firstChild);this.obj._postRowProcessing(g)}});a.attachEvent("updateCallback",function(c,j){var g=this.obj.getRowById(j);if(g){this.obj._process_xml_row(g,c.firstChild);this.obj._postRowProcessing(g)}});a.attachEvent("deleteCallback",function(c,g){this.obj.setUserData(g,this.action_param,"true_deleted");this.obj.deleteRow(g)});a._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(j,l,g){if(a._columns&&!a._columns[g]){return true}var c=this.cells(l,g);if(j==1){if(c.isCheckbox()){a.setUpdated(l,true)}}else{if(j==2){if(c.wasChanged()){a.setUpdated(l,true)}}}return true});this.attachEvent("onRowPaste",function(c){a.setUpdated(c,true)});this.attachEvent("onUndo",function(c){a.setUpdated(c,true)});this.attachEvent("onRowIdChange",function(j,c){var g=a.findRow(j);if(g<a.updatedRows.length){a.updatedRows[g]=c}});this.attachEvent("onSelectStateChanged",function(c){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onEnter",function(g,c){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onBeforeRowDeleted",function(c){if(!this.rowsAr[c]){return true}if(this.dragContext&&a.dnd){window.setTimeout(function(){a.setUpdated(c,true)},1);return true}var g=a.getState(c);if(this._h2){this._h2.forEachChild(c,function(j){a.setUpdated(j.id,false);a.markRow(j.id,true,"deleted")},this)}if(g=="inserted"){a.set_invalid(c,false);a.setUpdated(c,false);return true}if(g=="deleted"){return false}if(g=="true_deleted"){a.setUpdated(c,false);return true}a.setUpdated(c,true,"deleted");return false});this.attachEvent("onBindUpdate",function(c){if(typeof c=="object"){c=c.id}a.setUpdated(c,true)});this.attachEvent("onRowAdded",function(c){if(this.dragContext&&a.dnd){return true}a.setUpdated(c,true,"inserted");return true});a._getRowData=function(l,v){var o=[];o.gr_id=l;if(this.obj.isTreeGrid()){o.gr_pid=this.obj.getParentId(l)}var g=this.obj.getRowById(l);for(var q=0;q<this.obj._cCount;q++){if(this.obj._c_order){var s=this.obj._c_order[q]}else{var s=q}var u=this.obj.cells(g.idd,q);if(this._changed&&!u.wasChanged()){continue}if(this._endnm){o[this.obj.getColumnId(q)]=u.getValue()}else{o["c"+s]=u.getValue()}}var m=this.obj.UserData[l];if(m){for(var n=0;n<m.keys.length;n++){if(m.keys[n]&&m.keys[n].indexOf("__")!=0){o[m.keys[n]]=m.values[n]}}}var m=this.obj.UserData.gridglobaluserdata;if(m){for(var n=0;n<m.keys.length;n++){o[m.keys[n]]=m.values[n]}}return o};a._clearUpdateFlag=function(g){var l=this.obj.getRowById(g);if(l){for(var c=0;c<this.obj._cCount;c++){this.obj.cells(g,c).cell.wasChanged=false}}};a.checkBeforeUpdate=function(m){var l=true;var c=[];for(var j=0;j<this.obj._cCount;j++){if(this.mandatoryFields[j]){var g=this.mandatoryFields[j].call(this.obj,this.obj.cells(m,j).getValue(),m,j);if(typeof g=="string"){this.messages.push(g);l=false}else{l&=g;c[j]=!g}}}if(!l){this.set_invalid(m,"invalid",c);this.setUpdated(m,false)}return l}};dhx4.attachEvent("onGridCreated",function(c){c._con_f_used=[].concat(c._con_f_used);dhtmlXGridObject.prototype._con_f_used=[];var a=function(m){m=m.replace(/(\?|\&)connector[^\f]*/g,"");return m+(m.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")};var l=function(m){return a.call(this,m)+(this._connector_sorting||"")+(this._connector_filter||"")};var j=function(n,o,m){this._connector_sorting="&dhx_sort["+o+"]="+m;return l.call(this,n)};var g=function(n,m,q){var r=[];for(var o=0;o<m.length;o++){r[o]="dhx_filter["+m[o]+"]="+encodeURIComponent(q[o])}this._connector_filter="&"+r.join("&");return l.call(this,n)};c.attachEvent("onCollectValues",function(m){if(this._con_f_used[m]){if(typeof(this._con_f_used[m])=="object"){return this._con_f_used[m]}else{return false}}return true});c.attachEvent("onDynXLS",function(){this.xmlFileUrl=l.call(this,this.xmlFileUrl);return true});c.attachEvent("onBeforeSorting",function(q,o,n){if(o=="connector"){var m=this;this.clearAndLoad(j.call(this,this.xmlFileUrl,q,n),function(){m.setSortImgState(true,q,n)});return false}return true});c.attachEvent("onFilterStart",function(n,m){var q=this.getSortingState();if(this._con_f_used.length){var o=this;this.clearAndLoad(g.call(this,this.xmlFileUrl,n,m));if(q.length){o.setSortImgState(true,q[0],q[1])}return false}return true})});dhtmlXGridObject.prototype._con_f_used=[];dhtmlXGridObject.prototype._in_header_connector_text_filter=function(c,a){if(!this._con_f_used[a]){this._con_f_used[a]=1}return this._in_header_text_filter(c,a)};dhtmlXGridObject.prototype._in_header_connector_select_filter=function(c,a){if(!this._con_f_used[a]){this._con_f_used[a]=2}return this._in_header_select_filter(c,a)};dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;dhtmlXGridObject.prototype.load=function(c,l,j){if(!this._colls_loaded&&this.cellType){var a=[];for(var g=0;g<this.cellType.length;g++){if(this.cellType[g].indexOf("co")==0||this.cellType[g].indexOf("clist")==0||this._con_f_used[g]==2){a.push(g)}}if(a.length){arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+a.join(",")}}return this.load_connector.apply(this,arguments)};dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;dhtmlXGridObject.prototype._parseHead=function(c,x,s){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){var u=dhx4.ajax.xpath("./coll_options",arguments[0]);for(var o=0;o<u.length;o++){var r=u[o].getAttribute("for");var w=[];var l=null;if(this.cellType[r]=="combo"){l=this.getColumnCombo(r)}else{if(this.cellType[r].indexOf("co")==0){l=this.getCombo(r)}}var n=dhx4.ajax.xpath("./item",u[o]);var a=[];for(var m=0;m<n.length;m++){var g=n[m].getAttribute("value");if(l){var q=n[m].getAttribute("label")||g;if(l.addOption){a.push([g,q])}else{l.put(g,q)}w[w.length]=q}else{w[w.length]=g}}if(a.length){if(l){l.addOption(a)}}else{if(w.length&&!l){if(this.registerCList){this.registerCList(r*1,w)}}}if(this._con_f_used[r*1]){this._con_f_used[r*1]=w}}this._colls_loaded=true}};function dhtmlXGridCellObject(a){this.destructor=function(){this.cell.obj=null;this.cell=null;this.grid=null;this.base=null;return null};this.cell=a;this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}else{return this.cell.innerHTML._dhx_trim()}};this.getMathValue=function(){if(this.cell.original){return this.cell.original}else{return this.getValue()}};this.getFont=function(){arOut=new Array(3);if(this.cell.style.fontFamily){arOut[0]=this.cell.style.fontFamily}if(this.cell.style.fontWeight=="bold"||this.cell.parentNode.style.fontWeight=="bold"){arOut[1]="bold"}if(this.cell.style.fontStyle=="italic"||this.cell.parentNode.style.fontWeight=="italic"){arOut[1]+="italic"}if(this.cell.style.fontSize){arOut[2]=this.cell.style.fontSize}else{arOut[2]=""}return arOut.join("-")};this.getTextColor=function(){if(this.cell.style.color){return this.cell.style.color}else{return"#000000"}};this.getBgColor=function(){if(this.cell.bgColor){return this.cell.bgColor}else{return"#FFFFFF"}};this.getHorAlign=function(){if(this.cell.style.textAlign){return this.cell.style.textAlign}else{if(this.cell.style.textAlign){return this.cell.style.textAlign}else{return"left"}}};this.getWidth=function(){return this.cell.scrollWidth};this.setFont=function(c){fntAr=c.split("-");this.cell.style.fontFamily=fntAr[0];this.cell.style.fontSize=fntAr[fntAr.length-1];if(fntAr.length==3){if(/bold/.test(fntAr[1])){this.cell.style.fontWeight="bold"}if(/italic/.test(fntAr[1])){this.cell.style.fontStyle="italic"}if(/underline/.test(fntAr[1])){this.cell.style.textDecoration="underline"}}};this.setTextColor=function(c){this.cell.style.color=c};this.setBgColor=function(c){if(c==""){c=null}this.cell.style.background=c};this.setHorAlign=function(c){if(c.length==1){if(c=="c"){this.cell.style.textAlign="center"}else{if(c=="l"){this.cell.style.textAlign="left"}else{this.cell.style.textAlign="right"}}}else{this.cell.style.textAlign=c}};this.wasChanged=function(){if(this.cell.wasChanged){return true}else{return false}};this.isCheckbox=function(){var c=this.cell.firstChild;if(c&&c.tagName=="INPUT"){type=c.type;if(type=="radio"||type=="checkbox"){return true}else{return false}}else{return false}};this.isChecked=function(){if(this.isCheckbox()){return this.cell.firstChild.checked}};this.isDisabled=function(){return this.cell._disabled};this.setChecked=function(c){if(this.isCheckbox()){if(c!="true"&&c!=1){c=false}this.cell.firstChild.checked=c}};this.setDisabled=function(c){if(c!="true"&&c!=1){c=false}if(this.isCheckbox()){this.cell.firstChild.disabled=c;if(this.disabledF){this.disabledF(c)}}this.cell._disabled=c}}dhtmlXGridCellObject.prototype={getAttribute:function(a){return this.cell._attrs[a]},setAttribute:function(a,c){this.cell._attrs[a]=c},getInput:function(){if(this.obj&&(this.obj.tagName=="INPUT"||this.obj.tagName=="TEXTAREA")){return this.obj}var a=(this.obj||this.cell).getElementsByTagName("TEXTAREA");if(!a.length){a=(this.obj||this.cell).getElementsByTagName("INPUT")}return a[0]}};dhtmlXGridCellObject.prototype.setValue=function(a){if((typeof(a)!="number")&&(!a||a.toString()._dhx_trim()=="")){a="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCValue(a)};dhtmlXGridCellObject.prototype.getTitle=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};dhtmlXGridCellObject.prototype.setCValue=function(c,a){this.cell.innerHTML=c;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,(arguments.length>1?a:c)])};dhtmlXGridCellObject.prototype.setCTxtValue=function(a){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(a));this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,a])};dhtmlXGridCellObject.prototype.setLabel=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.getMath=function(){if(this._val){return this.val}else{return this.getValue()}};function eXcell(){this.obj=null;this.val=null;this.changeState=function(){return false};this.edit=function(){this.val=this.getValue()};this.detach=function(){return false};this.getPosition=function(j){var a=j;var g=0;var c=0;while(a.tagName!="BODY"){g+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return new Array(g,c)}}eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=(!this.grid.multiLine)?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(c){(c||event).cancelBubble=true};this.obj.onmousedown=function(c){(c||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(c){if(!c){c=event}c.cancelBubble=true;return true};if(_isIE){this.obj.focus();this.obj.blur()}this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell._orig_value||this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){var c=this.obj.value;this.setValue(c);return this.val!=this.getValue()}}eXcell_edn.prototype=new eXcell_ed;eXcell_edn.prototype.setValue=function(a){if(!a||a.toString()._dhx_trim()==""){this.cell._clearCell=true;return this.setCValue("&nbsp;",0)}else{this.cell._clearCell=false;this.cell._orig_value=a}this.setCValue(this.grid._aplNF(a,this.cell._cellIndex),a)};function eXcell_ch(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")}};this.changeState=function(c){if(c===true&&!this.grid.isActive){if(window.globalActiveDHTMLGridObject!=null&&window.globalActiveDHTMLGridObject!=this.grid&&window.globalActiveDHTMLGridObject.isActive){window.globalActiveDHTMLGridObject.setActive(false)}this.grid.setActive(true)}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(c){this.setValue(c.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+c+".gif' onclick='new eXcell_ch(this.parentNode).changeState(true); (arguments[0]||event).cancelBubble=true; '>",this.cell.chstate)};function eXcell_ra(a){this.base=eXcell_ch;this.base(a);this.grid=a.parentNode.grid;this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")}};this.changeState=function(c){if(c===false&&this.getValue()==1){return}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.edit=null}eXcell_ra.prototype=new eXcell_ch;eXcell_ra.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){if(!this.grid._RaSeCol){this.grid._RaSeCol=[]}if(this.grid._RaSeCol[this.cell._cellIndex]){var a=this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);a.setValue("0");if(this.grid.rowsAr[a.cell.parentNode.idd]){this.grid.callEvent("onEditCell",[1,a.cell.parentNode.idd,a.cell._cellIndex])}}this.grid._RaSeCol[this.cell._cellIndex]=this.cell;c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+c+".gif' onclick='new eXcell_ra(this.parentNode).changeState(false);'>",this.cell.chstate)};function eXcell_txt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(j){(j||event).cancelBubble=true};var c=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;document.body.appendChild(this.obj);if(_isOpera){this.obj.onkeypress=function(j){if(j.keyCode==9){return false}}}this.obj.onkeydown=function(l){var j=(l||event);if(j.keyCode==9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:j.keyCode,shiftKey:j.shiftKey,srcElement:"0"});return false}};this.obj.style.left=c[0]+"px";this.obj.style.top=c[1]+this.cell.offsetHeight+"px";if(this.cell.offsetWidth<200){var g=200}else{var g=this.cell.offsetWidth}this.obj.style.width=g+16+"px";if(_isIE){this.obj.select();this.obj.value=this.obj.value}this.obj.focus()};this.detach=function(){var c="";c=this.obj.value;if(c==""){this.cell._clearCell=true}else{this.cell._clearCell=false}this.setValue(c);document.body.removeChild(this.obj);this.obj=null;return this.val!=this.getValue()};this.getValue=function(){if(this.obj){return this.obj.value}if(this.cell._clearCell){return""}if(typeof this.cell._brval!="undefined"){return this.cell._brval}if((!this.grid.multiLine)){return this.cell._brval||this.cell.innerHTML}else{return this.cell._brval||this.cell.innerHTML.replace(/<br[^>]*>/gi,"\n")._dhx_trim()}}}eXcell_txt.prototype=new eXcell;function eXcell_txttxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}if((!this.grid.multiLine)&&this.cell._brval){return this.cell._brval}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){this.cell._brval=c;if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(a){this.cell._brval=a;if(!a||a.toString()._dhx_trim()==""){a="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}if((!this.grid.multiLine)||this.cell._clearCell){this.setCValue(a,this.cell._brval)}else{this.setCValue(a.replace(/\n/g,"<br/>"),a)}};function eXcell_co(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));this.editable=true}this.shiftNext=function(){var c=this.list.options[this.list.selectedIndex+1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text;return true};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var c=this.list.options[this.list.selectedIndex-1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text}return true};this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var j=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(q){(q||event).cancelBubble=true};this.obj.onmousedown=function(q){(q||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(q){if(!q){q=event}q.cancelBubble=true;return true};var m=this;this.obj.onkeyup=function(s){var r=(s||event).keyCode;if(r==38||r==40||r==9){return}var u=this.readonly?String.fromCharCode(r):this.value;var v=m.list.options;for(var q=0;q<v.length;q++){if(v[q].text.indexOf(u)==0){return v[q].selected=true}}};this.list=document.createElement("SELECT");this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=j[0]+"px";this.list.style.top=j[1]+this.cell.offsetHeight+"px";this.list.onclick=function(s){var r=s||window.event;var q=r.target||r.srcElement;if(q.tagName=="OPTION"){q=q.parentNode}m.editable=false;m.grid.editStop();r.cancelBubble=true};var c=this.combo.getKeys();var l=false;var o=0;for(var g=0;g<c.length;g++){var n=this.combo.get(c[g]);this.list.options[this.list.options.length]=new Option(n,c[g]);if(c[g]==this.val){o=this.list.options.length-1;l=true}}if(l==false){this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val);o=this.list.options.length-1}document.body.appendChild(this.list);this.list.size="6";this.cstate=1;if(this.editable){this.cell.innerHTML=""}else{this.obj.style.width="1px";this.obj.style.height="1px"}this.cell.appendChild(this.obj);this.list.options[o].selected=true;if(this.editable){this.obj.focus();this.obj.focus()}if(!this.editable){this.obj.style.visibility="hidden";this.list.focus();this.list.onkeydown=function(q){q=q||window.event;m.grid.setActive(true);if(q.keyCode<30){return m.grid.doKey({target:m.cell,keyCode:q.keyCode,shiftKey:q.shiftKey,ctrlKey:q.ctrlKey})}}}};this.getValue=function(){return((this.cell.combo_value==window.undefined)?"":this.cell.combo_value)};this.detach=function(){if(this.val!=this.getValue()){this.cell.wasChanged=true}if(this.list.parentNode!=null){if(this.editable){var c=this.list.options[this.list.selectedIndex];if(c&&c.text==this.obj.value){this.setValue(this.list.value)}else{var g=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));var j=g.values._dhx_find(this.obj.value);if(j!=-1){this.setValue(g.keys[j])}else{this.setValue(this.cell.combo_value=this.obj.value)}}}else{this.setValue(this.list.value)}}if(this.list.parentNode){this.list.parentNode.removeChild(this.list)}if(this.obj.parentNode){this.obj.parentNode.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_co.prototype=new eXcell;eXcell_co.prototype.getText=function(){return this.cell.innerHTML};eXcell_co.prototype.setValue=function(l){if(typeof(l)=="object"){var g=dhx4.ajax.xpath("./option",l);if(g.length){this.cell._combo=new dhtmlXGridComboObject()}for(var c=0;c<g.length;c++){this.cell._combo.put(g[c].getAttribute("value"),g[c].firstChild?g[c].firstChild.data:"")}l=l.firstChild.data}if((l||"").toString()._dhx_trim()==""){l=null}this.cell.combo_value=l;if(l!==null){var a=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(l);this.setCValue(a===null?l:a,l)}else{this.setCValue("&nbsp;",l)}};function eXcell_coro(a){this.base=eXcell_co;this.base(a);this.editable=false}eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(a){this.base=eXcell_co;this.base(a)}eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};eXcell_cotxt.prototype.setValue=function(g){if(typeof(g)=="object"){var c=dhx4.ajax.xpath("./option",g);if(c.length){this.cell._combo=new dhtmlXGridComboObject()}for(var a=0;a<c.length;a++){this.cell._combo.put(c[a].getAttribute("value"),c[a].firstChild?c[a].firstChild.data:"")}g=g.firstChild.data}if((g||"").toString()._dhx_trim()==""){g=null}if(g!==null){this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(g)||g,g)}else{this.setCTxtValue(" ",g)}this.cell.combo_value=g};function eXcell_corotxt(a){this.base=eXcell_co;this.base(a);this.editable=false}eXcell_corotxt.prototype=new eXcell_cotxt;function eXcell_cp(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("SPAN");this.obj.style.border="1px solid black";this.obj.style.position="absolute";var g=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=g[0]+"px";this.obj.style.zIndex=1000;this.obj.style.top=g[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(g){if(g.length==1){g="0"+g}return g};this.colorPanel=function(u,x){var q=document.createElement("TABLE");x.appendChild(q);q.cellSpacing=0;q.editor_obj=this;q.style.cursor="default";q.onclick=function(y){var r=y||window.event;var j=r.target||r.srcElement;var n=j.parentNode.parentNode.parentNode.editor_obj;n.setValue(j._bg);n.grid.editStop()};var m=256/u;for(var o=0;o<=(256/m);o++){var g=q.insertRow(o);for(var s=0;s<=(256/m);s++){for(var l=0;l<=(256/m);l++){R=new Number(m*o)-(o==0?0:1);G=new Number(m*s)-(s==0?0:1);B=new Number(m*l)-(l==0?0:1);var w=this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16));var v=g.insertCell(s);v.width="10px";v.innerHTML="&nbsp;";v.title=w.toUpperCase();v.style.backgroundColor="#"+w;v._bg="#"+w;if(this.val!=null&&"#"+w.toUpperCase()==this.val.toUpperCase()){v.style.border="2px solid white"}}}}};this.getValue=function(){return this.cell.firstChild._bg||""};this.getRed=function(){return Number(parseInt(this.getValue().substr(1,2),16))};this.getGreen=function(){return Number(parseInt(this.getValue().substr(3,2),16))};this.getBlue=function(){return Number(parseInt(this.getValue().substr(5,2),16))};this.detach=function(){if(this.obj.offsetParent!=null){document.body.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_cp.prototype=new eXcell;eXcell_cp.prototype.setValue=function(a){this.setCValue("<div style='width:100%;height:"+((this.grid.multiLine?"100%":23))+";background-color:"+(a||"")+";border:0px;'>&nbsp;</div>",a);this.cell.firstChild._bg=a};function eXcell_img(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG"){return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"")}else{if(this.cell.firstChild.tagName=="A"){var g=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");g+="^"+this.cell.lnk;if(this.cell.trg){g+="^"+this.cell.trg}return g}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(g){var c=g;if((g||"").indexOf("^")!=-1){var a=g.split("^");g=a[0];c=this.cell._attrs.title||a[1];if(a.length>2){this.cell.lnk=a[2];if(a[3]){this.cell.trg=a[3]}}this.cell.titFl="1"}this.setCValue("<img src='"+this.grid.iconURL+(g||"")._dhx_trim()+"' border='0'>",g);if(this.cell.lnk){this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>"}this.cell._brval=c};function eXcell_price(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){if(this.cell.childNodes.length>1){return this.cell.childNodes[1].innerHTML.toString()._dhx_trim()}else{return"0"}}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(c){if(isNaN(parseFloat(c))){c=this.val||0}var a="green";if(c<0){a="red"}this.setCValue("<span>$</span><span style='padding-right:2px;color:"+a+";'>"+c+"</span>",c)};function eXcell_dyn(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed;eXcell_dyn.prototype.setValue=function(g){if(!g||isNaN(Number(g))){if(g!==""){g=0}}if(g>0){var c="green";var a="dyn_up.gif"}else{if(g==0){var c="black";var a="dyn_.gif"}else{var c="red";var a="dyn_down.gif"}}this.setCValue("<div style='position:relative;padding-right:2px; width:100%;overflow:hidden; white-space:nowrap;'><img src='"+this.grid.imgURL+""+a+"' height='15' style='position:absolute;top:0px;left:0px;'><span style=' padding-left:20px; width:100%;color:"+c+";'>"+g+"</span></div>",g)};function eXcell_ro(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()}}eXcell_ro.prototype=new eXcell;window.eXcell_hidden=function(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell.val}};eXcell_hidden.prototype=new eXcell;eXcell_hidden.prototype.setValue=function(a){this.cell.val=a};function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex).toString()}}eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(a){if(a===0){}else{if(!a||a.toString()._dhx_trim()==""){this.setCValue("&nbsp;");return this.cell._clearCell=true}}this.cell._clearCell=false;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")};function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.setValue=function(c){if(!c){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)};this.getValue=function(){if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)}}eXcell_rotxt.prototype=new eXcell;function dhtmlXGridComboObject(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();this.put=function(c,g){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){this.values[a]=g;return true}}this.values[this.values.length]=g;this.keys[this.keys.length]=c};this.get=function(c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){return this.values[a]}}return null};this.clear=function(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray()};this.remove=function(c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){this.keys._dhx_removeAt(a);this.values._dhx_removeAt(a);return true}}};this.size=function(){var a=0;for(var c=0;c<this.keys.length;c++){if(this.keys[c]!=null){a++}}return a};this.getKeys=function(){var a=new Array(0);for(var c=0;c<this.keys.length;c++){if(this.keys[c]!=null){a[a.length]=this.keys[c]}}return a};this.save=function(){this._save=new Array();for(var a=0;a<this.keys.length;a++){this._save[a]=[this.keys[a],this.values[a]]}};this.restore=function(){if(this._save){this.keys[a]=new Array();this.values[a]=new Array();for(var a=0;a<this._save.length;a++){this.keys[a]=this._save[a][0];this.values[a]=this._save[a][1]}}};return this}function Hashtable(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();return this}Hashtable.prototype=new dhtmlXGridComboObject;if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachGrid=function(){this.callEvent("_onBeforeContentAttach",["grid"]);var a=document.createElement("DIV");a.style.width="100%";a.style.height="100%";a.style.position="relative";a.style.overflow="hidden";this._attachObject(a);this.dataType="grid";this.dataObj=new dhtmlXGridObject(a);this.dataObj.setSkin(this.conf.skin);if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}a=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXGridObject.prototype.enableDragAndDrop=function(a){if(a=="temporary_disabled"){this.dADTempOff=false;a=true}else{this.dADTempOff=true}this.dragAndDropOff=dhx4.s2b(a);this._drag_validate=true;if(a){this.objBox.ondragstart=function(c){(c||event).cancelBubble=true;return false}}};dhtmlXGridObject.prototype.setDragBehavior=function(a){this.dadmodec=this.dadmodefix=0;switch(a){case"child":this.dadmode=0;this._sbmod=false;break;case"sibling":this.dadmode=1;this._sbmod=false;break;case"sibling-next":this.dadmode=1;this._sbmod=true;break;case"complex":this.dadmode=2;this._sbmod=false;break;case"complex-next":this.dadmode=2;this._sbmod=true;break}};dhtmlXGridObject.prototype.enableDragOrder=function(a){this._dndorder=dhx4.s2b(a)};dhtmlXGridObject.prototype._checkParent=function(j,c){var g=this._h2.get[j.idd].parent;if(!g.parent){return}for(var a=0;a<c.length;a++){if(c[a]==g.id){return true}}return this._checkParent(this.rowsAr[g.id],c)};dhtmlXGridObject.prototype._createDragNode=function(g,j){this.editStop();if(window.dhtmlDragAndDrop.dragNode){return null}if(!this.dADTempOff){return null}g.parentObject=new Object();g.parentObject.treeNod=this;var o=this.callEvent("onBeforeDrag",[g.parentNode.idd,g._cellIndex,j]);if(!o){return null}var l=new Array();l=this.getSelectedId();l=(((l)&&(l!=""))?l.split(this.delim):[]);var m=false;for(var c=0;c<l.length;c++){if(l[c]==g.parentNode.idd){m=true}}if(!m){this.selectRow(this.rowsAr[g.parentNode.idd],false,j.ctrlKey,false);if(!j.ctrlKey){l=[]}l[this.selMultiRows?l.length:0]=g.parentNode.idd}if(this.isTreeGrid()){for(var c=l.length-1;c>=0;c--){if(this._checkParent(this.rowsAr[l[c]],l)){l.splice(c,1)}}}var q=this;if(l.length&&this._dndorder){l.sort(function(s,r){return(q.rowsAr[s].rowIndex>q.rowsAr[r].rowIndex?1:-1)})}var a=this.getFirstParentOfType(_isIE?j.srcElement:j.target,"TD");if(a){this._dndExtra=a._cellIndex}this._dragged=new Array();for(var c=0;c<l.length;c++){if(this.rowsAr[l[c]]){this._dragged[this._dragged.length]=this.rowsAr[l[c]];this.rowsAr[l[c]].treeNod=this}}g.parentObject.parentNode=g.parentNode;var n=document.createElement("div");n.innerHTML=(o!==true?o:this.rowToDragElement(g.parentNode.idd));n.style.position="absolute";n.className="dragSpanDiv";return n};dhtmlXGridObject.prototype._createSdrgc=function(){this._sdrgc=document.createElement("DIV");this._sdrgc.innerHTML="&nbsp;";this._sdrgc.className="gridDragLine";this.objBox.appendChild(this._sdrgc)};function dragContext(w,v,u,s,r,q,n,o,m,g){this.source=w||"grid";this.target=v||"grid";this.mode=u||"move";this.dropmode=s||"child";this.sid=r||0;this.tid=q;this.sobj=n||null;this.tobj=o||null;this.sExtra=m||null;this.tExtra=g||null;return this}dragContext.prototype.valid=function(){if(this.sobj!=this.tobj){return true}if(this.sid==this.tid){return false}if(this.target=="treeGrid"){var a=this.tid;while(a=this.tobj.getParentId(a)){if(this.sid==a){return false}}}return true};dragContext.prototype.close=function(){this.sobj=null;this.tobj=null};dragContext.prototype.copy=function(){return new dragContext(this.source,this.target,this.mode,this.dropmode,this.sid,this.tid,this.sobj,this.tobj,this.sExtra,this.tExtra)};dragContext.prototype.set=function(g,c){this[g]=c;return this};dragContext.prototype.uid=function(g,c){this.nid=this.sid;while(this.tobj.rowsAr[this.nid]){this.nid=this.nid+((new Date()).valueOf())}return this};dragContext.prototype.data=function(){if(this.sobj==this.tobj){return this.sobj._getRowArray(this.sobj.rowsAr[this.sid])}if(this.source=="tree"){return this.tobj.treeToGridElement(this.sobj,this.sid,this.tid)}else{return this.tobj.gridToGrid(this.sid,this.sobj,this.tobj)}};dragContext.prototype.attrs=function(){if(this.source=="tree"){return{}}else{return this.sobj.rowsAr[this.sid]._attrs}};dragContext.prototype.childs=function(){if(this.source=="treeGrid"){return this.sobj._h2.get[this.sid]._xml_await?this.sobj._h2.get[this.sid].has_kids:null}return null};dragContext.prototype.pid=function(){if(!this.tid){return 0}if(!this.tobj._h2){return 0}if(this.target=="treeGrid"){if(this.dropmode=="child"){return this.tid}else{var c=this.tobj.rowsAr[this.tid];var a=this.tobj._h2.get[c.idd].parent.id;if((this.alfa)&&(this.tobj._sbmod)&&(c.nextSibling)){var g=this.tobj._h2.get[c.nextSibling.idd].parent.id;if(g==this.tid){return this.tid}if(g!=a){return g}}return a}}};dragContext.prototype.ind=function(){if(this.tid==window.unknown){return this.tobj.rowsBuffer.length}if(this.target=="treeGrid"){if(this.dropmode=="child"){this.tobj.openItem(this.tid)}else{this.tobj.openItem(this.tobj.getParentId(this.tid))}}var a=this.tobj.rowsBuffer._dhx_find(this.tobj.rowsAr[this.tid]);if((this.alfa)&&(this.tobj._sbmod)&&(this.dropmode=="sibling")){var c=this.tobj.rowsAr[this.tid];if((c.nextSibling)&&(this._h2.get[c.nextSibling.idd].parent.id==this.tid)){return a+1}}return(a+1+((this.target=="treeGrid"&&a>=0&&this.tobj._h2.get[this.tobj.rowsBuffer[a].idd].state=="minus")?this.tobj._getOpenLenght(this.tobj.rowsBuffer[a].idd,0):0))};dragContext.prototype.img=function(){if((this.target!="grid")&&(this.sobj._h2)){return this.sobj.getItemImage(this.sid)}else{return null}};dragContext.prototype.slist=function(){var c=new Array();for(var a=0;a<this.sid.length;a++){c[c.length]=this.sid[a][(this.source=="tree")?"id":"idd"]}return c.join(",")};dhtmlXGridObject.prototype._drag=function(s,l,r,u){if(this._realfake){return this._fake._drag()}var q=(this.lastLanding);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}var j=r.parentNode;var g=s.parentObject;if(!j.idd){j.grid=this;this.dadmodefix=0}var o=new dragContext(0,0,0,((j.grid.dadmode==1||j.grid.dadmodec)?"sibling":"child"));if(g&&g.childNodes){o.set("source","tree").set("sobj",g.treeNod).set("sid",o.sobj._dragged)}else{if(!g){return true}if(g.treeNod.isTreeGrid&&g.treeNod.isTreeGrid()){o.set("source","treeGrid")}o.set("sobj",g.treeNod).set("sid",o.sobj._dragged)}if(j.grid.isTreeGrid()){o.set("target","treeGrid")}else{o.set("dropmode","sibling")}o.set("tobj",j.grid).set("tid",j.idd);if(((o.tobj.dadmode==2)&&(o.tobj.dadmodec==1))&&(o.tobj.dadmodefix<0)){if(o.tobj.obj.rows[1].idd!=o.tid){o.tid=j.previousSibling.idd}else{o.tid=0}}var a=this.getFirstParentOfType(u,"TD");if(a){o.set("tExtra",a._cellIndex)}if(a){o.set("sExtra",o.sobj._dndExtra)}if(o.sobj.dpcpy){o.set("mode","copy")}if(o.tobj._realfake){o.tobj=o.tobj._fake}if(o.sobj._realfake){o.sobj=o.sobj._fake}o.tobj._clearMove();if(g&&g.treeNod&&g.treeNod._nonTrivialRow){g.treeNod._nonTrivialRow(this,o.tid,o.dropmode,g)}else{o.tobj.dragContext=o;if(!o.tobj.callEvent("onDrag",[o.slist(),o.tid,o.sobj,o.tobj,o.sExtra,o.tExtra])){return o.tobj.dragContext=null}var v=new Array();if(typeof(o.sid)=="object"){var n=o.copy();for(var m=0;m<o.sid.length;m++){if(!n.set("alfa",(!m)).set("sid",o.sid[m][(o.source=="tree"?"id":"idd")]).valid()){continue}n.tobj._dragRoutine(n);if(n.target=="treeGrid"&&n.dropmode=="child"){n.tobj.openItem(n.tid)}v[v.length]=n.nid;n.set("dropmode","sibling").set("tid",n.nid)}n.close()}else{o.tobj._dragRoutine(o)}if(o.tobj.laterLink){o.tobj.laterLink()}o.tobj.callEvent("onDrop",[o.slist(),o.tid,v.join(","),o.sobj,o.tobj,o.sExtra,o.tExtra])}o.tobj.dragContext=null;o.close()};dhtmlXGridObject.prototype._dragRoutine=function(u){if((u.sobj==u.tobj)&&(u.source=="grid")&&(u.mode=="move")&&!this._fake){if(u.sobj._dndProblematic){return}var r=u.sobj.rowsAr[u.sid];var s=u.sobj.rowsCol._dhx_find(r);u.sobj.rowsCol._dhx_removeAt(u.sobj.rowsCol._dhx_find(r));u.sobj.rowsBuffer._dhx_removeAt(u.sobj.rowsBuffer._dhx_find(r));u.sobj.rowsBuffer._dhx_insertAt(u.ind(),r);if(u.tobj._fake){u.tobj._fake.rowsCol._dhx_removeAt(s);var v=u.tobj._fake.rowsAr[u.sid];v.parentNode.removeChild(v)}u.sobj._insertRowAt(r,u.ind());u.nid=u.sid;u.sobj.callEvent("onGridReconstructed",[]);return}var q;if(this._h2&&typeof u.tid!="undefined"&&u.dropmode=="sibling"&&(this._sbmod||u.tid)){if(u.alfa&&this._sbmod&&this._h2.get[u.tid].childs.length){this.openItem(u.tid);q=u.uid().tobj.addRowBefore(u.nid,u.data(),this._h2.get[u.tid].childs[0].id,u.img(),u.childs())}else{q=u.uid().tobj.addRowAfter(u.nid,u.data(),u.tid,u.img(),u.childs())}}else{q=u.uid().tobj.addRow(u.nid,u.data(),u.ind(),u.pid(),u.img(),u.childs())}q._attrs=u.attrs();if(u.source=="tree"){this.callEvent("onRowAdded",[u.nid]);var a=u.sobj._globalIdStorageFind(u.sid);if(a.childsCount){var o=u.copy().set("tid",u.nid).set("dropmode",u.target=="grid"?"sibling":"child");for(var m=0;m<a.childsCount;m++){u.tobj._dragRoutine(o.set("sid",a.childNodes[m].id));if(u.mode=="move"){m--}}o.close()}}else{u.tobj._copyUserData(u);this.callEvent("onRowAdded",[u.nid]);if((u.source=="treeGrid")){if(u.sobj==u.tobj){q._xml=u.sobj.rowsAr[u.sid]._xml}var n=u.sobj._h2.get[u.sid];if((n)&&(n.childs.length)){var o=u.copy().set("tid",u.nid);if(u.target=="grid"){o.set("dropmode","sibling")}else{if(!o.tobj.kidsXmlFile){o.tobj.openItem(u.tid)}o.set("dropmode","child")}var g=n.childs.length;if(!o.tobj.kidsXmlFile){for(var m=0;m<g;m++){u.sobj.render_row_tree(null,n.childs[m].id);u.tobj._dragRoutine(o.set("sid",n.childs[m].id));if(g!=n.childs.length){m--;g=n.childs.length}}}o.close()}}}if(u.mode=="move"){u.sobj[(u.source=="tree")?"deleteItem":"deleteRow"](u.sid);if((u.sobj==u.tobj)&&(!u.tobj.rowsAr[u.sid])){u.tobj.changeRowId(u.nid,u.sid);u.nid=u.sid}}};dhtmlXGridObject.prototype.gridToGrid=function(j,a,g){var l=new Array();for(var c=0;c<a.hdr.rows[0].cells.length;c++){l[c]=a.cells(j,c).getValue()}return l};dhtmlXGridObject.prototype.checkParentLine=function(a,c){if((!this._h2)||(!c)||(!a)){return false}if(a.id==c){return true}else{return this.checkParentLine(a.parent,c)}};dhtmlXGridObject.prototype._dragIn=function(m,j,c,n){if(!this.dADTempOff){return 0}var a=this.isTreeGrid();var l=j.parentNode.idd?j.parentNode:j.parentObject;if(this._drag_validate){if(m.parentNode==j.parentNode){return 0}if((a)&&(this==l.grid)&&((this.checkParentLine(this._h2.get[m.parentNode.idd],j.parentNode.idd)))){return 0}}if(!this.callEvent("onDragIn",[l.idd||l.id,m.parentNode.idd,l.grid||l.treeNod,(m.grid||m.parentNode.grid)])){return this._setMove(m,c,n,true)}this._setMove(m,c,n);if((a)&&(m.parentNode.expand!="")){var g=this;this._autoOpenTimer=window.setTimeout(function(){g._autoOpenItem(null,g);g=null},1000);this._autoOpenId=m.parentNode.idd}else{if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}}return m};dhtmlXGridObject.prototype._autoOpenItem=function(a,c){c.openItem(c._autoOpenId)};dhtmlXGridObject.prototype._dragOut=function(c){this._clearMove();var a=c.parentNode.parentObject?c.parentObject.id:c.parentNode.idd;this.callEvent("onDragOut",[a]);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}};dhtmlXGridObject.prototype._setMove=function(m,c,o,l){if(!m.parentNode.idd){return}var g=dhx4.absTop(m);var a=dhx4.absTop(this.objBox);if((g-a)>(parseInt(this.objBox.offsetHeight)-50)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20}if((g-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(l){return 0}if(this.dadmode==2){var n=o-g+(document.body.scrollTop||document.documentElement.scrollTop)-2-m.offsetHeight/2;if((Math.abs(n)-m.offsetHeight/6)>0){this.dadmodec=1;if(n<0){this.dadmodefix=-1}else{this.dadmodefix=1}}else{this.dadmodec=0}}else{this.dadmodec=this.dadmode}if(this.dadmodec){if(!this._sdrgc){this._createSdrgc()}this._sdrgc.style.display="block";this._sdrgc.style.top=g-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?m.offsetHeight:0)+"px"}else{this._llSelD=m;if(m.parentNode.tagName=="TR"){for(var j=0;j<m.parentNode.childNodes.length;j++){var n=m.parentNode.childNodes[j];n._bgCol=n.style.backgroundColor;n.style.backgroundColor="#FFCCCC"}}}};dhtmlXGridObject.prototype._clearMove=function(){if(this._sdrgc){this._sdrgc.style.display="none"}if((this._llSelD)&&(this._llSelD.parentNode.tagName=="TR")){var c=this._llSelD.parentNode.childNodes;for(var a=0;a<c.length;a++){c[a].style.backgroundColor=c[a]._bgCol}}this._llSelD=null};dhtmlXGridObject.prototype.rowToDragElement=function(a){var c=this.cells(a,0).getValue();return c};dhtmlXGridObject.prototype._copyUserData=function(j){if(!j.tobj.UserData[j.nid]||j.tobj!=j.sobj){j.tobj.UserData[j.nid]=new Hashtable()}else{return}var g=j.sobj.UserData[j.sid];var a=j.tobj.UserData[j.nid];if(g){a.keys=a.keys.concat(g.keys);a.values=a.values.concat(g.values)}};dhtmlXGridObject.prototype.moveRow=function(g,j,a,c){switch(j){case"row_sibling":this.moveRowTo(g,a,"move","sibling",this,c);break;case"up":this.moveRowUp(g);break;case"down":this.moveRowDown(g);break}};dhtmlXGridObject.prototype._nonTrivialNode=function(s,r,n,o,g){if((s.callEvent)&&(!g)){if(!s.callEvent("onDrag",[o.idd,r.id,(n?n.id:null),this,s])){return false}}var q=o.idd;var a=q;while(s._idpull[a]){a+=(new Date()).getMilliseconds().toString()}var l=(this.isTreeGrid()?this.getItemImage(q):"");if(n){for(j=0;j<r.childsCount;j++){if(r.childNodes[j]==n){break}}if(j!=0){n=r.childNodes[j-1]}else{st="TOP";n=""}}var c=s._attachChildNode(r,a,this.gridToTreeElement(s,a,q),"",l,l,l,"","",n);if(this._h2){var m=this._h2.get[q];if(m.childs.length){for(var j=0;j<m.childs.length;j++){this._nonTrivialNode(s,c,0,this.rowsAr[m.childs[j].id],1);if(!this.dpcpy){j--}}}}if(!this.dpcpy){this.deleteRow(q)}if((s.callEvent)&&(!g)){s.callEvent("onDrop",[a,r.id,(n?n.id:null),this,s])}};dhtmlXGridObject.prototype.gridToTreeElement=function(c,g,a){return this.cells(a,0).getValue()};dhtmlXGridObject.prototype.treeToGridElement=function(j,l,a){var c=new Array();var m=this.cellType._dhx_find("tree");if(m==-1){m=0}for(var g=0;g<this.getColumnCount();g++){c[c.length]=(g!=m)?(j.getUserData(l,this.getColumnId(g))||""):j.getItemText(l)}return c};dhtmlXGridObject.prototype.moveRowTo=function(j,g,n,m,a,l){var o=new dragContext((a||this).isTreeGrid()?"treeGrid":"grid",(l||this).isTreeGrid()?"treeGrid":"grid",n,m||"sibling",j,g,a||this,l||this);o.tobj._dragRoutine(o);o.close();return o.nid};dhtmlXGridObject.prototype.enableMercyDrag=function(a){this.dpcpy=dhx4.s2b(a)};dhtmlXGridObject.prototype.toPDF=function(j,r,w,u,o,C){var l={row:this.getSelectedRowId(),col:this.getSelectedCellIndex()};if(l.row===null||l.col===-1){l=false}else{if(l.row&&l.row.indexOf(this.delim)!==-1){var c=this.cells(l.row,l.col).cell;c.parentNode.className=c.parentNode.className.replace(" rowselected","");c.className=c.className.replace(" cellselected","");l.el=c}else{l=false}}r=r||"color";var x=r=="full_color";var a=this;a._asCDATA=true;if(typeof(C)==="undefined"){this.target=' target="_blank"'}else{this.target=C}eXcell_ch.prototype.getContent=function(){return this.getValue()};eXcell_ra.prototype.getContent=function(){return this.getValue()};function A(F){var M=[];for(var K=1;K<a.hdr.rows.length;K++){M[K]=[];for(var J=0;J<a._cCount;J++){var O=a.hdr.rows[K].childNodes[J];if(!M[K][J]){M[K][J]=[0,0]}if(O){M[K][O._cellIndexS]=[O.colSpan,O.rowSpan]}}}var L="<rows profile='"+F+"'";if(w){L+=" header='"+w+"'"}if(u){L+=" footer='"+u+"'"}L+="><head>"+a._serialiseExportConfig(M).replace(/^<head/,"<columns").replace(/head>$/,"columns>");for(var K=2;K<a.hdr.rows.length;K++){var D=0;var S=a.hdr.rows[K];var N="";for(var J=0;J<a._cCount;J++){if((a._srClmn&&!a._srClmn[J])||(a._hrrar[J]&&(!a._fake||J>=a._fake.hdrLabels.length))){D++;continue}var Q=M[K][J];var P=((Q[0]&&Q[0]>1)?' colspan="'+Q[0]+'" ':"");if(Q[1]&&Q[1]>1){P+=' rowspan="'+Q[1]+'" ';D=-1}var E="";var I=S;if(a._fake&&J<a._fake._cCount){I=a._fake.hdr.rows[K]}for(var H=0;H<I.cells.length;H++){if(I.cells[H]._cellIndexS==J){if(I.cells[H].getElementsByTagName("SELECT").length){E=""}else{E=_isIE?I.cells[H].innerText:I.cells[H].textContent}E=E.replace(/[ \n\r\t\xA0]+/," ");break}}if(!E||E==" "){D++}N+="<column"+P+"><![CDATA["+E+"]]></column>"}if(D!=a._cCount){L+="\n<columns>"+N+"</columns>"}}L+="</head>\n";L+=q();return L}function g(){var D=[];if(o){for(var E=0;E<o.length;E++){D.push(v(a.getRowIndex(o[E])))}}else{for(var E=0;E<a.getRowsNum();E++){D.push(v(E))}}return D.join("\n")}function q(){var F=["<foot>"];if(!a.ftr){return""}for(var H=1;H<a.ftr.rows.length;H++){F.push("<columns>");var K=a.ftr.rows[H];for(var E=0;E<a._cCount;E++){if(a._srClmn&&!a._srClmn[E]){continue}if(a._hrrar[E]&&(!a._fake||E>=a._fake.hdrLabels.length)){continue}for(var D=0;D<K.cells.length;D++){var J="";var I="";if(K.cells[D]._cellIndexS==E){J=_isIE?K.cells[D].innerText:K.cells[D].textContent;J=J.replace(/[ \n\r\t\xA0]+/," ");if(K.cells[D].colSpan&&K.cells[D].colSpan!=1){I=" colspan='"+K.cells[D].colSpan+"' "}if(K.cells[D].rowSpan&&K.cells[D].rowSpan!=1){I=" rowspan='"+K.cells[D].rowSpan+"' "}break}}F.push("<column"+I+"><![CDATA["+J+"]]></column>")}F.push("</columns>")}F.push("</foot>");return F.join("\n")}function n(E,D){return(window.getComputedStyle?(window.getComputedStyle(E,null)[D]):(E.currentStyle?E.currentStyle[D]:null))||""}function v(H){if(!a.rowsBuffer[H]){return""}var D=a.render_row(H);if(D.style.display=="none"){return""}var E=a.isTreeGrid()?' level="'+a.getLevel(D.idd)+'"':"";var L="<row"+E+">";for(var J=0;J<a._cCount;J++){if(((!a._srClmn)||(a._srClmn[J]))&&(!a._hrrar[J]||(a._fake&&J<a._fake.hdrLabels.length))){var P=a.cells(D.idd,J);if(x){var I=n(P.cell,"color");var O=n(P.cell,"backgroundColor");var N=n(P.cell,"font-weight")||n(P.cell,"fontWeight");var K=n(P.cell,"font-style")||n(P.cell,"fontStyle");var M=n(P.cell,"text-align")||n(P.cell,"textAlign");var F=n(P.cell,"font-family")||n(P.cell,"fontFamily");if(O=="transparent"||O=="rgba(0, 0, 0, 0)"){O="rgb(255,255,255)"}L+="<cell bgColor='"+O+"' textColor='"+I+"' bold='"+N+"' italic='"+K+"' align='"+M+"' font='"+F+"'>"}else{L+="<cell>"}L+="<![CDATA["+(P.getContent?P.getContent():P.getTitle())+"]]></cell>"}}return L+"</row>"}function s(){var D="</rows>";return D}var y=document.createElement("div");y.style.display="none";document.body.appendChild(y);var m="form_"+a.uid();y.innerHTML='<form id="'+m+'" method="post" action="'+j+'" accept-charset="utf-8"  enctype="application/x-www-form-urlencoded"'+this.target+'><input type="hidden" name="grid_xml" id="grid_xml"/> </form>';document.getElementById(m).firstChild.value=encodeURIComponent(A(r).replace("\u2013","-")+g()+s());document.getElementById(m).submit();y.parentNode.removeChild(y);a=null;if(l){l.el.parentNode.className+=" rowselected";l.el.className+=" cellselected"}l=null};dhtmlXGridObject.prototype._serialiseExportConfig=function(n){function m(j){if(typeof(j)!=="string"){return j}j=j.replace(/&/g,"&amp;");j=j.replace(/"/g,"&quot;");j=j.replace(/'/g,"&apos;");j=j.replace(/</g,"&lt;");j=j.replace(/>/g,"&gt;");return j}var c="<head>";for(var g=0;g<this.hdr.rows[0].cells.length;g++){if(this._srClmn&&!this._srClmn[g]){continue}if(this._hrrar[g]&&(!this._fake||g>=this._fake.hdrLabels.length)){continue}var l=this.fldSort[g];if(l=="cus"){l=this._customSorts[g].toString();l=l.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var r=n[1][g];var o=((r[1]&&r[1]>1)?' rowspan="'+r[1]+'" ':"")+((r[0]&&r[0]>1)?' colspan="'+r[0]+'" ':"");c+="<column "+o+" width='"+this.getColWidth(g)+"' align='"+this.cellAlign[g]+"' type='"+this.cellType[g]+"' hidden='"+((this.isColumnHidden&&this.isColumnHidden(g))?"true":"false")+"' sort='"+(l||"na")+"' color='"+(this.columnColor[g]||"")+"'"+(this.columnIds[g]?(" id='"+this.columnIds[g]+"'"):"")+">";if(this._asCDATA){c+="<![CDATA["+this.getColumnLabel(g)+"]]>"}else{c+=this.getColumnLabel(g)}var q=this.combos[g]?this.getCombo(g):null;if(q){for(var a=0;a<q.keys.length;a++){c+="<option value='"+m(q.keys[a])+"'><![CDATA["+q.values[a]+"]]></option>"}}c+="</column>"}return c+="</head>"};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,j,n,m,c){if(!document.getElementById("ifr")){var l=document.createElement("iframe");l.style.display="none";l.setAttribute("name","dhx_export_iframe");l.setAttribute("src","");l.setAttribute("id","dhx_export_iframe");document.body.appendChild(l)}var g=' target="dhx_export_iframe"';this.toPDF(a,j,n,m,c,g)};dhtmlXGridObject.prototype.filterBy=function(g,l,c){if(this.isTreeGrid()){return this.filterTreeBy(g,l,c)}if(this._f_rowsBuffer){if(!c){this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer));if(this._fake){this._fake.rowsBuffer=this.rowsBuffer}}}else{this._f_rowsBuffer=[].concat(this.rowsBuffer)}if(!this.rowsBuffer.length){return}var m=true;this.dma(true);if(typeof(g)=="object"){for(var a=0;a<l.length;a++){this._filterA(g[a],l[a])}}else{this._filterA(g,l)}this.dma(false);if(this.pagingOn&&this.rowsBuffer.length/this.rowsBufferOutSize<(this.currentPage-1)){this.changePage(0)}this._reset_view();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._filterA=function(c,g){if(g==""){return}var j=true;if(typeof(g)=="function"){j=false}else{g=(g||"").toString().toLowerCase()}if(!this.rowsBuffer.length){return}for(var a=this.rowsBuffer.length-1;a>=0;a--){if(j?(this._get_cell_value(this.rowsBuffer[a],c).toString().toLowerCase().indexOf(g)==-1):(!g.call(this,this._get_cell_value(this.rowsBuffer[a],c),this.rowsBuffer[a].idd))){this.rowsBuffer.splice(a,1)}}};dhtmlXGridObject.prototype.getFilterElement=function(a){if(!this.filters){return}for(var c=0;c<this.filters.length;c++){if(this.filters[c][1]==a){return(this.filters[c][0].combo||this.filters[c][0])}}return null};dhtmlXGridObject.prototype.collectValues=function(j){var u=this.dhxevs.data.oncollectvalues;if(u){var r=true;for(var s in u){var v=u[s].call(this,j);if(v!==true){r=v||r}}if(r!==true){return r}}if(this.isTreeGrid()){return this.collectTreeValues(j)}this.dma(true);this._build_m_order();j=this._m_order?this._m_order[j]:j;var o={};var m=[];var g=this._f_rowsBuffer||this.rowsBuffer;for(var l=0;l<g.length;l++){var a=this._get_cell_value(g[l],j);if(a&&(!g[l]._childIndexes||g[l]._childIndexes[j]!=g[l]._childIndexes[j-1])){o[a]=true}}this.dma(false);var q=(this.combos[j]||(this._col_combos?this._col_combos[j]:false));for(var n in o){if(o[n]===true){if(q){if(q.get&&q.get(n)){n=q.get(n)}else{if(q.getOption&&q.getOption(n)){n=q.getOption(n).text}}}m.push(n)}}return m.sort()};dhtmlXGridObject.prototype._build_m_order=function(){if(this._c_order){this._m_order=[];for(var a=0;a<this._c_order.length;a++){this._m_order[this._c_order[a]]=a}}};dhtmlXGridObject.prototype.filterByAll=function(){var g=[];var c=[];this._build_m_order();for(var j=0;j<this.filters.length;j++){var m=this._m_order?this._m_order[this.filters[j][1]]:this.filters[j][1];if(m>=this._cCount){continue}c.push(m);var n=this.filters[j][0].old_value=this.filters[j][0].value;if(this.filters[j][0]._filter){n=this.filters[j][0]._filter()}var l;if(typeof n!="function"&&(l=(this.combos[m]||(this._col_combos?this._col_combos[m]:false)))){if(l.values){m=l.values._dhx_find(n);n=(m==-1)?n:l.keys[m]}else{if(l.getOptionByLabel){n=(l.getOptionByLabel(n)?l.getOptionByLabel(n).value:n)}}}g.push(n)}if(!this.callEvent("onFilterStart",[c,g])){return}this.filterBy(c,g);if(this._cssEven){this._fixAlterCss()}this.callEvent("onFilterEnd",[this.filters]);if(this._f_rowsBuffer&&this.rowsBuffer.length==this._f_rowsBuffer.length){this._f_rowsBuffer=null}};dhtmlXGridObject.prototype.makeFilter=function(l,g,c){if(!this.filters){this.filters=[]}if(typeof(l)!="object"){l=document.getElementById(l)}if(!l){return}var a=this;if(!l.style.width){l.style.width="90%"}if(l.tagName=="SELECT"){this.filters.push([l,g]);this._loadSelectOptins(l,g);l.onchange=function(){a.filterByAll()};if(_isIE){l.style.marginTop="1px"}this.attachEvent("onEditCell",function(n,m,o){this._build_m_order();if(n==2&&this.filters&&(this._m_order?(o==this._m_order[g]):(o==g))){this._loadSelectOptins(l,g)}return true})}else{if(l.tagName=="INPUT"){this.filters.push([l,g]);l.old_value=l.value="";l.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(l.value!=l.old_value){a.filterByAll();l.old_value=l.value}},500)}}else{if(l.tagName=="DIV"&&l.className=="combo"){this.filters.push([l,g]);l.style.padding="0px";l.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var j=new dhtmlXCombo(l,"_filter","90%");j.filterSelfA=j.filterSelf;j.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};j.enableFilteringMode(true);l.combo=j;l.value="";this._loadComboOptins(l,g);j.attachEvent("onChange",function(){l.value=j.getSelectedValue();if(l.value===null){l.value=""}a.filterByAll()})}}}if(l.parentNode){l.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(n,o,l,m){var m=m||(function(q,j){return j.toString().toLowerCase().indexOf(q)!=-1});if(m===true){m=function(q,j){return j.toString().toLowerCase()==q}}var g=new Array();n=n.toString().toLowerCase();if(typeof l!="number"){l=l?1:0}if(!this.rowsBuffer.length){return g}for(var c=(o||0);c<this._cCount;c++){if(this._h2){this._h2.forEachChild(0,function(j){if(l&&g.length==l){return g}if(m(n,this._get_cell_value(j.buff,c))){g.push([j.id,c])}},this)}else{for(var a=0;a<this.rowsBuffer.length;a++){if(m(n,this._get_cell_value(this.rowsBuffer[a],c))){g.push([this.rowsBuffer[a].idd,c]);if(l&&g.length==l){return g}}}}if(typeof(o)!="undefined"){return g}}return g};dhtmlXGridObject.prototype.makeSearch=function(j,g,a){if(typeof(j)!="object"){j=document.getElementById(j)}if(!j){return}var c=this;if(j.tagName=="INPUT"){j.onkeypress=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(j.value==""){return}var l=c.findCell(j.value,g,true,a);if(l.length){if(c._h2){c.openItem(l[0][0])}c.selectCell(c.getRowIndex(l[0][0]),(g||0))}},500)}}if(j.parentNode){j.parentNode.className+=" filter"}};dhtmlXGridObject.prototype._loadSelectOptins=function(m,o){var a=this.collectValues(o);var g=m.value;m.innerHTML="";m.options[0]=new Option("","");var n=this._filter_tr?this._filter_tr[o]:null;for(var j=0;j<a.length;j++){m.options[m.options.length]=new Option(n?n(a[j]):a[j],a[j])}m.value=g};dhtmlXGridObject.prototype.setSelectFilterLabel=function(c,a){if(!this._filter_tr){this._filter_tr=[]}this._filter_tr[c]=a};dhtmlXGridObject.prototype._loadComboOptins=function(j,n){if(!j.combo){return}var a=this.collectValues(n);j.combo.clearAll();var m=[["",""]];for(var g=0;g<a.length;g++){m.push([a[g],a[g]])}j.combo.addOption(m)};dhtmlXGridObject.prototype.refreshFilters=function(){if(!this.filters){return}for(var a=0;a<this.filters.length;a++){switch(this.filters[a][0].tagName.toLowerCase()){case"input":break;case"select":this._loadSelectOptins.apply(this,this.filters[a]);break;case"div":this._loadComboOptins.apply(this,this.filters[a]);break}}};dhtmlXGridObject.prototype._filters_ready=function(c,a){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onRowCreated",function(l,j){if(this._f_rowsBuffer){for(var g=0;g<this._f_rowsBuffer.length;g++){if(this._f_rowsBuffer[g].idd==l){return this._f_rowsBuffer[g]=j}}}});this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if(!this.hdr.rows.length){this.filters=[]}});this.attachEvent("onSetSizes",this._filters_resize_combo);this.attachEvent("onResize",this._filters_resize_combo);this._filters_ready=function(){}};dhtmlXGridObject.prototype._filters_resize_combo=function(){if(!this.filters){return}for(var a=0;a<this.filters.length;a++){if(this.filters[a][0].combo!=null){this.filters[a][0].combo.setSize(Math.round(this.filters[a][0].offsetWidth*90/100))}}return true};dhtmlXGridObject.prototype._in_header_text_filter=function(c,a){c.innerHTML="<input type='text'>";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_text_filter_inc=function(c,a){c.innerHTML="<input type='text'>";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a);c.firstChild._filter=function(){if(c.firstChild.value==""){return""}return function(g){return(g.toString().toLowerCase().indexOf(c.firstChild.value.toLowerCase())==0)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(c,a){c.innerHTML="<select></select>";c.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(g,c){g.innerHTML="<select style='width:90%; font-size:8pt; font-family:Tahoma;'></select>";g.onclick=function(j){(j||event).cancelBubble=true;return false};this.makeFilter(g.firstChild,c);var a=this.combos;g.firstChild._filter=function(){var j=g.firstChild.value;if(!j){return""}if(a[c]){j=a[c].keys[a[c].values._dhx_find(j)]}j=j.toLowerCase();return function(l){return(l.toString().toLowerCase()==j)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(c,a){c.innerHTML="<div style='width:100%; padding-left:2px; overflow:hidden; ' class='combo'></div>";c.onselectstart=function(){return(event.cancelBubble=true)};c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._search_common=function(c,a){c.innerHTML="<input type='text' style='width:90%; '>";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)}};dhtmlXGridObject.prototype._in_header_text_search=function(g,c,a){this._search_common(g,c);this.makeSearch(g.firstChild,c)};dhtmlXGridObject.prototype._in_header_text_search_strict=function(c,a){this._search_common(c,a);this.makeSearch(c.firstChild,a,true)};dhtmlXGridObject.prototype._in_header_numeric_filter=function(c,a){this._in_header_text_filter.call(this,c,a);c.firstChild._filter=function(){var g=this.value;var l;var n="==";var j=parseFloat(g.replace("=",""));var m=null;if(g){if(g.indexOf("..")!=-1){g=g.split("..");j=parseFloat(g[0]);m=parseFloat(g[1]);return function(o){if(o>=j&&o<=m){return true}return false}}l=g.match(/>=|<=|>|</);if(l){n=l[0];j=parseFloat(g.replace(n,""))}return Function("v"," if (v "+n+" "+j+" ) return true; return false;")}return""}};dhtmlXGridObject.prototype._in_header_master_checkbox=function(j,g,l){j.innerHTML=l[0]+"<input type='checkbox' />"+l[1];var a=this;j.getElementsByTagName("input")[0].onclick=function(m){a._build_m_order();var c=a._m_order?a._m_order[g]:g;var n=this.checked?1:0;a.forEachRowA(function(q){var o=this.cells(q,c);if(o.isCheckbox()){o.setValue(n);o.cell.wasChanged=true}this.callEvent("onEditCell",[1,q,c,n]);this.callEvent("onCheckbox",[q,c,n])});(m||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(g,a,l){var j=function(){var o=0;this._build_m_order();var n=this._m_order?this._m_order[a]:a;for(var m=0;m<this.rowsBuffer.length;m++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[m],n));o+=isNaN(c)?0:c}return this._maskArr[n]?this._aplNF(o,n):(Math.round(o*100)/100)};this._stat_in_header(g,j,a,l,l)};dhtmlXGridObject.prototype._in_header_stat_multi_total=function(l,j,q){var o=q[1].split(":");q[1]="";for(var g=0;g<o.length;g++){o[g]=parseInt(o[g])}var m=function(){var u=0;for(var s=0;s<this.rowsBuffer.length;s++){var r=1;for(var c=0;c<o.length;c++){r*=parseFloat(this._get_cell_value(this.rowsBuffer[s],o[c]))}u+=isNaN(r)?0:r}return this._maskArr[j]?this._aplNF(u,j):(Math.round(u*100)/100)};var a=[];for(var n=0;n<o.length;n++){a[o[n]]=true}this._stat_in_header(l,m,a,q,q)};dhtmlXGridObject.prototype._in_header_stat_max=function(g,a,l){var j=function(){this._build_m_order();var m=this._m_order?this._m_order[a]:a;var n=-999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){n=Math.max(n,parseFloat(this._get_cell_value(this.rowsBuffer[c],m)))}return this._maskArr[a]?this._aplNF(n,a):n};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._in_header_stat_min=function(g,a,l){var j=function(){this._build_m_order();var m=this._m_order?this._m_order[a]:a;var n=999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){n=Math.min(n,parseFloat(this._get_cell_value(this.rowsBuffer[c],m)))}return this._maskArr[a]?this._aplNF(n,a):n};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._in_header_stat_average=function(g,a,l){var j=function(){this._build_m_order();var n=this._m_order?this._m_order[a]:a;var q=0;var o=0;if(this.getRowsNum()==0){return"&nbsp;"}for(var m=0;m<this.rowsBuffer.length;m++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[m],n));if(!isNaN(c)){q+=c;o++}}return this._maskArr[a]?this._aplNF(q/o,a):(Math.round(q/o*100)/100)};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._in_header_stat_count=function(g,a,l){var j=function(){return this.getRowsNum()};this._stat_in_header(g,j,a,l)};dhtmlXGridObject.prototype._stat_in_header=function(g,j,a,n){var l=this;var m=function(){this.dma(true);g.innerHTML=(n[0]?n[0]:"")+j.call(this)+(n[1]?n[1]:"");this.dma(false);this.callEvent("onStatReady",[])};if(!this._stat_events){this._stat_events=[];this.attachEvent("onClearAll",function(){if(!this.hdr.rows[1]){for(var o=0;o<this._stat_events.length;o++){for(var c=0;c<4;c++){this.detachEvent(this._stat_events[o][c])}}this._stat_events=[]}})}this._stat_events.push([this.attachEvent("onGridReconstructed",m),this.attachEvent("onXLE",m),this.attachEvent("onFilterEnd",m),this.attachEvent("onEditCell",function(c,q,o){if(c==2&&(o==a||(a&&a[o]))){m.call(this)}return true})]);g.innerHTML=""};dhtmlXGridObject.prototype.loadCSVFile=function(c,a){this.load(c,a,"csv")};dhtmlXGridObject.prototype.enableCSVAutoID=function(a){this._csvAID=dhx4.s2b(a)};dhtmlXGridObject.prototype.enableCSVHeader=function(a){this._csvHdr=dhx4.s2b(a)};dhtmlXGridObject.prototype.setCSVDelimiter=function(a){this.csv.cell=a};dhtmlXGridObject.prototype._csvAID=true;dhtmlXGridObject.prototype.loadCSVString=function(a){this.parse(a,"csv")};dhtmlXGridObject.prototype.serializeToCSV=function(q){this.editStop();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText||q){this._agetm="getTitle"}else{this._agetm="getValue"}}var n=[];if(this._csvHdr){for(var m=1;m<this.hdr.rows.length;m++){var c=[];for(var o=0;o<this._cCount;o++){if((!this._srClmn)||(this._srClmn[o])){c.push(this.getColumnLabel(o,m-1))}}n.push(this.csvParser.str(c,this.csv.cell,this.csv.row))}}var o=0;var l=this.rowsBuffer.length;for(o;o<l;o++){var g=this._serializeRowToCVS(null,o);if(g!=""){n.push(g)}}return this.csvParser.block(n,this.csv.row)};dhtmlXGridObject.prototype._serializeRowToCVS=function(a,q,g,n){var o=new Array();if(!a){a=this.render_row(q);if(this._fake&&!this._fake.rowsAr[a.idd]){this._fake.render_row(q)}}if(!this._csvAID){o[o.length]=a.idd}g=g||0;n=n||this._cCount;var v=false;var j=g;while(a.childNodes[g]._cellIndex>j&&g){g--}for(var s=g;j<n;s++){if(!a.childNodes[s]){break}var c=a.childNodes[s]._cellIndex;if(((!this._srClmn)||(this._srClmn[c]))&&(!this._serialize_visible||!this._hrrar[c])){var l=a.childNodes[s];var m=this.cells(a.idd,c);while(j!=c){j++;o.push("");if(j>=n){break}}if(j>=n){break}j++;if(m.cell){zxVal=m[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(m.wasChanged())){v=true}o[o.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&l.colSpan&&l.colSpan>1){l=l.colSpan-1;for(var w=0;w<l;w++){o[o.length]="";j++}}}else{j++}}if((this._onlChAttr)&&(!v)){return""}return this.csvParser.str(o,this.csv.cell,this.csv.row)};dhtmlXGridObject.prototype.toClipBoard=function(a){if(window.clipboardData){window.clipboardData.setData("Text",a)}else{(new Clipboard()).copy(a)}};dhtmlXGridObject.prototype.fromClipBoard=function(){if(window.clipboardData){return window.clipboardData.getData("Text")}else{return(new Clipboard()).paste()}};dhtmlXGridObject.prototype.cellToClipboard=function(g,c){if((!g)||(!c&&c!==0)){if(!this.selectedRows[0]){return}g=this.selectedRows[0].idd;c=this.cell._cellIndex}var a=this.cells(g,c);this.toClipBoard(((a.getLabel?a.getLabel():a.getValue())||"").toString())};dhtmlXGridObject.prototype.updateCellFromClipboard=function(g,c){if((!g)||(!c)){if(!this.selectedRows[0]){return}g=this.selectedRows[0].idd;c=this.cell._cellIndex}var a=this.cells(g,c);a[a.setImage?"setLabel":"setValue"](this.fromClipBoard())};dhtmlXGridObject.prototype.rowToClipboard=function(j){var a="";if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=!this._fake;if(j){a=this._serializeRowToCVS(this.getRowById(j))}else{var g=[];for(var c=0;c<this.selectedRows.length;c++){g[g.length]=this._serializeRowToCVS(this.selectedRows[c]);a=this.csvParser.block(g,this.csv.row)}}this._serialize_visible=false;this.toClipBoard(a)};dhtmlXGridObject.prototype.updateRowFromClipboard=function(l){var a=this.fromClipBoard();if(!a){return}if(l){var j=this.getRowById(l)}else{var j=this.selectedRows[0]}if(!j){return}var m=this.csvParser;a=m.unblock(a,this.csv.cell,this.csv.row)[0];if(!this._csvAID){a.splice(0,1)}for(var g=0;g<a.length;g++){var c=this.cells3(j,g);c[c.setImage?"setLabel":"setValue"](a[g])}};dhtmlXGridObject.prototype.csvParser={block:function(a,c){return a.join(c)},unblock:function(m,a,l){var j=(m||"").split(l);for(var c=0;c<j.length;c++){j[c]=(j[c]||"").split(a)}var g=j.length-1;if(j[g].length==1&&j[g][0]==""){j.splice(g,1)}return j},str:function(c,a,g){return c.join(a)}};dhtmlXGridObject.prototype.csvExtParser={_quote:RegExp('"',"g"),_quote_esc:RegExp('\\\\"',"g"),block:function(a,c){return a.join(c)},unblock:function(o,s,v){var g=[[]];var c=0;if(!o){return g}var q=/^[ ]*"/;var n=/"[ ]*$/;var a=new RegExp(".*"+v+".*$");var l=o.split(s);for(var j=0;j<l.length;j++){if(l[j].match(q)){var u=l[j].replace(q,"");while(!l[j].match(n)){j++;u+=l[j]}g[c].push(u.replace(n,"").replace(this._quote_esc,'"'))}else{if(l[j].match(a)){var m=l[j].indexOf(v);g[c].push(l[j].substr(0,m));c++;g[c]=[];l[j]=l[j].substr(m+1);j--}else{if(l[j]||j!=l.length-1){g[c].push(l[j])}}}}var r=g.length-1;if(r>0&&!g[r].length){g.splice(r,1)}return g},str:function(g,a,j){for(var c=0;c<g.length;c++){g[c]='"'+g[c].replace(this._quote,'\\"')+'"'}return g.join(a)}};dhtmlXGridObject.prototype.addRowFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}var g=this.csvParser.unblock(a,this.csv.cell,this.csv.row);for(var c=0;c<g.length;c++){if(g[c]){a=g[c];if(!a.length){continue}if(this._csvAID){this.addRow(this.getRowsNum()+2,a)}else{if(this.rowsAr[a[0]]){a[0]=this.uid()}this.addRow(a[0],a.slice(1))}}}};dhtmlXGridObject.prototype.gridToClipboard=function(){this.toClipBoard(this.serializeToCSV())};dhtmlXGridObject.prototype.gridFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}this.loadCSVString(a)};dhtmlXGridObject.prototype.getXLS=function(n){if(!this.xslform){this.xslform=document.createElement("FORM");this.xslform.action=(n||"")+"xls.php";this.xslform.method="post";this.xslform.target=(_isIE?"_blank":"");document.body.appendChild(this.xslform);var m=document.createElement("INPUT");m.type="hidden";m.name="csv";this.xslform.appendChild(m);var j=document.createElement("INPUT");j.type="hidden";j.name="csv_header";this.xslform.appendChild(j)}var o=this.serializeToCSV();this.xslform.childNodes[0].value=o;var g=[];var a=this._cCount;for(var c=0;c<a;c++){g.push(this.getHeaderCol(c))}g=g.join(",");this.xslform.childNodes[1].value=g;this.xslform.submit()};dhtmlXGridObject.prototype.printView=function(u,g){var r="<style>TD { font-family:Arial; text-align:center; padding-left:2px;padding-right:2px; } \n td.filter input, td.filter select { display:none; }  \n  </style>";var D=null;if(this._fake){D=[].concat(this._hrrar);for(var C=0;C<this._fake._cCount;C++){this._hrrar[C]=null}}r+="<base  href='"+document.location.href+"'></base>";if(!this.parentGrid){r+=(u||"")}r+='<table width="100%" border="2px" cellpadding="0" cellspacing="0">';var s=Math.max(this.rowsBuffer.length,this.rowsCol.length);var q=this._cCount;var v=this._printWidth();r+='<tr class="header_row_1">';for(var C=0;C<q;C++){if(this._hrrar&&this._hrrar[C]){continue}var m=this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes?this.hdr.rows[1]._childIndexes[parseInt(C)]:C];var a=(m.colSpan||1);var I=(m.rowSpan||1);for(var A=1;A<a;A++){v[C]+=v[A]}r+='<td rowspan="'+I+'" width="'+v[C]+'%" style="background-color:lightgrey;" colspan="'+a+'">'+this.getHeaderCol(C)+"</td>";C+=a-1}r+="</tr>";for(var C=2;C<this.hdr.rows.length;C++){if(_isIE){r+="<tr style='background-color:lightgrey' class='header_row_"+C+"'>";var l=this.hdr.rows[C].childNodes;for(var A=0;A<l.length;A++){if(!this._hrrar||!this._hrrar[l[A]._cellIndex]){r+=l[A].outerHTML}}r+="</tr>"}else{r+="<tr class='header_row_"+C+"' style='background-color:lightgrey'>"+(this._fake?this._fake.hdr.rows[C].innerHTML:"")+this.hdr.rows[C].innerHTML+"</tr>"}}for(var C=0;C<s;C++){r+="<tr>";if(this.rowsCol[C]&&this.rowsCol[C]._cntr){r+=this.rowsCol[C].innerHTML.replace(/<img[^>]*>/gi,"")+"</tr>";continue}if(this.rowsCol[C]&&this.rowsCol[C].style.display=="none"){continue}var o;if(this.rowsCol[C]){o=this.rowsCol[C].idd}else{if(this.rowsBuffer[C]){o=this.rowsBuffer[C].idd}else{continue}}for(var A=0;A<q;A++){if(this._hrrar&&this._hrrar[A]){continue}if(this.rowsAr[o]&&this.rowsAr[o].tagName=="TR"){var H=this.cells(o,A);if(H._setState){var w=""}else{if(H.getContent){w=H.getContent()}else{if(H.getImage||H.combo){var w=H.cell.innerHTML}else{var w=H.getValue()}}}}else{var w=this._get_cell_value(this.rowsBuffer[C],A)}var x=this.columnColor[A]?"background-color:"+this.columnColor[A]+";":"";var y=this.cellAlign[A]?"text-align:"+this.cellAlign[A]+";":"";var E=H.getAttribute("colspan");r+='<td style="'+x+y+'" '+(E?'colSpan="'+E+'"':"")+">"+(w===""?"&nbsp;":w)+"</td>";if(E){A+=E-1}}r+="</tr>";if(this.rowsCol[C]&&this.rowsCol[C]._expanded){var n=this.cells4(this.rowsCol[C]._expanded.ctrl);if(n.getSubGrid){r+='<tr><td colspan="'+q+'">'+n.getSubGrid().printView()+"</td></tr>"}else{r+='<tr><td colspan="'+q+'">'+this.rowsCol[C]._expanded.innerHTML+"</td></tr>"}}}if(this.ftr){for(var C=1;C<this.ftr.childNodes[0].rows.length;C++){r+="<tr style='background-color:lightgrey'>"+((this._fake)?this._fake.ftr.childNodes[0].rows[C].innerHTML:"")+this.ftr.childNodes[0].rows[C].innerHTML+"</tr>"}}r+="</table>";if(this.parentGrid){return r}r+=(g||"");var F=window.open("","_blank");F.document.write(r);F.document.write("<script>window.onerror=function(){return true;}<\/script>");F.document.close();if(this._fake){this._hrrar=D}};dhtmlXGridObject.prototype._printWidth=function(){var l=[];var j=0;for(var g=0;g<this._cCount;g++){var a=this.getColWidth(g);l.push(a);j+=a}var n=[];var c=0;for(var g=0;g<l.length;g++){var m=Math.floor((l[g]/j)*100);c+=m;n.push(m)}n[n.length-1]+=100-c;return n};if(!window.clipboardData){window.clipboardData={_make:function(){var c=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!c){return null}var a=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!a){return null}a.addDataFlavor("text/unicode");var g=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);this._p=[c,a,g];return true},setData:function(a,j){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(g){dhx4.callEvent("onClipboardError",["Access to clipboard denied",a,j]);return""}if(!this._make()){return false}this._p[2].data=j;this._p[1].setTransferData("text/unicode",this._p[2],j.length*2);var c=Components.interfaces.nsIClipboard;this._p[0].setData(this._p[1],null,c.kGlobalClipboard)},getData:function(a){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(g){dhx4.callEvent("onClipboardError",["Access to clipboard denied",a]);return""}if(!this._make()){return false}this._p[0].getData(this._p[1],this._p[0].kGlobalClipboard);var c=new Object();var j=new Object();try{this._p[1].getTransferData("text/unicode",j,c)}catch(g){return""}if(j){j=j.value.QueryInterface(Components.interfaces.nsISupportsString)}if(j){return j.data.substring(0,c.value/2)}return""}}}dhtmlXGridObject.prototype.enableBlockSelection=function(g){if(typeof this._bs_mode=="undefined"){var a=this;this.obj.onmousedown=function(j){if(a._bs_mode){a._OnSelectionStart((j||event),this)}return true};this._CSVRowDelimiter=this.csv.row;this.attachEvent("onResize",function(){a._HideSelection();return true});this.attachEvent("onGridReconstructed",function(){a._HideSelection();return true});this.attachEvent("onFilterEnd",this._HideSelection)}if(g===false){this._bs_mode=false;return this._HideSelection()}else{this._bs_mode=true}if(!window.dhx4.isIPad){var c=this._clip_area=document.createElement("textarea");c.style.cssText="position:absolute; width:1px; height:1px; overflow:hidden; color:transparent; background-color:transparent; bottom:1px; right:1px; border:none;";c.onkeydown=function(j){j=j||event;if(j.keyCode==86&&(j.ctrlKey||j.metaKey)){a.pasteBlockFromClipboard()}};document.body.insertBefore(this._clip_area,document.body.firstChild);dhtmlxEvent(this.entBox,"click",function(){if(!a.editor){a._clip_area.select()}})}};dhtmlXGridObject.prototype.forceLabelSelection=function(a){this._strictText=dhx4.s2b(a)};dhtmlXGridObject.prototype._OnSelectionStart=function(g,j){var c=this;if(g.button==2){return}var l=g.srcElement||g.target;if(this.editor){if(l.tagName&&(l.tagName=="INPUT"||l.tagName=="TEXTAREA")){return}this.editStop()}c.setActive(true);var n=this.getPosition(this.obj);var a=g.clientX-n[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var m=g.clientY-n[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));this._CreateSelection(a-4,m-4);if(l==this._selectionObj){this._HideSelection();this._startSelectionCell=null}else{while(l&&(!l.tagName||l.tagName.toLowerCase()!="td")){l=l.parentNode}this._startSelectionCell=l}if(this._startSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._startSelectionCell.parentNode.idd,this._startSelectionCell._cellIndex])){return this._startSelectionCell=null}}this.obj.onmousedown=null;this.obj[_isIE?"onmouseleave":"onmouseout"]=function(o){if(c._blsTimer){window.clearTimeout(c._blsTimer)}};this.obj.onmmold=this.obj.onmousemove;this._init_pos=[a,m];this._selectionObj.onmousemove=this.obj.onmousemove=function(o){o=o||g;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}c._OnSelectionMove(o)};this._oldDMP=document.body.onmouseup;document.body.onmouseup=function(o){o=o||g;c._OnSelectionStop(o,this);return true};this.callEvent("onBeforeBlockSelection",[]);document.body.onselectstart=function(){return false}};dhtmlXGridObject.prototype._getCellByPos=function(a,j){a=a;if(this._fake){a+=this._fake.objBox.scrollWidth}j=j;var c=0;for(var g=0;g<this.obj.rows.length;g++){j-=this.obj.rows[g].offsetHeight;if(j<=0){c=this.obj.rows[g];break}}if(!c||!c.idd){return null}for(var g=0;g<this._cCount;g++){a-=this.getColWidth(g);if(a<=0){while(true){if(c._childIndexes&&c._childIndexes[g+1]==c._childIndexes[g]){c=c.previousSibling}else{return this.cells(c.idd,g).cell}}}}return null};dhtmlXGridObject.prototype._OnSelectionMove=function(j){var x=this;this._ShowSelection();var s=this.getPosition(this.obj);var n=j.clientX-s[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var m=j.clientY-s[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));if((Math.abs(this._init_pos[0]-n)<5)&&(Math.abs(this._init_pos[1]-m)<5)){return this._HideSelection()}var v=this._endSelectionCell;if(this._startSelectionCell==null){this._endSelectionCell=this._startSelectionCell=this.getFirstParentOfType(j.srcElement||j.target,"TD")}else{if(j.srcElement||j.target){if((j.srcElement||j.target).className=="dhtmlxGrid_selection"){this._endSelectionCell=(this._getCellByPos(n,m)||this._endSelectionCell)}else{var w=this.getFirstParentOfType(j.srcElement||j.target,"TD");if(w.parentNode.idd){this._endSelectionCell=w}}}}if(this._endSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._endSelectionCell.parentNode.idd,this._endSelectionCell._cellIndex])){this._endSelectionCell=v}}var l=this.objBox.scrollLeft+this.objBox.clientWidth;var c=this.objBox.scrollTop+this.objBox.clientHeight;var q=this.objBox.scrollLeft;var o=this.objBox.scrollTop;var g=false;if(this._blsTimer){window.clearTimeout(this._blsTimer)}if(n+20>=l){this.objBox.scrollLeft=this.objBox.scrollLeft+20;g=true}else{if(n-20<q){this.objBox.scrollLeft=this.objBox.scrollLeft-20;g=true}}if(m+20>=c&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop+20;g=true}else{if(m-20<o&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop-20;g=true}}this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._endSelectionCell);if(g){var u=j.clientX;var r=j.clientY;this._blsTimer=window.setTimeout(function(){x._OnSelectionMove({clientX:u,clientY:r})},100)}};dhtmlXGridObject.prototype._OnSelectionStop=function(c){var a=this;if(this._blsTimer){window.clearTimeout(this._blsTimer)}this.obj.onmousedown=function(j){if(a._bs_mode){a._OnSelectionStart((j||c),this)}return true};this.obj.onmousemove=this.obj.onmmold||null;this._selectionObj.onmousemove=null;document.body.onmouseup=this._oldDMP||null;if(parseInt(this._selectionObj.style.width)<2&&parseInt(this._selectionObj.style.height)<2){this._HideSelection()}else{var g=this.getFirstParentOfType(c.srcElement||c.target,"TD");if((!g)||(!g.parentNode.idd)){g=this._endSelectionCell}while(g&&(!g.tagName||g.tagName.toLowerCase()!="td")){g=g.parentNode}if(!g){return this._HideSelection()}this._stopSelectionCell=g;this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._stopSelectionCell);this.callEvent("onBlockSelected",[])}document.body.onselectstart=function(){}};dhtmlXGridObject.prototype._RedrawSelectionPos=function(u,n){if(u.parentNode.grid!=n.parentNode.grid){return this._selectionArea}var r={};r.LeftTopCol=u._cellIndex;r.LeftTopRow=this.getRowIndex(u.parentNode.idd);r.RightBottomCol=n._cellIndex;r.RightBottomRow=this.getRowIndex(n.parentNode.idd);var j=u.offsetWidth;var g=u.offsetHeight;u=this.getPosition(u,this.obj);var v=n.offsetWidth;var o=n.offsetHeight;n=this.getPosition(n,this.obj);if(u[0]<n[0]){var l=u[0];var m=n[0]+v}else{var q=r.RightBottomCol;r.RightBottomCol=r.LeftTopCol;r.LeftTopCol=q;var l=n[0];var m=u[0]+j}if(u[1]<n[1]){var s=u[1];var a=n[1]+o}else{var q=r.RightBottomRow;r.RightBottomRow=r.LeftTopRow;r.LeftTopRow=q;var s=n[1];var a=u[1]+g}var w=m-l;var c=a-s;this._selectionObj.style.left=l+"px";this._selectionObj.style.top=s+"px";this._selectionObj.style.width=w+"px";this._selectionObj.style.height=c+"px";return r};dhtmlXGridObject.prototype._CreateSelection=function(a,g){if(this._selectionObj==null){var c=document.createElement("div");c.style.position="absolute";c.style.display="none";c.className="dhtmlxGrid_selection";this._selectionObj=c;this._selectionObj.onmousedown=function(j){j=j||event;if(j.button==2||(_isMacOS&&j.ctrlKey)){return this.parentNode.grid.callEvent("onBlockRightClick",["BLOCK",j])}};this._selectionObj.oncontextmenu=function(j){(j||event).cancelBubble=true;return false};this.objBox.appendChild(this._selectionObj)}this._selectionObj.style.width="0px";this._selectionObj.style.height="0px";this._selectionObj.style.left=a+"px";this._selectionObj.style.top=g+"px";this._selectionObj.startX=a;this._selectionObj.startY=g};dhtmlXGridObject.prototype._ShowSelection=function(){if(this._selectionObj){this._selectionObj.style.display=""}};dhtmlXGridObject.prototype._HideSelection=function(){if(this._selectionObj){this._selectionObj.style.display="none"}this._selectionArea=null;if(this._clip_area){this._clip_area.value="";this._clip_area.blur()}};dhtmlXGridObject.prototype.copyBlockToClipboard=function(){if(!this._clip_area){return}if(this._selectionArea!=null){var g=new Array();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=true;for(var a=this._selectionArea.LeftTopRow;a<=this._selectionArea.RightBottomRow;a++){var c=this._serializeRowToCVS(this.rowsBuffer[a],null,this._selectionArea.LeftTopCol,this._selectionArea.RightBottomCol+1);if(!this._csvAID){g[g.length]=c.substr(c.indexOf(this.csv.cell)+1)}else{g[g.length]=c}}g=g.join(this._CSVRowDelimiter);this._clip_area.value=g;this._clip_area.select();this._serialize_visible=false}};dhtmlXGridObject.prototype.pasteBlockFromClipboard=function(){if(!this._clip_area){return}this._clip_area.select();var a=this;window.setTimeout(function(){a._pasteBlockFromClipboard();a=null},1)};dhtmlXGridObject.prototype._pasteBlockFromClipboard=function(){var q=this._clip_area.value;if(!q){return}if(this._selectionArea!=null){var x=this._selectionArea.LeftTopRow;var a=this._selectionArea.LeftTopCol}else{if(this.cell!=null&&!this.editor){var x=this.getRowIndex(this.cell.parentNode.idd);var a=this.cell._cellIndex}else{return false}}q=this.csvParser.unblock(q,this.csv.cell,this.csv.row);var r=x+q.length;var v=a+q[0].length;if(v>this._cCount){v=this._cCount}var m=0;for(var s=x;s<r;s++){var y=this.render_row(s);if(y==-1){continue}var g=0;for(var o=a;o<v;o++){if(this._hrrar[o]&&!this._fake){v=Math.max(v+1,this._cCount);continue}var u=this.cells3(y,o);if(u.isDisabled()){g++;continue}if(this._onEditUndoRedo){this._onEditUndoRedo(2,y.idd,o,q[m][g],u.getValue())}if(u.combo){var w=u.combo.values;for(var c=0;c<w.length;c++){if(q[m][g]==w[c]){u.setValue(u.combo.keys[c]);w=null;break}}if(w!=null&&u.editable){u.setValue(q[m][g++])}else{g++}}else{u[u.setImage?"setLabel":"setValue"](q[m][g++])}u.cell.wasChanged=true}this.callEvent("onRowPaste",[y.idd]);m++}};dhtmlXGridObject.prototype.getSelectedBlock=function(){if(this._selectionArea){return this._selectionArea}else{if(this.getSelectedRowId()!==null){return{LeftTopRow:this.getSelectedRowId(),LeftTopCol:this.getSelectedCellIndex(),RightBottomRow:this.getSelectedRowId(),RightBottomCol:this.getSelectedCellIndex()}}else{return null}}};dhtmlXGridObject.prototype.enableSmartRendering=function(g,c,a){if(arguments.length>2){if(c&&!this.rowsBuffer[c-1]){this.rowsBuffer[c-1]=0}c=a}this._srnd=dhx4.s2b(g);this._srdh=this._srdh||20;this._dpref=c||0};dhtmlXGridObject.prototype.enablePreRendering=function(a){this._srnd_pr=parseInt(a||50)};dhtmlXGridObject.prototype.forceFullLoading=function(a,l){for(var g=0;g<this.rowsBuffer.length;g++){if(!this.rowsBuffer[g]){var j=a||(this.rowsBuffer.length-g);if(this.callEvent("onDynXLS",[g,j])){var c=this;this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+g+"&count="+j,function(){window.setTimeout(function(){c.forceFullLoading(a,l)},100)},this._data_type)}return}}if(l){l.call(this)}};dhtmlXGridObject.prototype.setAwaitedRowHeight=function(a){this._srdh=parseInt(a)};dhtmlXGridObject.prototype._get_view_size=function(){return Math.floor(parseInt(this.entBox.offsetHeight)/this._srdh)+2};dhtmlXGridObject.prototype._add_filler=function(n,a,c,j){if(!a){return null}var m="__filler__";var l=this._prepareRow(m);l.firstChild.style.width="1px";l.firstChild.style.padding=l.firstChild.style.margin="0px";for(var g=1;g<l.childNodes.length;g++){l.childNodes[g].style.display="none"}l.firstChild.style.height=a*this._srdh+"px";c=c||this.rowsCol[n];if(c&&c.nextSibling){c.parentNode.insertBefore(l,c.nextSibling)}else{if(_isKHTML){this.obj.appendChild(l)}else{this.obj.rows[0].parentNode.appendChild(l)}}this.callEvent("onAddFiller",[n,a,l,c,j]);return[n,a,l]};dhtmlXGridObject.prototype._update_srnd_view=function(){var n=Math.floor(this.objBox.scrollTop/this._srdh);var c=n+this._get_view_size();if(this.multiLine){var o=this.objBox.scrollTop;n=0;while(o>0){o-=this.rowsCol[n]?this.rowsCol[n].offsetHeight:this._srdh;n++}c=n+this._get_view_size();if(n>0){n--}}c+=(this._srnd_pr||0);if(c>this.rowsBuffer.length){c=this.rowsBuffer.length}for(var l=n;l<c;l++){if(!this.rowsCol[l]){var m=this._add_from_buffer(l);if(m==-1){if(this.xmlFileUrl){if(this._dpref&&this.rowsBuffer[c-1]){var g=this._dpref?this._dpref:(c-l);var a=Math.max(0,Math.min(l,c-this._dpref));this._current_load=[a,c-a]}else{this._current_load=[l,(this._dpref?this._dpref:(c-l))]}if(this.callEvent("onDynXLS",this._current_load)){this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+this._current_load[0]+"&count="+this._current_load[1],this._data_type)}}return}else{if(this._tgle){this._updateLine(this._h2.get[this.rowsBuffer[l].idd],this.rowsBuffer[l]);this._updateParentLine(this._h2.get[this.rowsBuffer[l].idd],this.rowsBuffer[l])}if(l&&l==(this._realfake?this._fake:this)["_r_select"]){this.selectCell(l,this.cell?this.cell._cellIndex:0,true)}}}}if(this._fake&&!this._realfake&&this.multiLine){this._fake.objBox.scrollTop=this.objBox.scrollTop}};dhtmlXGridObject.prototype._add_from_buffer=function(j){var l=this.render_row(j);if(l==-1){return -1}if(l._attrs.selected||l._attrs.select){this.selectRow(l,false,true);l._attrs.selected=l._attrs.select=null}if(!this._cssSP){if(this._cssEven&&j%2==0){l.className=this._cssEven+((l.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(l._css||"")}else{if(this._cssUnEven&&j%2==1){l.className=this._cssUnEven+((l.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(l._css||"")}}}else{if(this._h2){var a=this._h2.get[l.idd];l.className+=" "+((a.level%2)?(this._cssUnEven+" "+this._cssUnEven):(this._cssEven+" "+this._cssEven))+"_"+a.level+(this.rowsAr[a.id]._css||"")}}for(var c=0;c<this._fillers.length;c++){var g=this._fillers[c];if(g&&g[0]<=j&&(g[0]+g[1])>j){var m=j-g[0];if(m==0){this._insert_before(j,l,g[2]);this._update_fillers(c,-1,1)}else{if(m==g[1]-1){this._insert_after(j,l,g[2]);this._update_fillers(c,-1,0)}else{this._fillers.push(this._add_filler(j+1,g[1]-m-1,g[2],1));this._insert_after(j,l,g[2]);this._update_fillers(c,-g[1]+m,0)}}return}}};dhtmlXGridObject.prototype._update_fillers=function(g,a,j){var c=this._fillers[g];c[1]=c[1]+a;c[0]=c[0]+j;if(!c[1]){this.callEvent("onRemoveFiller",[c[2]]);c[2].parentNode.removeChild(c[2]);this._fillers.splice(g,1)}else{c[2].firstChild.style.height=parseFloat(c[2].firstChild.style.height)+a*this._srdh+"px";this.callEvent("onUpdateFiller",[c[2]])}};dhtmlXGridObject.prototype._insert_before=function(c,g,a){a.parentNode.insertBefore(g,a);this.rowsCol[c]=g;this.callEvent("onRowInserted",[g,null,a,"before"])};dhtmlXGridObject.prototype._insert_after=function(c,g,a){if(a.nextSibling){a.parentNode.insertBefore(g,a.nextSibling)}else{a.parentNode.appendChild(g)}this.rowsCol[c]=g;this.callEvent("onRowInserted",[g,null,a,"after"])};if(typeof(window.dhtmlxValidation)!="undefined"){dhtmlxValidation.trackInput=function(g,j,c,a){dhtmlxEvent(g,"keyup",function(l){if(dhtmlxValidation._timer){window.clearTimeout(dhtmlxValidation._timer);dhtmlxValidation._timer=null}dhtmlxValidation._timer=window.setTimeout(function(){if(!dhtmlxValidation.checkInput(g,j)){if(!c||c(g,g.value,j)){g.className+=" dhtmlx_live_validation_error"}}else{g.className=g.className.replace(/[ ]*dhtmlx_live_validation_error/g,"");if(a){a(g,g.value,j)}}},250)})};dhtmlxValidation.checkInput=function(a,c){return dhtmlxValidation.checkValue(a.value,c)};dhtmlxValidation.checkValue=function(g,j){if(typeof j=="string"){j=j.split(",")}var a=true;for(var c=0;c<j.length;c++){if(!this["is"+j[c]]){alert("Incorrect validation rule: "+j[c])}else{a=a&&this["is"+j[c]](g)}}return a}}dhtmlXGridObject.prototype.enableValidation=function(c,a){c=dhx4.s2b(c);if(c){this._validators={data:[]}}else{this._validators=false}if(arguments.length>1){this._validators._live=a}if(!this._validators._event){this._validators._event=this.attachEvent("onEditCell",this.validationEvent)}};dhtmlXGridObject.prototype.setColValidators=function(a){if(!this._validators){this.enableValidation(true)}if(typeof a=="string"){a=a.split(this.delim)}this._validators.data=a};dhtmlXGridObject.prototype.validationEvent=function(m,c,j,g,o){var q=this._validators;if(!q){return true}var n=(q.data[j]||this.cells(c,j).getAttribute("validate"))||"";if(m==1&&n){var l=this.editor||(this._fake||{}).editor;if(!l){return true}l.cell.className=l.cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");if(q._live){var a=this;dhtmlxValidation.trackInput(l.getInput(),n,function(r,s,u){return a.callEvent("onLiveValidationError",[c,j,s,r,u])},function(r,s,u){return a.callEvent("onLiveValidationCorrect",[c,j,s,r,u])})}}if(m==2){this.validateCell(c,j,n,g)}return true};dhtmlXGridObject.prototype.validateCell=function(n,l,m,j){m=m||(this._validators.data[l]||this.cells(n,l).getAttribute("validate"));j=j||this.cells(n,l).getValue();if(!m){return}var c=this.cells(n,l).cell;var a=true;if(typeof m=="string"){m=m.split(this.delim)}for(var g=0;g<m.length;g++){if(!dhtmlxValidation.checkValue(j,m[g])){if(this.callEvent("onValidationError",[n,l,j,m[g]])){c.className+=" dhtmlx_validation_error"}a=false}}if(a){this.callEvent("onValidationCorrect",[n,l,j,m]);c.className=c.className.replace(/[ ]*dhtmlx_validation_error/g,"")}return a};function eXcell_stree(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_trees){return}this._sub=this.grid._sub_trees[a._cellIndex];if(!this._sub){return}this._sub=this._sub[0]}this.getValue=function(){return this.cell._val};this.setValue=function(c){this.cell._val=c;c=this._sub.getItemText(this.cell._val);this.setCValue((c||"&nbsp;"),c)};this.edit=function(){this._sub.parentObject.style.display="block";var g=this.grid.getPosition(this.cell);this._sub.parentObject.style.top=g[1]+"px";this._sub.parentObject.style.left=g[0]+"px";this._sub.parentObject.style.position="absolute";var c=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=c};this.detach=function(){this._sub.parentObject.style.display="none";if(this.grid._sub_id!=null){var c=this.cell._val;this.setValue(this._sub.getSelectedItemId());this.grid._sub_id=null;return this.cell._val!=c}}}eXcell_stree.prototype=new eXcell;dhtmlXGridObject.prototype.setSubTree=function(a,c){if(!this._sub_trees){this._sub_trees=[]}this._sub_trees[c]=[a];a.parentObject.style.display="none";var g=this;a.parentObject.onclick=function(j){(j||window.event).cancelBubble=true;return false};a.ev_onDblClick=null;a.attachEvent("onDblClick",function(j){g._sub_id=j;g.editStop();return true});a._chRRS=true};function eXcell_link(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.isDisabled=function(){return true};this.edit=function(){};this.getValue=function(){if(this.cell.firstChild.getAttribute){var c=this.cell.firstChild.getAttribute("target");return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")+(c?("^"+c):"")}else{return""}};this.setValue=function(g){if((typeof(g)!="number")&&(!g||g.toString()._dhx_trim()=="")){this.setCValue("&nbsp;",c);return(this.cell._clearCell=true)}var c=g.split("^");if(c.length==1){c[1]=""}else{if(c.length>1){c[1]="href='"+c[1]+"'";if(c.length==3){c[1]+=" target='"+c[2]+"'"}else{c[1]+=" target='_blank'"}}}this.setCValue("<a "+c[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+c[0]+"</a>",c)}}eXcell_link.prototype=new eXcell;eXcell_link.prototype.getTitle=function(){var a=this.cell.firstChild;return((a&&a.tagName)?a.getAttribute("href"):"")};eXcell_link.prototype.getContent=function(){var a=this.cell.firstChild;return((a&&a.tagName)?a.innerHTML:"")};function eXcell_grid(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_grids){return}this._sub=this.grid._sub_grids[a._cellIndex];if(!this._sub){return}this._sindex=this._sub[1];this._sub=this._sub[0]}this.getValue=function(){return this.cell.val};this.setValue=function(c){this.cell.val=c;if(this._sub.getRowById(c)){c=this._sub.cells(c,this._sindex);if(c){c=c.getValue()}else{c=""}}this.setCValue((c||"&nbsp;"),c)};this.edit=function(){this.val=this.cell.val;this._sub.entBox.style.display="block";var g=this.grid.getPosition(this.cell);this._sub.entBox.style.top=g[1]+"px";this._sub.entBox.style.left=g[0]+"px";this._sub.entBox.style.position="absolute";this._sub.setSizes();var c=this.grid.editStop;this.grid.editStop=function(){};if(this._sub.getRowById(this.cell.val)){this._sub.setSelectedRow(this.cell.val)}this._sub.setActive(true);this.grid.editStop=c};this.detach=function(){var c=this.cell.val;this._sub.entBox.style.display="none";if(this._sub.getSelectedId()===null){return false}this.setValue(this._sub.getSelectedId());this.grid.setActive(true);return this.cell.val!=c}}eXcell_grid.prototype=new eXcell;dhtmlXGridObject.prototype.setSubGrid=function(c,a,j){if(!this._sub_grids){this._sub_grids=[]}this._sub_grids[a]=[c,j];c.entBox.style.display="none";var g=this;c.entBox.onclick=function(l){(l||window.event).cancelBubble=true;return false};c.attachEvent("onRowSelect",function(l){g.editStop();return true});c._chRRS=false};function eXcell_dhxCalendar(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var g=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[g]);var c=this.grid;g.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){c.editStop()},1);return true});var j=function(l){(l||event).cancelBubble=true};dhtmlxEvent(g.base,"click",j);g=null}}}eXcell_dhxCalendar.prototype=new eXcell;eXcell_dhxCalendar.prototype.edit=function(){var c=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(c[0],c[1]+this.cell.offsetHeight);this.grid._grid_calendarA._last_operation_calendar=false;this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;var a=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=function(){};this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val||(new Date()));this.grid._grid_calendarA.draw=a};eXcell_dhxCalendar.prototype.getDate=function(){if(this.cell.val){return this.cell.val}return null};eXcell_dhxCalendar.prototype.getValue=function(){if(this.cell._clearCell){return""}if(this.grid._dtmask_inc&&this.cell.val){return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString()}return this.cell.innerHTML.toString()._dhx_trim()};eXcell_dhxCalendar.prototype.detach=function(){if(!this.grid._grid_calendarA){return}this.grid._grid_calendarA.hide();if(this.cell._cediton){this.cell._cediton=false}else{return}if(this.grid._grid_calendarA._last_operation_calendar){var g=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"));var c=this.grid._grid_calendarA.getDate();this.cell.val=new Date(c);this.setCValue(g,c);this.cell._clearCell=!g;var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=a)}return false};eXcell_dhxCalendar.prototype.setValue=function(a){if(a&&typeof a=="object"){this.cell.val=a;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),a).toString(),this.cell.val);return}if(!a||a.toString()._dhx_trim()==""){a="&nbsp";this.cell._clearCell=true;this.cell.val=""}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),a.toString(),null,true));if(this.grid._dtmask_inc){a=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val)}}if((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell._clearCell=true;this.cell.val=new Date();this.setCValue("&nbsp;",0)}else{this.setCValue((a||"").toString(),this.cell.val)}};function eXcell_dhxCalendarA(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var g=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[g]);var c=this.grid;g.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){c.editStop()},1);return true});var j=function(l){(l||event).cancelBubble=true};dhtmlxEvent(g.base,"click",j)}}}eXcell_dhxCalendarA.prototype=new eXcell;eXcell_dhxCalendarA.prototype.edit=function(){var c=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(c[0]*1+this.cell.offsetWidth,c[1]*1);this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid._grid_calendarA._last_operation_calendar=false;this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;var a=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=function(){};this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val);this.grid._grid_calendarA.draw=a;this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.obj=document.createElement(this.cell.atag);this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(g){(g||event).cancelBubble=true};this.obj.onmousedown=function(g){(g||event).cancelBubble=true};this.obj.value=this.getValue();this.cell.innerHTML="";this.cell.appendChild(this.obj);if(window.dhx4.isIE){this.obj.style.overflow="visible";if((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){this.obj.style.height="36px";this.obj.style.overflow="scroll"}}this.obj.onselectstart=function(g){if(!g){g=event}g.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};eXcell_dhxCalendarA.prototype.getDate=function(){if(this.cell.val){return this.cell.val}return null};eXcell_dhxCalendarA.prototype.getValue=function(){if(this.cell._clearCell){return""}if(this.grid._dtmask_inc&&this.cell.val){return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString()}return this.cell.innerHTML.toString()._dhx_trim()};eXcell_dhxCalendarA.prototype.detach=function(){if(!this.grid._grid_calendarA){return}this.grid._grid_calendarA.hide();if(this.cell._cediton){this.cell._cediton=false}else{return}if(this.grid._grid_calendarA._last_operation_calendar){this.grid._grid_calendarA._last_operation_calendar=false;var g=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y");var c=this.grid._grid_calendarA.getDate();this.cell.val=new Date(c);this.setCValue(g,c);this.cell._clearCell=!g;var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=(a|"").valueOf())}this.setValue(this.obj.value);var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=(a||"").valueOf())};eXcell_dhxCalendarA.prototype.setValue=function(a){if(a&&typeof a=="object"){this.cell.val=a;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),a).toString(),this.cell.val);return}if(!a||a.toString()._dhx_trim()==""){a="&nbsp";this.cell._clearCell=true;this.cell.val=""}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),a.toString(),null,true));if(this.grid._dtmask_inc){a=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val)}}if((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell.val=new Date();this.cell._clearCell=true;this.setCValue("&nbsp;",0)}else{this.setCValue((a||"").toString(),this.cell.val)}};function eXcell_cntr(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._ex_cntr_ready&&!this._realfake){this.grid._ex_cntr_ready=true;if(this.grid._h2){this.grid.attachEvent("onOpenEn",function(g){this.resetCounter(a._cellIndex)})}var c=function(){var g=this;window.setTimeout(function(){if(!g.resetCounter){return}if(g._fake&&!g._realfake&&a._cellIndex<g._fake._cCount){g._fake.resetCounter(a._cellIndex)}else{g.resetCounter(a._cellIndex)}},1);return true};this.grid.attachEvent("onBeforeSorting",c);this.grid.attachEvent("onFilterEnd",c)}this.edit=function(){};this.getValue=function(){return this.cell.innerHTML};this.setValue=function(j){this.cell.style.paddingRight="2px";var g=this.cell;window.setTimeout(function(){if(!g.parentNode){return}var l=g.parentNode.rowIndex;if(g.parentNode.grid.currentPage||l<0||g.parentNode.grid._srnd){l=g.parentNode.grid.rowsBuffer._dhx_find(g.parentNode)+1}if(l<=0){return}g.innerHTML=l;if(g.parentNode.grid._fake&&g._cellIndex<g.parentNode.grid._fake._cCount&&g.parentNode.grid._fake.rowsAr[g.parentNode.idd]){g.parentNode.grid._fake.cells(g.parentNode.idd,g._cellIndex).setCValue(l)}g=null},100)}}dhtmlXGridObject.prototype.resetCounter=function(c){if(this._fake&&!this._realfake&&c<this._fake._cCount){this._fake.resetCounter(c,this.currentPage)}var a=arguments[0]||0;if(this.currentPage){a=(this.currentPage-1)*this.rowsBufferOutSize}for(a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].tagName=="TR"&&this.rowsAr[this.rowsBuffer[a].idd]){this.rowsAr[this.rowsBuffer[a].idd].childNodes[c].innerHTML=a+1}}};eXcell_cntr.prototype=new eXcell;function eXcell_acheck(a){try{this.cell=a;this.grid=this.cell.parentNode.grid;this.cell.obj=this}catch(c){}this.changeState=function(){if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("<checkbox state='false'>")}else{this.setValue("<checkbox state='true'>")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){try{return this.cell.chstate.toString()}catch(g){return null}};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(g){this.setValue(g.toString())};this.detach=function(){return this.val!=this.getValue()};this.drawCurrentState=function(){if(this.cell.chstate==1){return"<div  onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;'  style='cursor:pointer; font-weight:bold; text-align:center; '><span style='height:8px; width:8px; background:green; display:inline-block;'></span>&nbsp;Yes</div>"}else{return"<div  onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;' style='cursor:pointer;  text-align:center; '><span style='height:8px; width:8px; background:red; display:inline-block;'></span>&nbsp;No</div>"}}}eXcell_acheck.prototype=new eXcell;eXcell_acheck.prototype.setValue=function(c){c=(c||"").toString();if(c.indexOf("1")!=-1||c.indexOf("true")!=-1){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.setCValue(this.drawCurrentState(),this.cell.chstate)};function eXcell_context(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_context){return}this._sub=this.grid._sub_context[a._cellIndex];if(!this._sub){return}this._sindex=this._sub[1];this._sub=this._sub[0]}this.getValue=function(){return _isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(g){this.cell._val=g;var c=this._sub.itemPull[this._sub.idPrefix+this.cell._val];g=c?c.title:g;this.setCValue((g||"&nbsp;"),g)};this.edit=function(){var g=this.grid.getPosition(this.cell);this._sub.showContextMenu(g[0]+this.cell.offsetWidth,g[1]);var c=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=c};this.detach=function(){if(this.grid._sub_id!=null){var c=this.cell._val;this.setValue(this.grid._sub_id);this.grid._sub_id=null;return this.cell._val!=c}this._sub.hideContextMenu()}}eXcell_context.prototype=new eXcell;dhtmlXGridObject.prototype.setSubContext=function(a,c,j){var g=this;a.attachEvent("onClick",function(m,l){g._sub_id=m;g.editStop();a.hideContextMenu();return true});if(!this._sub_context){this._sub_context=[]}this._sub_context[c]=[a,j];a.hideContextMenu()};function dhtmlXGridFromTable(obj,init){if(typeof(obj)!="object"){obj=document.getElementById(obj)}var w=document.createElement("DIV");w.setAttribute("width",obj.getAttribute("gridWidth")||(obj.offsetWidth?(obj.offsetWidth+"px"):0)||(window.getComputedStyle?window.getComputedStyle(obj,null)["width"]:(obj.currentStyle?obj.currentStyle.width:0)));w.setAttribute("height",obj.getAttribute("gridHeight")||(obj.offsetHeight?(obj.offsetHeight+"px"):0)||(window.getComputedStyle?window.getComputedStyle(obj,null)["height"]:(obj.currentStyle?obj.currentStyle.height:0)));w.className=obj.className;obj.className="";if(obj.id){w.id=obj.id}var mr=obj;var drag=obj.getAttribute("dragAndDrop");mr.parentNode.insertBefore(w,mr);var f=mr.getAttribute("name")||("name_"+(new Date()).valueOf());var windowf=new dhtmlXGridObject(w);window[f]=windowf;var acs=mr.getAttribute("onbeforeinit");var acs2=mr.getAttribute("oninit");if(acs){eval(acs)}windowf.setImagePath(windowf.imgURL||(mr.getAttribute("imgpath")||mr.getAttribute("image_path")||""));var skin=mr.getAttribute("skin");if(skin){windowf.setSkin(skin)}if(init){init(windowf)}var hrow=mr.rows[0];var za="";var zb="";var zc="";var zd="";var ze="";for(var i=0;i<hrow.cells.length;i++){za+=(za?",":"")+hrow.cells[i].innerHTML;var width=hrow.cells[i].getAttribute("width")||hrow.cells[i].offsetWidth||(window.getComputedStyle?window.getComputedStyle(hrow.cells[i],null)["width"]:(hrow.cells[i].currentStyle?hrow.cells[i].currentStyle.width:0));zb+=(zb?",":"")+(width=="*"?width:parseInt(width));zc+=(zc?",":"")+(hrow.cells[i].getAttribute("align")||"left");zd+=(zd?",":"")+(hrow.cells[i].getAttribute("type")||"ed");ze+=(ze?",":"")+(hrow.cells[i].getAttribute("sort")||"str");var f_a=hrow.cells[i].getAttribute("format");if(f_a){if(hrow.cells[i].getAttribute("type").toLowerCase().indexOf("calendar")!=-1){windowf._dtmask=f_a}else{windowf.setNumberFormat(f_a,i)}}}windowf.setHeader(za);windowf.setInitWidths(zb);windowf.setColAlign(zc);windowf.setColTypes(zd);windowf.setColSorting(ze);if(obj.getAttribute("gridHeight")=="auto"){windowf.enableAutoHeigth(true)}if(obj.getAttribute("multiline")){windowf.enableMultiline(true)}var lmn=mr.getAttribute("lightnavigation");if(lmn){windowf.enableLightMouseNavigation(lmn)}var evr=mr.getAttribute("evenrow");var uevr=mr.getAttribute("unevenrow");if(evr||uevr){windowf.enableAlterCss(evr,uevr)}if(drag){windowf.enableDragAndDrop(true)}windowf.init();if(obj.getAttribute("split")){windowf.splitAt(obj.getAttribute("split"))}windowf._process_inner_html(mr,1);if(acs2){eval(acs2)}if(obj.parentNode&&obj.parentNode.removeChild){obj.parentNode.removeChild(obj)}return windowf}dhtmlXGridObject.prototype._process_html=function(c){if(c.tagName&&c.tagName=="TABLE"){return this._process_inner_html(c,0)}var a=document.createElement("DIV");a.innerHTML=c.xmlDoc.responseText;var g=a.getElementsByTagName("TABLE")[0];this._process_inner_html(g,0)};dhtmlXGridObject.prototype._process_inner_html=function(g,m){var c=g.rows.length;for(var a=m;a<c;a++){var l=g.rows[a].getAttribute("id")||a;this.rowsBuffer.push({idd:l,data:g.rows[a],_parser:this._process_html_row,_locator:this._get_html_data})}this.render_dataset();this.setSizes()};dhtmlXGridObject.prototype._process_html_row=function(q,m){var o=m.getElementsByTagName("TD");var c=[];q._attrs=this._xml_attrs(m);for(var l=0;l<o.length;l++){var n=o[l];var a=n.getAttribute("type");if(q.childNodes[l]){if(a){q.childNodes[l]._cellType=a}q.childNodes[l]._attrs=this._xml_attrs(o[l])}if(n.firstChild){c.push(n.innerHTML)}else{c.push("")}if(n.colSpan>1){q.childNodes[l]._attrs.colspan=n.colSpan;for(var g=1;g<n.colSpan;g++){c.push("")}}}for(l<o.length;l<q.childNodes.length;l++){q.childNodes[l]._attrs={}}this._fillRow(q,(this._c_order?this._swapColumns(c):c));return q};dhtmlXGridObject.prototype._get_html_data=function(c,a){c=c.firstChild;while(true){if(!c){return""}if(c.tagName=="TD"){a--}if(a<0){break}c=c.nextSibling}return(c.firstChild?c.firstChild.data:"")};dhtmlxEvent(window,"load",function(){var g=document.getElementsByTagName("table");for(var c=0;c<g.length;c++){if(g[c].className=="dhtmlxGrid"){dhtmlXGridFromTable(g[c])}}});function dhtmlXForm(l,j,m){this.idef={position:"label-left",labelWidth:"auto",labelHeight:"auto",inputWidth:"auto",inputHeight:"auto",labelAlign:"left",noteWidth:"auto",offsetTop:0,offsetLeft:0,blockOffset:20};this.idef_const={offsetNested:20};this.apos_css={"label-left":"dhxform_item_label_left","label-right":"dhxform_item_label_right","label-top":"dhxform_item_label_top","label-bottom":"dhxform_item_label_bottom",absolute:"dhxform_item_absolute"};this.align_css={left:"dhxform_label_align_left",center:"dhxform_label_align_center",right:"dhxform_label_align_right"};var g=this;this.setSkin=function(a){this.skin=a;this.cont.className="dhxform_obj_"+this.skin;this.cont.style.fontSize=(a=="dhx_terrace"?"13px":"12px");this._updateBlocks();this.forEachItem(function(o){var n=g.getItemType(o);if(typeof(g.items[n])!="undefined"&&typeof(g.items[n].setSkin)=="function"){g.doWithItem(o,"setSkin",a)}})};this.skin=(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_form")||"dhx_skyblue");this.separator=",";this.live_validate=false;this._type="checkbox";this._rGroup="default";this._idIndex={};this._indexId=[];this.cont=(typeof(l)=="object"?l:document.getElementById(l));if(!l._isNestedForm){this._parentForm=true;this.cont.style.fontSize=(this.skin=="dhx_terrace"?"13px":"12px");this.cont.className="dhxform_obj_"+this.skin;this.setFontSize=function(a){this.cont.style.fontSize=a;this._updateBlocks()};this.getForm=function(){return this};this.cont.onkeypress=function(n){n=(n||event);if(n.keyCode==13){var a=(n.target||n.srcElement);if(typeof(a.tagName)!="undefined"&&String(a.tagName).toLowerCase()=="textarea"&&!n.ctrlKey){return}g.callEvent("onEnter",[])}}}this.b_index=null;this.base=[];this._prepare=function(v,x){if(this.b_index==null){this.b_index=0}else{this.b_index++}var o=null;var n=null;if(x!=null){if(x<0){x=0}var s=0;for(var a=0;a<this.cont.childNodes.length;a++){for(var u=0;u<this.cont.childNodes[a].childNodes.length;u++){if(n==null&&this.cont.childNodes[a].childNodes[u]._isNestedForm!=true){if(s==x){o=this.cont.childNodes[a].nextSibling;n=this.cont.childNodes[a].childNodes[u]}s++}}}}this.base[this.b_index]=document.createElement("DIV");this.base[this.b_index].className="dhxform_base";if(typeof(v)!="undefined"){this.base[this.b_index].style.cssText+=" margin-left:"+v+"px!important;"}if(o!=null){this.cont.insertBefore(this.base[this.b_index],o);o=null}else{this.cont.appendChild(this.base[this.b_index])}if(n!=null){while(n!=null){var r=n;n=n.nextSibling;this.base[this.b_index].appendChild(r);r=null}}};this.setSizes=function(){};this._mergeSettings=function(v){var o=-1;var r={type:"settings"};for(var n in this.idef){r[n]=this.idef[n]}for(var s=0;s<v.length;s++){if(typeof(v[s])!="undefined"&&v[s].type=="settings"){for(var n in v[s]){r[n]=v[s][n]}o=s}}v[o>=0?o:v.length]=r;return v};this._genStr=function(a){var n="";var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=0;o<a;o++){n+=r.charAt(Math.floor(Math.random()*r.length))}return n};this.idPrefix="dhxForm_"+this._genStr(12)+"_";this._rId=(this._parentForm?this._genStr(12)+"_":l._rId);this.objPull={};this.itemPull={};this._ic=0;this._addItem=function(F,s,y,v,D,H,C){if(this.items[F]._index){this.getForm()._indexId.push(s);this.getForm()._idIndex[s]={ind:this.getForm()._indexId.length-1}}if(!F){F=this._type}if(F=="list"&&D!=null&&this.itemPull[this.idPrefix+D]!=null&&typeof(this.itemPull[this.idPrefix+D]._addSubListNode)=="function"){var E=this.itemPull[this.idPrefix+D]._addSubListNode()}else{if(F=="newcolumn"){var E={}}else{var u=this.base[this.b_index];var n=null;if(typeof(H)!="undefined"&&!isNaN(H)&&F!="list"){H=Math.max(parseInt(H),0)+1;for(var J=0;J<this.cont.childNodes.length;J++){for(var o=0;o<this.cont.childNodes[J].childNodes.length;o++){if(n==null&&this.cont.childNodes[J].childNodes[o]._isNestedForm!=true){H--;if(H==0){n=this.cont.childNodes[J].childNodes[o];u=this.cont.childNodes[J]}}}}}else{if(F=="list"){for(var I in this.itemPull){if(I==this.idPrefix+s){n=this.itemPull[I].nextSibling;if(this.itemPull[I]._listBase!=null&&this.itemPull[I]._listBase.length>0){n=this.itemPull[I]._listBase[this.itemPull[I]._listBase.length-1]}}}}}var E=document.createElement("DIV");if(C==true&&n!=null){n=n.nextSibling}if(n!=null){u.insertBefore(E,n)}else{u.appendChild(E)}}}E._idd=s;E._rId=this._rId;if(typeof(E.style)!="undefined"){if(typeof(y.offsetLeft)=="undefined"&&this.idef.offsetLeft>0){y.offsetLeft=this.idef.offsetLeft}if(typeof(y.offsetTop)=="undefined"&&this.idef.offsetTop>0){y.offsetTop=this.idef.offsetTop}var x="";if(typeof(y.offsetLeft)!="undefined"){x+=" padding-left:"+y.offsetLeft+"px!important;"}if(typeof(y.offsetTop)!="undefined"){x+=" padding-top:"+y.offsetTop+"px!important;"}E.style.cssText+=x}if(F=="block"){if(isNaN(y.blockOffset)){y.blockOffset=this.idef.blockOffset}}if(F=="list"){if(typeof(E._ofsNested)=="undefined"){E._ofsNested=this.idef_const.offsetNested}if(v!=null){E._sId=v}var A=this.items[F].render(E,this.skin);if(!this.itemPull[this.idPrefix+s]._listObj){this.itemPull[this.idPrefix+s]._listObj=[]}if(!this.itemPull[this.idPrefix+s]._list){this.itemPull[this.idPrefix+s]._list=[]}if(!this.itemPull[this.idPrefix+s]._listBase){this.itemPull[this.idPrefix+s]._listBase=[]}(this.itemPull[this.idPrefix+s]._listObj).push(A[0]);(this.itemPull[this.idPrefix+s]._list).push(A[1]);(this.itemPull[this.idPrefix+s]._listBase).push(E);A[1].checkEvent=function(a){return g.checkEvent(a)};A[1].callEvent=function(a,q){return g.callEvent(a,q)};A[1].getForm=function(){return g.getForm()};A[1]._initObj(this._mergeSettings(y));if(E._inBlcok){E.className+=" in_block"}return A[1]}if(F=="newcolumn"){this._prepare(y.offset,H);return}if(F=="label"&&this._ic++==0){y._isTopmost=true}y.position=this.apos_css[(!y.position||!this.apos_css[y.position]?this.idef.position:y.position)];E.className=y.position+(typeof(y.className)=="string"?" "+y.className:"");if(!y.labelWidth){y.labelWidth=this.idef.labelWidth}if(!y.labelHeight){y.labelHeight=this.idef.labelHeight}if(typeof(y.wrap)!="undefined"){y.wrap=window.dhx4.s2b(y.wrap)}y.labelAlign=(this.align_css[y.labelAlign]?this.align_css[y.labelAlign]:this.align_css[this.idef.labelAlign]);y.inputWidth=(y.width?y.width:(y.inputWidth?y.inputWidth:this.idef.inputWidth));if(!y.inputHeight){y.inputHeight=this.idef.inputHeight}if(typeof(y.note)!="undefined"){if(y.note.length!=null&&y.note[0]!=null){y.note=y.note[0]}if(typeof(y.note.width)=="undefined"){y.note.width=this.idef.noteWidth}if(y.note.width=="auto"){y.note.width=y.inputWidth}}E.checkEvent=function(a){return g.checkEvent(a)};E.callEvent=function(a,q){return g.callEvent(a,q)};E.getForm=function(){return g.getForm()};E._autoCheck=function(a){g._autoCheck(a)};if(typeof(y.readonly)=="string"){y.readonly=window.dhx4.s2b(y.readonly)}if(typeof(y.autoStart)=="string"){y.autoStart=window.dhx4.s2b(y.autoStart)}if(typeof(y.autoRemove)=="string"){y.autoRemove=window.dhx4.s2b(y.autoRemove)}if(typeof(y.titleScreen)=="string"){y.titleScreen=window.dhx4.s2b(y.titleScreen)}if(typeof(y.info)=="string"){y.info=window.dhx4.s2b(y.info)}if(typeof(y.hidden)=="string"){y.hidden=window.dhx4.s2b(y.hidden)}if(typeof(y.checked)=="string"){y.checked=window.dhx4.s2b(y.checked)}if(typeof(y.userdata)!="undefined"){for(var I in y.userdata){this.getForm().setUserData(s,I,y.userdata[I])}}if(y.validate){if(typeof(y.validate!="undefined")&&(typeof(y.validate)=="function"||typeof(window[y.validate])=="function")){E._validate=[y.validate]}else{E._validate=String(y.validate).split(this.separator)}}if(typeof(y.required)!="undefined"){if(typeof(y.required)=="string"){y.required=window.dhx4.s2b(y.required)}E._required=(y.required==true)}if(E._required){if(!E._validate){E._validate=[]}var r=false;for(o=0;o<E._validate.length;o++){r=(r||(E._validate[o]=="NotEmpty"))}if(!r){E._validate.push("NotEmpty")}}E._ll=(y.position==this.apos_css["label-left"]||y.position==this.apos_css["label-top"]);this.objPull[this.idPrefix+s]=this.items[F].render(E,y);this.itemPull[this.idPrefix+s]=E};this._initObj=function(s,o){if(typeof(s.data)!="undefined"){var u=null;if(typeof(o)!="undefined"){u=o.match(/(\?|\&)id\=([a-z0-9_\-]*)/i);if(u!=null&&u[0]!=null){u=u[0].split("=")[1]}}if(this.callEvent("onBeforeDataLoad",[u,window.dhx4._copyObj(s.data)])===true){this.formId=u;this._last_load_data=s;this.setFormData(s.data);this.resetDataProcessor("updated")}return}this._prepare();for(var r=0;r<s.length;r++){if(typeof(s[r])!="undefined"&&s[r].type=="settings"){for(var n in s[r]){this.idef[n]=s[r][n]}}}for(var r=0;r<s.length;r++){this._prepareItem(s[r])}this._autoCheck()};this._prepareItem=function(r,v,q){var o=(r!=null&&r.type!=null?r.type:"");if(this.items[o]){if(!r.name){r.name=this._genStr(12)}var u=r.name;if(this.objPull[this.idPrefix+u]!=null||o=="radio"){u=this._genStr(12)}var s=r;s.label=s.label||"";s.value=s.value;s.checked=window.dhx4.s2b(s.checked);s.disabled=window.dhx4.s2b(s.disabled);s.name=s.name||this._genStr(12);s.options=s.options||[];s.rows=s.rows||"none";s.uid=this._genStr(12);this._addItem(o,u,s,null,null,v,q);v=null;if(this._parentEnabled===false){this._disableItem(u)}for(var n=0;n<s.options.length;n++){if(s.options[n].list!=null){if(!s.options[n].value){s.options[n].value=this._genStr()}var a=this._addItem("list",u,s.options[n].list,s.options[n].value,null);a._subSelect=true;a._subSelectId=s.options[n].value}}if(r.list!=null){if(!r.listParent){r.listParent=s.name}var a=this._addItem("list",u,r.list,null,r.listParent)}}};this._xmlSubItems={item:"list",option:"options",note:"note",userdata:"_userdata"};this._xmlToObject=function(D,n){if(typeof(n)=="undefined"){n=true}if(n){var F=D.getElementsByTagName("items");F=(F!=null&&F[0]!=null?F[0]:null);var o=D.getElementsByTagName("data");o=(o!=null&&o[0]!=null?o[0]:null)}else{F=D}var A=(n?[]:{});if(F!=null){for(var s=0;s<F.childNodes.length;s++){if(typeof(F.childNodes[s].tagName)!="undefined"){var u=F.childNodes[s].tagName;if(this._xmlSubItems[u]!=null){var v=this._xmlSubItems[u];if(typeof(A[v])=="undefined"){A[v]=[]}var C=F.childNodes[s];var y={};for(var K=0;K<C.attributes.length;K++){var H=C.attributes[K].name;var E=C.attributes[K].value;y[H]=E}if(v=="note"){y.text=C.firstChild.nodeValue}if(v=="_userdata"){y.value=(C.firstChild!=null&&C.firstChild.nodeValue!=null?C.firstChild.nodeValue:"")}var x=this._xmlToObject(C,false);for(var I in x){if(I=="_userdata"){if(!y.userdata){y.userdata={}}for(var K=0;K<x[I].length;K++){y.userdata[x[I][K].name]=x[I][K].value}}else{y[I]=x[I]}}C=null;if(n){A.push(y)}else{A[v].push(y)}}}}}if(o!=null){A={data:{}};for(var s=0;s<o.childNodes.length;s++){if(typeof(o.childNodes[s].tagName)!="undefined"){var r=o.childNodes[s].tagName;var J=(o.childNodes[s].firstChild!=null?o.childNodes[s].firstChild.nodeValue:"");A.data[r]=J}}}return A};this._autoCheck=function(u){if(this._locked===true){u=false}else{if(typeof(u)=="undefined"){u=true}}for(var r in this.itemPull){var x=(u&&(this.itemPull[r]._udis!==true));this[x?"_enableItem":"_disableItem"](this.itemPull[r]._idd);if(this.getForm()._idIndex[this.itemPull[r]._idd]!=null){this.getForm()._idIndex[this.itemPull[r]._idd].enabled=x}var o=(x&&(typeof(this.itemPull[r]._checked)=="boolean"?this.itemPull[r]._checked:true));if(this.itemPull[r]._list){for(var A=0;A<this.itemPull[r]._list.length;A++){var y=true;if(this.itemPull[r]._list[A]._subSelect==true){y=false;var s=this.getItemValue(this.itemPull[r]._idd);if(!(typeof(s)=="object"&&typeof(s.length)=="number")){s=[s]}for(var n=0;n<s.length;n++){y=(s[n]==this.itemPull[r]._list[A]._subSelectId)||y}this.itemPull[r]._listObj[A][y?"show":"hide"](this.itemPull[r]._listBase[A])}this.itemPull[r]._list[A]._autoCheck(o&&y)}}}};this.doWithItem=function(r,n,y,x,w,v){if(typeof(r)=="object"){var C=r[0];var A=r[1];var D=null;var u=null;for(var s in this.itemPull){if((this.itemPull[s]._value==A||A===null)&&this.itemPull[s]._group==C){return this.objPull[s][n](this.itemPull[s],y,x,w,v)}if(this.itemPull[s]._list!=null&&!u){for(var o=0;o<this.itemPull[s]._list.length;o++){u=this.itemPull[s]._list[o].doWithItem(r,n,y,x,w)}}}if(u!=null){return u}else{if(n=="getType"){return this.doWithItem(r[0],"getType")}}}else{if(!this.itemPull[this.idPrefix+r]){var u=null;for(var s in this.itemPull){if(this.itemPull[s]._list&&!u){for(var o=0;o<this.itemPull[s]._list.length;o++){if(u==null){u=this.itemPull[s]._list[o].doWithItem(r,n,y,x,w,v)}}}}return u}else{return this.objPull[this.idPrefix+r][n](this.itemPull[this.idPrefix+r],y,x,w,v)}}};this._removeItem=function(n,a){if(a!=null){n=this.doWithItem([n,a],"destruct")}else{this.doWithItem(n,"destruct")}this._clearItemData(n)};this._clearItemData=function(r){if(this.itemPull[this.idPrefix+r]){r=this.idPrefix+r;try{this.objPull[r]=null;this.itemPull[r]=null;delete this.objPull[r];delete this.itemPull[r]}catch(o){}}else{for(var a in this.itemPull){if(this.itemPull[a]._list){for(var n=0;n<this.itemPull[a]._list.length;n++){this.itemPull[a]._list[n]._clearItemData(r)}}}}};this.isItem=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isExist")};this.getItemType=function(n,a){n=[n,(a||null)];return this.doWithItem(n,"getType")};this.forEachItem=function(o){for(var n in this.objPull){if(this.objPull[n].t=="radio"){o(this.itemPull[n]._group,this.itemPull[n]._value)}else{o(String(n).replace(this.idPrefix,""))}if(this.itemPull[n]._list){for(var r=0;r<this.itemPull[n]._list.length;r++){this.itemPull[n]._list[r].forEachItem(o)}}}};this.setItemLabel=function(o,a,n){if(n!=null){o=[o,a]}else{n=a}this.doWithItem(o,"setText",n)};this.getItemLabel=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"getText")};this._enableItem=function(a){this.doWithItem(a,"enable")};this._disableItem=function(a){this.doWithItem(a,"disable")};this._isItemEnabled=function(a){return this.doWithItem(a,"isEnabled")};this.checkItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"check");this._autoCheck()};this.uncheckItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"unCheck");this._autoCheck()};this.isItemChecked=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isChecked")};this.getCheckedValue=function(a){return this.doWithItem([a,null],"getChecked")};this._getRGroup=function(v,u){for(var n in this.itemPull){if(this.itemPull[n]._group==v&&(u==null||this.itemPull[n]._value==u)){return this.itemPull[n]._idd}if(this.itemPull[n]._list!=null){for(var s=0;s<this.itemPull[n]._list.length;s++){var o=this.itemPull[n]._list[s]._getRGroup(v,u);if(o!=null){return o}}}}return null};this.setItemValue=function(n,a){this.resetValidateCss(n,a);if(this.getItemType(n)=="radio"){if(this._getRGroup(n,a)!=null){this.checkItem(n,a)}else{this.uncheckItem(n,this.getCheckedValue(n))}return null}return this.doWithItem(n,"setValue",a)};this.getItemValue=function(n,a){if(this.getItemType(n)=="radio"){return this.getCheckedValue(n)}return this.doWithItem(n,"getValue",a)};this.updateValues=function(){this._updateValues()};this.showItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"show")};this.hideItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"hide")};this.isItemHidden=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isHidden")};this.getOptions=function(a){return this.doWithItem(a,"getOptions")};this.setItemWidth=function(n,a){this.doWithItem(n,"setWidth",a)};this.getItemWidth=function(a){return this.doWithItem(a,"getWidth")};this.setItemHeight=function(n,a){this.doWithItem(n,"setHeight",a)};this.setItemFocus=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"setFocus")};this._updateValues=function(){for(var n in this.itemPull){if(this.objPull[n]&&typeof(this.objPull[n].updateValue)=="function"){this.objPull[n].updateValue(this.itemPull[n])}if(this.itemPull[n]._list){for(var o=0;o<this.itemPull[n]._list.length;o++){this.itemPull[n]._list[o]._updateValues()}}}};this._getItemByName=function(u){for(var n in this.itemPull){if(this.itemPull[n]._idd==u){return this.itemPull[n]}if(this.itemPull[n]._list!=null){for(var s=0;s<this.itemPull[n]._list.length;s++){var o=this.itemPull[n]._list[s]._getItemByName(u);if(o!=null){return o}}}}return null};this._resetValidateCss=function(a){a.className=(a.className).replace(a._vcss,"");a._vcss=null};this.setValidateCss=function(a,q,o){var n=this[this.getItemType(a)=="radio"?"_getRGroup":"_getItemByName"](a);if(!n){return}if(n._vcss!=null){this._resetValidateCss(n)}n._vcss=(typeof(o)=="string"?o:"validate_"+(q===true?"ok":"error"));n.className+=" "+n._vcss};this.resetValidateCss=function(o){for(var n in this.itemPull){if(this.itemPull[n]._vcss!=null){this._resetValidateCss(this.itemPull[n])}if(this.itemPull[n]._list!=null){for(var r=0;r<this.itemPull[n]._list.length;r++){this.itemPull[n]._list[r].resetValidateCss()}}}};this.validate=function(n){if(this.callEvent("onBeforeValidate",[])==false){return}var a=true;this.forEachItem(function(q,r){if(typeof(r)!="undefined"){q=[q,r]}var o=g.doWithItem(q,"_validate");if(typeof(o)!="boolean"){o=true}a=o&&a});this.callEvent("onAfterValidate",[a]);return a};this.validateItem=function(a,n){if(typeof(n)!="undefined"){a=[a,n]}return this.doWithItem(a,"_validate")};this.enableLiveValidation=function(a){this.live_validate=(a==true)};this.setReadonly=function(n,a){this.doWithItem(n,"setReadonly",a)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};this.getFirstActive=function(n){for(var r=0;r<this._indexId.length;r++){var a=true;if(n==true){var o=this.getItemType(this._indexId[r]);if(!dhtmlXForm.prototype.items[o].setFocus){a=false}}if(a&&this._idIndex[this._indexId[r]].enabled){return this._indexId[r]}}return null};this.setFocusOnFirstActive=function(){var a=this.getFirstActive(true);if(a!=null){this.setItemFocus(a)}};this.enableItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"userEnable");this._autoCheck()};this.disableItem=function(n,a){if(a!=null){n=[n,a]}this.doWithItem(n,"userDisable");this._autoCheck()};this.isItemEnabled=function(n,a){if(a!=null){n=[n,a]}return this.doWithItem(n,"isUserEnabled")};this.clear=function(){var n={};this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");for(var o in this.itemPull){var r=this.itemPull[o]._idd;if(this.itemPull[o]._type=="ch"){this.uncheckItem(r)}if(this.itemPull[o]._type in {ta:1,editor:1,calendar:1,pw:1,hd:1}){this.setItemValue(r,"")}if(this.itemPull[o]._type=="combo"){this.itemPull[o]._apiChange=true;var w=this.getCombo(r);w.selectOption(0);w=null;this.itemPull[o]._apiChange=false}if(this.itemPull[o]._type=="se"){var u=this.getOptions(r);if(u.length>0){u[0].selected=true}}if(this.itemPull[o]._type=="ra"){var s=this.itemPull[o]._group;if(!n[s]){this.checkItem(s,this.doWithItem(r,"_getFirstValue"));n[s]=true}}if(this.itemPull[o]._list){for(var v=0;v<this.itemPull[o]._list.length;v++){this.itemPull[o]._list[v].clear()}}if(this["setFormData_"+this.itemPull[o]._type]){this["setFormData_"+this.itemPull[o]._type](r,"")}}n=null;if(this._parentForm){this._autoCheck()}this.resetValidateCss()};this.unload=function(){window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");for(var n in this.objPull){this._removeItem(String(n).replace(this.idPrefix,""))}if(this._ccTm){window.clearTimeout(this._ccTm)}this._formLS=null;for(var o=0;o<this.base.length;o++){while(this.base[o].childNodes.length>0){this.base[o].removeChild(this.base[o].childNodes[0])}if(this.base[o].parentNode){this.base[o].parentNode.removeChild(this.base[o])}this.base[o]=null}this.base=null;this.cont.onkeypress=null;this.cont.className="";this.cont=null;for(var n in this){this[n]=null}g=null};for(var c in this.items){this.items[c].t=c;if(typeof(this.items[c]._index)=="undefined"){this.items[c]._index=true}if(!this.items[c].show){this.items[c].show=function(a){a.style.display="";if(a._listObj){for(var n=0;n<a._listObj.length;n++){a._listObj[n].show(a._listBase[n])}}}}if(!this.items[c].hide){this.items[c].hide=function(a){a.style.display="none";if(a._listObj){for(var n=0;n<a._listObj.length;n++){a._listObj[n].hide(a._listBase[n])}}}}if(!this.items[c].isHidden){this.items[c].isHidden=function(a){return(a.style.display=="none")}}if(!this.items[c].userEnable){this.items[c].userEnable=function(a){a._udis=false}}if(!this.items[c].userDisable){this.items[c].userDisable=function(a){a._udis=true}}if(!this.items[c].isUserEnabled){this.items[c].isUserEnabled=function(a){return(a._udis!==true)}}if(!this.items[c].getType){this.items[c].getType=function(){return this.t}}if(!this.items[c].isExist){this.items[c].isExist=function(){return true}}if(!this.items[c]._validate){this.items[c]._validate=function(o){if(!o._validate||!o._enabled){return true}if(o._type=="ch"){var w=(this.isChecked(o)?this.getValue(o):0)}else{var w=this.getValue(o)}var n=true;for(var u=0;u<o._validate.length;u++){var a="is"+o._validate[u];if((w==null||w.length==0)&&a!="isNotEmpty"&&o._type!="container"){}else{var s=dhtmlxValidation[a];if(o._type=="container"&&typeof(s)=="function"){s=function(){return true}}if(typeof(s)!="function"&&typeof(o._validate[u])=="function"){s=o._validate[u]}if(typeof(s)!="function"&&typeof(window[o._validate[u]])=="function"){s=window[o._validate[u]]}n=((typeof(s)=="function"?s(w,o._idd):new RegExp(o._validate[u]).test(w))&&n);s=null}}if(!(o.callEvent("onValidate"+(n?"Success":"Error"),[o._idd,w,n])===false)){o.getForm().setValidateCss(o._idd,n)}return n}}}this._locked=false;this._doLock=function(n){var a=(n===true?true:false);if(this._locked==a){return}else{this._locked=a}this._autoCheck(!this._locked)};this.lock=function(){this._doLock(true)};this.unlock=function(){this._doLock(false)};this.isLocked=function(){return this._locked};this.setNumberFormat=function(q,n,a,o){return this.doWithItem(q,"setNumberFormat",n,a,o)};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObject","items",{struct:true,data:true});window.dhx4._eventable(this);this.attachEvent("_onButtonClick",function(a,n){this.callEvent("onButtonClick",[a,n])});this._updateBlocks=function(){this.forEachItem(function(a){if(g.getItemType(a)=="block"||g.getItemType(a)=="combo"){g.doWithItem(a,"_setCss",g.skin,g.cont.style.fontSize)}})};this._isObj=function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")};this._copyObj=function(q){if(this._isObj(q)){var o={};for(var n in q){if(typeof(q[n])=="object"&&q[n]!=null){o[n]=this._copyObj(q[n])}else{o[n]=q[n]}}}else{var o=[];for(var n=0;n<q.length;n++){if(typeof(q[n])=="object"&&q[n]!=null){o[n]=this._copyObj(q[n])}else{o[n]=q[n]}}}return o};if(j!=null&&typeof(j)=="object"){this._initObj(this._copyObj(j))}if(this._parentForm){this._updateBlocks()}this._ccActive=false;this._ccTm=null;return this}dhtmlXForm.prototype.getInput=function(a){return this.doWithItem(a,"getInput")};dhtmlXForm.prototype.getSelect=function(a){return this.doWithItem(a,"getSelect")};dhtmlXForm.prototype.items={};dhtmlXForm.prototype.items.checkbox={render:function(a,c){a._type="ch";a._enabled=true;a._checked=false;a._value=(typeof(c.value)=="undefined"?null:String(c.value));a._ro=(c.readonly==true);if(c._autoInputWidth!==false){c.inputWidth=14}this.doAddLabel(a,c);this.doAddInput(a,c,"INPUT","TEXT",true,true,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var g=document.createElement("DIV");g.className="dhxform_img chbx0";a.appendChild(g);if(!isNaN(c.inputLeft)){a.childNodes[a._ll?1:0].style.left=parseInt(c.inputLeft)+"px"}if(!isNaN(c.inputTop)){a.childNodes[a._ll?1:0].style.top=parseInt(c.inputTop)+"px"}a.childNodes[a._ll?1:0].appendChild(g);a.childNodes[a._ll?1:0].firstChild.value=String(c.value);a._updateImgNode=function(l,m){var j=l.childNodes[l._ll?1:0].lastChild;j.className=(m?"dhxform_actv_c":"dhxform_img")+" "+(l._checked?"chbx1":"chbx0");l=j=null};a._doOnFocus=function(j){j.getForm().callEvent("onFocus",[j._idd])};a._doOnBlur=function(j){j.getForm().callEvent("onBlur",[j._idd])};a._doOnKeyUpDown=function(l,j){this.callEvent(l,[this.childNodes[this._ll?0:1].childNodes[0],j,this._idd])};if(c.checked==true){this.check(a)}if(c.hidden==true){this.hide(a)}if(c.disabled==true){this.userDisable(a)}this.doAttachEvents(a);return this},destruct:function(a){a._doOnFocus=a._doOnBlur=a._updateImgNode=null;this.doUnloadNestedLists(a);this.doDestruct(a)},doAddLabel:function(c,g){var a=document.createElement("DIV");a.className="dhxform_label "+g.labelAlign;if(g.wrap==true){a.style.whiteSpace="normal"}if(c._ll){c.insertBefore(a,c.firstChild)}else{c.appendChild(a)}if(typeof(g.tooltip)!="undefined"){a.title=g.tooltip}a.innerHTML="<div class='dhxform_label_nav_link' onfocus='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,true);this.parentNode.parentNode._doOnFocus(this.parentNode.parentNode);' onblur='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,false);this.parentNode.parentNode._doOnBlur(this.parentNode.parentNode);' onkeypress='var e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;if(e.preventDefault)e.preventDefault();else e.returnValue=false;_dhxForm_doClick(this,\"mousedown\");return false;}' onkeyup='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyUp\",e);' onkeydown='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyDown\",e);' "+(window.dhx4.isIPad?"ontouchstart='var e=event;e.preventDefault();_dhxForm_doClick(this,\"mousedown\");' ":"")+"role='link' tabindex='0'>"+g.label+(g.info?"<span class='dhxform_info'>[?]</span>":"")+(c._required?"<span class='dhxform_item_required'>*</span>":"")+"</div>";if(!isNaN(g.labelWidth)){a.firstChild.style.width=parseInt(g.labelWidth)+"px"}if(!isNaN(g.labelHeight)){a.firstChild.style.height=parseInt(g.labelHeight)+"px"}if(!isNaN(g.labelLeft)){a.style.left=parseInt(g.labelLeft)+"px"}if(!isNaN(g.labelTop)){a.style.top=parseInt(g.labelTop)+"px"}},doAddInput:function(C,E,g,m,n,y,r){var x=document.createElement("DIV");x.className="dhxform_control";if(C._ll){C.appendChild(x)}else{C.insertBefore(x,C.firstChild)}var v=document.createElement(g);v.className=r;v.name=C._idd;v._idd=C._idd;v.id=E.uid;if(typeof(m)=="string"){v.type=m}if(g=="INPUT"||g=="TEXTAREA"){v.onkeyup=function(u){u=u||event;C.callEvent("onKeyUp",[this,u,this._idd])};v.onkeydown=function(u){u=u||event;C.callEvent("onKeyDown",[this,u,this._idd])}}x.appendChild(v);if(E.readonly){this.setReadonly(C,true)}if(E.hidden==true){this.hide(C)}if(E.disabled==true){this.userDisable(C)}if(n){if(!isNaN(E.inputLeft)){x.style.left=parseInt(E.inputLeft)+"px"}if(!isNaN(E.inputTop)){x.style.top=parseInt(E.inputTop)+"px"}}var s="";var l=false;if(y){if(!isNaN(E.inputWidth)){s+="width:"+parseInt(E.inputWidth)+"px;";l=true}if(!isNaN(E.inputHeight)){s+="height:"+parseInt(E.inputHeight)+"px;"}}if(typeof(E.style)=="string"){s+=E.style}v.style.cssText=s;if(E.maxLength){v.setAttribute("maxLength",E.maxLength)}if(E.connector){v.setAttribute("connector",E.connector)}var A=(dhtmlXForm.prototype.items[this.t]!=null?dhtmlXForm.prototype.items[this.t]._dimFix==true:false);if(l&&({input:1,password:1,select:1,multiselect:1,calendar:1,colorpicker:1}[this.t]==1||A)){if(dhtmlXForm.prototype.items[this.t]._dim==null){var c=document.createElement("DIV");c.className="dhxform_dim_test_"+C.getForm().skin;document.body.appendChild(c);var a=x.parentNode;var D=x.nextSibling;c.appendChild(x);var q=parseInt(v.style.width);var o=(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?v.offsetWidth:v.clientWidth);dhtmlXForm.prototype.items[this.t]._dim=o-q;if(D!=null){a.insertBefore(x,D)}else{a.appendChild(x)}c.parentNode.removeChild(c);a=D=c=null}v.style.width=parseInt(v.style.width)-dhtmlXForm.prototype.items[this.t]._dim+"px"}if(typeof(E.note)=="object"){var j=document.createElement("DIV");j.className="dhxform_note";j.style.width=(isNaN(E.note.width)?v.offsetWidth:parseInt(E.note.width))+"px";j._w=E.note.width;j.innerHTML=E.note.text;x.appendChild(j);j=null}},doUnloadNestedLists:function(a){if(!a._list){return}for(var c=0;c<a._list.length;c++){a._list[c].unload();a._list[c]=null;a._listObj[c]=null;a._listBase[c].parentNode.removeChild(a._listBase[c]);a._listBase[c]=null}a._list=null;a._listObj=null;a._listBase=null},doDestruct:function(a){a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._group=null;a.onselectstart=null;a.childNodes[a._ll?1:0].onmousedown=null;a.childNodes[a._ll?1:0].ontouchstart=null;a.childNodes[a._ll?0:1].onmousedown=null;a.childNodes[a._ll?0:1].ontouchstart=null;a.childNodes[a._ll?0:1].childNodes[0].onfocus=null;a.childNodes[a._ll?0:1].childNodes[0].onblur=null;a.childNodes[a._ll?0:1].childNodes[0].onkeypress=null;a.childNodes[a._ll?0:1].childNodes[0].onkeyup=null;a.childNodes[a._ll?0:1].childNodes[0].onkeydown=null;a.childNodes[a._ll?0:1].childNodes[0].onmousedown=null;a.childNodes[a._ll?0:1].childNodes[0].ontouchstart=null;a.childNodes[a._ll?0:1].removeChild(a.childNodes[a._ll?0:1].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAttachEvents:function(c){var a=this;c.childNodes[c._ll?1:0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}var g=(j.target||j.srcElement);if(!this.parentNode._enabled||this.parentNode._ro||(typeof(g.className)!="undefined"&&g.className=="dhxform_note")){j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}a.doClick(this.parentNode)};c.childNodes[c._ll?0:1].childNodes[0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}if(!this.parentNode.parentNode._enabled){j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}var g=j.target||j.srcElement;if(typeof(g.className)!="undefined"&&g.className=="dhxform_info"){this.parentNode.parentNode.callEvent("onInfo",[this.parentNode.parentNode._idd]);j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}a.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();if(!a._enabled||a._ro){return}if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._checked])!==true){return}}this.setChecked(a,!a._checked);a._autoCheck();a.callEvent("onChange",[a._idd,a._value,a._checked])},doCheckValue:function(a){if(a._checked&&a._enabled){a.childNodes[a._ll?1:0].firstChild.name=String(a._idd);a.childNodes[a._ll?1:0].firstChild.value=this.getValue(a)}else{a.childNodes[a._ll?1:0].firstChild.name="";a.childNodes[a._ll?1:0].firstChild.value=""}},setChecked:function(a,c){a._checked=(c===true?true:false);a.childNodes[a._ll?1:0].lastChild.className=a.childNodes[a._ll?1:0].lastChild.className.replace(/chbx[0-1]{1}/gi,"")+(a._checked?" chbx1":" chbx0");this.doCheckValue(a)},check:function(a){this.setChecked(a,true)},unCheck:function(a){this.setChecked(a,false)},isChecked:function(a){return a._checked},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=0;a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("disabled");this.doCheckValue(a)},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;if(a._updateImgNode!=null){a._updateImgNode(a,false)}a.childNodes[a._ll?0:1].childNodes[0].tabIndex=-1;a.childNodes[a._ll?0:1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,c){a.childNodes[a._ll?0:1].childNodes[0].innerHTML=c+(a._required?"<span class='dhxform_item_required'>*</span>":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},setValue:function(a,c){this.setChecked(a,(c===true||parseInt(c)==1||c=="true"||a._value===c))},getValue:function(a,c){if(c=="realvalue"){return a._value}return((typeof(a._value)=="undefined"||a._value==null)?(a._checked?1:0):a._value)},setReadonly:function(a,c){a._ro=(c===true)},isReadonly:function(a){return a._ro},setFocus:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus()}};dhtmlXForm.prototype.items.radio={input:{},r:{},firstValue:{},render:function(g,j,c){g._type="ra";g._enabled=true;g._checked=false;g._group=j.name;g._value=j.value;g._uid=c;g._ro=(j.readonly==true);g._rName=g._rId+g._group;this.r[g._idd]=g;j.inputWidth=14;this.doAddLabel(g,j);this.doAddInput(g,j,"INPUT","TEXT",true,true,"dhxform_textarea");g.childNodes[g._ll?1:0].className+=" dhxform_img_node";var l=document.createElement("DIV");l.className="dhxform_img rdbt0";g.appendChild(l);if(!isNaN(j.inputLeft)){g.childNodes[g._ll?1:0].style.left=parseInt(j.inputLeft)+"px"}if(!isNaN(j.inputTop)){g.childNodes[g._ll?1:0].style.top=parseInt(j.inputTop)+"px"}g.childNodes[g._ll?1:0].appendChild(l);g.childNodes[g._ll?1:0].firstChild.name="";g.childNodes[g._ll?1:0].firstChild.value="";g._updateImgNode=function(n,o){var m=n.childNodes[n._ll?1:0].lastChild;m.className=(o?"dhxform_actv_r":"dhxform_img")+" "+(n._checked?"rdbt1":"rdbt0");n=m=null};g._doOnFocus=function(m){m.getForm().callEvent("onFocus",[m._group,m._value])};g._doOnBlur=function(m){m.getForm().callEvent("onBlur",[m._group,m._value])};g._doOnKeyUpDown=function(n,m){this.callEvent(n,[this.childNodes[this._ll?0:1].childNodes[0],m,this._group,this._value])};if(this.input[g._rName]==null){var a=document.createElement("INPUT");a.type="HIDDEN";a.name=j.name;a.firstValue=g._value;g.appendChild(a);this.input[g._rName]=a}if(!this.firstValue[g._rName]){this.firstValue[g._rName]=j.value}if(j.checked==true){this.check(g)}if(j.hidden==true){this.hide(g)}if(j.disabled==true){this.userDisable(g)}this.doAttachEvents(g);return this},destruct:function(j,l){if(j.lastChild==this.input[j._rName]){var g=false;for(var c in this.r){if(!g&&this.r[c]._group==j._group&&this.r[c]._idd!=j._idd){this.r[c].appendChild(this.input[j._rName]);g=true}}if(!g){this.input[j._rName].parentNode.removeChild(this.input[j._rName]);this.input[j._rName]=null;this.firstValue[j._rName]=null}}var m=j._idd;j._doOnFocus=j._doOnBlur=j._updateImgNode=null;this.doUnloadNestedLists(j);this.doDestruct(j);return m},doClick:function(c){c.childNodes[c._ll?0:1].childNodes[0].focus();if(!(c._enabled&&!c._checked)){return}if(c._ro){return}var a=[c._group,c._value,true];if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",a)!==true){return}}this.setChecked(c,true);c.getForm()._autoCheck();c.callEvent("onChange",a)},doCheckValue:function(g){var j=null;for(var c in this.r){if(this.r[c]._checked&&this.r[c]._group==g._group&&this.r[c]._rId==g._rId){j=this.r[c]._value}}if(j!=null&&this.r[c]._enabled){this.input[g._rName].name=String(g._group);this.input[g._rName].value=j}else{this.input[g._rName].name="";this.input[g._rName].value=""}this.input[g._rName]._value=j},setChecked:function(l,m){m=(m===true);for(var c in this.r){if(this.r[c]._group==l._group&&this.r[c]._rId==l._rId){var j=false;if(this.r[c]._idd==l._idd){if(this.r[c]._checked!=m){this.r[c]._checked=m;j=true}}else{if(this.r[c]._checked){this.r[c]._checked=false;j=true}}if(j){var g=this.r[c].childNodes[this.r[c]._ll?1:0].childNodes[1];g.className=g.className.replace(/rdbt[0-1]{1}/gi,"")+(this.r[c]._checked?" rdbt1":" rdbt0");g=null}}}this.doCheckValue(l)},getChecked:function(a){return this.input[a._rName]._value},_getFirstValue:function(a){return this.firstValue[a._rName]},_getId:function(a){return a._idd},setValue:function(a,c){}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doDestruct:1,doUnloadNestedLists:1,doAttachEvents:1,check:1,unCheck:1,isChecked:1,enable:1,disable:1,isEnabled:1,setText:1,getText:1,getValue:1,setReadonly:1,isReadonly:1,setFocus:1}){dhtmlXForm.prototype.items.radio[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.select={render:function(a,c){a._type="se";a._enabled=true;a._value=null;a._newValue=null;this.doAddLabel(a,c);this.doAddInput(a,c,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,c);if(c.connector!=null){this.doLoadOptsConnector(a,c.connector)}if(typeof(c.value)!="undefined"&&c.value!=null){this.setValue(a,c.value)}return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._newValue=null;a.onselectstart=null;a.childNodes[a._ll?1:0].childNodes[0].onclick=null;a.childNodes[a._ll?1:0].childNodes[0].onkeydown=null;a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a.childNodes[a._ll?1:0].childNodes[0].onfocus=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;a.childNodes[a._ll?1:0].childNodes[0].onkeyup=null;a.childNodes[a._ll?1:0].removeChild(a.childNodes[a._ll?1:0].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAddLabel:function(c,g){var a=document.createElement("DIV");a.className="dhxform_label "+g.labelAlign;a.innerHTML="<label for='"+g.uid+"'>"+g.label+(g.info?"<span class='dhxform_info'>[?]</span>":"")+(c._required?"<span class='dhxform_item_required'>*</span>":"")+"</label>";if(g.wrap==true){a.style.whiteSpace="normal"}if(typeof(g.tooltip)!="undefined"){a.title=g.tooltip}c.appendChild(a);if(typeof(g.label)=="undefined"||g.label==null||g.label.length==0){a.style.display="none"}if(!isNaN(g.labelWidth)){a.style.width=parseInt(g.labelWidth)+"px"}if(!isNaN(g.labelHeight)){a.style.height=parseInt(g.labelHeight)+"px"}if(!isNaN(g.labelLeft)){a.style.left=parseInt(g.labelLeft)+"px"}if(!isNaN(g.labelTop)){a.style.top=parseInt(g.labelTop)+"px"}if(g.info){a.onclick=function(l){l=l||event;var j=l.target||l.srcElement;if(typeof(j.className)!="undefined"&&j.className=="dhxform_info"){this.parentNode.callEvent("onInfo",[this.parentNode._idd]);l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false}}}},doAttachEvents:function(g){var a=g.childNodes[g._ll?1:0].childNodes[0];var c=this;a.onclick=function(){c.doOnChange(this)};a.onkeydown=function(j){j=j||event;c.doOnChange(this);this.parentNode.parentNode.callEvent("onKeyDown",[this,j,this.parentNode.parentNode._idd])};a.onchange=function(){c.doOnChange(this)};a.onkeyup=function(j){j=j||event;this.parentNode.parentNode.callEvent("onKeyUp",[this,j,this.parentNode.parentNode._idd])};a=null;this.doAttachChangeLS(g)},doAttachChangeLS:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];a.onfocus=function(){var g=this.parentNode.parentNode;g.getForm()._ccActivate(g._idd,this,g.getForm().getItemValue(g._idd,true));g.getForm().callEvent("onFocus",[g._idd]);g=null};a.onblur=function(){var g=this.parentNode.parentNode;g.getForm()._ccDeactivate(g._idd);g.getForm().callEvent("onBlur",[g._idd]);g=null};a=null},doValidate:function(a){if(a.getForm().live_validate){this._validate(a)}},doLoadOpts:function(n,l,r){var o=n.childNodes[n._ll?1:0].childNodes[0];var a=l.options;var j=false;for(var c=0;c<a.length;c++){var m=a[c].text||a[c].label;if(!m||typeof(m)=="undefined"){m=""}var g=new Option(m,a[c].value);if(typeof(a[c].img_src)=="string"){g.setAttribute("img_src",a[c].img_src)}o.options.add(g);if(typeof(a[c].selected)!="undefined"&&window.dhx4.s2b(a[c].selected)==true){g.selected=true;n._value=a[c].value;j=true}if(typeof(a[c].checked)!="undefined"&&window.dhx4.s2b(a[c].checked)==true){g.setAttribute("checked","1")}if(typeof(a[c].img)!="undefined"){g.setAttribute("img",a[c].img)}if(typeof(a[c].img_dis)!="undefined"){g.setAttribute("img_dis",a[c].img_dis)}}if(!j&&o.selectedIndex>=0){n._value=o.options[o.selectedIndex].value}if(r===true){n.callEvent("onOptionsLoaded",[n._idd])}this._checkNoteWidth(n)},doLoadOptsConnector:function(g,a){var c=this;g._connector_working=true;window.dhx4.ajax.get(a,function(n){n=n.xmlDoc.responseXML;if(n==null){return}var j=n.getElementsByTagName("data");if(j==null||j[0]==null){return}j=j[0];var m=[];for(var o=0;o<j.childNodes.length;o++){if(typeof(j.childNodes[o].tagName)!="undefined"&&String(j.childNodes[o].tagName).toLowerCase()=="item"){var l=j.childNodes[o];m.push({label:l.getAttribute("label"),value:l.getAttribute("value"),selected:(l.getAttribute("selected")!=null)});l=null}}c.doLoadOpts(g,{options:m},true);g._connector_working=false;if(g._connector_value!=null){c.setValue(g,g._connector_value);g._connector_value=null}c=g=null})},doOnChange:function(g){var a=g.parentNode.parentNode;a._newValue=(g.selectedIndex>=0?g.options[g.selectedIndex].value:null);if(a._newValue!=a._value){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._newValue])!==true){for(var c=0;c<g.options.length;c++){if(g.options[c].value==a._value){g.options[c].selected=true}}return}}a._value=a._newValue;a.callEvent("onChange",[a._idd,a._value]);if(a._type=="se"&&a.getForm().live_validate){this._validate(a)}}a._autoCheck()},setText:function(a,c){if(!c){c=""}a.childNodes[a._ll?0:1].childNodes[0].innerHTML=c+(a._required?"<span class='dhxform_item_required'>*</span>":"");a.childNodes[a._ll?0:1].style.display=(c.length==0||c==null?"none":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("disabled")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?1:0].childNodes[0].setAttribute("disabled",true)},getOptions:function(a){return a.childNodes[a._ll?1:0].childNodes[0].options},setValue:function(c,j){if(c._connector_working){c._connector_value=j;return}var a=this.getOptions(c);for(var g=0;g<a.length;g++){if(a[g].value==j){a[g].selected=true;c._value=a[g].value}}if(c._list!=null&&c._list.length>0){c.getForm()._autoCheck()}c.getForm()._ccReload(c._idd,c._value)},getValue:function(g){var a=-1;var c=this.getOptions(g);for(var j=0;j<c.length;j++){if(c[j].selected){a=c[j].value}}return a},setWidth:function(c,a){c.childNodes[c._ll?1:0].childNodes[0].style.width=a+"px"},getSelect:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setFocus:function(a){a.childNodes[a._ll?1:0].childNodes[0].focus()},_checkNoteWidth:function(c){var a;if(c.childNodes[c._ll?1:0].childNodes[1]!=null){a=c.childNodes[c._ll?1:0].childNodes[1];if(a.className!=null&&a.className.search(/dhxform_note/gi)>=0&&a._w=="auto"){a.style.width=c.childNodes[c._ll?1:0].childNodes[0].offsetWidth+"px"}}a=null}};(function(){for(var c in {doAddInput:1,doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.select[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(j,m,n){var c=j.childNodes[j._ll?1:0].childNodes[0];c.multiple=true;if(!isNaN(m.size)){c.size=Number(m.size)}j._value=[];j._newValue=[];var g=m.options;for(var l=0;l<g.length;l++){var a=new Option(g[l].text||g[l].label,g[l].value);c.options.add(a);if(g[l].selected==true||g[l].selected=="true"){a.selected=true;j._value.push(g[l].value)}}if(n===true){j.callEvent("onOptionsLoaded",[j._idd])}this._checkNoteWidth(j)},doAttachEvents:function(g){var a=g.childNodes[g._ll?1:0].childNodes[0];var c=this;a.onfocus=function(){c.doOnChange(this);var j=this.parentNode.parentNode;j.getForm().callEvent("onFocus",[j._idd]);j=null};a.onblur=function(){c.doOnChange(this);var j=this.parentNode.parentNode;j.getForm().callEvent("onBlur",[j._idd]);j=null};a.onclick=function(){c.doOnChange(this);var j=this.parentNode.parentNode;j._autoCheck();j=null}},doOnChange:function(j){var c=j.parentNode.parentNode;c._newValue=[];for(var g=0;g<j.options.length;g++){if(j.options[g].selected){c._newValue.push(j.options[g].value)}}if((c._value).sort().toString()!=(c._newValue).sort().toString()){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,c._newValue])!==true){var a={};for(var g=0;g<c._value.length;g++){a[c._value[g]]=true}for(var g=0;g<j.options.length;g++){j.options[g].selected=(a[j.options[g].value]==true)}a=null;return}}c._value=[];for(var g=0;g<c._newValue.length;g++){c._value.push(c._newValue[g])}c.callEvent("onChange",[c._idd,c._value])}c._autoCheck()},setValue:function(g,l){var a={};if(typeof(l)=="string"){l=l.split(",")}if(typeof(l)!="object"){l=[l]}for(var j=0;j<l.length;j++){a[l[j]]=true}var c=this.getOptions(g);for(var j=0;j<c.length;j++){c[j].selected=(a[c[j].value]==true)}g._autoCheck()},getValue:function(g){var a=[];var c=this.getOptions(g);for(var j=0;j<c.length;j++){if(c[j].selected){a.push(c[j].value)}}return a}};(function(){for(var c in dhtmlXForm.prototype.items.select){if(!dhtmlXForm.prototype.items.multiselect[c]){dhtmlXForm.prototype.items.multiselect[c]=dhtmlXForm.prototype.items.select[c]}}})();dhtmlXForm.prototype.items.input={render:function(m,n){var l=(!isNaN(n.rows));m._type="ta";m._enabled=true;this.doAddLabel(m,n);this.doAddInput(m,n,(l?"TEXTAREA":"INPUT"),(l?null:"TEXT"),true,true,"dhxform_textarea");this.doAttachEvents(m);if(l){m.childNodes[m._ll?1:0].childNodes[0].rows=Number(n.rows)+(window.dhx4.isIE6?1:0)}if(typeof(n.numberFormat)!="undefined"){var j,g=null,o=null;if(typeof(n.numberFormat)!="string"){j=n.numberFormat[0];g=n.numberFormat[1]||null;o=n.numberFormat[2]||null}else{j=n.numberFormat;if(typeof(n.groupSep)=="string"){g=n.groupSep}if(typeof(n.decSep)=="string"){o=n.decSep}}this.setNumberFormat(m,j,g,o,false)}this.setValue(m,n.value);return this},doAttachEvents:function(c){var a=this;if(c._type=="ta"||c._type=="se"||c._type=="pw"){c.childNodes[c._ll?1:0].childNodes[0].onfocus=function(){var g=this.parentNode.parentNode;if(g._df!=null){this.value=g._value||""}g.getForm()._ccActivate(g._idd,this,this.value);g.getForm().callEvent("onFocus",[g._idd]);g=null}}c.childNodes[c._ll?1:0].childNodes[0].onblur=function(){var g=this.parentNode.parentNode;g.getForm()._ccDeactivate(g._idd);a.updateValue(g,true);if(g.getForm().live_validate){a._validate(g)}g.getForm().callEvent("onBlur",[g._idd]);g=null}},updateValue:function(l,a){var m=l.childNodes[l._ll?1:0].childNodes[0].value;var j=l.getForm();var c=(j._ccActive==true&&j._formLS!=null&&j._formLS[l._idd]!=null);j=null;if(!c&&l._df!=null&&m==window.dhx4.template._getFmtValue(l._value,l._df)){return}if(!a&&l._df!=null&&l._value==m&&m==window.dhx4.template._getFmtValue(m,l._df)){return}var g=this;if(l._value!=m){if(l.checkEvent("onBeforeChange")){if(l.callEvent("onBeforeChange",[l._idd,l._value,m])!==true){if(l._df!=null){g.setValue(l,l._value)}else{l.childNodes[l._ll?1:0].childNodes[0].value=l._value}return}}if(l._df!=null&&a){g.setValue(l,m)}else{l._value=m}l.callEvent("onChange",[l._idd,m]);return}if(l._df!=null&&a){this.setValue(l,l._value)}},setValue:function(g,j){g._value=(typeof(j)!="undefined"&&j!=null?j:"");var c=(String(g._value)||"");var a=g.childNodes[g._ll?1:0].childNodes[0];if(g._df!=null){c=window.dhx4.template._getFmtValue(c,g._df)}if(a.value!=c){a.value=c;g.getForm()._ccReload(g._idd,c)}a=null},getValue:function(a){var c=a.getForm();if(c._formLS&&c._formLS[a._idd]!=null){this.updateValue(a)}c=null;return(typeof(a._value)!="undefined"&&a._value!=null?a._value:"")},setReadonly:function(a,c){a._ro=(c===true);if(a._ro){a.childNodes[a._ll?1:0].childNodes[0].setAttribute("readOnly","true")}else{a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("readOnly")}},isReadonly:function(a){if(!a._ro){a._ro=false}return a._ro},getInput:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setNumberFormat:function(j,l,g,m,c){if(typeof(c)!="boolean"){c=true}if(l==""){j._df=null;if(c){this.setValue(j,j._value)}return true}if(typeof(l)!="string"){return}var a=window.dhx4.template._parseFmt(l,g,m);if(a==false){return false}else{j._df=a}if(c){this.setValue(j,j._value)}return true}};(function(){for(var c in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setFocus:1}){dhtmlXForm.prototype.items.input[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype.items.password={render:function(a,c){a._type="pw";a._enabled=true;this.doAddLabel(a,c);this.doAddInput(a,c,"INPUT","PASSWORD",true,true,"dhxform_textarea");this.doAttachEvents(a);this.setValue(a,c.value);return this}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doAttachEvents:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,setValue:1,getValue:1,updateValue:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.password[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.file={render:function(g,j){g._type="fl";g._enabled=true;this.doAddLabel(g,j);this.doAddInput(g,j,"INPUT","FILE",true,false,"dhxform_textarea");var a=g.childNodes[g._ll?1:0].childNodes[0];var c=this;a.onfocus=function(){var l=this.parentNode.parentNode;l.getForm().callEvent("onFocus",[l._idd]);l=null};a.onblur=function(){var l=this.parentNode.parentNode;if(l.getForm().live_validate){c._validate(l)}l.getForm().callEvent("onBlur",[l._idd]);l=null};a=null;g.childNodes[g._ll?1:0].childNodes[0].onchange=function(){g.callEvent("onChange",[g._idd,this.value])};return this},setValue:function(){},getValue:function(a){return a.childNodes[a._ll?1:0].childNodes[0].value}};(function(){for(var c in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,getInput:1,enable:1,disable:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.file[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.label={_index:false,render:function(c,g){c._type="lb";c._enabled=true;c._checked=true;var a=document.createElement("DIV");a.className="dhxform_txt_label2"+(g._isTopmost?" topmost":"");a.innerHTML=g.label;c.appendChild(a);if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}if(!isNaN(g.labelWidth)){a.style.width=parseInt(g.labelWidth)+"px"}if(!isNaN(g.labelHeight)){a.style.height=parseInt(g.labelHeight)+"px"}if(!isNaN(g.labelLeft)){a.style.left=parseInt(g.labelLeft)+"px"}if(!isNaN(g.labelTop)){a.style.top=parseInt(g.labelTop)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._autoCheck=null;a._enabled=null;a._type=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.onselectstart=null;a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false},setText:function(a,c){a.firstChild.innerHTML=c},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.label[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.button={render:function(g,j){g._type="bt";g._enabled=true;g._name=j.name;g.className=String(g.className).replace("item_label_top","item_label_left").replace("item_label_right","item_label_left");if(!isNaN(j.width)){var a=Math.max(j.width,10)}var c=(typeof(a)!="undefined");g._doOnKeyUpDown=function(m,l){this.callEvent(m,[this.childNodes[0].childNodes[0],l,this._idd])};g.innerHTML='<div class="dhxform_btn" role="link" tabindex="0" dir="ltr"><div class="dhxform_btn_txt" '+(c?' style="width:'+a+'px;"':"")+">"+j.value+'</div><div class="dhxform_btn_filler" disabled="true"></div></div>';if(!isNaN(j.inputLeft)){g.childNodes[0].style.left=parseInt(j.inputLeft)+"px"}if(!isNaN(j.inputTop)){g.childNodes[0].style.top=parseInt(j.inputTop)+"px"}if(j.hidden==true){this.hide(g)}if(j.disabled==true){this.userDisable(g)}if(typeof(j.tooltip)!="undefined"){g.firstChild.title=j.tooltip}g.onselectstart=function(l){l=l||event;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.firstChild.onselectstart=function(l){l=l||event;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}return false};g.firstChild.onkeypress=function(l){l=l||event;if((l.keyCode==32||l.charCode==32||l.keyCode==13||l.charCode==13)&&!this.parentNode._busy){this.parentNode._busy=true;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"]);return false}};g.firstChild.onfocus=function(){this.parentNode._doOnFocus(this.parentNode)};g.firstChild.onblur=function(){_dhxForm_doClick(this.childNodes[0],"mouseout");this.parentNode._doOnBlur(this.parentNode)};g.firstChild.onkeyup=function(l){this.parentNode._doOnKeyUpDown("onKeyUp",l||event)};g.firstChild.onkeydown=function(l){this.parentNode._doOnKeyUpDown("onKeyDown",l||event)};g.firstChild.onmouseover=function(){var l=this.parentNode;if(!l._enabled){return}this._isOver=true;this.className="dhxform_btn dhxform_btn_over";l=null};g.firstChild.onmouseout=function(){var l=this.parentNode;if(!l._enabled){return}this.className="dhxform_btn";this._allowClick=false;this._pressed=false;this._isOver=false;l=null};g.firstChild.ontouchstart=g.firstChild.onmousedown=function(m){m=m||event;if(m.type=="touchstart"&&m.preventDefault){m.preventDefault()}if(m.button>=2){return}if(this._pressed){return}var l=this.parentNode;if(!l._enabled){return}this.className="dhxform_btn dhxform_btn_pressed";this._allowClick=true;this._pressed=true;l=null};g.firstChild.ontouchend=g.firstChild.onmouseup=function(m){m=m||event;if(m.button>=2){return}if(!this._pressed){return}var l=this.parentNode;if(!l._enabled){return}l._busy=false;this.className="dhxform_btn"+(this._isOver?" dhxform_btn_over":"");if(this._pressed&&this._allowClick){l.callEvent("_onButtonClick",[l._name,l._cmd])}this._allowClick=false;this._pressed=false;l=null};g._doOnFocus=function(l){l.getForm().callEvent("onFocus",[l._idd])};g._doOnBlur=function(l){l.getForm().callEvent("onBlur",[l._idd])};return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._type=null;a._enabled=null;a._cmd=null;a._name=null;a._doOnFocus=null;a._doOnBlur=null;a._doOnKeyUpDown=null;a.onselectstart=null;a.firstChild.onselectstart=null;a.firstChild.onkeypress=null;a.firstChild.ontouchstart=null;a.firstChild.ontouchend=null;a.firstChild.onfocus=null;a.firstChild.onblur=null;a.firstChild.onkeyup=null;a.firstChild.onkeydown=null;a.firstChild.onmouseover=null;a.firstChild.onmouseout=null;a.firstChild.onmousedown=null;a.firstChild.onmouseup=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[0].removeAttribute("disabled");a.childNodes[0].setAttribute("role","link");a.childNodes[0].setAttribute("tabIndex","0")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[0].setAttribute("disabled","true");a.childNodes[0].removeAttribute("role");a.childNodes[0].removeAttribute("tabIndex")},setText:function(a,c){a.childNodes[0].childNodes[0].innerHTML=c},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},setFocus:function(a){a.childNodes[0].focus()}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.button[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.hidden={_index:false,render:function(c,g){c.style.display="none";c._name=g.name;c._type="hd";c._enabled=true;var a=document.createElement("INPUT");a.type="HIDDEN";a.name=g.name;a.value=(g.value||"");c.appendChild(a);return this},destruct:function(a){this.doUnloadNestedLists(a);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a._autoCheck=null;a._name=null;a._type=null;a._enabled=null;a.onselectstart=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.parentNode.removeChild(a);a=null},enable:function(a){a._enabled=true;a.childNodes[0].setAttribute("name",a._name)},disable:function(a){a._enabled=false;a.childNodes[0].removeAttribute("name")},show:function(){},hide:function(){},isHidden:function(){return true},setValue:function(a,c){a.childNodes[0].value=c},getValue:function(a){return a.childNodes[0].value},getInput:function(a){return a.childNodes[0]}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.hidden[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.list={_index:false,render:function(a,c){a._type="list";a._enabled=true;a._isNestedForm=true;a.style.paddingLeft=a._ofsNested+"px";a.className="dhxform_base_nested"+(a._custom_css||"");return[this,new dhtmlXForm(a,null,c)]},destruct:function(a){}};dhtmlXForm.prototype.items.fieldset={_index:false,render:function(c,j){c._type="fs";if(typeof(parseInt(j.inputWidth))=="number"){}c._width=j.width;c._enabled=true;c._checked=true;c.className="fs_"+j.position+(typeof(j.className)=="string"?" "+j.className:"");var g=document.createElement("FIELDSET");g.className="dhxform_fs";var l=String(j.labelAlign).replace("align_","");g.innerHTML="<legend class='fs_legend' align='"+l+"' style='text-align:"+l+"'>"+j.label+"</legend>";c.appendChild(g);if(!isNaN(j.inputLeft)){g.style.left=parseInt(j.inputLeft)+"px"}if(!isNaN(j.inputTop)){g.style.top=parseInt(j.inputTop)+"px"}if(j.inputWidth!="auto"){if(!isNaN(j.inputWidth)){g.style.width=parseInt(j.inputWidth)+"px";var a=parseInt(g.style.width);if(g.offsetWidth>a){g.style.width=a+(a-g.offsetWidth)+"px"}}}c._addSubListNode=function(){var m=document.createElement("DIV");m._custom_css=" dhxform_fs_nested";this.childNodes[0].appendChild(m);return m};if(j.hidden==true){this.hide(c)}if(j.disabled==true){this.userDisable(c)}return this},destruct:function(a){this.doUnloadNestedLists(a);a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._width=null;a.onselectstart=null;a._addSubListNode=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,c){a.childNodes[0].childNodes[0].innerHTML=c},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}},setWidth:function(c,a){c.childNodes[0].style.width=a+"px";c._width=a},getWidth:function(a){return a._width}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.fieldset[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.block={_index:false,render:function(c,g){c._type="bl";c._width=g.width;c._enabled=true;c._checked=true;c.className="block_"+g.position+(typeof(g.className)=="string"?" "+g.className:"");var a=document.createElement("DIV");a.className="dhxform_obj_"+c.getForm().skin+" dhxform_block";a.style.fontSize=c.getForm().cont.style.fontSize;if(g.style){a.style.cssText=g.style}if(typeof(g.id)!="undefined"){a.id=g.id}c.appendChild(a);if(!isNaN(g.inputLeft)){a.style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){a.style.top=parseInt(g.inputTop)+"px"}if(g.inputWidth!="auto"){if(!isNaN(g.inputWidth)){a.style.width=parseInt(g.inputWidth)+"px"}}if(!isNaN(g.blockOffset)){c._ofsNested=g.blockOffset}c._addSubListNode=function(){var j=document.createElement("DIV");j._inBlcok=true;if(typeof(this._ofsNested)!="undefined"){j._ofsNested=this._ofsNested}this.childNodes[0].appendChild(j);return j};if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}return this},_setCss:function(a,g,c){a.firstChild.className="dhxform_obj_"+g+" dhxform_block";a.firstChild.style.fontSize=c}};(function(){for(var c in {enable:1,disable:1,isEnabled:1,setWidth:1,getWidth:1,doUnloadNestedLists:1,destruct:1}){dhtmlXForm.prototype.items.block[c]=dhtmlXForm.prototype.items.fieldset[c]}})();dhtmlXForm.prototype.items.newcolumn={_index:false};dhtmlXForm.prototype.items.template={render:function(c,g){var a=(!isNaN(g.rows));c._type="tp";c._enabled=true;if(g.format!=null){if(typeof(g.format)=="function"){c.format=g.format}else{if(typeof(g.format)=="string"&&typeof(window[g.format])=="function"){c.format=window[g.format]}}}if(c.format==null){c.format=function(j,l){return l}}this.doAddLabel(c,g);this.doAddInput(c,g,"DIV",null,true,true,"dhxform_item_template");this.setValue(c,g.value||"");return this},destruct:function(a){a.format=null;this.d2(a);a=null},setValue:function(a,c){a._value=c;a.childNodes[a._ll?1:0].childNodes[0].innerHTML=a.format(a._idd,a._value)},getValue:function(a){return a._value},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false}};(function(){dhtmlXForm.prototype.items.template.d2=dhtmlXForm.prototype.items.input.destruct;for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.template[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype._ulToObject=function(l,r){var m=[];for(var c=0;c<l.childNodes.length;c++){if(String(l.childNodes[c].tagName||"").toLowerCase()=="li"){var g={};var u=l.childNodes[c];for(var s=0;s<r.length;s++){if(u.getAttribute(r[s])!=null){g[String(r[s]).replace("ftype","type")]=u.getAttribute(r[s])}}if(!g.label){try{g.label=u.firstChild.nodeValue}catch(o){}}var j=u.getElementsByTagName("UL");if(j[0]!=null){g[(g.type=="select"?"options":"list")]=dhtmlXForm.prototype._ulToObject(j[0],r)}for(var s=0;s<u.childNodes.length;s++){if(String(u.childNodes[s].tagName||"").toLowerCase()=="userdata"){if(!g.userdata){g.userdata={}}g.userdata[u.childNodes[s].getAttribute("name")]=u.childNodes[s].firstChild.nodeValue}}m[m.length]=g}if(String(l.childNodes[c].tagName||"").toLowerCase()=="div"){var g={};g.type="label";try{g.label=l.childNodes[c].firstChild.nodeValue}catch(o){}m[m.length]=g}}return m};dhtmlXForm.prototype.setUserData=function(l,g,j,a){if(typeof(a)!="undefined"){var c=this.doWithItem([l,g],"_getId");if(c!=null){l=c;g=j;j=a}}if(!this._userdata){this._userdata={}}this._userdata[l]=(this._userdata[l]||{});this._userdata[l][g]=j};dhtmlXForm.prototype.getUserData=function(j,g,a){if(typeof(a)!="undefined"){var c=this.doWithItem([j,g],"_getId");if(c!=null){j=c;g=a}}if(this._userdata!=null&&typeof(this._userdata[j])!="undefined"&&typeof(this._userdata[j][g])!="undefined"){return this._userdata[j][g]}return""};dhtmlXForm.prototype.setRTL=function(a){this._rtl=(a===true?true:false);if(this._rtl){if(String(this.cont).search(/dhxform_rtl/gi)<0){this.cont.className+=" dhxform_rtl"}}else{if(String(this.cont).search(/dhxform_rtl/gi)>=0){this.cont.className=String(this.cont.className).replace(/dhxform_rtl/gi,"")}}};_dhxForm_doClick=function(j,c){if(typeof(c)=="object"){var a=c[1];c=c[0]}if(document.createEvent){var g=document.createEvent("MouseEvents");g.initEvent(c,true,false);j.dispatchEvent(g)}else{if(document.createEventObject){var g=document.createEventObject();g.button=1;j.fireEvent("on"+c,g)}}if(a){window.setTimeout(function(){_dhxForm_doClick(j,a)},100)}};dhtmlXForm.prototype.setFormData=function(g){for(var c in g){var j=this.getItemType(c);switch(j){case"checkbox":this[g[c]==true||parseInt(g[c])==1||g[c]=="true"||g[c]==this.getItemValue(c,"realvalue")?"checkItem":"uncheckItem"](c);break;case"radio":this.checkItem(c,g[c]);break;case"input":case"textarea":case"password":case"select":case"multiselect":case"hidden":case"template":case"combo":case"calendar":case"colorpicker":case"editor":this.setItemValue(c,g[c]);break;default:if(this["setFormData_"+j]){this["setFormData_"+j](c,g[c])}else{if(!this.hId){this.hId=this._genStr(12)}this.setUserData(this.hId,c,g[c])}break}}};dhtmlXForm.prototype.getFormData=function(w,m){var c={};var s=this;for(var v in this.itemPull){var o=this.itemPull[v]._idd;var x=this.itemPull[v]._type;if(x=="ch"){c[o]=(this.isItemChecked(o)?this.getItemValue(o):0)}if(x=="ra"&&!c[this.itemPull[v]._group]){c[this.itemPull[v]._group]=this.getCheckedValue(this.itemPull[v]._group)}if(x in {se:1,ta:1,pw:1,hd:1,tp:1,fl:1,calendar:1,combo:1,editor:1,colorpicker:1}){c[o]=this.getItemValue(o,w)}if(this["getFormData_"+x]){c[o]=this["getFormData_"+x](o)}if(x=="up"){var l=this.getItemValue(o);for(var j in l){c[j]=l[j]}}if(this.itemPull[v]._list){for(var g=0;g<this.itemPull[v]._list.length;g++){var n=this.itemPull[v]._list[g].getFormData(w,m);for(var u in n){c[u]=n[u]}}}}if(!m&&this.hId&&this._userdata[this.hId]){for(var v in this._userdata[this.hId]){if(!c[v]){c[v]=this._userdata[this.hId][v]}}}return c};dhtmlXForm.prototype.adjustParentSize=function(){var l=0;var j=-1;for(var m=0;m<this.base.length;m++){l+=this.base[m].firstChild.offsetWidth;if(this.base[m].offsetHeight>j){j=this.base[m].offsetHeight}}var g=false;try{g=(this.cont.parentNode.parentNode.parentNode.parentNode._isCell==true);if(g){var a=this.cont.parentNode.parentNode.parentNode.parentNode}}catch(n){}if(g&&typeof(a)!="undefined"){if(l>0){a.setWidth(l+10)}if(j>0){a.setHeight(j+a.firstChild.firstChild.offsetHeight+5)}g=a=null;return}var c=false;try{c=(this.cont.parentNode.parentNode.parentNode._isWindow==true);if(c){var o=this.cont.parentNode.parentNode;if(typeof(o.callEvent)=="function"){this.cont.style.display="none";o.callEvent("_setCellSize",[l+15,j+15]);this.cont.style.display=""}}}catch(n){}};dhtmlXForm.prototype.reset=function(){if(this.callEvent("onBeforeReset",[this.formId,this.getFormData()])){if(this._last_load_data){this.setFormData(this._last_load_data)}this.callEvent("onAfterReset",[this.formId])}};dhtmlXForm.prototype.send=function(c,n,o,j){if(typeof n=="function"){o=n;n="post"}else{n=(n=="get"?"get":"post")}if(j!==true&&!this.validate()){return}var m=this.getFormData(true);var l=[];for(var g in m){l.push(g+"="+encodeURIComponent(m[g]))}var a=function(q){if(o){o.call(this,q,q.xmlDoc.responseText)}};if(n=="get"){window.dhx4.ajax.get(c+(c.indexOf("?")==-1?"?":"&")+l.join("&"),a)}else{window.dhx4.ajax.post(c,l.join("&"),a)}};dhtmlXForm.prototype.save=function(a,c){};dhtmlXForm.prototype.dummy=function(){};dhtmlXForm.prototype._changeFormId=function(c,a){this.formId=a};dhtmlXForm.prototype._dp_init=function(a){a._methods=["dummy","dummy","_changeFormId","dummy"];a._getRowData=function(j,c){var g=this.obj.getFormData(true);g[this.action_param]=this.obj.getUserData(j,this.action_param);return g};a._clearUpdateFlag=function(){};a.attachEvent("onAfterUpdate",function(g,j,l,c){if(j=="inserted"||j=="updated"){this.obj.resetDataProcessor("updated");this.obj._last_load_data=this.obj.getFormData(true)}this.obj.callEvent("onAfterSave",[this.obj.formId,c]);return true});a.autoUpdate=false;a.setTransactionMode("POST",true);this.dp=a;this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");this.save=function(){if(!this.callEvent("onBeforeSave",[this.formId,this.getFormData()])){return}if(!this.validate()){return}a.sendData()}};dhtmlXForm.prototype.resetDataProcessor=function(a){if(!this.dp){return}this.dp.updatedRows=[];this.dp._in_progress=[];this.dp.setUpdated(this.formId,true,a)};dhtmlXForm.prototype._ccActivate=function(g,a,c){if(!this._formLS){this._formLS={}}if(!this._formLS[g]){this._formLS[g]={input:a,value:c}}if(!this._ccActive){this._ccActive=true;this._ccDo()}a=null};dhtmlXForm.prototype._ccDeactivate=function(a){if(this._ccTm){window.clearTimeout(this._ccTm)}this._ccActive=false;if(this._formLS!=null&&this._formLS[a]!=null){this._formLS[a].input=null;this._formLS[a]=null;delete this._formLS[a]}};dhtmlXForm.prototype._ccDo=function(){if(this._ccTm){window.clearTimeout(this._ccTm)}for(var c in this._formLS){var l=this._formLS[c].input;if(String(l.tagName).toLowerCase()=="select"){var g="";if(l.selectedIndex>=0&&l.selectedIndex<l.options.length){g=l.options[l.selectedIndex].value}}else{var g=l.value}if(g!=this._formLS[c].value){this._formLS[c].value=g;this.callEvent("onInputChange",[l._idd,g,this])}l=null}if(this._ccActive){var j=this;this._ccTm=window.setTimeout(function(){j._ccDo();j=null},100)}};dhtmlXForm.prototype._ccReload=function(c,a){if(this._formLS&&this._formLS[c]){this._formLS[c].value=a}};dhtmlXForm.prototype._autoload=function(){var c=["ftype","name","value","label","check","checked","disabled","text","rows","select","selected","width","style","className","labelWidth","labelHeight","labelLeft","labelTop","inputWidth","inputHeight","inputLeft","inputTop","position","size"];var g=document.getElementsByTagName("UL");var j=[];for(var n=0;n<g.length;n++){if(g[n].className=="dhtmlxForm"){var m=document.createElement("DIV");j[j.length]={nodeUL:g[n],nodeForm:m,data:dhtmlXForm.prototype._ulToObject(g[n],c),name:(g[n].getAttribute("name")||null)}}}for(var n=0;n<j.length;n++){j[n].nodeUL.parentNode.insertBefore(j[n].nodeForm,j[n].nodeUL);var o=new dhtmlXForm(j[n].nodeForm,j[n].data);if(j[n].name!==null){window[j[n].name]=o}var l=(j[n].nodeUL.getAttribute("oninit")||null);j[n].nodeUL.parentNode.removeChild(j[n].nodeUL);j[n].nodeUL=null;j[n].nodeForm=null;j[n].data=null;j[n]=null;if(l){if(typeof(l)=="function"){l()}else{if(typeof(window[l])=="function"){window[l]()}}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.detachEvent("onload",dhtmlXForm.prototype._autoload)}};if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.attachEvent("onload",dhtmlXForm.prototype._autoload)}if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachForm=function(a){this.callEvent("_onBeforeContentAttach",["form"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";if(window.dhtmlx&&dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(c)}else{c.style.overflow="auto"}this._attachObject(c);this.dataType="form";this.dataObj=new dhtmlXForm(c,a);this.dataObj.setSkin(this.conf.skin);c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXForm.prototype.items.combo={render:function(c,g){c._type="combo";c._enabled=true;c._value=null;c._newValue=null;this.doAddLabel(c,g);this.doAddInput(c,g,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(c);this.doLoadOpts(c,g);c.onselectstart=function(j){return true};c.childNodes[c._ll?1:0].childNodes[0].setAttribute("mode",g.comboType||"");if(g.comboImagePath){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("imagePath",g.comboImagePath)}if(g.comboDefaultImage){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("defaultImage",g.comboDefaultImage)}if(g.comboDefaultImageDis){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("defaultImageDis",g.comboDefaultImageDis)}c._combo=new dhtmlXComboFromSelect(c.childNodes[c._ll?1:0].childNodes[0]);c._combo.setSkin(c.getForm().skin);c._combo._currentComboValue=c._combo.getSelectedValue();c._combo.getInput().id=g.uid;var a=this;c._combo.attachEvent("onChange",function(){a.doOnChange(this)});if(g.connector){this.doLoadOptsConnector(c,g.connector)}if(g.filtering){c._combo.enableFilteringMode(true)}else{if(g.serverFiltering){c._combo.enableFilteringMode(true,g.serverFiltering,g.filterCache,g.filterSubLoad)}}if(g.readonly==true){this.setReadonly(c,true)}if(g.style){c._combo.DOMelem_input.style.cssText+=g.style}c._combo.attachEvent("onFocus",function(){var j=this.cont.parentNode.parentNode;var l=j.getForm();if(l.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)<0){this.cont.className+=" combo_in_focus"}l.callEvent("onFocus",[j._idd]);l=j=null});c._combo.attachEvent("onBlur",function(){var j=this.cont.parentNode.parentNode;var l=j.getForm();if(l.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)>=0){this.cont.className=this.cont.className.replace(/\s{0,}combo_in_focus/gi,"")}l.callEvent("onBlur",[j._idd]);l=j=null});return this},destruct:function(a){a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a._combo._currentComboValue=null;a._combo.unload();a._combo=null;a._apiChange=null;this.d2(a);a=null},doAttachEvents:function(c){var a=this;c.childNodes[c._ll?1:0].childNodes[0].onchange=function(){a.doOnChange(this);a.doValidate(this.DOMParent.parentNode.parentNode)}},doValidate:function(a){if(a.getForm().hot_validate){this._validate(a)}},doOnChange:function(c){var a=c.base.parentNode.parentNode.parentNode;if(a._apiChange){return}c._newComboValue=c.getSelectedValue();if(c._newComboValue!=c._currentComboValue){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,c._currentComboValue,c._newComboValue])!==true){window.setTimeout(function(){c.setComboValue(c._currentComboValue)},1);return false}}c._currentComboValue=c._newComboValue;a.callEvent("onChange",[a._idd,c._currentComboValue])}a._autoCheck(a._enabled)},doLoadOptsConnector:function(j,a){var g=this;var c=j;j._connector_working=true;j._apiChange=true;j._combo.load(a,function(){c.callEvent("onOptionsLoaded",[c._idd]);c._connector_working=false;if(c._connector_value!=null){g.setValue(c,c._connector_value);c._connector_value=null}c._apiChange=false;g=c=null})},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a._combo.enable()},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a._combo.disable()},getCombo:function(a){return a._combo},setValue:function(a,c){if(a._connector_working){a._connector_value=c;return}a._apiChange=true;a._combo.setComboValue(c);a._combo._currentComboValue=a._combo.getActualValue();a._apiChange=false},getValue:function(a){return a._combo.getActualValue()},setWidth:function(c,a){c.childNodes[c._ll?1:0].childNodes[0].style.width=a+"px"},setReadonly:function(a,c){if(!a._combo){return}a._combo_ro=c;a._combo.readonly(a._combo_ro)},isReadonly:function(a,c){return a._combo_ro||false},setFocus:function(a){if(a._enabled){a._combo.setFocus()}},_setCss:function(a,g,c){a._combo.setFontSize(c,c)}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,_checkNoteWidth:1}){dhtmlXForm.prototype.items.combo[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype.items.combo.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.getCombo=function(a){return this.doWithItem(a,"getCombo")};dhtmlXForm.prototype.items.calendar={render:function(g,l){var c=this;g._type="calendar";g._enabled=true;var m=navigator.userAgent;var a=(m.indexOf("MSIE 6.0")>=0||m.indexOf("MSIE 7.0")>=0||m.indexOf("MSIE 8.0")>=0);this.doAddLabel(g,l);this.doAddInput(g,l,"INPUT","TEXT",true,true,"dhxform_textarea calendar");this.doAttachChangeLS(g);if(a){g.childNodes[g._ll?1:0].childNodes[0].onfocus2=g.childNodes[g._ll?1:0].childNodes[0].onfocus;g.childNodes[g._ll?1:0].childNodes[0].onfocus=function(){if(this._skipOnFocus==true){this._skipOnFocus=false;return}this.onfocus2.apply(this,arguments)}}g.childNodes[g._ll?1:0].childNodes[0]._idd=g._idd;g.childNodes[g._ll?1:0].childNodes[0].onblur=function(){var n=this.parentNode.parentNode;if(n._c.base._formMouseDown){n._c.base._formMouseDown=false;this._skipOnFocus=true;this.focus();this.value=this.value;n=null;return true}var o=n.getForm();o._ccDeactivate(n._idd);c.checkEnteredValue(this.parentNode.parentNode);if(o.live_validate){c._validate(n)}o.callEvent("onBlur",[n._idd]);o=n=null};g._f=(l.dateFormat||null);g._f0=(l.serverDateFormat||g._f);var j=g.getForm();g._c=new dhtmlXCalendarObject(g.childNodes[g._ll?1:0].childNodes[0],l.skin||j.skin||"dhx_skyblue");g._c._nullInInput=true;g._c.enableListener(g.childNodes[g._ll?1:0].childNodes[0]);if(g._f!=null){g._c.setDateFormat(g._f)}if(!window.dhx4.s2b(l.enableTime)){g._c.hideTime()}if(window.dhx4.s2b(l.showWeekNumbers)){g._c.showWeekNumbers()}if(!isNaN(l.weekStart)){g._c.setWeekStartDay(l.weekStart)}if(typeof(l.calendarPosition)!="undefined"){g._c.setPosition(l.calendarPosition)}if(l.minutesInterval!=null){g._c.setMinutesInterval(l.minutesInterval)}g._c._itemIdd=g._idd;g._c.attachEvent("onBeforeChange",function(n){if(g._value!=n){if(g.checkEvent("onBeforeChange")){if(g.callEvent("onBeforeChange",[g._idd,g._value,n])!==true){return false}}g._tempValue=g._value=n;c.setValue(g,n,false);g.callEvent("onChange",[this._itemIdd,g._value])}return true});g._c.attachEvent("onClick",function(){g._tempValue=null});if(a){g._c.base.onmousedown=function(){this._formMouseDown=true;return false}}this.setValue(g,l.value);j=null;return this},getCalendar:function(a){return a._c},setSkin:function(a,c){a._c.setSkin(c)},setValue:function(c,g,a){if(!g||g==null||typeof(g)=="undefined"||g==""){c._value=null;c.childNodes[c._ll?1:0].childNodes[0].value=""}else{c._value=(g instanceof Date?g:c._c._strToDate(g,c._f0||c._c._dateFormat));c.childNodes[c._ll?1:0].childNodes[0].value=c._c._dateToStr(c._value,c._f||c._c._dateFormat)}if(a!==false){c._c.setDate(c._value)}},getValue:function(c,a){var g=c._tempValue||c._c.getDate();if(a===true&&g==null){return""}return(a===true?c._c._dateToStr(g,c._f0||c._c._dateFormat):g)},setDateFormat:function(c,a,g){c._f=a;c._f0=(g||c._f);c._c.setDateFormat(c._f);this.setValue(c,this.getValue(c))},destruct:function(a){a._c.disableListener(a.childNodes[a._ll?1:0].childNodes[0]);a._c.unload();a._c=null;try{delete a._c}catch(c){}a._f=null;try{delete a._f}catch(c){}a._f0=null;try{delete a._f0}catch(c){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;this.d2(a);a=null},checkEnteredValue:function(a){this.setValue(a,a._c.getDate())}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.calendar[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.calendar.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};dhtmlXForm.prototype.setCalendarDateFormat=function(c,a,g){this.doWithItem(c,"setDateFormat",a,g)};dhtmlXForm.prototype.items.btn2state={setChecked:function(a,c){a._checked=(c===true?true:false);a.childNodes[a._ll?1:0].lastChild.className="dhxform_img "+a._cssName+"_"+(a._checked?"1":"0");this.doCheckValue(a)}};(function(){for(var c in dhtmlXForm.prototype.items.checkbox){if(!dhtmlXForm.prototype.items.btn2state[c]){dhtmlXForm.prototype.items.btn2state[c]=dhtmlXForm.prototype.items.checkbox[c]}}})();dhtmlXForm.prototype.items.btn2state.render2=dhtmlXForm.prototype.items.btn2state.render;dhtmlXForm.prototype.items.btn2state.render=function(a,c){c._autoInputWidth=false;this.render2(a,c);a._type="btn2state";a._cssName=(typeof(c.cssName)=="undefined"?"btn2state":c.cssName);a._updateImgNode=function(){};a._doOnFocus=function(){a.getForm().callEvent("onFocus",[a._idd])};a._doOnBlur=function(){a.getForm().callEvent("onBlur",[a._idd])};a._doOnKeyUpDown=function(j,g,l){this.callEvent(j,[this.childNodes[this._ll?0:1].childNodes[0],g,this._idd])};this.setChecked(a,a._checked);return this};dhtmlXForm.prototype.setFormData_btn2state=function(a,c){this[c==true||parseInt(c)==1||c=="true"||c==this.getItemValue(a)?"checkItem":"uncheckItem"](a)};dhtmlXForm.prototype.getFormData_btn2state=function(a){return(this.isItemChecked(a)?this.getItemValue(a):0)};dhtmlXForm.prototype.items.colorpicker={colorpicker:{},render:function(g,j){var c=this;g._type="colorpicker";g._enabled=true;this.doAddLabel(g,j);this.doAddInput(g,j,"INPUT","TEXT",true,true,"dhxform_textarea");g._value=(j.value||"");g.childNodes[g._ll?1:0].childNodes[0].value=g._value;var a={input:g.childNodes[g._ll?1:0].childNodes[0],custom_colors:(window.dhx4.s2b(j.enableCustomColors)==true),skin:g.getForm().skin};this.colorpicker[g._idd]=new dhtmlXColorPicker(a);this.colorpicker[g._idd]._nodes[0].valueColor=null;this.colorpicker[g._idd].base.className+=" dhtmlxcp_in_form";if(typeof(j.customColors)!="undefined"){this.colorpicker[g._idd].setCustomColors(j.customColors)}if(typeof(j.cpPosition)=="string"){this.colorpicker[g._idd].setPosition(j.cpPosition)}this.colorpicker[g._idd].attachEvent("onSelect",function(l){if(g._value!=l){if(g.checkEvent("onBeforeChange")){if(g.callEvent("onBeforeChange",[g._idd,g._value,l])!==true){g.childNodes[g._ll?1:0].childNodes[0].value=g._value;return}}g._value=l;c.setValue(g,l);g.callEvent("onChange",[g._idd,g._value])}});this.colorpicker[g._idd].attachEvent("onHide",function(l){var m=g.childNodes[g._ll?1:0].childNodes[0];if(m.value!=g._value){m.value=g._value}m=null});g.childNodes[g._ll?1:0].childNodes[0]._idd=g._idd;return this},getColorPicker:function(a){return this.colorpicker[a._idd]},destruct:function(a){if(this.colorpicker[a._idd].unload){this.colorpicker[a._idd].unload()}this.colorpicker[a._idd]=null;try{delete this.colorpicker[a._idd]}catch(c){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null},setSkin:function(a,c){this.colorpicker[a._idd].setSkin(c)}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setValue:1,getValue:1,updateValue:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.colorpicker[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.colorpicker.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getColorPicker=function(a){return this.doWithItem(a,"getColorPicker")};dhtmlXForm.prototype.items.container={render:function(a,c){a._type="container";a._enabled=true;this.doAddLabel(a,c);this.doAddInput(a,c,"DIV",null,true,true,"dhxform_container");return this},getContainer:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a.callEvent("onEnable",[a._idd])},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a.callEvent("onDisable",[a._idd])},doAttachEvents:function(){},setValue:function(){},getValue:function(){return null}};dhtmlXForm.prototype.getContainer=function(a){return this.doWithItem(a,"getContainer")};(function(){for(var c in dhtmlXForm.prototype.items.input){if(!dhtmlXForm.prototype.items.container[c]){dhtmlXForm.prototype.items.container[c]=dhtmlXForm.prototype.items.input[c]}}})();dhtmlXForm.prototype.items.editor={editor:{},render:function(g,j){var a=(!isNaN(j.rows));g._type="editor";g._enabled=true;g._editor_id=g.getForm().idPrefix+g._idd;this.doAddLabel(g,j);this.doAddInput(g,j,"DIV",null,true,true,"dhxform_item_template");g._value=(j.value||"");var c=this;this.editor[g._editor_id]=new dhtmlXEditor({parent:g.childNodes[g._ll?1:0].childNodes[0],content:g._value,iconsPath:j.iconsPath,toolbar:j.toolbar});this.editor[g._editor_id].attachEvent("onAccess",function(m,n){g.callEvent("_onBeforeEditorAccess",[]);_dhxForm_doClick(document.body,"click");if(m=="blur"){c.doOnBlur(g,this);g.callEvent("onBlur",[g._idd]);if(g.getForm().skin=="dhx_terrace"){var l=g.childNodes[g._ll?1:0].className;if(l.indexOf("dhxeditor_focus")>=0){g.childNodes[g._ll?1:0].className=(l).replace(/\s{0,}dhxeditor_focus/gi,"")}}}else{g.callEvent("onEditorAccess",[g._idd,m,n,this,g.getForm()]);g.callEvent("onFocus",[g._idd]);if(g.getForm().skin=="dhx_terrace"){var l=g.childNodes[g._ll?1:0].className;if(l.indexOf("dhxeditor_focus")==-1){g.childNodes[g._ll?1:0].className+=" dhxeditor_focus"}}}});this.editor[g._editor_id].attachEvent("onToolbarClick",function(l){g.callEvent("onEditorToolbarClick",[g._idd,l,this,g.getForm()])});if(j.readonly){this.setReadonly(g,true)}g.childNodes[g._ll?0:1].childNodes[0].removeAttribute("for");g.childNodes[g._ll?0:1].childNodes[0].onclick=function(){c.editor[g._editor_id]._focus()};return this},doOnBlur:function(g,c){var a=c.getContent();if(g._value!=a){if(g.checkEvent("onBeforeChange")){if(g.callEvent("onBeforeChange",[g._idd,g._value,a])!==true){c.setContent(g._value);return}}g._value=a;g.callEvent("onChange",[g._idd,a])}},setValue:function(a,c){if(a._value==c){return}a._value=c;this.editor[a._editor_id].setContent(a._value)},getValue:function(a){a._value=this.editor[a._editor_id].getContent();return a._value},enable:function(a){if(this.isEnabled(a)!=true){this.editor[a._editor_id].setReadonly(false);this.doEn(a)}},disable:function(a){if(this.isEnabled(a)==true){this.editor[a._editor_id].setReadonly(true);this.doDis(a)}},setReadonly:function(a,c){this.editor[a._editor_id].setReadonly(c)},getEditor:function(a){return(this.editor[a._editor_id]||null)},destruct:function(a){a.childNodes[a._ll?0:1].childNodes[0].onclick=null;this.editor[a._editor_id].unload();this.editor[a._editor_id]=null;this.d2(a);a=null},setFocus:function(a){this.editor[a._editor_id]._focus()}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,setWidth:1,isEnabled:1}){dhtmlXForm.prototype.items.editor[c]=dhtmlXForm.prototype.items.template[c]}})();dhtmlXForm.prototype.items.editor.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.items.editor.doEn=dhtmlXForm.prototype.items.select.enable;dhtmlXForm.prototype.items.editor.doDis=dhtmlXForm.prototype.items.select.disable;dhtmlXForm.prototype.getEditor=function(a){return this.doWithItem(a,"getEditor")};dhtmlXForm.prototype.items.upload={render:function(c,g){c._type="up";c._enabled=true;c._checked=true;c.className=g.position+(typeof(g.className)=="string"?" "+g.className:"");var a=document.createElement("DIV");c.appendChild(a);if(!isNaN(g.inputLeft)){c.style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){c.style.top=parseInt(g.inputTop)+"px"}if(g.inputWidth!="auto"){if(!isNaN(g.inputWidth)){a.style.width=parseInt(g.inputWidth)+"px"}}c._uploader=new dhtmlXFileUploader(a,g.swfPath||"",g.swfUrl||"",g.mode||null,g.swfLogs,g.slXap||"",g.slUrl||"",g.slLogs||"",g.multiple);c._uploader.setURL(g.url||"");c._uploader.callEvent=c.callEvent;if(typeof(g.autoStart)!="undefined"){c._uploader.setAutoStart(g.autoStart)}if(typeof(g.autoRemove)!="undefined"){c._uploader.setAutoRemove(g.autoRemove)}if(typeof(g.titleScreen)!="undefined"){c._uploader.enableTitleScreen(g.titleScreen)}if(typeof(g.titleText)!="undefined"){c._uploader.setTitleText(g.titleText)}if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}if(!(g.inputHeight=="auto"||parseInt(g.inputHeight)==NaN)){c._uploader.p_files.style.height=parseInt(g.inputHeight)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._uploader.callEvent=function(){return true};a._uploader.unload();a._uploader.callEvent=null;a._uploader=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a.onselectstart=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,c){},getText:function(a){},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._uploader.enable()},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._uploader.disable()},setWidth:function(c,a){c.childNodes[0].style.width=a+"px";c._width=a},getWidth:function(a){return a._width||parseInt(a.childNodes[0].style.width)},setValue:function(a){a._uploader.clear()},getValue:function(m){var j=m._uploader.getData();var l={};var g=0;for(var c in j){l[m._idd+"_r_"+g]=j[c].realName;l[m._idd+"_s_"+g]=j[c].serverName;g++}l[m._idd+"_count"]=g;return l},getUploader:function(a){return a._uploader},getStatus:function(a){return a._uploader.getStatus()}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.upload[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.setFormData_upload=function(a){this.doWithItem(a,"setValue")};dhtmlXForm.prototype.getUploader=function(a){return this.doWithItem(a,"getUploader")};dhtmlXForm.prototype.getUploaderStatus=function(a){return this.doWithItem(a,"getStatus")};function dhtmlXFileUploader(c,n,m,o,s,l,v,j,w){var q=this;if(typeof(o)=="string"&&typeof(this[o])=="function"){this.engine=o}else{this.engine="html4";var g=null;if(typeof(window.FormData)!="undefined"&&typeof(window.XMLHttpRequest)!="undefined"){g=new XMLHttpRequest();if(typeof(g.upload)=="undefined"){g=null}}if(g!=null){this.engine="html5"}else{if(typeof(window.swfobject)!="undefined"||g===false){var g=swfobject.getFlashPlayerVersion();if(g.major>=10){this.engine="flash"}}else{this._sl_v=this.getSLVersion();if(this._sl_v){this.engine="sl"}}}g=null}if(typeof(c)=="string"){c=document.getElementById(c)}this._upload_mp=(typeof(w)!="undefined"?w==true:true);this._upload_dnd=true;this._swf_file_url=n||"";this._swf_upolad_url=m||"";this._swf_logs=s;this._sl_xap=l;this._sl_upload_url=v;this._sl_logs=j;this.p=document.createElement("DIV");this.p.className+=" dhx_file_uploader";c.appendChild(this.p);this.p_files=document.createElement("DIV");this.p_files.className="dhx_upload_files";this.p.appendChild(this.p_files);this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_upload_controls";this.p.appendChild(this.p_controls);this._files={};this._items={};this._data={};this._autoStart=false;this._autoRemove=false;this._titleScreen=true;this._enabled=true;this._uploaded_count=0;this._initToolbar=function(){this.b_opts={info:{onclick:null},browse:{onclick:null,tooltip:"Browse"},upload:{onclick:function(){if(!q._enabled){return}if(!q._uploading){q._uploadStart()}},tooltip:"Upload"},cancel:{onclick:function(){if(!q._enabled){return}q._uploadStop();q._switchButton(false)},tooltip:"Stop"},clear:{onclick:function(){if(!q._enabled){return}q.clear()},tooltip:"Clear list"}};this.buttons={};for(var x in this.b_opts){var y=document.createElement("DIV");y.innerHTML="&nbsp;";y.className="dhx_file_uploader_button button_"+x;y.onclick=this.b_opts[x].onclick;if(this.b_opts[x].tooltip){y.title=this.b_opts[x].tooltip}this.p_controls.appendChild(y);this.buttons[x]=y;y=null}this.buttons.cancel.style.display="none"};this._readableSize=function(y){var x=false;var a=["b","Kb","Mb","Gb","Tb","Pb","Eb"];for(var A=0;A<a.length;A++){if(y>1024){y=y/1024}else{if(x===false){x=A}}}if(x===false){x=a.length-1}return Math.round(y*100)/100+" "+a[x]};this._beforeAddFileToList=function(a,x){return(this.callEvent("onBeforeFileAdd",[a,x])===true)};this._addFileToList=function(D,x,A,C,a){this._checkTitleScreen();var y=document.createElement("DIV");y._idd=D;y.className="dhx_file dhx_file_"+C;y.innerHTML="<div class='dhx_file_param dhx_file_name'>&nbsp;</div><div class='dhx_file_param dhx_file_progress'>"+a+"%</div><div class='dhx_file_param dhx_file_delete' title='Remove from list'>&nbsp;</div>";this.p_files.appendChild(y);y.childNodes[0].style.width=y.offsetWidth-127+"px";this._items[D]=y;this._updateFileNameSize(D);y.childNodes[2].onclick=function(){if(!q._enabled){return}var E=this.parentNode._idd;q._removeFileFromQueue(E)};this.callEvent("onFileAdd",[x])};this._removeFileFromList=function(a){if(!this._items[a]){return}this._items[a].childNodes[2].onclick=null;this._items[a].parentNode.removeChild(this._items[a]);this._items[a]=null;delete this._items[a];if(this._data[a]){this._data[a]=null;delete this._data[a]}this._checkTitleScreen()};this._updateFileNameSize=function(a){this._items[a].childNodes[0].innerHTML=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"&nbsp;");this._items[a].childNodes[0].title=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"")};this._updateFileInList=function(y,x,a){if(!this._items[y]){return}this._items[y].className="dhx_file dhx_file_"+x;this._updateProgress(y,x,a);this._updateFileNameSize(y)};this._updateProgress=function(y,x,a){if(x=="uploading"&&a<100&&this._progress_type=="loader"){this._items[y].childNodes[1].className="dhx_file_param dhx_file_uploading";this._items[y].childNodes[1].innerHTML="&nbsp;"}else{this._items[y].childNodes[1].className="dhx_file_param dhx_file_progress";this._items[y].childNodes[1].innerHTML=a+"%"}this._updateFileNameSize(y)};this._removeFilesByState=function(y){for(var x in this._files){if(y===true||this._files[x].state==y){this._removeFileFromQueue(x)}}};this._switchButton=function(x){if(x==true){this.buttons.upload.style.display="none";this.buttons.cancel.style.display=""}else{var a=this._uploaded_count;this.buttons.upload.style.display="";this.buttons.cancel.style.display="none";this._uploaded_count=0;if(a>0){this.callEvent("onUploadComplete",[a])}}};this._uploadStart=function(){this._switchButton(true);if(!this._uploading){for(var x in this._files){if(this._files[x].state=="fail"){this._files[x].state="added";this._updateFileInList(x,"added",0)}}}this._uploading=true;var y=false;for(var x in this._files){if(!y&&[this._files[x].state]=="added"){y=true;this._files[x].state="uploading";this._updateFileInList(x,"uploading",0);this._doUploadFile(x)}}if(!y){this._uploading=false;this._switchButton(false)}};this._onUploadSuccess=function(C,A,y,a){if(typeof(y)!="undefined"&&this.engine=="flash"){var x=dhx4.s2j(y.data);if(x!=null&&x.state==true&&x.name!=null){A=x.name;if(x.extra!=null){a=x.extra}}else{this._onUploadFail(C,(x!=null&&x.extra!=null?x.extra:null));return}}this._uploaded_count++;this._data[C]={realName:this._files[C].name,serverName:A};this._files[C].state="uploaded";this._updateFileInList(C,"uploaded",100);this.callEvent("onUploadFile",[this._files[C].name,A,a]);if(this._autoRemove){this._removeFileFromQueue(C)}if(this._uploading){this._uploadStart()}};this._onUploadFail=function(x,a){this._files[x].state="fail";this._updateFileInList(x,"fail",0);this.callEvent("onUploadFail",[this._files[x].name,a]);if(this._uploading){this._uploadStart()}};this._onUploadAbort=function(a){this._uploading=false;this._files[a].state="added";this._updateFileInList(a,"added",0);this.callEvent("onUploadCancel",[this._files[a].name])};this._checkTitleScreen=function(){var y=0;for(var x in this._files){y++}if(y==0&&this.p.className.search("dhx_file_uploader_title")<0&&this._titleScreen){this.p.className+=" dhx_file_uploader_title";this.buttons.info.innerHTML=this._titleText;this.buttons.info.style.width=Math.max(this.p_controls.offsetWidth-134,0)+"px"}if((y>0||!this._titleScreen)&&this.p.className.search("dhx_file_uploader_title")>=0){this.p.className=this.p.className.replace(/dhx_file_uploader_title/g,"");this.buttons.info.innerHTML=""}};this.callEvent=function(){};this.upload=function(){if(!this._uploading){this._uploadStart()}};this.setAutoStart=function(a){this._autoStart=(a==true)};this.setAutoRemove=function(a){this._autoRemove=(a==true)};this.enableTitleScreen=function(a){this._titleScreen=(a==true);this._checkTitleScreen()};this.setTitleText=function(a){this._titleText=a;if(this.p.className.search("dhx_file_uploader_title")>=0){this.buttons.info.innerHTML=this._titleText}};this.setURL=function(a){this._url=a};this.setSWFURL=function(a){this._swf_upolad_url=a};this.enable=function(){this._enabled=true;this.p_files.className="dhx_upload_files";this.p_controls.className="dhx_upload_controls"};this.disable=function(){this._enabled=false;this.p_files.className="dhx_upload_files dhx_uploader_dis";this.p_controls.className="dhx_upload_controls dhx_uploader_dis"};this.getStatus=function(){var y=0;for(var x in this._files){if(this._files[x].state!="uploaded"){return -1}y=1}return y};this.getData=function(){return this._data};this.clear=function(){if(this.callEvent("onBeforeClear",[])!==true){return}if(this._uploading){q._uploadStop()}q._switchButton(false);q._removeFilesByState(true);this.callEvent("onClear",[])};this.unload=function(){this._removeFilesByState(true);this._data=null;this._files=null;this._items=null;this._unloadEngine();for(var x in this.buttons){this.buttons[x].onclick=null;this.buttons[x].parentNode.removeChild(this.buttons[x]);this.buttons[x]=null;delete this.buttons[x]}this.buttons=null;for(var x in this.b_opts){this.b_opts[x].onclick=null;this.b_opts[x]=null;delete this.b_opts[x]}this.b_opts=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_files.parentNode.removeChild(this.p_files);this.p.className=this.p.className.replace(/dhx_file_uploader_title/gi,"").replace(/dhx_file_uploader/gi,"");for(var x in this){this[x]=null}q=x=null};var r=new this[this.engine]();for(var u in r){this[u]=r[u];r[u]=null}u=r=c=null;this._initToolbar();this._initEngine();this._checkTitleScreen();return this}dhtmlXFileUploader.prototype.html5=function(){};dhtmlXFileUploader.prototype.html5.prototype={_initEngine:function(){var c=this;this.buttons.browse.onclick=function(){if(c._enabled){c.f.click()}};this._progress_type="percentage";var a=window.navigator.userAgent;if(a.match(/Windows/gi)!=null&&a.match(/AppleWebKit/gi)!=null&&a.match(/Safari/gi)!=null){if(a.match(/Version\/5\.1\.5/gi)){this._upload_mp=false}if(a.match(/Version\/5\.1[^\.\d{1,}]/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.1/gi)){this._upload_mp=false;this._upload_dnd=false}if(a.match(/Version\/5\.1\.2/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.7/gi)){this._upload_mp=false}}this._addFileInput();if(this._upload_dnd){this.p.ondragenter=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault()};this.p.ondragover=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault()};this.p.ondrop=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault();if(c._enabled){c._parseFilesInInput(g.dataTransfer.files)}};this._titleText="Drag-n-Drop files here or<br>click to select files for upload."}else{this._titleText="Click to select files for upload."}},_addFileInput:function(){if(this.f!=null){this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null}var a=this;this.f=document.createElement("INPUT");this.f.type="file";if(this._upload_mp){this.f.multiple="1"}this.f.className="dhx_uploader_input";this.p_controls.appendChild(this.f);this.f.onchange=function(){a._parseFilesInInput(this.files);if(window.dhx4.isOpera){a._addFileInput()}else{this.value=""}}},_doUploadFile:function(g){var c=this;if(!this._loader){this._loader=new XMLHttpRequest();this._loader.upload.onprogress=function(j){if(c._files[this._idd].state=="uploading"){c._updateFileInList(this._idd,"uploading",Math.round(j.loaded*100/j.total))}};this._loader.onload=function(l){var j=dhx4.s2j(this.responseText);if(typeof(j)=="object"&&j!=null&&typeof(j.state)!="undefined"&&j.state==true){c._onUploadSuccess(this.upload._idd,j.name,null,j.extra);j=null}else{c._onUploadFail(this.upload._idd,(j!=null&&j.extra!=null?j.extra:null))}};this._loader.onerror=function(j){c._onUploadFail(this.upload._idd)};this._loader.onabort=function(j){c._onUploadAbort(this.upload._idd)}}this._loader.upload._idd=g;var a=new FormData();a.append("file",this._files[g].file);this._loader.open("POST",this._url+(String(this._url).indexOf("?")<0?"?":"&")+"mode=html5&dhxr"+new Date().getTime(),true);this._loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this._loader.send(a)},_uploadStop:function(){if(!this._uploading||!this._loader){return}this._loader.abort()},_parseFilesInInput:function(c){for(var a=0;a<c.length;a++){this._addFileToQueue(c[a])}},_addFileToQueue:function(a){if(!this._beforeAddFileToList(a.name,a.size)){return}var c=(a._idd||window.dhx4.newId());this._files[c]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(c,a.name,a.size,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(j){if(!this._files[j]){return}var c=this._files[j].name;var g=(this._data!=null&&this._data[j]!=null?this._data[j].serverName:null);if(this.callEvent("onBeforeFileRemove",[c,g])!==true){return}var a=false;if(this._uploading&&j==this._loader.upload._idd&&this._files[j].state=="uploading"){this._uploadStop();a=true}this._files[j].file=null;this._files[j].name=null;this._files[j].size=null;this._files[j].state=null;this._files[j]=null;delete this._files[j];this._removeFileFromList(j);this.callEvent("onFileRemove",[c,g]);if(a){this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=null;this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;this.p.ondragenter=null;this.p.ondragover=null;this.p.ondrop=null;if(this._loader){this._loader.upload.onprogress=null;this._loader.onload=null;this._loader.onerror=null;this._loader.onabort=null;this._loader.upload._idd=null;this._loader=null}this._initEngine=null;this._doUploadFile=null;this._uploadStop=null;this._parseFilesInInput=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.html4=function(){};dhtmlXFileUploader.prototype.html4.prototype={_initEngine:function(){this._addForm();this._progress_type="loader";this._titleText="Click button<br>to select files for upload."},_addForm:function(){var a=this;var g=window.dhx4.newId();if(!this.k){this.k=document.createElement("DIV");this.k.className="dhx_file_form_cont";this.buttons.browse.appendChild(this.k);this.fr_name="dhx_file_"+window.dhx4.newId();this.k.innerHTML='<iframe name="'+this.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>';this.fr=this.k.firstChild;if(window.navigator.userAgent.indexOf("MSIE")>=0){this.fr.onreadystatechange=function(){if(this.readyState=="complete"){a._onLoad()}}}else{this.fr.onload=function(){a._onLoad()}}}var c=document.createElement("DIV");c.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.fr_name+"' class='dhx_file_form' name='dhx_file_form_"+window.dhx4.newId()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value='"+g+"'><input type='file' name='file' class='dhx_file_input'></form>";this.k.appendChild(c);c.firstChild.lastChild._idd=g;c.firstChild.lastChild.onchange=function(){if(!a._beforeAddFileToList(this.value,null)){return}a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};c=null},_onLoad:function(){if(this._uploading){var a=dhx4.s2j(this.fr.contentWindow.document.body.innerHTML);if(typeof(a)=="object"&&a!=null){if(typeof(a.state)!="undefined"){if(a.state=="cancelled"){this._onUploadAbort(this.fr._idd);a=null;return}else{if(a.state==true){if(typeof(a.size)!="undefined"&&!isNaN(a.size)){this._files[this.fr._idd].size=a.size}this._onUploadSuccess(this.fr._idd,a.name,null,a.extra);a=null;return}}}}this._onUploadFail(this.fr._idd,(a!=null&&a.extra!=null?a.extra:null))}},_addFileToQueue:function(c){var a=c.value.match(/[^\\\/]*$/g);if(a[0]!=null){a=a[0]}else{a=c.value}this._files[c._idd]={name:a,form:c.parentNode,node:c.parentNode.parentNode,input:c,state:"added"};this._addFileToList(c._idd,c.value,false,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(g){var a=this._files[g].name;var c=(this._data!=null&&this._data[g]!=null?this._data[g].serverName:null);if(this.callEvent("onBeforeFileRemove",[a,c])!==true){return}this._files[g].input.onchange=null;this._files[g].form.removeChild(this._files[g].input);this._files[g].node.removeChild(this._files[g].form);this._files[g].node.parentNode.removeChild(this._files[g].node);this._files[g].input=null;this._files[g].name=null;this._files[g].form=null;this._files[g].node=null;this._files[g].size=null;this._files[g].state=null;this._files[g]=null;delete this._files[g];this._removeFileFromList(g);this.callEvent("onFileRemove",[a,c])},_doUploadFile:function(a){this.fr._idd=a;this._files[a].form.action=this._url;this._files[a].form.submit()},_uploadStop:function(){if(!this._uploading){return}this.fr.contentWindow.location.href=(this._url)+(this._url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&dhxr"+new Date().getTime()},_unloadEngine:function(){if(this.k){this.fr_name=null;this.fr.onreadystatechange=null;this.fr.onload=null;this.fr.parentNode.removeChild(this.fr);this.fr=null;this.k.firstChild.firstChild.lastChild.onchange=null;this.k.parentNode.removeChild(this.k);this.k=null}this._initEngine=null;this._addForm=null;this._onLoad=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.flash=function(){};dhtmlXFileUploader.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXFileUploaderSWFObjects){window.dhtmlXFileUploaderSWFObjects={items:{},callEvent:function(l,g,j){return window.dhtmlXFileUploaderSWFObjects.items[l].uploader[g].apply(window.dhtmlXFileUploaderSWFObjects.items[l].uploader,j)}}}var c=this;this._swf_obj_id="dhtmlXFileUploaderSWFObject_"+window.dhx4.newId();this._swf_file_url=this._swf_file_url+(this._swf_file_url.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime();this.buttons.browse.innerHTML="<div id='"+this._swf_obj_id+"' style='width:100%;height:100%;'></div>";swfobject.embedSWF(this._swf_file_url,this._swf_obj_id,"100%","100%","9",null,{ID:this._swf_obj_id,enableLogs:this._swf_logs},{wmode:"transparent"});var a=swfobject.getFlashPlayerVersion();this._titleText="Engine successfuly inited<br>Flash Player: "+a.major+"."+a.minor+"."+a.release;this._progress_type="percentage";window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]={id:this._swf_obj_id,uploader:this}},_beforeAddFileToQueue:function(a,c){return(this.callEvent("onBeforeFileAdd",[a,c])===true)},_addFileToQueue:function(j,c,g){if(window.dhx4.isIE){var a=document.createElement("INPUT");a.type="TEXT";a.style.position="absolute";a.style.left="0px";a.style.top=window.dhx4.absTop(this.buttons.browse)+"px";a.style.width="10px";document.body.appendChild(a);a.focus();document.body.removeChild(a);a=null}this._files[j]={name:c,size:g,state:"added"};this._addFileToList(j,c,g,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(j){if(!this._files[j]){return}var c=this._files[j].name;var g=(this._data!=null&&this._data[j]!=null?this._data[j].serverName:null);if(this.callEvent("onBeforeFileRemove",[c,g])!==true){return}var a=false;if(this._uploading&&this._files[j].state=="uploading"){this._uploadStop();a=true}swfobject.getObjectById(this._swf_obj_id).removeFileById(j);this._files[j].name=null;this._files[j].size=null;this._files[j].state=null;this._files[j]=null;delete this._files[j];this._removeFileFromList(j);this.callEvent("onFileRemove",[c,g]);if(a){this._uploadStart()}},_doUploadFile:function(a){swfobject.getObjectById(this._swf_obj_id).upload(a,this._swf_upolad_url)},_uploadStop:function(g){for(var c in this._files){if(this._files[c].state=="uploading"){swfobject.getObjectById(this._swf_obj_id).uploadStop(c)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]){window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].id=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].uploader=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]=null;delete window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]}this._swf_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.sl=function(){};dhtmlXFileUploader.prototype.sl.prototype={_initEngine:function(){if(typeof(this._sl_v)=="undefined"){this._sl_v=this.getSLVersion()}if(!window.dhtmlXFileUploaderSLObjects){window.dhtmlXFileUploaderSLObjects={items:{},callEvent:function(g,a,c){window.dhtmlXFileUploaderSLObjects.items[g].uploader[a].apply(window.dhtmlXFileUploaderSLObjects.items[g].uploader,c)}}}this._sl_obj_id="dhtmlXFileUploaderSLObject_"+window.dhx4.newId();if(this._sl_v!=false){this._titleText="Engine successfuly inited<br>Silverlight version: "+this._sl_v[0]+"."+this._sl_v[1];this.buttons.browse.innerHTML='<div style="width:100%;height:100%;"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" id="'+this._sl_obj_id+'"><param name="source" value="'+this._sl_xap+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="SLID='+this._sl_obj_id+",LOGS="+this._sl_logs+'"/><param name="minRuntimeVersion" value="5.0"/></object></div>'}else{this._titleText="Silverlight plugin not found<br>or version less than 4.0";this.buttons.browse.style.cursor="wait";this.buttons.browse.title=""}this._progress_type="percentage";window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]={id:this._sl_obj_id,uploader:this}},_addFileToQueue:function(g,a,c){this._files[g]={name:a,size:c,state:"added"};this._addFileToList(g,a,c,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(c){if(!this._files[c]){return}var a=false;if(this._uploading&&this._files[c].state=="uploading"){this._uploadStop();a=true}document.getElementById([this._sl_obj_id]).Content.a.removeFileById(c);this._files[c].name=null;this._files[c].size=null;this._files[c].state=null;this._files[c]=null;delete this._files[c];this._removeFileFromList(c);if(a){this._uploadStart()}},_doUploadFile:function(c){var a=this._sl_upload_url.split("?");a=(a[1]!=null?"&"+a[1]:"");document.getElementById(this._sl_obj_id).Content.a.upload(c,this._sl_upload_url,a+"&mode=sl&dhxr"+new Date().getTime())},_uploadStop:function(g){this._uploading=false;for(var c in this._files){if(this._files[c].state=="uploading"){document.getElementById(this._sl_obj_id).Content.a.uploadStop(c)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]){window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].id=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].uploader=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]=null;delete window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]}this._sl_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.setSLURL=function(a){this._sl_upload_url=a};dhtmlXFileUploader.prototype.getSLVersion=function(){var a=false;if(window.dhx4.isIE){try{var c=new ActiveXObject("AgControl.AgControl");if(c!=null){var l=4,j=0;while(c.isVersionSupported([l,j].join("."))){a=[l,j];if(++j>9){l++;j=0}}}c=null}catch(g){}}else{if(navigator.plugins["Silverlight Plug-In"]!=null){a=navigator.plugins["Silverlight Plug-In"].description.split(".")}}return a};dhtmlXForm.prototype.saveBackup=function(){if(!this._backup){this._backup={};this._backupId=new Date().getTime()}this._backup[++this._backupId]=this.getFormData();return this._backupId};dhtmlXForm.prototype.restoreBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this.setFormData(this._backup[a])}};dhtmlXForm.prototype.clearBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this._backup[a]=null;delete this._backup[a]}};dhtmlXForm.prototype.addItem=function(g,a,m,j){var c=null;if(g instanceof Array){c=g[1];g=g[0]}var l=null;if(g!=null){var l=this._getParentForm(g,c);if(l!=null){if(l.item._list==null){if(!a.listParent){a.listParent=l.item._idd}l.form._addItem("list",l.item._idd,[a],null,l.item._idd,m,j)}else{l.item._list[0].addItem(null,a,m,j)}l.form=l.item=null;l=null;this._autoCheck();return}}this._prepareItem(a,m,j);this._autoCheck()};dhtmlXForm.prototype.removeItem=function(c,a){this._removeItem(c,a)};dhtmlXForm.prototype.removeColumn=function(n,m,j,g){var r=null;if(n instanceof Array){r=n[1];n=n[0]}if(n!=null){var l=this._getParentForm(n,r);if(l!=null){if(l.item._list!=null&&l.item._list[0]!=null){l.item._list[0].removeColumn(null,m,j,g)}l.form=l.item=null;l=null}return}m=Math.min(Math.max(m,0),this.cont.childNodes.length-1);if(this.cont.childNodes.length==1){if(j==true){this._removeItemsInColumn(this.cont.childNodes[m])}}else{if(j==true){this._removeItemsInColumn(this.cont.childNodes[m])}else{if(!g){var a=m-1;if(a<0){a=m+1}}else{var a=m+1;if(a>this.cont.childNodes.length-1){a=m-1}}while(this.cont.childNodes[m].childNodes.length>0){this.cont.childNodes[a].appendChild(this.cont.childNodes[m].childNodes[0])}}var o=[];for(var c=0;c<this.base.length;c++){if(this.cont.childNodes[m]!=this.base[c]){o.push(this.base[c])}}this.base=o;this.cont.removeChild(this.cont.childNodes[m]);this.b_index--;o=null}};dhtmlXForm.prototype.getColumnNode=function(g,c){var j=null;var a=null;if(g instanceof Array){a=g[1];g=g[0]}if(g!=null){var l=this._getParentForm(g,a);if(l!=null){if(l.item._list!=null&&l.item._list[0]!=null&&j==null){j=l.item._list[0].getColumnNode(null,c)}l.form=l.item=null;l=null}return j}if(c<0||c>this.cont.childNodes.length-1){return null}return this.cont.childNodes[c]};dhtmlXForm.prototype._removeItemsInColumn=function(j){var a=[];for(var g=0;g<j.childNodes.length;g++){var c=j.childNodes[g];if(c._idd!=null&&c._type!=null){a.push([c._idd,(c._type=="ra"?c._value:null)])}c=null}for(var g=0;g<a.length;g++){this.removeItem(a[g][0],a[g][1])}};dhtmlXForm.prototype._getParentForm=function(m,l){if(this.itemPull[this.idPrefix+m]!=null){return{form:this,item:this.itemPull[this.idPrefix+m]}}for(var c in this.itemPull){if(this.itemPull[c]._type=="ra"&&this.itemPull[c]._group==m&&this.itemPull[c]._value==l){return{form:this,item:this.itemPull[c]}}}var j=null;for(var c in this.itemPull){if(!j&&this.itemPull[c]._list!=null){for(var g=0;g<this.itemPull[c]._list.length;g++){if(!j){j=this.itemPull[c]._list[g]._getParentForm(m,l)}}}}return j};(function(){for(var c in dhtmlXForm.prototype.items){if(!dhtmlXForm.prototype.items[c]._getItemNode){dhtmlXForm.prototype.items[c]._getItemNode=function(a){return a}}}})();dhtmlXForm.prototype._getItemNode=function(c,a){if(a!=null){c=[c,a]}return this.doWithItem(c,"_getItemNode")};dhtmlXForm.prototype.setRequired=function(o,m,l){if(typeof(l)=="undefined"){l=m}else{o=[o,m]}var g=this._getItemNode(o);if(!g){return}l=window.dhx4.s2b(l);g._required=(l==true);if(g._required){if(!g._validate){g._validate=[]}var c=false;for(var j=0;j<g._validate.length;j++){c=(g._validate[j]=="NotEmpty"||c)}if(!c){g._validate.push("NotEmpty")}var n=g.childNodes[g._ll?0:1].childNodes[0];if(!(n.lastChild&&n.lastChild.className&&n.lastChild.className.search(/required/)>=0)){var a=document.createElement("SPAN");a.className="dhxform_item_required";a.innerHTML="*";n.appendChild(a);a=n=null}}else{if(g._validate!=null){var c=g._validate;g._validate=[];for(var j=0;j<c.length;j++){if(c[j]!="NotEmpty"){g._validate.push(c[j])}}if(g._validate.length==0){g._validate=null}}var n=g.childNodes[g._ll?0:1].childNodes[0];if(n.lastChild&&n.lastChild.className&&n.lastChild.className.search(/required/)>=0){n.removeChild(n.lastChild);n=null}}this._resetValidateCss(g);g=null};dhtmlXForm.prototype.setNote=function(l,g,a){if(typeof(a)=="undefined"){a=g}else{l=[l,g]}var c=this._getItemNode(l);if(!c){return}var j=this._getNoteNode(c);if(!j){if(!a.width){a.width=c.childNodes[c._ll?1:0].childNodes[0].offsetWidth}j=document.createElement("DIV");j.className="dhxform_note";if({ch:1,ra:1}[c._type]){c.childNodes[c._ll?1:0].insertBefore(j,c.childNodes[c._ll?1:0].lastChild)}else{c.childNodes[c._ll?1:0].appendChild(j)}}j.innerHTML=a.text;if(a.width!=null){j.style.width=a.width+"px";j._w=a.width}j=null};dhtmlXForm.prototype.clearNote=function(j,c){if(typeof(c)!="undefined"){j=[j,c]}var a=this._getItemNode(j);if(!a){return}var g=this._getNoteNode(a);if(g!=null){g.parentNode.removeChild(g);g=null}};dhtmlXForm.prototype._getNoteNode=function(a){var g=null;for(var c=0;c<a.childNodes[a._ll?1:0].childNodes.length;c++){if(String(a.childNodes[a._ll?1:0].childNodes[c].className).search(/dhxform_note/)>=0){g=a.childNodes[a._ll?1:0].childNodes[c]}}a=null;return g};dhtmlXForm.prototype.setValidation=function(m,j,l){if(typeof(note)=="undefined"){l=j}else{m=[m,j]}var c=this._getItemNode(m);if(!c){return}if(c._validate!=null){for(var g=0;g<c._validate.length;g++){c._validate[g]=null}}c._validate=[];if(typeof(l)=="function"||typeof(window[l])=="function"){c._validate=[l]}else{c._validate=String(l).split(this.separator)}if(c._required){var a=false;for(var g=0;g<c._validate.length;g++){a=(c._validate[g]=="NotEmpty"||a)}if(!a){c._validate.push("NotEmpty")}}c=null};dhtmlXForm.prototype.clearValidation=function(j,g){if(typeof(g)!="undefined"){j=[j,g]}var a=this._getItemNode(j);if(!a){return}if(a._validate!=null){for(var c=0;c<a._validate.length;c++){a._validate[c]=null}}a._validate=a._required?["NotEmpty"]:null;a=null};dhtmlXForm.prototype.reloadOptions=function(a,m){var c=this.getItemType(a);if(!{select:1,multiselect:1,combo:1}[c]){return}if(c=="select"||c=="multiselect"){var j=this.getOptions(a);while(j.length>0){j.remove(0)}j.length=0;j=null;if(typeof(m)=="string"){this.doWithItem(a,"doLoadOptsConnector",m)}else{if(m instanceof Array){this.doWithItem(a,"doLoadOpts",{options:m})}}}if(c=="combo"){var n=this.getCombo(a);n.clearAll();n.setComboValue("");if(typeof(m)=="string"){this.doWithItem(a,"doLoadOptsConnector",m)}else{if(m instanceof Array){var g=null;for(var l=0;l<m.length;l++){if(window.dhx4.s2b(m[l].selected)){g=m[l].value}}n.addOption(m);if(g!=null){this.setItemValue(a,g)}n=null}}}};dhtmlXForm.prototype.setTooltip=function(m,l,j){if(typeof(j)=="undefined"){j=l}else{m=[m,l]}var c=this._getItemNode(m);if(!c){return}var a=null;if(c.childNodes.length==1){a=c.childNodes[0]}else{for(var g=0;g<c.childNodes.length;g++){if(c.childNodes[g].className!=null&&c.childNodes[g].className.search("dhxform_label")>=0){a=c.childNodes[g]}}}if(a!=null){if(j==null||j.length==0){a.removeAttribute("title")}else{a.title=j}}a=null};function dhtmlXAccordion(l,n){var j=this;var g=window.dhx4.transDetect();this.conf={skin:(n||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxacc")||"dhx_skyblue"),css:"dhxacc",icons_path:"",multi_mode:false,last_opened:null,on_active_id:null,on_active_click:false,size_changed:true,def_height:90,total_count:0,hiden_count:0,cont_w:null};this.conf.tr={prop:g.transProp,ev:g.transEv,height_open:"height 0.2s cubic-bezier(0.25,0.1,0.25,1)",height_close:"height 0.18s cubic-bezier(0.25,0.1,0.25,1)",op_open:"opacity 0.16s ease-in",op_close:"opacity 0.2s ease-out",op_v_open:"1",op_v_close:"0.4",dnd_top:"top 0.16s"};this.ofs={m:{},s:{},def:{m:{left:0,right:0,first:0,between:8},s:{left:0,right:0,first:0,between:-1,last:0}},base:{s:{},m:{}},skin:{dhx_web:{s:{between:3},m:{between:3}},dhx_terrace:{m:{between:12,left:0,right:0}}}};if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0){this.conf.tr.height_open=this.conf.tr.height_close}else{this.conf.tr.height_open=this.conf.tr.height_close}var m=null;if(typeof(l)=="object"&&!l.tagName){m={};for(var c in l){m[c]=l[c];l[c]=null}l=m.parent;m.parent=null}window.dhtmlXCellTop.apply(this,[l,l._ofs]);this._adjustCont();if(this.base._ofs!=null){for(var o in this.ofs.base){if(this.base._ofs[o]!=null){for(var c in this.base._ofs[o]){this.ofs.base[o][c]=this.base._ofs[o][c]}}}}this._applyOffsets=function(){for(var v in this.ofs.def){var s=this.ofs.def[v];var u=(this.ofs.skin[this.conf.skin]!=null&&this.ofs.skin[this.conf.skin][v]!=null?this.ofs.skin[this.conf.skin][v]:null);var r=(this.base._ofs!=null?this.base._ofs[v]:null);for(var q in s){if(u!=null&&u[q]!=null){this.ofs[v][q]=u[q]}else{if(r!=null&&r[q]!=null){this.ofs[v][q]=r[q]}else{this.ofs[v][q]=s[q]}}}}};this._applyOffsets();this.t={};this.addItem=function(x,w,r,q,v){if(x==null){x="a"+window.dhx4.newId()}while(this.t[x]!=null){x="a"+window.dhx4.newId()}var a=new dhtmlXAccordionCell(x,this);a.conf.skin=this.conf.skin;a.setText(w);if(v!=null){a.setIcon(v)}a.cell._accId=x;a.cell.childNodes[a.conf.idx.hdr].onselectstart=function(y){y=y||event;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}return false};a.cell.childNodes[a.conf.idx.hdr].onclick=function(A){A=A||event;if(A.preventDefault){A.preventDefault()}else{A.returnValue=false}if(j._dnd!=null&&j._dnd.ofs==true){return}var y=(A.target||A.srcElement);var C=null;while(y._accId!=this&&C==null){if(y._accId!=null){C=y._accId}else{y=y.parentNode}}if(C!=null){j._hdrClick(C)}};this.t[x]={cell:a};this.conf.total_count++;if(this.conf.multi_mode){if(typeof(r)=="undefined"){r=true}this.cont.appendChild(a.cell);a.conf.opened=(r==true);if(typeof(q)=="undefined"||q==null||q=="*"){if(q=="*"){a.conf.h_auto=true}q=this.conf.def_height}else{q=Math.max(parseInt(q),30)}a._setSize(this.ofs.m.left,0,this.conf.cont_w||this._getAvailItemWidth(),a.conf.opened?q:a._getHdrHeight());a.cell.style.marginTop=(a.cell==this.cont.firstChild?this.ofs.m.first:this.ofs.m.between)+"px";if(r!=true){a.conf.size.h=q;a._adjustCell();a.cell.className+=" dhx_cell_closed"}this._adjustOpened();if(this._dnd!=null){this._dndAttachEvent(x)}}else{r=(this.conf.last_opened==null?true:window.dhx4.s2b(r));var u=this._updateCellsHeight();if(this.conf.last_opened!=null){if(r){this._closeItem(this.conf.last_opened,false)}else{var s=this.t[this.conf.last_opened].cell;s._setSize(s.conf.size.x,s.conf.size.y,s.conf.size.w,u);s=null}}this.cont.appendChild(a.cell);a.conf.opened=r;a.cell.style.marginTop=String(a.cell==this.cont.firstChild?this.ofs.s.first:this.ofs.s.between)+"px";a._setSize(this.ofs.s.left,0,this.conf.cont_w||this._getAvailItemWidth(),r?u:a._getHdrHeight());if(r){this.conf.last_opened=x}else{a.conf.size.h=u;a._adjustCell();a.cell.className+=" dhx_cell_closed"}}a=null;return this.t[x].cell};this.removeItem=function(a){if(!this.t[a]){return}if(this.conf.last_opened==a){this.conf.last_opened=null}if(this.conf.on_active_id==a){this.conf.on_active_id=null}if(this._dnd!=null){this._dndClearCell(a)}this.conf.total_count--;if(!this.conf.multi_mode&&!this.t[a].cell.conf.visible){this.conf.hiden_count--}this.t[a].cell._unload();this.t[a].cell=null;this.t[a]=null;delete this.t[a];if(!this.conf.unloading){if(!this.conf.multi_mode){this._updateCellsMargin()}this.setSizes()}};this.cells=function(a){return this.t[a].cell};this.enableMultiMode=function(a,q){this.conf.multi_mode=true;if(!isNaN(q)){this.conf.def_height=q}if(a=="auto"||a=="scroll"){this.cont.style.overflowX="hidden";this.cont.style.overflowY=a}else{this.cont.style.overflow="visible"}};this.forEachItem=function(r){for(var q in this.t){if(typeof(r)=="function"){r.apply(this,[this.t[q].cell])}else{if(typeof(r)=="string"&&typeof(window[r])=="function"){window[r].apply(this,[this.t[q].cell])}}}};this._openItem=function(q,a){if(typeof(a)=="undefined"){a=true}if(this.t[q].cell.conf.opened==false){if(this.conf.multi_mode){this.t[q].cell._open(a)}else{if(this.conf.tr.prop==false){if(this.conf.last_opened!=null){this.t[this.conf.last_opened].cell._close(false)}this.t[q].cell._open(false);this.conf.last_opened=q}else{this.conf.on_active_id=q;this.t[q].cell._open(a);if(this.conf.last_opened!=null){this.t[this.conf.last_opened].cell._close(a)}this.conf.last_opened=q}}}};this._closeItem=function(q,a){if(typeof(a)=="undefined"){a=true}if(this.t[q].cell.conf.opened==true){this.t[q].cell._close(a);this.conf.last_opened=null}};this._adjustOpened=function(){if(this.conf.multi_mode==true){if(this._openCache==null){var u=this._getDynData();for(var r in u){this.t[r].cell.conf.size.h=u[r];this.t[r].cell.cell.style.height=u[r]+"px"}}else{var v=false;for(var r in this._openCache){v=(v||this._openCache[r])}if(v==true){return}this._openCache=this._openId=null}var q=this._getAvailItemWidth();for(var r in this.t){var s=true;if(q==this.t[r].cell.conf.size.w&&(this._openMode=="close"||this.t[r].cell.conf.opened==false)){s=false}if(s){this.t[r].cell._setWidth(q)}}this._openMode=null}else{if(this.conf.last_opened!=null){var w=this.conf.last_opened;this.t[w].cell._setSize(this.t[w].cell.conf.size.x,this.t[w].cell.conf.size.y,this.t[w].cell.conf.size.w,this.t[w].cell.conf.size.h)}}};this._getDynData=function(E,D){if(typeof(E)=="undefined"||E==null){E={}}if(typeof(D)=="undefined"||D==null){D={}}var x={};var C=0;var w=0;var u=0;for(var r=0;r<this.cont.childNodes.length;r++){var s=this.cont.childNodes[r]._accId;var H=this.t[s].cell;if(H.conf.visible==true){var y=this.ofs.m[u==0?"first":"between"];if(E[s]==true||D[s]==true||(H.conf.opened==true&&H.conf.h_auto==true)){if(D[s]==true){var A=H._getHdrHeight();x[s]=A;w+=A+y}else{if(H.conf.h_auto==true){x[s]=true;w+=y;C++}else{if(E[s]==true){x[s]=H.conf.size.h;w+=H.conf.size.h+y}}}}else{w+=H.cell.offsetHeight+y}u++}H=null}if(C>0){var v=this.cont.offsetHeight-w;var w=Math.floor(v/C);for(var F in x){if(x[F]==true){if(C>1){v-=w}else{w=v}x[F]=w;C--}}}return x};this.setSizes=function(){this._adjustCont();if(this.conf.multi_mode==true){this._adjustOpened()}else{this.conf.cont_w=null;var r=this._updateCellsHeight();for(var q in this.t){this.t[q].cell._setSize(this.ofs.s.left,0,this.conf.cont_w||this._getAvailItemWidth(),this.t[q].cell.conf.opened?r:this.t[q].cell._getHdrHeight());if(!this.t[q].cell.conf.opened){this.t[q].cell.conf.size.h=r;this.t[q].cell._adjustCell()}}this.conf.size_changed=true}this.callEvent("_onSetSizes",[])};this.setSkin=function(r){this._setBaseSkin(r);this.conf.skin=r;for(var q in this.t){this.t[q].cell.conf.cells_cont=null;this.t[q].cell.conf.skin=this.conf.skin}this._applyOffsets();this._updateCellsMargin();this.setSizes()};this.setIconsPath=function(a){this.conf.icons_path=a};this._getAvailItemWidth=function(){var q=this.ofs[(this.conf.multi_mode?"m":"s")];var a=Math.max(this.cont.clientWidth-q.left-q.right,10);this.conf.cont_w=a;q=null;return a};this._updateCellsHeight=function(){if(this.conf.multi_mode==true){return}var s=this.conf.total_count-this.conf.hiden_count;var u=this.cont.offsetHeight-this.ofs.s.last;if(s==0){return u}var w=false;for(var v=0;v<this.cont.childNodes.length;v++){if(w==false){var x=this.cont.childNodes[v]._accId;if(this.t[x].cell.conf.visible){u-=this.t[x].cell._getHdrHeight()*(s-1);w=true}}}u-=(s-1)*this.ofs.s.between+this.ofs.s.first;for(var r in this.t){if(this.t[r].cell.conf.size!=null){this.t[r].cell.conf.size.h=u;this.t[r].cell._adjustCell()}}return u};this._updateCellsMargin=function(){var a=0;for(var r=0;r<this.cont.childNodes.length;r++){var s=this.cont.childNodes[r]._accId;if(this.t[s].cell.conf.visible){this.t[s].cell.cell.style.marginTop=String(this.ofs[this.conf.multi_mode?"m":"s"][a++==0?"first":"between"])+"px"}}};this._hdrClick=function(q){if(!this.conf.multi_mode&&this.t[q].cell.conf.opened){return}var a=this.t[q].cell.conf.opened;if(this.callEvent("onBeforeActive",[q,(a?false:true)])!==true){return}this.conf.on_active_click=true;this[a?"_closeItem":"_openItem"](q);if(this.conf.multi_mode&&this.conf.tr.prop==false){this._adjustOpened()}};this.unload=function(){this.conf.unloading=true;for(var q in this.t){this.removeItem(q)}this.t=null;if(typeof(this._unloadDND)=="function"){this._unloadDND()}if(this.conf.fs_mode){if(this.conf.fs_tm){window.clearTimeout(this.conf.fs_tm)}if(window.addEventListener){window.removeEventListener("resize",this._doOnResizeStart,false)}else{window.detachEvent("onresize",this._doOnResizeStart)}this._doOnResizeStart=null;this._doOnResizeEnd=null;this.conf.fs_tm=null}if(this.dhxWins){this.dhxWins.unload();this.dhxWins=null}this._unloadTop();window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.ofs=this.conf=null;for(var q in this){this[q]=null}j=null};this.setOffset=function(a){this.ofs.s.between=a;this.ofs.m.between=a;this._updateCellsMargin();this.setSizes()};this._initObj=function(r){if(r.skin!=null){this.setSkin(r.skin)}if(window.dhx4.s2b(r.multi_mode)){this.enableMultiMode()}if(r.icons_path!=null){this.setIconsPath(r.icons_path)}if(r.icon_path!=null){this.setIconsPath(r.icon_path)}if(r.items!=null){for(var a=0;a<r.items.length;a++){this.addItem(r.items[a].id,r.items[a].text,r.items[a].open,r.items[a].height,r.items[a].icon||r.items[a].img)}}if(window.dhx4.s2b(r.dnd)==true&&typeof(this.enableDND)=="function"){this.enableDND()}};this._xmlToObj=function(v){var s={items:[]};var a=v.getElementsByTagName("accordion")[0];if(a.getAttribute("skin")!=null){s.skin=a.getAttribute("skin")}if(a.getAttribute("mode")=="multi"){s.multi_mode=true}if(a.getAttribute("multiMode")!=null){s.multi_mode=window.dhx4.s2b(a.getAttribute("multiMode"))}if(a.getAttribute("iconsPath")!=null){s.icons_path=a.getAttribute("iconsPath")}for(var u=0;u<a.childNodes.length;u++){var w=a.childNodes[u];if(typeof(w.tagName)!="undefined"&&String(w.tagName).toLowerCase()=="cell"){var r={};if(w.getAttribute("id")!=null){r.id=w.getAttribute("id")}if(w.getAttribute("icon")!=null){r.icon=w.getAttribute("icon")}if(w.getAttribute("height")!=null){r.height=w.getAttribute("height")}if(w.getAttribute("open")!=null){r.open=window.dhx4.s2b(w.getAttribute("open"))}r.text=w.firstChild.nodeValue;s.items.push(r)}w=null}return s};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","accordion",{struct:true});window.dhx4._eventable(this);this._callMainEvent=function(q,a){return this.callEvent(q,a)};this.attachEvent("onActive",function(a){if(this.t[a].cell.dataObj!=null&&this.t[a].cell.dataType=="editor"){this.t[a].cell.dataObj._prepareContent(true)}if(this.t[a].cell.conf.opened==true){this.t[a].cell._adjustProgress()}});if(typeof(window.dhtmlXWindows)=="function"){this.dhxWins=new dhtmlXWindows();this.dhxWins.setSkin(this.conf.skin)}if(m!=null){this._initObj(m);m=null}return this}dhtmlXAccordion.prototype=new dhtmlXCellTop();function dhtmlXAccordionCell(j,g){dhtmlXCellObject.apply(this,[j,"_acc"]);this.acc=g;this.conf.visible=true;this.conf.docked=true;this.attachEvent("_onCellUnload",function(){this._trDetachEv();this._unloadDocking();this.acc=null;this.cell._accObj=null;this.cell.childNodes[this.conf.idx.hdr].onselectstart=null;this.cell.childNodes[this.conf.idx.hdr].onclick=null;this._initHeader=null;this._getHdrHeight=null;this._setWidth=null;this._adjustCell=null;this._open=null;this._close=null;this._isOpened=null;this._trInitEv=null;this._trAttachEv=null;this._trDetachEv=null;this._trOnEnd=null;this._onActiveCall=null;this.setText=null;this.getText=null;this.setIcon=null;this.clearIcon=null;this.show=null;this.hide=null;this.isVisible=null;this.setHeight=null;this.moveOnTop=null});this.acc.attachEvent("onBeforeDrag",function(m){if(this.t[m].cell.dataObj!=null&&this.t[m].cell.dataType=="editor"){if(this.conf.editor_data==null){this.conf.editor_data={}}this.conf.editor_data[m]=this.t[m].cell.dataObj.getContent()}for(var l in this.t){this.t[l].cell._showCellCover()}return true});this.acc.attachEvent("onDrop",function(m){if(this.t[m].cell.dataObj!=null&&this.t[m].cell.dataType=="editor"){this.t[m].cell.dataObj._prepareContent(true);if(this.conf.editor_data!=null&&this.conf.editor_data[m]!=null){this.t[m].cell.dataObj.setContent(this.conf.editor_data[m]);this.conf.editor_data[m]=null}}for(var l in this.t){this.t[l].cell._hideCellCover()}});this.attachEvent("_onContentLoaded",function(){this.acc._callMainEvent("onContentLoaded",arguments)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="sidebar"){this._hideBorders()}});this._initHeader();this.conf.tr={};for(var c in this.acc.conf.tr){this.conf.tr[c]=this.acc.conf.tr[c]}if(this.conf.tr.prop!=false){this.attachEvent("_onIdxUpdated",function(){this._cellSetOpacity((this.conf.opened?"open":"close"),false)})}this.open=function(){this.acc._openItem(this._idd)};this.close=function(){this.acc._closeItem(this._idd)};this._setWidth=function(a){if(a!=this.conf.size.w){this.conf.size.w=a;this.cell.style.width=a+"px"}this._adjustCell()};this._adjustCell=function(){this._adjustCont();if(this.dataObj!=null&&typeof(this.dataObj.setSizes)=="function"){this.dataObj.setSizes()}};this._initDocking();return this}dhtmlXAccordionCell.prototype=new dhtmlXCellObject();dhtmlXAccordionCell.prototype._initHeader=function(){var a=document.createElement("DIV");a.className="dhx_cell_hdr";a.innerHTML="<div class='dhx_cell_hdr_text'></div><div class='dhx_cell_hdr_arrow'></div>";this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cont]);a=null;this.conf.ofs_nodes.t._getHdrHeight="func";this.conf.hdr={visible:true};this.conf.idx_data.hdr="dhx_cell_hdr";this._updateIdx()};dhtmlXAccordionCell.prototype._getHdrHeight=function(){return this.cell.childNodes[this.conf.idx.hdr].offsetHeight};dhtmlXAccordionCell.prototype.setText=function(a){this.conf.text=a;this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML="<span>"+a+"</span>"};dhtmlXAccordionCell.prototype.getText=function(){return this.conf.text};dhtmlXAccordionCell.prototype.setIcon=function(g){var c=this.cell.childNodes[this.conf.idx.hdr];if(c.firstChild.className!="dhx_cell_hdr_icon"){c.firstChild.className+=" dhx_cell_hdr_icon";var a=document.createElement("IMG");a.className="dhx_cell_hdr_icon";c.insertBefore(a,c.firstChild);a=null}c.firstChild.src=this.acc.conf.icons_path+g;c=null};dhtmlXAccordionCell.prototype.clearIcon=function(){var a=this.cell.childNodes[this.conf.idx.hdr];if(a.firstChild.className=="dhx_cell_hdr_icon"){a.removeChild(a.firstChild);a.firstChild.className=String(a.firstChild.className).replace(/\s{1,}dhx_cell_hdr_icon/gi,"")}a=null};dhtmlXAccordionCell.prototype._open=function(c){var l={};if(this.acc.conf.multi_mode){var j={};j[this._idd]=true;l=this.acc._getDynData(j);this.acc._openId=this._idd;this.acc._openCache={};this.acc._openMode="open"}else{l[this._idd]=this.conf.size.h}for(var g in l){if(this.acc._openCache!=null){this.acc._openCache[g]=true}var m=this.acc.t[g].cell;m.cell.className=String(m.cell.className).replace(/\s{1,}dhx_cell_closed/gi,"");m.conf.opened=true;m._trInitEv("open",c);m.conf.size.h=l[g];m.cell.style.height=m.conf.size.h+"px";m=null}if(this.conf.tr.prop==false){this.acc._openId=this.acc._openCache=this.acc._openMode=null;this._onActiveCall(true)}};dhtmlXAccordionCell.prototype._close=function(c){var j={};if(this.acc.conf.multi_mode){var l={};l[this._idd]=true;j=this.acc._getDynData(null,l);this.acc._openId=this._idd;this.acc._openCache={};this.acc._openMode="close"}else{j[this._idd]=this._getHdrHeight()}for(var g in j){var m=this.acc.t[g].cell;if(this.acc._openCache!=null){this.acc._openCache[g]=true}if(g==this._idd){m.cell.className+=" dhx_cell_closed";m.conf.opened=false;m._trInitEv("close",c)}else{m.conf.size.h=j[g];m._adjustCell();m._trInitEv("open",c)}m.cell.style.height=j[g]+"px";m=null}if(this.conf.tr.prop==false){this.acc._openId=this.acc._openCache=this.acc._openMode=null;this._onActiveCall(false)}};dhtmlXAccordionCell.prototype.isOpened=function(){return(this.conf.opened==true)};dhtmlXAccordionCell.prototype._trInitEv=function(c,a){if(this.conf.tr.prop==false){return}this._trAttachEv();if(!this.cell._accObj){this.cell._accObj=this.acc}if(a){this.cell.style[this.conf.tr.prop]=this.conf.tr["height_"+c]}this._cellSetOpacity(c,a)};dhtmlXAccordionCell.prototype._trAttachEv=function(){if(!this.conf.tr.ev_attached){this.cell._trProp=this.conf.tr.prop;this.cell.addEventListener(this.conf.tr.ev,this._trOnEnd,false);this.conf.tr.ev_attached=true}};dhtmlXAccordionCell.prototype._trDetachEv=function(){if(this.conf.tr.ev_attached){this.cell.addEventListener(this.conf.tr.ev,this._trOnEnd,false);this.conf.tr.ev_attached=false}};dhtmlXAccordionCell.prototype._trOnEnd=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.propertyName=="height"&&this._accObj!=null){this.style[this._trProp]="";if(this._accObj.conf.multi_mode){if(this._accObj._openCache!=null){this._accObj._openCache[this._accId]=false}this._accObj._adjustOpened()}if(this._accObj.conf.on_active_click==true){if(this._accObj.conf.multi_mode){this._accObj._callMainEvent("onActive",[this._accId,this._accObj.t[this._accId].cell.conf.opened]);this._accObj.conf.on_active_click=false}else{this._accObj._callMainEvent("onActive",[this._accObj.conf.on_active_id,true]);this._accObj.conf.on_active_id=null;this._accObj.conf.on_active_click=false}}this._accObj=null}};dhtmlXAccordionCell.prototype._cellSetOpacity=function(j,c){for(var g in this.conf.idx){if({hdr:true,pr1:true,pr2:true,cover:true}[g]!=true){if(c){this.cell.childNodes[this.conf.idx[g]].style[this.conf.tr.prop]=this.conf.tr["op_"+j]}this.cell.childNodes[this.conf.idx[g]].style.opacity=this.conf.tr["op_v_"+j]}}};dhtmlXAccordionCell.prototype._onActiveCall=function(a){if(this.acc.conf.on_active_click==false){return}if(this.acc.conf.multi_mode==true){this.acc._callMainEvent("onActive",[this._idd,this.conf.opened]);this.acc.conf.on_active_click=false}else{if(a==true){this.acc._callMainEvent("onActive",[this._idd,true]);this.acc.conf.on_active_click=false}}};dhtmlXAccordionCell.prototype.show=function(){if(this.conf.visible){return}if(this.conf.docked==false){this.dock();return}this.cell.style.display="";this.conf.visible=true;if(!this.acc.conf.multi_mode){this.acc.conf.hiden_count--;this.acc._updateCellsHeight();this.acc._updateCellsMargin()}if(this.acc.conf.size_changed){this.acc.setSizes();this.acc.conf.size_changed=false}else{this.acc._adjustOpened()}};dhtmlXAccordionCell.prototype.hide=function(){if(!this.conf.visible){return}if(!this.acc.conf.multi_mode&&this.conf.opened){this._close(false);this.acc.conf.last_opened=null}this.cell.style.display="none";this.conf.visible=false;if(!this.acc.conf.multi_mode){this.acc.conf.hiden_count++;this.acc._updateCellsHeight();this.acc._updateCellsMargin()}this.acc._adjustOpened()};dhtmlXAccordionCell.prototype.isVisible=function(){return(this.conf.visible==true)};dhtmlXAccordionCell.prototype.setHeight=function(a){if(!this.acc.conf.multi_mode){return}if(a=="*"){this.conf.h_auto=true}else{this.conf.h_auto=false;this.conf.size.h=a}if(this.conf.opened){if(a!="*"){this.cell.style.height=a+"px"}this.acc._adjustOpened()}};dhtmlXAccordionCell.prototype.moveOnTop=function(){if(this.cell.parentNode.firstChild==this.cell){return}this.cell.parentNode.insertBefore(this.cell,this.cell.parentNode.firstChild);this.acc._updateCellsMargin()};dhtmlXAccordionCell.prototype._initDocking=function(){var a=this;this.dock=function(){if(this.acc.dhxWins==null||this.conf.docked==true){return}var c=this.acc.dhxWins.window(this._idd);c.close();this._attachFromCell(c);this.conf.docked=true;this.show();if(this.conf.dock_opened){this.open()}c=null;this.acc._callMainEvent("onDock",[this._idd])};this.undock=function(c,m,j,l){if(this.acc.dhxWins==null||this.conf.docked==false){return}this.conf.dock_opened=this.conf.opened;if(this.acc.dhxWins.window(this._idd)!=null){var g=this.acc.dhxWins.window(this._idd);g.show()}else{if(c==null){c=20}if(m==null){m=20}if(j==null){j=320}if(l==null){l=200}var g=this.acc.dhxWins.createWindow(this._idd,c,m,j,l);g.button("close").hide();g.addUserButton("dock",99,"Dock");g.button("dock").show();g.button("dock").attachEvent("onClick",this._doOnDockClick);g.setText(this.getText());g.attachEvent("onClose",this._doOnDockWinClose)}this.conf.docked=false;this.hide();g._attachFromCell(this);g=null;this.acc._callMainEvent("onUnDock",[this._idd])};this._doOnDockClick=function(){a.dock()};this._doOnDockWinClose=function(c){c.hide();return false};this._unloadDocking=function(){a=null}};dhtmlXCellObject.prototype.attachAccordion=function(a){this.callEvent("_onBeforeContentAttach",["acc"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";this._attachObject(c);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={s:{first:-1},m:{first:4}}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_web"){c._ofs={l:2}}else{c._ofs={l:-1}}}this.dataType="acc";this.dataObj=new dhtmlXAccordion(a);a.obj=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXAccordion.prototype.enableDND=function(){if(this.conf.multi_mode==false||this._dnd!=null){return}var g=this;this._dnd={tr_count:0,tr_items:{}};this._dndAttachEvent=function(j){var a=this.t[j].cell;if(a.conf.dnd_inited!=true){if(typeof(window.addEventListener)=="function"){a.cell.childNodes[a.conf.idx.hdr].addEventListener("mousedown",this._dndOnMouseDown,false)}else{a.cell.childNodes[a.conf.idx.hdr].attachEvent("onmousedown",this._dndOnMouseDown)}a.conf.dnd_inited=true}a=null};this._dndDetachEvent=function(j){var a=this.t[j].cell;if(a.conf.dnd_inited==true){if(typeof(window.addEventListener)=="function"){a.cell.childNodes[a.conf.idx.hdr].removeEventListener("mousedown",this._dndOnMouseDown,false)}else{a.cell.childNodes[a.conf.idx.hdr].detachEvent("onmousedown",this._dndOnMouseDown)}a.conf.dnd_inited=false}a=null};this._dndOnMouseDown=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}var a=(j.target||j.srcElement);while(a!=null&&a.parentNode!=g.cont){a=a.parentNode}if(a!=null){g._dndDragStart(j,a)}a=null};this._dndDragStart=function(n,l){if(this._dnd.tr_waiting==true){return}var a=-1;for(var m=0;m<l.parentNode.childNodes.length;m++){if(l.parentNode.childNodes[m]==l){a=m}}if(this.callEvent("onBeforeDrag",[l._accId,a])!==true){return}if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",this._dndOnMouseMove,false);document.body.addEventListener("mouseup",this._dndOnMouseUp,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove,false);document.body.attachEvent("onmouseup",this._dndOnMouseUp,false)}this._dnd.dragObj=l;this._dnd.dy=n.clientY;var j=0;for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){this._dnd.dragObj.parentNode.childNodes[m]._ind=m;if(this._dnd.dragObj.parentNode.childNodes[m]==this._dnd.dragObj){this._dnd.dragObj._k0=j;if(m>0){this._dnd.dragObj._k0+=this.ofs.m.between-this.ofs.m.first}j=0}else{j+=this._dnd.dragObj.parentNode.childNodes[m].offsetHeight+parseInt(this._dnd.dragObj.parentNode.childNodes[m].style.marginTop)}}this._dnd.dragObj._k1=j;this._dnd.h=this._dnd.dragObj.offsetHeight;this._dnd.ofs=false};this._dndDoDrag=function(v){if(!this._dnd.dragObj){return}if(this._dnd.tr_waiting==true){return}var n=v.clientY-this._dnd.dy;if(this._dnd.ofs==false&&Math.abs(n)>5){this._dnd.dragObj.className+=" acc_cell_dragged";this._dnd.ofs=true}if(n<0){if(n<-this._dnd.dragObj._k0){n=-this._dnd.dragObj._k0}}else{if(n>this._dnd.dragObj._k1){n=this._dnd.dragObj._k1}}this._dnd.dragObj.style.top=n+"px";var u=v.clientY-this._dnd.dy;var m=0;var j=0;for(var o=this._dnd.dragObj._ind+1;o<=this._dnd.dragObj.parentNode.lastChild._ind;o++){var a=this._dnd.dragObj.parentNode.childNodes[o].offsetHeight;if(u>m+a*2/3){j++}m+=a}var l=this._dnd.dragObj.nextSibling;var o=0;while(l!=null){if(++o<=j&&l!=null){if(!l._ontop){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,false,parseInt(l.style.top||0),-this._dnd.h-this.ofs.m.between);l._ontop=true}}else{if(l._ontop){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,true,parseInt(l.style.top||0),0);l._ontop=false}}l=l.nextSibling}var u=this._dnd.dy-v.clientY;var m=0;var j=0;for(var o=this._dnd.dragObj._ind-1;o>=this._dnd.dragObj.parentNode.firstChild._ind;o--){var a=this._dnd.dragObj.parentNode.childNodes[o].offsetHeight;if(u>m+a*2/3){j++}m+=a}var l=this._dnd.dragObj.previousSibling;var o=0;while(l!=null){if(++o<=j&&l!=null){if(!l._onbottom){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,true,parseInt(l.style.top||0),this._dnd.h+this.ofs.m.between);l._onbottom=true}}else{if(l._onbottom){if(l._tm){window.clearTimeout(l._tm)}this._dndAnim(l,false,parseInt(l.style.top),0);l._onbottom=false}}l=l.previousSibling}};this._dndDragStop=function(r,n){if(n){}else{if(this._dnd.tr_count>0){this._dnd.tr_waiting=true;return}}if(!this._dnd.dragObj){return}this._dnd.dragObj.className=String(this._dnd.dragObj.className).replace(/\s{0,}acc_cell_dragged/gi,"");this._dnd.dragObj.style.top="0px";var o=false;for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){var l=this._dnd.dragObj.parentNode.childNodes[m];if(l!=this._dnd.dragObj){if(l._tm){window.clearTimeout(l._tm)}l.style.top="0px";if(l._ontop&&((l.nextSibling!=null&&l.nextSibling._ontop!=true)||!l.nextSibling)){o=(l.nextSibling||null)}if(l._onbottom&&((l.previousSibling!=null&&l.previousSibling._onbottom!=true)||!l.previousSibling)){o=l}}l=null}for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){this._dnd.dragObj.parentNode.childNodes[m]._ontop=null;this._dnd.dragObj.parentNode.childNodes[m]._onbottom=null}if(o!==false){if(o==null){this._dnd.dragObj.parentNode.appendChild(this._dnd.dragObj)}else{this._dnd.dragObj.parentNode.insertBefore(this._dnd.dragObj,o)}}var u=this._dnd.dragObj._accId;var j=this._dnd.dragObj._ind;var a=j;for(var m=0;m<this._dnd.dragObj.parentNode.childNodes.length;m++){if(this._dnd.dragObj.parentNode.childNodes[m]==this._dnd.dragObj){a=m}}this._dnd.dragObj=null;this._dnd.tr_waiting=false;this._updateCellsMargin();if(j!=a){this.setSizes();this.callEvent("onDrop",[u,j,a])}if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousemove",this._dndOnMouseMove,false);document.body.removeEventListener("mouseup",this._dndOnMouseUp,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove,false);document.body.detachEvent("onmouseup",this._dndOnMouseUp,false)}};this._dndAnim=function(n,a,m,l){if(this.conf.tr.prop!=false){if(!n._dnd_ev){n._dnd_ev=true;n._dnd_tr_prop=this.conf.tr.prop;n.addEventListener(this.conf.tr.ev,this._dndOnTrEnd,false)}if(this._dnd.tr_items[n._accId]!=true){this._dnd.tr_items[n._accId]=true;this._dnd.tr_count++}n.style[this.conf.tr.prop]=this.conf.tr.dnd_top;n.style.top=l+"px";return}var j=false;if(a){m+=5;if(m>=l){m=l;j=true}}else{m-=5;if(m<=l){m=l;j=true}}n.style.top=m+"px";if(n._tm){window.clearTimeout(n._tm)}if(!j){n._tm=window.setTimeout(function(){g._dndAnim(n,a,m,l)},5)}else{n._tm=null}};this._dndOnTrEnd=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.propertyName=="top"){if(g._dnd.tr_items[this._accId]==true){g._dnd.tr_count--;g._dnd.tr_items[this._accId]=false}this.style[this._dnd_tr_prop]="";if(g._dnd.tr_count==0&&g._dnd.tr_waiting==true){g._dndDragStop(null,true)}}};this._dndOnMouseMove=function(a){g._dndDoDrag(a||event)};this._dndOnMouseUp=function(a){g._dndDragStop(a||event)};this._dndClearCell=function(a){if(this.t[a].cell.cell._dnd_ev){this.t[a].cell.cell.addEventListener(this.conf.tr.ev,this._dndOnTrEnd,false)}this._dndDetachEvent(a)};this._unloadDND=function(){for(var j in this){if(String(j).indexOf("_dnd")==0&&typeof(this[j])=="function"){this[j]=null}}this._dnd=null;g=null};for(var c in this.t){this._dndAttachEvent(c)}};function dhtmlXLayoutObject(g,o,w){var u=null;if(g!=null&&typeof(g)=="object"&&typeof(g.tagName)=="undefined"&&g._isCell!=true){u={};if(g.autosize!=null){u.autosize=g.autosize}if(g.cells!=null){u.cells=g.cells}if(g.pattern!=null){o=g.pattern}if(g.skin!=null){w=g.skin}if(g.offsets!=null){u.offsets=g.offsets}g=g.parent}this.cdata={};this.conf={skin:(w||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxlayout")||"dhx_skyblue"),css:"dhxlayout",hh:20,autosize:"b",nextCell:{a:"b",b:"a"},inited:false,b_size:{w:-1,h:-1}};if(typeof(g)=="object"&&g._isCell==true){var n=(typeof(u)!="undefined"&&u!=null?u:{});if(n.pattern==null&&o!=null){n.pattern=o}if(n.skin==null&&w!=null){n.skin=w}var l=g.attachLayout(n);return l}window.dhtmlXCellTop.apply(this,[g,(u==null?null:u.offsets)]);this.conf.sw=this._detectSW();var m=this;this._getLayout=function(){return this};this.mainInst=(g._layoutMainInst!=null?g._layoutMainInst:null);this._getMainInst=function(){if(this.mainInst!=null){return this.mainInst._getMainInst()}return this};this._init=function(A){var y=(typeof(A)=="string"?this.tplData[A]:A);this.conf.mode=y.mode;if(this.conf.mode=="c"){this.cdata.a=new dhtmlXLayoutCell("a",this)}else{this.cdata.a=new dhtmlXLayoutCell("a",this);this.cdata.b=new dhtmlXLayoutCell("b",this)}for(var x in this.cdata){this.cont.appendChild(this.cdata[x].cell);this.cdata[x].conf.init={w:0.5,h:0.5}}if(this.conf.mode!="c"){var q=this._getMainInst();if(q.conf.sep_idx==null){q.conf.sep_idx=1}else{q.conf.sep_idx++}this.sep=new dhtmlXLayoutSepObject(this.conf.mode,q.conf.sep_idx);this.cont.appendChild(this.sep.sep);this.sep._getLayout=function(){return m._getLayout()};q=null}if(y.cells!=null){for(var x in y.cells){if(y.cells[x].width!=null){this.cdata[x].conf.init.w=y.cells[x].width}if(y.cells[x].height!=null){this.cdata[x].conf.init.h=y.cells[x].height}if(y.cells[x].name!=null){this.cdata[x].conf.name=y.cells[x].name;this.cdata[x].setText(y.cells[x].name)}if(y.cells[x].fsize!=null){this.cdata[x].conf.fsize=y.cells[x].fsize}}}this.setSizes();for(var x in this.cdata){this.cdata[x].conf.init={}}if(y.cells!=null){for(var x in y.cells){if(y.cells[x].layout!=null){this.cdata[x].dataNested=true;this.cdata[x]._layoutMainInst=this;this.cdata[x].attachLayout({pattern:y.cells[x].layout});this.cdata[x]._layoutMainInst=null}}}};this.setSizes=function(E,M,I,x){var F=(this.conf.inited==true&&this._getMainInst()==this&&this.checkEvent("onResizeFinish")==true?{}:false);this._adjustCont();var L=this.cont.offsetWidth;var C=this.cont.offsetHeight;if(this.conf.mode=="c"){var a=0;var N=0;var q=L;var K=C;this.cdata.a._setSize(a,N,q,K,E,I,x);this.callEvent("_onSetSizes",[]);if(F&&(!(this.conf.b_size.w==L&&this.conf.b_size.h==C))){this._callMainEvent("onResizeFinish",[])}this.conf.b_size={w:L,h:C};return}if(typeof(M)=="undefined"){var y=(this.conf.mode=="v"?"w":"h");M=this.conf.autosize;if(this.cdata.a.conf.collapsed){M="b"}else{if(this.cdata.b.conf.collapsed){M="a"}else{if(E=="a"||E=="b"){M=this.conf.nextCell[E]}}}}else{}if(this.conf.mode=="v"){if(M=="a"){if(this.cdata.b.conf.init.w!=null){var J=Math.round(L*this.cdata.b.conf.init.w-this.conf.sw/2)}else{var J=this.cdata.b.conf.size.w}var H=L-J;var D=0;var A=C;var a=0;var N=D;var q=H-a-this.conf.sw;var K=A}else{var a=0;var N=0;if(this.cdata.a.conf.init.w!=null){var q=Math.round(L*this.cdata.a.conf.init.w-this.conf.sw/2)-a}else{var q=this.cdata.a.conf.size.w}var K=C-N;var H=a+q+this.conf.sw;var D=N;var J=L-H;var A=K}this.cdata.a._setSize(a,N,q,K,E,I,x);this.cdata.b._setSize(H,D,J,A,E,I,x);this.sep._setSize(a+q,N,this.conf.sw,K)}else{if(M=="a"){if(this.cdata.b.conf.init.h!=null){var A=Math.round(C*this.cdata.b.conf.init.h-this.conf.sw/2)}else{var A=this.cdata.b.conf.size.h}var H=0;var D=C-A;var J=L-H;var a=H;var N=0;var q=J;var K=D-N-this.conf.sw}else{var a=0;var N=0;var q=L-a;if(this.cdata.a.conf.init.h!=null){var K=Math.round(C*this.cdata.a.conf.init.h-this.conf.sw/2)}else{var K=this.cdata.a.conf.size.h}var H=a;var D=N+K+this.conf.sw;var J=q;var A=C-D}this.cdata.a._setSize(a,N,q,K,E,I,x);this.cdata.b._setSize(H,D,J,A,E,I,x);this.sep._setSize(a,N+K,q,this.conf.sw)}this.callEvent("_onSetSizes",[]);if(F&&(!(this.conf.b_size.w==L&&this.conf.b_size.h==C))){this._callMainEvent("onResizeFinish",[])}this.conf.b_size={w:L,h:C}};this._getAvailWidth=function(){var A=[];for(var E=0;E<this.conf.as_cells.h.length;E++){var x=this.cells(this.conf.as_cells.h[E]);var C=x.layout;var y=C.conf.autosize;if(x.conf.collapsed){x=C.cdata[C.conf.nextCell[x._idd]];y=C.conf.nextCell[y]}A.push(Math.max(0,x.getWidth()-x._getMinWidth(y)));C=x=null}var D=(A.length>0?Math.min.apply(window,A):0);return this.cont.offsetWidth-D};this._getAvailHeight=function(){var C=[];for(var E=0;E<this.conf.as_cells.v.length;E++){var x=this.cells(this.conf.as_cells.v[E]);var A=x.layout;var y=A.conf.autosize;if(x.conf.collapsed){x=A.cdata[A.conf.nextCell[x._idd]];y=A.conf.nextCell[y]}C.push(Math.max(0,x.getHeight()-x._getHdrHeight()-x._getMinHeight(y)));A=x=null}var D=Math.min.apply(window,C);return this.cont.offsetHeight-D};this.setSkin=function(a){this._setBaseSkin(a);this.conf.skin=a};this.unload=function(){this.conf.unloading=true;this.mainInst=null;this.parentLayout=null;if(this.items!=null){for(var y=0;y<this.items.length;y++){this.items[y]=null}this.items=null}if(this.dhxWins!=null){this.dhxWins.unload();this.dhxWins=null}if(this.sep!=null){this.sep._unload();this.sep=null}for(var x in this.cdata){this.cdata[x]._unload();this.cdata[x]=null}this._unloadTop();window.dhx4._eventable(this,"clear");for(var x in this){this[x]=null}m=null};this._getWindowMinDimension=function(y){var a=m._getAvailWidth()+7+7;var x=m._getAvailHeight()+7+31;var q={w:Math.max(a,200),h:Math.max(x,140)};y=null;return q};window.dhx4._eventable(this);this._callMainEvent=function(q,a){return this.callEvent(q,a)};this._init(o||"3E");var r=this._availAutoSize[o];if(r!=null){this.conf.pattern=o;this.setAutoSize(r.h[r.h.length-1],r.v[r.v.length-1])}if(typeof(window.dhtmlXWindows)=="function"){this.dhxWins=new dhtmlXWindows();this.dhxWins.setSkin(this.conf.skin)}this.conf.inited=true;if(this==this._getMainInst()){var s=0;this.items=[];this.forEachItem(function(a){m.items.push(a);a.conf.index=s++})}if(this==this._getMainInst()&&u!=null){if(u.autosize!=null){this.setAutoSize.apply(this,u.autosize)}if(u.cells!=null){for(var c=0;c<u.cells.length;c++){var j=u.cells[c];var v=this.cells(j.id);if(j.width){v.setWidth(j.width)}if(j.height){v.setHeight(j.height)}if(j.text){v.setText(j.text)}if(j.collapsed_text){v.setCollapsedText(j.collapsed_text)}if(j.collapse){v.collapse()}if(j.fix_size){v.fixSize(j.fix_size[0],j.fix_size[1])}if(typeof(j.header)!="undefined"&&window.dhx4.s2b(j.header)==false){v.hideHeader()}}}}u=null;return this}dhtmlXLayoutObject.prototype=new dhtmlXCellTop();dhtmlXLayoutObject.prototype.cells=function(j){for(var c in this.cdata){if(this.cdata[c].conf.name==j){return this.cdata[c]}if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){var g=this.cdata[c].dataObj.cells(j);if(g!=null){return g}}}return null};dhtmlXLayoutObject.prototype.forEachItem=function(j,g){if(typeof(j)!="function"){return}if(typeof(g)=="undefined"){g=this}for(var c in this.cdata){if(typeof(this.cdata[c].conf.name)!="undefined"){j.apply(g,[this.cdata[c]])}if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){this.cdata[c].dataObj.forEachItem(j,g)}}g=null};dhtmlXLayoutObject.prototype._forEachSep=function(j,g){if(typeof(j)!="function"){return}if(typeof(g)=="undefined"){g=this}if(this.sep!=null){j.apply(g,[this.sep])}for(var c in this.cdata){if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){this.cdata[c].dataObj._forEachSep(j,g)}}g=null};dhtmlXLayoutObject.prototype._detectSW=function(){if(this._confGlob.sw==null){this._confGlob.sw={}}if(this._confGlob.sw[this.conf.skin]==null){this._confGlob.sw[this.conf.skin]=window.dhx4.readFromCss("dhxlayout_sep_sw_"+this.conf.skin)}return this._confGlob.sw[this.conf.skin]};dhtmlXLayoutObject.prototype._confGlob={};dhtmlXLayoutObject.prototype.listPatterns=function(){var g=[];for(var c in this.tplData){g.push(c)}return g};dhtmlXLayoutObject.prototype.listAutoSizes=function(){var j=(this.conf.as_cells!=null?(this.conf.as_cells.h).join(";"):"");var g=(this.conf.as_cells!=null?(this.conf.as_cells.v).join(";"):"");var c=this._availAutoSize[this.conf.pattern].h;var a=this._availAutoSize[this.conf.pattern].v;return[j,g,c,a]};dhtmlXLayoutObject.prototype._getCellsNames=function(j){var l={};if(this.cdata[j].conf.name!=null){l[this.cdata[j].conf.name]=true}if(this.cdata[j].dataType=="layout"&&this.cdata[j].dataObj!=null&&this.cdata[j].dataObj.mainInst==this){var c=this.cdata[j].dataObj._getCellsNames("a");var m=this.cdata[j].dataObj._getCellsNames("b");for(var g in c){l[g]=c[g]}for(var g in m){l[g]=m[g]}}return l};dhtmlXLayoutObject.prototype.setAutoSize=function(c,r,u){if(u!==true){var w=this.listAutoSizes();if(w[0]==c&&w[1]==r){return}var o=false;var n=false;for(var g=0;g<w[2].length;g++){o=o||w[2][g]==c}for(var g=0;g<w[3].length;g++){n=n||w[3][g]==r}if(!o||!n){return}}this.conf.as_cells={h:c.split(";"),v:r.split(";")};var j=(this.conf.mode=="v"?"h":"v");for(var v in this.cdata){var l=this._getCellsNames(v);var x=false;for(var g=0;g<this.conf.as_cells[j].length;g++){x=x||l[this.conf.as_cells[j][g]]}if(x){this.conf.autosize=v}if(this.cdata[v].dataType=="layout"&&this.cdata[v].dataObj!=null){this.cdata[v].dataObj.setAutoSize(c,r,true)}}};dhtmlXLayoutObject.prototype.tplData={"1C":{mode:"c",cells:{a:{name:"a"}}},"2E":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{name:"b",fsize:{v:1}}}},"2U":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{name:"b",fsize:{h:1}}}},"3E":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{v:[1,2]}},b:{name:"c",fsize:{v:2}}}}}}},"3W":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{name:"c",fsize:{h:2}}}}}}},"3J":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"c",fsize:{h:1,v:2}}}}},b:{name:"b",fsize:{h:1}}}},"3L":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:2}},b:{name:"c",fsize:{h:1,v:2}}}}}}},"3T":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:2,v:1}},b:{name:"c",fsize:{h:2,v:1}}}}}}},"3U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2,v:1}},b:{name:"b",fsize:{h:2,v:1}}}}},b:{name:"c",fsize:{v:1}}}},"4H":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:[1,2],v:3}},b:{name:"c",fsize:{h:[1,2],v:3}}}}},b:{name:"d",fsize:{h:2}}}}}}},"4I":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:3,v:[1,2]}},b:{name:"c",fsize:{h:3,v:[1,2]}}}}},b:{name:"d",fsize:{v:2}}}}}}},"4T":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[2,3],v:1}},b:{name:"d",fsize:{h:3,v:1}}}}}}}}}},"4U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[2,3],v:1}},b:{name:"c",fsize:{h:3,v:1}}}}}}}},b:{name:"d",fsize:{v:1}}}},"4E":{mode:"h",cells:{a:{name:"a",height:1/4,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{v:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{v:[2,3]}},b:{name:"d",fsize:{v:3}}}}}}}}}},"4W":{mode:"v",cells:{a:{name:"a",width:1/4,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[2,3]}},b:{name:"d",fsize:{h:3}}}}}}}}}},"4A":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"b",fsize:{h:1,v:2}}}}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[1,3]}},b:{name:"d",fsize:{h:3}}}}}}},"4L":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:2,v:3}},b:{name:"d",fsize:{h:2,v:3}}}}}}}}}},"4J":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:3,v:2}},b:{name:"d",fsize:{h:3,v:2}}}}}}}}}},"4F":{mode:"h",cells:{a:{height:1/3,layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2,v:1}},b:{name:"b",fsize:{h:2,v:1}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{v:[1,3]}},b:{name:"d",fsize:{v:3}}}}}}},"4G":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{name:"d",fsize:{h:1}}}},"4C":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:1,v:[2,3]}},b:{name:"d",fsize:{h:1,v:3}}}}}}}}}},"5H":{mode:"v",cells:{a:{width:1/3,name:"a",fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:[1,2],v:[3,4]}},b:{name:"d",fsize:{h:[1,2],v:4}}}}}}}},b:{name:"e",fsize:{h:2}}}}}}},"5I":{mode:"h",cells:{a:{height:1/3,name:"a",fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[3,4],v:[1,2]}},b:{name:"d",fsize:{h:4,v:[1,2]}}}}}}}},b:{name:"e",fsize:{v:2}}}}}}},"5U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",width:1/4,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:[2,3],v:1}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[3,4],v:1}},b:{name:"d",fsize:{h:4,v:1}}}}}}}}}}},b:{name:"e",fsize:{v:1}}}},"5E":{mode:"h",cells:{a:{name:"a",height:1/5,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{v:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{v:[3,4]}},b:{name:"e",fsize:{v:4}}}}}}}}}}}}},"5W":{mode:"v",cells:{a:{name:"a",width:1/5,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/4,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/3,fsize:{h:[2,3]}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[3,4]}},b:{name:"e",fsize:{h:4}}}}}}}}}}}}},"5K":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:4}},b:{name:"e",fsize:{h:1,v:4}}}}}}},"5S":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"b",fsize:{h:1,v:2}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[3,2]}},b:{name:"e",fsize:{h:1,v:4}}}}}}}}}},"5G":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[1,4]}},b:{name:"e",fsize:{h:4}}}}}}},"5C":{mode:"v",cells:{a:{width:2/3,layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2}},b:{name:"b",fsize:{h:[2,1]}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[3,4]}},b:{name:"e",fsize:{h:1,v:4}}}}}}}}}},"6H":{mode:"v",cells:{a:{width:1/3,name:"a",fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:[1,2],v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:[1,2],v:[4,5]}},b:{name:"e",fsize:{h:[1,2],v:5}}}}}}}}}}},b:{name:"f",fsize:{h:2}}}}}}},"6I":{mode:"h",cells:{a:{height:1/3,name:"a",fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/4,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/3,fsize:{h:[3,4],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[4,5],v:[1,2]}},b:{name:"e",fsize:{h:5,v:[1,2]}}}}}}}}}}},b:{name:"f",fsize:{v:2}}}}}}},"6A":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/5,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[4,5]}},b:{name:"e",fsize:{h:1,v:5}}}}}}}}}}}}}},b:{name:"f",fsize:{h:1}}}},"6C":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/5,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:1,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:1,v:[4,5]}},b:{name:"f",fsize:{h:1,v:5}}}}}}}}}}}}}}}},"6J":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",height:1/4,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:1,v:[3,4]}},b:{name:"d",fsize:{h:1,v:4}}}}}}}}}}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[1,5]}},b:{name:"f",fsize:{h:5}}}}}}},"6E":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:2,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:2,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:2,v:[4,5]}},b:{name:"f",fsize:{h:2,v:5}}}}}}}}}}}}}}}},"6W":{mode:"v",cells:{a:{name:"a",width:1/6,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/5,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/4,fsize:{h:[2,3]}},b:{layout:{mode:"v",cells:{a:{name:"d",width:1/3,fsize:{h:[3,4]}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[4,5]}},b:{name:"f",fsize:{h:5}}}}}}}}}}}}}}}},"7H":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/5,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:[1,2],v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:[1,2],v:[4,5]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:[1,2],v:[5,6]}},b:{name:"f",fsize:{h:[1,2],v:6}}}}}}}}}}}}}},b:{name:"g",fsize:{h:2}}}}}}},"7I":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/5,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/4,fsize:{h:[3,4],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"d",width:1/3,fsize:{h:[4,5],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[5,6],v:[1,2]}},b:{name:"f",fsize:{h:6,v:[1,2]}}}}}}}}}}}}}},b:{name:"g",fsize:{v:2}}}}}}}};dhtmlXLayoutObject.prototype._availAutoSize={"1C":{h:["a"],v:["a"]},"2E":{h:["a;b"],v:["a","b"]},"2U":{h:["a","b"],v:["a;b"]},"3E":{h:["a;b;c"],v:["a","b","c"]},"3W":{h:["a","b","c"],v:["a;b;c"]},"3J":{h:["a;c","b"],v:["a;b","b;c"]},"3L":{h:["a","b;c"],v:["a;b","a;c"]},"3T":{h:["a;b","a;c"],v:["a","b;c"]},"3U":{h:["a;c","b;c"],v:["a;b","c"]},"4H":{h:["a","b;c","d"],v:["a;b;d","a;c;d"]},"4I":{h:["a;b;d","a;c;d"],v:["a","b;c","d"]},"4T":{h:["a;b","a;c","a;d"],v:["a","b;c;d"]},"4U":{h:["a;d","b;d","c;d"],v:["a;b;c","d"]},"4E":{h:["a;b;c;d"],v:["a","b","c","d"]},"4W":{h:["a","b","c","d"],v:["a;b;c;d"]},"4A":{h:["a;b","c","d"],v:["a;c;d","b;c;d"]},"4L":{h:["a","b","c;d"],v:["a;b;c","a;b;d"]},"4J":{h:["a;b;c","a;b;d"],v:["a","b","c;d"]},"4F":{h:["a;c;d","b;c;d"],v:["a;b","c","d"]},"4G":{h:["a;b;c","d"],v:["a;d","b;d","c;d"]},"4C":{h:["a","b;c;d"],v:["a;b","a;c","a;d"]},"5H":{h:["a","b;c;d","e"],v:["a;b;e","a;c;e","a;d;e"]},"5I":{h:["a;b;e","a;c;e","a;d;e"],v:["a","b;c;d","e"]},"5U":{h:["a;e","b;e","c;e","d;e"],v:["a;b;c;d","e"]},"5E":{h:["a;b;c;d;e"],v:["a","b","c","d","e"]},"5W":{h:["a","b","c","d","e"],v:["a;b;c;d;e"]},"5K":{h:["a;b;c","d;e"],v:["a;d","b;d","c;d","a;e","b;e","c;e"]},"5S":{h:["a;b","c;d;e"],v:["a;c","a;d","a;e","b;c","b;d","b;e"]},"5G":{h:["a;b;c","d","e"],v:["a;d;e","b;d;e","c;d;e"]},"5C":{h:["a","b","c;d;e"],v:["a;b;c","a;b;d","a;b;e"]},"6H":{h:["a","b;c;d;e","f"],v:["a;b;f","a;c;f","a;d;f","a;e;f"]},"6I":{h:["a;b;f","a;c;f","a;d;f","a;e;f"],v:["a","b;c;d;e","f"]},"6A":{h:["a;b;c;d;e","f"],v:["a;f","b;f","c;f","d;f","e;f"]},"6C":{h:["a","b;c;d;e;f"],v:["a;b","a;c","a;d","a;e","a;f"]},"6J":{h:["a;b;c;d","e","f"],v:["a;e;f","b;e;f","c;e;f","d;e;f"]},"6E":{h:["a","b","c;d;e;f"],v:["a;b;c","a;b;d","a;b;e","a;b;f"]},"6W":{h:["a","b","c","d","e","f"],v:["a;b;c;d;e;f"]},"7H":{h:["a","b;c;d;e;f","g"],v:["a;b;g","a;c;g","a;d;g","a;e;g","a;f;g"]},"7I":{h:["a;b;g","a;c;g","a;d;g","a;e;g","a;f;g"],v:["a","b;c;d;e;f","g"]}};function dhtmlXLayoutSepObject(g,a){var c=this;this.conf={mode:g,idx:a,blocked:false,locked:false,btn_left:((window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8)&&typeof(window.addEventListener)=="undefined"?1:0)};if(window.dhx4.isIE&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")>=0){this.conf.btn_left=1}this.sep=document.createElement("DIV");this.sep.className="dhxlayout_sep";if(window.dhx4.isIE==true){this.sep.onselectstart=function(){return false}}this.sep.className="dhxlayout_sep dhxlayout_sep_resize_"+this.conf.mode;this._setSize=function(j,n,l,m){this.sep.style.left=j+"px";this.sep.style.top=n+"px";this.sep.style.width=Math.max(l,0)+"px";this.sep.style.height=Math.max(m,0)+"px"};this._lockSep=function(j){this.conf.locked=(j==true);this._blockSep()};this._setWH=function(j){var l=this._getLayout();l.conf.sw=(j==null?l._detectSW():Math.max(parseInt(j)||-1,-1));l._getMainInst().setSizes();l=null};this._blockSep=function(){var j=this._getLayout();var l=j.cdata.a.conf.collapsed||j.cdata.b.conf.collapsed||this.conf.locked;j=null;if(this.conf.blocked==l){return}this.sep.className="dhxlayout_sep"+(l?"":" dhxlayout_sep_resize_"+this.conf.mode);this.conf.blocked=l};this._beforeResize=function(l){if(this.conf.blocked){return}if(this.conf.resize!=null&&this.conf.resize.active==true){return}if(l.type=="touchstart"){this.sep.className+=" dhxlayout_sep_resize_actv";var n=(l.pageX||l.touches[0].pageX);var m=(l.pageY||l.touches[0].pageY)}else{if(l.button!==this.conf.btn_left){return}var n=l.clientX;var m=l.clientY}var j=this._getLayout();this.conf.resize={sx:n,sy:m,tx:l.layerX,ty:l.layerY,sep_x:parseInt(this.sep.style.left),sep_y:parseInt(this.sep.style.top),min_wa:j.cdata.a._getAvailWidth("a"),min_wb:j.cdata.b._getAvailWidth("b"),min_ha:j.cdata.a._getAvailHeight("a"),min_hb:j.cdata.b._getAvailHeight("b")};this.conf.resize.nx=this.conf.resize.sep_x;this.conf.resize.ny=this.conf.resize.sep_y;if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._doOnMouseMove,false);window.addEventListener("mouseup",this._doOnMouseUp,false);window.addEventListener("touchmove",this._doOnMouseMove,false);window.addEventListener("touchend",this._doOnMouseUp,false)}else{document.body.attachEvent("onmousemove",this._doOnMouseMove);document.body.attachEvent("onmouseup",this._doOnMouseUp)}j=null};this._onResize=function(m){if(!this.conf.resize.active){this._initResizeArea();this.conf.resize.active=true}if(this.conf.mode=="v"){var j=(m.type=="mousemove"?m.clientX:(m.pageX||m.touches[0].pageX));var l=this.conf.resize.sx-j;this.conf.resize.nx=this.conf.resize.sep_x-l;if(this.conf.resize.nx>this.conf.resize.sep_x+this.conf.resize.min_wb){this.conf.resize.nx=this.conf.resize.sep_x+this.conf.resize.min_wb}else{if(this.conf.resize.nx<this.conf.resize.sep_x-this.conf.resize.min_wa){this.conf.resize.nx=this.conf.resize.sep_x-this.conf.resize.min_wa}}this.r_sep.style.left=this.conf.resize.nx+"px"}else{var n=(m.type=="mousemove"?m.clientY:(m.pageY||m.touches[0].pageY));var l=this.conf.resize.sy-n;this.conf.resize.ny=this.conf.resize.sep_y-l;if(this.conf.resize.ny>this.conf.resize.sep_y+this.conf.resize.min_hb){this.conf.resize.ny=this.conf.resize.sep_y+this.conf.resize.min_hb}else{if(this.conf.resize.ny<this.conf.resize.sep_y-this.conf.resize.min_ha){this.conf.resize.ny=this.conf.resize.sep_y-this.conf.resize.min_ha}}this.r_sep.style.top=this.conf.resize.ny+"px"}};this._afterResize=function(r){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._doOnMouseMove,false);window.removeEventListener("mouseup",this._doOnMouseUp,false);window.removeEventListener("touchmove",this._doOnMouseMove,false);window.removeEventListener("touchend",this._doOnMouseUp,false)}else{document.body.detachEvent("onmousemove",this._doOnMouseMove);document.body.detachEvent("onmouseup",this._doOnMouseUp)}if(!this.conf.resize.active){this.conf.resize=null;return}if(r.type=="touchend"){this.sep.className=this.sep.className.replace(/\s{0,}dhxlayout_sep_resize_actv/gi,"")}else{if(r.button!==this.conf.btn_left){return}}var n=this._getLayout();var l=n._getMainInst();var o=(l.checkEvent("onPanelResizeFinish")==true?{}:false);if(o!==false){l.forEachItem(function(u){o[u.conf.name]={w:u.conf.size.w,h:u.conf.size.h};u=null})}var m=this.conf.resize.nx-this.conf.resize.sep_x;var j=this.conf.resize.ny-this.conf.resize.sep_y;n.cdata.a._setSize(n.cdata.a.conf.size.x,n.cdata.a.conf.size.y,n.cdata.a.conf.size.w+m,n.cdata.a.conf.size.h+j,"a");n.cdata.b._setSize(n.cdata.b.conf.size.x+m,n.cdata.b.conf.size.y+j,n.cdata.b.conf.size.w-m,n.cdata.b.conf.size.h-j,"b");this._setSize(parseInt(this.r_sep.style.left),parseInt(this.r_sep.style.top),parseInt(this.r_sep.style.width),parseInt(this.r_sep.style.height));if(window.dhx4.isIE){var s=this;window.setTimeout(function(){s._removeResizeArea();s=null},1)}else{this._removeResizeArea()}if(o!==false){var q=[];l.forEachItem(function(u){var v=o[u.conf.name];if(!(v.w==u.conf.size.w&&v.h==u.conf.size.h)){q.push(u.conf.name)}u=null});l._callMainEvent("onPanelResizeFinish",[q])}l=n=null;this.conf.resize.active=false;this.conf.resize=null};this._initResizeArea=function(){if(this.r_sep==null){this.r_sep=document.createElement("DIV");this.r_sep.className="dhxlayout_resize_sep";this.r_sep.style.left=this.sep.style.left;this.r_sep.style.top=this.sep.style.top;this.r_sep.style.width=this.sep.style.width;this.r_sep.style.height=this.sep.style.height;this.sep.parentNode.appendChild(this.r_sep);if(window.dhx4.isIE){this.r_sep.onselectstart=function(){return false}}}if(this.r_area==null){this.r_area=document.createElement("DIV");this.r_area.className="dhxlayout_resize_area";this.sep.parentNode.appendChild(this.r_area);if(window.dhx4.isIE){this.r_area.onselectstart=function(){return false}}if(this.conf.mode=="v"){var j=parseInt(this.r_sep.style.left)-this.conf.resize.min_wa;var n=parseInt(this.r_sep.style.top);var l=this.conf.resize.min_wa+this.conf.resize.min_wb+parseInt(this.r_sep.style.width);var m=parseInt(this.r_sep.style.height)}else{var j=parseInt(this.r_sep.style.left);var n=parseInt(this.r_sep.style.top)-this.conf.resize.min_ha;var l=parseInt(this.r_sep.style.width);var m=this.conf.resize.min_ha+this.conf.resize.min_hb+parseInt(this.r_sep.style.height)}this.r_area.style.left=j+"px";this.r_area.style.top=n+"px";if(!dhtmlXLayoutObject.prototype._confGlob.reszieCover){dhtmlXLayoutObject.prototype._confGlob.reszieCover={};this.r_area.style.width=l+"px";this.r_area.style.height=m+"px";dhtmlXLayoutObject.prototype._confGlob.reszieCover.w=parseInt(this.r_area.style.width)-this.r_area.offsetWidth;dhtmlXLayoutObject.prototype._confGlob.reszieCover.h=parseInt(this.r_area.style.height)-this.r_area.offsetHeight}this.r_area.style.width=l+dhtmlXLayoutObject.prototype._confGlob.reszieCover.w+"px";this.r_area.style.height=m+dhtmlXLayoutObject.prototype._confGlob.reszieCover.h+"px"}document.body.className+=" dhxlayout_resize_"+this.conf.mode};this._removeResizeArea=function(){this.r_sep.onselectstart=null;this.r_sep.parentNode.removeChild(this.r_sep);this.r_sep=null;this.r_area.onselectstart=null;this.r_area.parentNode.removeChild(this.r_area);this.r_area=null;document.body.className=String(document.body.className).replace(/\s{0,}dhxlayout_resize_[vh]/gi,"")};this._doOnMouseDown=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.cancelBubble=true}c._beforeResize(j)};this._doOnMouseMove=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.cancelBubble=true}c._onResize(j)};this._doOnMouseUp=function(j){j=j||event;c._afterResize(j)};if(typeof(window.addEventListener)=="function"){this.sep.addEventListener("mousedown",this._doOnMouseDown,false);this.sep.addEventListener("touchstart",this._doOnMouseDown,false)}else{this.sep.attachEvent("onmousedown",this._doOnMouseDown)}this._unload=function(){if(typeof(window.addEventListener)=="function"){this.sep.removeEventListener("mousedown",this._doOnMouseDown,false);this.sep.removeEventListener("touchstart",this._doOnMouseDown,false)}else{this.sep.detachEvent("onmousedown",this._doOnMouseDown)}if(window.dhx4.isIE==true){this.sep.onselectstart=null}this.sep.parentNode.removeChild(this.sep);this.sep=null;for(var j in this){this[j]=null}c=null};return this}dhtmlXLayoutObject.prototype.setSeparatorSize=function(g,j){if(typeof(g)=="number"){var l=this.setSeparatorSize({index:g,current:-1},j);if(l.sep!=null){l.sep._setWH(j)}return}for(var c in this.cdata){if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){g=this.cdata[c].dataObj.setSeparatorSize(g,j);if(g.sep!=null){return g}}if(c=="a"&&this.sep!=null){g.current++;if(g.index==g.current){return{sep:this.sep}}}}return g};window.dhtmlXLayoutCell=function(j,g){dhtmlXCellObject.apply(this,[j,"_layout"]);var c=this;this.layout=g;this.conf.skin=this.layout.conf.skin;this.conf.mode=this.layout.conf.mode;this.conf.collapsed=false;this.conf.fixed={w:false,h:false};this.conf.docked=true;this.conf.min_width=26;this.conf.min_height=26;this.attachEvent("_onCellUnload",function(){this.cell.childNodes[this.conf.idx.hdr].ondblclick=null;if(this.conf.mode!="c"){this.cell.childNodes[this.conf.idx.hdr].lastChild.ondblclick=null}this._unloadDocking();this.layout=null;c=null});this._hdrInit();this.cell.childNodes[this.conf.idx.hdr].ondblclick=function(){var l=c.layout._getMainInst();l._callMainEvent("onDblClick",[c.conf.name]);l=null};this.attachEvent("_onContentLoaded",function(){var l=this.layout._getMainInst();l._callMainEvent("onContentLoaded",[this.conf.name]);l=null});if(this.conf.mode!="c"){var a=document.createElement("DIV");a.className="dhxlayout_arrow dhxlayout_arrow_"+this.conf.mode+this._idd;this.cell.childNodes[this.conf.idx.hdr].appendChild(a);a.onclick=function(l){if(c.conf.collapsed){c.expand()}else{c.collapse()}};a=null}this.attachEvent("_onBeforeContentAttach",function(l){if(l=="tabbar"||l=="layout"||l=="acc"){this._hideBorders()}if(l=="sidebar"){this._hideBorders();this.showHeader()}});this._initDocking();return this};dhtmlXLayoutCell.prototype=new dhtmlXCellObject();dhtmlXLayoutCell.prototype.getId=function(){return this.conf.name};dhtmlXLayoutCell.prototype._initDocking=function(){var a=this;this.dock=function(){var g=this.layout._getMainInst();if(g.dhxWins==null||this.conf.docked){g=null;return}var c=g.dhxWins.window(this.conf.name);c.close();this._attachFromCell(c);this.conf.docked=true;if(!this.conf.dock_collapsed){this.expand()}g._callMainEvent("onDock",[this.conf.name]);g=c=null};this.undock=function(c,n,l,m){var j=this.layout._getMainInst();if(j.dhxWins==null||this.conf.docked==false){j=null;return}this.conf.dock_collapsed=this.conf.collapsed;if(!this.conf.collapsed){this.collapse()}if(j.dhxWins.window(this.conf.name)!=null){var g=j.dhxWins.window(this.conf.name);g.show()}else{if(c==null){c=20}if(n==null){n=20}if(l==null){l=320}if(m==null){m=200}var g=j.dhxWins.createWindow(this.conf.name,c,n,l,m);g.button("close").hide();g.addUserButton("dock",99,"Dock");g.button("dock").show();g.button("dock").attachEvent("onClick",this._doOnDockClick);g.setText(this.getText());g.attachEvent("onClose",this._doOnDockWinClose)}this.conf.docked=false;g._attachFromCell(this);j._callMainEvent("onUnDock",[this.conf.name]);j=g=null};this._doOnDockClick=function(){a.dock()};this._doOnDockWinClose=function(c){c.hide();return false};this._unloadDocking=function(){a=null}};dhtmlXLayoutCell.prototype._hdrInit=function(){var c="";if(window.dhx4.isIE){if(navigator.userAgent.indexOf("MSIE 9.0")!=-1){c=" dhx_cell_hdr_text_ie9"}else{if(window.dhx4.isIE8){c=" dhx_cell_hdr_text_ie8"}else{if(window.dhx4.isIE7){c=" dhx_cell_hdr_text_ie7"}else{if(window.dhx4.isIE6){c=" dhx_cell_hdr_text_ie6"}}}}}else{if(window.dhx4.isChrome||window.dhx4.isKHTML){c=" dhx_cell_hdr_text_chrome"}}var a=document.createElement("DIV");a.className="dhx_cell_hdr";a.innerHTML="<div class='dhx_cell_hdr_text"+c+"'></div>";this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cont]);a=null;this.conf.ofs_nodes.t._getHdrHeight="func";this.conf.hdr={visible:true};this.conf.idx_data.hdr="dhx_cell_hdr";this._updateIdx();this.attachEvent("_onSetSize",this._hdrOnSetSize);this.attachEvent("_onBorderChange",this._hdrOnBorderChange);this.attachEvent("_onViewSave",this._hdrOnViewSave);this.attachEvent("_onViewRestore",this._hdrOnViewRestore)};dhtmlXLayoutCell.prototype.showHeader=function(a){if(this.conf.hdr.visible||this.conf.collapsed){return}if(this.conf.hdr.w_saved>this._getAvailWidth()||this.conf.hdr.h_saved>this._getAvailHeight()){return}this.conf.hdr.w_saved=this.conf.hdr.h_saved=null;this.conf.hdr.visible=true;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr";if(a!==true){this._adjustCont(this._idd)}};dhtmlXLayoutCell.prototype.hideHeader=function(a){if(!this.conf.hdr.visible||this.conf.collapsed){return}this.conf.hdr.w_saved=this._getMinWidth();this.conf.hdr.h_saved=this._getMinHeight();this.conf.hdr.visible=false;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden";this._hdrUpdBorder();this._mtbUpdBorder();if(a!==true){this._adjustCont(this._idd)}};dhtmlXLayoutCell.prototype.isHeaderVisible=function(){return(this.conf.hdr.visible==true)};dhtmlXLayoutCell.prototype.showArrow=function(){this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display=""};dhtmlXLayoutCell.prototype.hideArrow=function(){this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display="none"};dhtmlXLayoutCell.prototype.isArrowVisible=function(){return(this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display=="")};dhtmlXLayoutCell.prototype.setText=function(a){this.conf.hdr.text=a;this._hdrUpdText()};dhtmlXLayoutCell.prototype.getText=function(){return this.conf.hdr.text};dhtmlXLayoutCell.prototype.setCollapsedText=function(a){this.conf.hdr.text_collapsed=a;this._hdrUpdText()};dhtmlXLayoutCell.prototype.getCollapsedText=function(){return(this.conf.hdr.text_collapsed!=null?this.conf.hdr.text_collapsed:this.conf.hdr.text)};dhtmlXLayoutCell.prototype._hdrUpdText=function(){var a=(this.conf.collapsed==true&&this.conf.hdr.text_collapsed!=null?this.conf.hdr.text_collapsed:this.conf.hdr.text);this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML="<span>"+a+"</span>"};dhtmlXLayoutCell.prototype._hdrUpdBorder=function(){if(this.conf.borders==true){this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr"+(this.conf.hdr.visible?"":" dhx_cell_hdr_hidden")}else{if(!this.conf.hdr.visible){this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden_no_borders"}}};dhtmlXLayoutCell.prototype._hdrOnSetSize=function(){if(this.conf.collapsed&&this.conf.mode=="v"){this._fitHdr()}};dhtmlXLayoutCell.prototype._hdrOnBorderChange=function(){this.hideHeader(true);this._hdrUpdBorder()};dhtmlXLayoutCell.prototype._hdrOnViewSave=function(a){this.views[a].hdr_vis=this.conf.hdr.visible};dhtmlXLayoutCell.prototype._hdrOnViewRestore=function(a){if(this.conf.hdr.visible!=this.views[a].hdr_vis){this[this.views[a].hdr_vis?"showHeader":"hideHeader"](true)}this.views[a].hdr_vis=null;delete this.views[a].hdr_vis};dhtmlXLayoutCell.prototype._getHdrHeight=function(a){if(this.conf.collapsed&&this.conf.mode=="v"&&a!==true){return 27}return this.cell.childNodes[this.conf.idx.hdr].offsetHeight};dhtmlXLayoutCell.prototype._fitHdr=function(){if(this.conf.collapsed){if(typeof(dhtmlXLayoutObject.prototype._confGlob.hdrColH)=="undefined"){this.cell.childNodes[this.conf.idx.hdr].style.height=this.cell.offsetHeight+"px";dhtmlXLayoutObject.prototype._confGlob.hdrColH=parseInt(this.cell.childNodes[this.conf.idx.hdr].style.height)-this._getHdrHeight(true)}this.cell.childNodes[this.conf.idx.hdr].style.height=this.cell.offsetHeight+dhtmlXLayoutObject.prototype._confGlob.hdrColH+"px"}else{this.cell.childNodes[this.conf.idx.hdr].style.height=null}};dhtmlXLayoutCell.prototype.expand=function(n){if(!this.conf.collapsed){return true}var g=this.layout;if(this.conf.mode=="v"){var m=(n?g.conf.hh:g.cdata[g.conf.nextCell[this._idd]]._getMinWidth(this._idd));var j=g.cont.offsetWidth-g.conf.sw;if(m+this.conf.size.w_avl>j){g=null;return false}}else{var l=(n?g.conf.hh:g.cdata[g.conf.nextCell[this._idd]]._getMinHeight(this._idd)+g.cdata[g.conf.nextCell[this._idd]]._getHdrHeight());var c=g.cont.offsetHeight-g.conf.sw;if(l+this.conf.size.h_avl>c){g=null;return false}}if(this.conf.docked==false){this.dock();return}this.cell.className=String(this.cell.className).replace(/\s{0,}dhxlayout_collapsed_[hv]/gi,"");this.conf.collapsed=false;if(this.conf.mode=="v"){this.conf.size.w=Math.min(j-m,this.conf.size.w_saved);this.conf.size.w_saved=this.conf.size.w_avl=null}else{this.conf.size.h=Math.min(c-l,this.conf.size.h_saved);this.conf.size.h_saved=this.conf.size.h_avl=null}if(this.conf.mode=="v"){this._fitHdr()}g.setSizes(g.conf.nextCell[this._idd],g.conf.nextCell[this._idd],n==true,"expand");g.sep._blockSep();g=null;this._hdrUpdText();var a=this.layout._getMainInst();a._callMainEvent("onExpand",[this.conf.name]);a=null;return true};dhtmlXLayoutCell.prototype.collapse=function(){if(this.conf.collapsed){return false}var c=this.layout;if(c.cdata[c.conf.nextCell[this._idd]].expand(true)==false){return false}if(this.conf.mode=="v"){this.conf.size.w_saved=this.conf.size.w;this.conf.size.w_avl=this._getMinWidth(this._idd)}else{this.conf.size.h_saved=this.conf.size.h;this.conf.size.h_avl=this._getMinHeight(this._idd)+this._getHdrHeight()}this.cell.className+=" dhxlayout_collapsed_"+this.conf.mode;this.conf.collapsed=true;if(this.conf.mode=="v"){this.conf.size.w=c.conf.hh}else{this.conf.size.h=this._getHdrHeight()}c.setSizes(c.conf.nextCell[this._idd],c.conf.nextCell[this._idd],false,"collapse");c.sep._blockSep();c=null;this._hdrUpdText();var a=this.layout._getMainInst();a._callMainEvent("onCollapse",[this.conf.name]);a=null;return true};dhtmlXLayoutCell.prototype.isCollapsed=function(){return(this.conf.collapsed==true)};dhtmlXLayoutCell.prototype.setMinWidth=function(a){this.conf.min_height=parseInt(h)||0};dhtmlXLayoutCell.prototype.setMinHeight=function(a){this.conf.min_height=parseInt(a)||0};dhtmlXLayoutCell.prototype._getMinWidth=function(c){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return Math.max(this.conf.min_width,this.dataObj.cdata.a._getMinWidth(c))}else{if(this.dataObj.conf.mode=="v"){var a=c||this._idd;if(this.dataObj.cdata[a].conf.collapsed){a=this.dataObj.conf.nextCell[a]}return Math.max(this.conf.min_width,this.dataObj.cdata[a]._getMinWidth(c)+this.dataObj.cdata[this.dataObj.conf.nextCell[a]]._getWidth()+this.dataObj.conf.sw)}else{return Math.max(this.conf.min_width,this.dataObj.cdata.a._getMinWidth(c),this.dataObj.cdata.b._getMinWidth(c))}}}return Math.max(this.conf.min_width,1)};dhtmlXLayoutCell.prototype._getMinHeight=function(g){var c=0;if(this.conf.idx.menu!=null){c+=this.cell.childNodes[this.conf.idx.menu].offsetHeight}if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return Math.max(this.conf.min_height,this.dataObj.cdata.a._getMinHeight(g))}else{if(this.dataObj.conf.mode=="h"){var a=g;if(this.dataObj.cdata[a].conf.collapsed){a=this.dataObj.conf.nextCell[a]}return Math.max(this.conf.min_height,this.dataObj.cdata[a]._getMinHeight(g)+this.dataObj.cdata[a]._getHdrHeight()+this.dataObj.cdata[this.dataObj.conf.nextCell[a]]._getHeight()+this.dataObj.conf.sw)}else{return Math.max(this.conf.min_height,this.dataObj.cdata.a._getMinHeight(g)+this.dataObj.cdata.a._getHdrHeight(),this.dataObj.cdata.b._getMinHeight(g)+this.dataObj.cdata.b._getHdrHeight())}}}return Math.max(this.conf.min_height,c)};dhtmlXLayoutCell.prototype._getAvailWidth=function(g){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return this.dataObj.cdata.a._getAvailWidth(g)}else{if(this.dataObj.conf.mode=="v"){var a=(this.dataObj.cdata.a.conf.collapsed==true);var c=(this.dataObj.cdata.b.conf.collapsed==true);if(g=="a"){return this.dataObj.cdata[c?"a":"b"]._getAvailWidth(g)}else{return this.dataObj.cdata[a?"b":"a"]._getAvailWidth(g)}}else{return Math.min(this.dataObj.cdata.a._getAvailWidth(g),this.dataObj.cdata.b._getAvailWidth(g))}}}return this.cell.offsetWidth-this._getMinWidth()};dhtmlXLayoutCell.prototype._getAvailHeight=function(j){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return this.dataObj.cdata.a._getAvailHeight(j)}else{if(this.dataObj.conf.mode=="h"){var c=(this.dataObj.cdata.a.conf.collapsed==true);var g=(this.dataObj.cdata.b.conf.collapsed==true);if(j=="a"){return this.dataObj.cdata[g?"a":"b"]._getAvailHeight(j)}else{return this.dataObj.cdata[c?"b":"a"]._getAvailHeight(j)}}else{return Math.min(this.dataObj.cdata.a._getAvailHeight(j),this.dataObj.cdata.b._getAvailHeight(j))}}}var a=this._getHdrHeight();if(this.conf.mode=="v"&&this.conf.collapsed){a=this.conf.hh}return this.cell.offsetHeight-a-this._getMinHeight()};dhtmlXLayoutCell.prototype.setWidth=function(j){if(this.conf.mode=="v"){if(this.conf.collapsed){return}var l=this.layout;var m=l.cdata[l.conf.nextCell[this._idd]];if(m.conf.collapsed){j=j+l.conf.sw+m._getWidth();n=l=m=null;return}var g=this._getMinWidth(this._idd);var o=l.cont.offsetWidth-m._getMinWidth(this._idd)-l.conf.sw;j=Math.max(g,Math.min(j,o));this.conf.size.w=j;l.setSizes(m._idd,m._idd);l=m=null}else{if(this.layout==null||this.layout.parentLayout==null){return}var n=this.layout.parentLayout;var l=this.layout;var m=l.cdata[l.conf.nextCell[this._idd]];for(var c in n.cdata){if(n.cdata[c].dataObj==l){n.cdata[c].setWidth(j)}}n=l=null}};dhtmlXLayoutCell.prototype.setHeight=function(n){if(this.conf.mode=="h"){if(this.conf.collapsed){return}var j=this.layout;var m=j.cdata[j.conf.nextCell[this._idd]];if(m.conf.collapsed){n=n+j.conf.sw+m._getHeight();var o=(this.layout!=null&&this.layout.parentLayout!=null?this.layout.parentLayout:null);if(o!=null){for(var c in o.cdata){if(o.cdata[c].dataObj==j){o.cdata[c].setHeight(n)}}}o=j=m=null;return}var l=this._getMinHeight(this._idd)+this._getHdrHeight();var g=j.cont.offsetHeight-m._getMinHeight(this._idd)-m._getHdrHeight()-j.conf.sw;n=Math.max(l,Math.min(n,g));this.conf.size.h=n;j.setSizes(m._idd,m._idd);j=m=null}else{if(this.layout==null||this.layout.parentLayout==null){return}var o=this.layout.parentLayout;var j=this.layout;var m=j.cdata[j.conf.nextCell[this._idd]];for(var c in o.cdata){if(o.cdata[c].dataObj==j){o.cdata[c].setHeight(n)}}o=j=null}};dhtmlXLayoutCell.prototype.getWidth=function(){return this.conf.size.w};dhtmlXLayoutCell.prototype.getHeight=function(){return this.conf.size.h};dhtmlXLayoutCell.prototype.fixSize=function(c,j){this.conf.fixed.w=window.dhx4.s2b(c);this.conf.fixed.h=window.dhx4.s2b(j);var a=this.layout._getMainInst();var g={};a.forEachItem(function(l){if(l.conf.fsize!=null){var r=l.getId();var o={h:(l.conf.fixed.w==true),v:(l.conf.fixed.h==true)};for(var m in o){if(o[m]==true&&l.conf.fsize[m]!=null){if(!(l.conf.fsize[m] instanceof Array)){l.conf.fsize[m]=[l.conf.fsize[m]]}for(var n=0;n<l.conf.fsize[m].length;n++){g[l.conf.fsize[m][n]]=true}}}}l=null});a._forEachSep(function(l){l._lockSep(g[l.conf.idx]==true);l=null});a=null};dhtmlXCellObject.prototype.attachLayout=function(a){this.callEvent("_onBeforeContentAttach",["layout"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(this._layoutMainInst)!="undefined"){c._layoutMainInst=this._layoutMainInst}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof dhtmlXLayoutCell){c._isParentCell=true}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1,r:-1,l:-1,b:-1}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_web"){c._ofs={l:8}}if(this.conf.skin=="dhx_terrace"){c._ofs={l:11}}else{c._ofs={l:-1}}}if(typeof(a)=="string"){a={pattern:a}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;this.dataType="layout";this.dataObj=new dhtmlXLayoutObject(a);if(this instanceof dhtmlXLayoutCell){this.dataObj.parentLayout=this.layout}c._layoutMainInst=null;a.parent=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXTabBar(c,l){var g=this;this.conf={skin:(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtabbar")||"dhx_skyblue"),css:"dhxtabbar",lastActive:null,closeButton:false,align:"left",tabsMode:(l=="bottom"?"bottom":"top"),tabsContCss:(navigator.userAgent.indexOf("Safari")>=0&&navigator.userAgent.indexOf("5.1.7")>=0?" safari_517_fix":""),contZone:true,transSpeed:"0.15s",arwMode:"always",tabsOfs:1,tabsTop:0,url_demand:false,urls:{},autoload:{}};var j;if(c!=null&&typeof(c)=="object"&&typeof(c.tagName)=="undefined"){j=c.parent;if(typeof(c.skin)!="undefined"){this.conf.skin=c.skin}if(typeof(c.mode)!="undefined"){this.conf.tabsMode=(c.mode=="bottom"?"bottom":"top")}if(typeof(c.align)!="undefined"){this.conf.align=(c.align=="right"?"right":"left")}if(typeof(c.close_button)!="undefined"){this.conf.closeButton=window.dhx4.s2b(c.close_button)}if(typeof(c.content_zone)!="undefined"){this.conf.contZone=window.dhx4.s2b(c.content_zone)}if(typeof(c.xml)!="undefined"){this.conf.autoload.xml=c.xml}if(typeof(c.json)!="undefined"){this.conf.autoload.xml=c.json}if(typeof(c.tabs)!="undefined"){this.conf.autoload.tabs=c.tabs}if(typeof(c.onload)!="undefined"){this.conf.autoload.tabs=c.tabs}if(typeof(c.arrows_mode)!="undefined"){this.conf.autoload.arrows_mode=c.arrows_mode}}else{j=c}window.dhtmlXCellTop.apply(this,[j,c.offsets]);if(this.base._ofs!=null&&this.base._ofs.t!=null){this.conf.tabsTop=this.base._ofs.t}this.tabsMode=document.createElement("DIV");this.tabsMode.className="dhxtabbar_tabs_"+this.conf.tabsMode;this.cont.appendChild(this.tabsMode);this.tabsArea=document.createElement("DIV");this.tabsArea.className="dhxtabbar_tabs dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.innerHTML="<div class='dhxtabbar_tabs_ar_left'><div class='dhxtabbar_arrow_img'></div></div><div class='dhxtabbar_tabs_base'><div class='dhxtabbar_tabs_cont_"+this.conf.align+this.conf.tabsContCss+"'><div class='dhxtabbar_tabs_line'></div></div></div><div class='dhxtabbar_tabs_ar_right'><div class='dhxtabbar_arrow_img'></div></div>";this.tabsArea.style.top=(this.conf.tabsMode=="top"?this.conf.tabsTop+"px":"auto");this.tabsMode.appendChild(this.tabsArea);this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";this.tabsArea.childNodes[0].onclick=function(){if(g.conf.align=="left"){g._moveTabs(1)}else{g._moveTabs(-1)}};this.tabsArea.childNodes[2].onclick=function(){if(g.conf.align=="left"){g._moveTabs(-1)}else{g._moveTabs(1)}};this._onTabsAreaClick=function(m){return this._callMainEvent("onTabClose",[m])};this.tabsArea.onclick=function(n){n=n||event;var m=(n.target||n.srcElement);while(m!=null){if(typeof(m._tabCloseId)!="undefined"){if(g._onTabsAreaClick(m._tabCloseId)!==true){return}g.t[m._tabCloseId].conf.remove=true;g._hideTab(m._tabCloseId);m=null}else{if(typeof(m._tabId)!="undefined"){g._doOnClick(m._tabId);m=null}}if(m!=null){m=m.parentNode;if(m==this){m=null}}}};this.tabsArea.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this._doOnClick=function(m){this.callEvent("onTabClick",[m,this.conf.lastActive]);if(this.t[m].conf.enabled){this._setTabActive(m)}};this.t={};this.addTab=function(m,v,o,s,r,w){if(typeof(w)!="boolean"){w=(this.conf.closeButton==true)}r=window.dhx4.s2b(r);var q=document.createElement("DIV");q.className="dhxtabbar_tab";q.innerHTML="<div class='dhxtabbar_tab_text"+(w?" dhxtabbar_tab_text_close":"")+"'>"+v+"</div>"+(w?"<div class='dhxtabbar_tab_close'></div>":"");q._tabId=m;if(w){q.childNodes[1]._tabCloseId=m}var n=this.tabsArea.childNodes[1].firstChild;if(s!=null&&s+1>0&&s+1<n.childNodes.length){n.insertBefore(q,n.childNodes[s+1])}else{n.appendChild(q)}var x=false;if(typeof(o)=="undefined"||o==null||o=="*"){o=this._getLabelWidth(v,w);x=true}else{o=parseInt(o)}q.style.width=o+"px";var u=new dhtmlXTabBarCell(m,this);this.tabsMode.appendChild(u.cell);this.t[m]={tab:q,cell:u,conf:{text:v,visible:true,active:false,enabled:true,close:w,width:o,autowidth:x}};n=u=null;if(r){this._setTabActive(m)}else{this._adjustCell(m)}if(this.conf.initSeq!=true&&this.conf.arwMode=="auto"){this.setSizes()}};this.setSizes=function(){this._adjustCont();if(this.conf.tabsAreaOfs==null){this.tabsArea.style.width=this.cont.offsetWidth+"px";this.conf.tabsAreaOfs=parseInt(this.tabsArea.style.width)-this.tabsArea.offsetWidth}this.tabsArea.style.width=this.cont.offsetWidth+this.conf.tabsAreaOfs+"px";this._adjustCell(this.conf.lastActive);this._adjustTabs(true);this.callEvent("_onSetSizes",[])};this._adjustCell=function(q){if(!this.conf.contZone||q==null){return}var o=(this.conf.tabsMode=="top"?this.tabsArea.offsetHeight:0)+this.conf.tabsTop;var n=this.cont.offsetHeight-this.tabsArea.offsetHeight-this.conf.tabsTop;var m=this.t[q].cell.dataType;if(this.conf.skin=="dhx_skyblue"&&(m=="layout"||m=="tabbar"||m=="acc")){if(this.conf.tabsMode=="top"){o=o-1}n=n+1}if(q!=this.conf.lastActive){o=-5000;this.t[q].cell.cell.style.visibility="hidden";this.t[q].cell.cell.style.zIndex=0}this.t[q].cell._setSize(0,o,this.cont.offsetWidth,n)};this.setTabsMode=function(m){this.conf.tabsMode=(m=="bottom"?"bottom":"top");this.tabsMode.className="dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.className="dhxtabbar_tabs dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.style.top=(this.conf.tabsMode=="top"?this.conf.tabsTop+"px":"auto");this.setSizes()};this._tabCss=function(r,o){var m=this.t[r].conf.active;var q=!this.t[r].conf.enabled;var n=!this.t[r].conf.visible;return"dhxtabbar_tab"+(n?" dhxtabbar_tab_hidden":(m||q?" dhxtabbar_tab"+(m?"_actv":"")+(q?"_dis":""):""))};this._getLabelWidth=function(o,n){if(this.tabsTextTest==null){this.tabsTextTest=document.createElement("SPAN");this.tabsTextTest.className="dhxtabbar_tabs_text_test_"+this.conf.skin}document.body.appendChild(this.tabsTextTest);this.tabsTextTest.innerHTML=o;var m=this.tabsTextTest.offsetWidth;if(window.dhx4.isIE&&m==0){m=this.tabsTextTest.offsetWidth}m+=(this.conf.skin=="dhx_terrace"?44:35);m+=(n?(this.conf.skin=="dhx_terrace"?14:9):0);document.body.removeChild(this.tabsTextTest);return m};this._adjustTabs=function(r){if(this._checkArrows()==true||r==true){this.tabsArea.childNodes[1].style.left=this.tabsArea.childNodes[0].offsetWidth-1+"px";this.tabsArea.childNodes[1].style.width=Math.max(0,this.tabsArea.offsetWidth-this.tabsArea.childNodes[0].offsetWidth-this.tabsArea.childNodes[2].offsetWidth)+1+"px"}var u=this.tabsArea.childNodes[1];if(u.offsetWidth<5){u=null;return}var m=parseInt(u.childNodes[0].style[this.conf.align]);var o=null;for(var s=0;s<u.childNodes[0].childNodes.length;s++){var v=u.childNodes[0].childNodes[s]._tabId;if(v!=null&&this.t[v].conf.visible){var n=this.t[v].tab.offsetWidth-this.conf.tabsOfs;if(this.t[v].conf.active){if(m<0||u.offsetWidth<n){o={d:1,id:v}}else{if(m+n>u.offsetWidth){o={d:-1,id:v}}}}m+=n}}if(o!=null){this._moveTabs(o.d,o.id)}else{if(u.offsetWidth>m+1){u.childNodes[0].style[this.conf.align]=Math.min(0,parseInt(u.childNodes[0].style[this.conf.align])+(u.offsetWidth-m))+"px"}}u=o=null};this._moveTabs=function(y,r){var o=this.tabsArea.childNodes[1].childNodes[0];var v=0;var A=[];var D=null;for(var m=0;m<o.childNodes.length;m++){var n=o.childNodes[m]._tabId;if(n!=null&&this.t[n].conf.visible){A.push({id:n,w:this.t[n].tab.offsetWidth-this.conf.tabsOfs,ind:v});if(n==r){D=v}v++}}var C=parseInt(this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]);var u=this.tabsArea.offsetWidth-this.tabsArea.childNodes[0].offsetWidth-this.tabsArea.childNodes[2].offsetWidth;var w=null;var s=null;for(var m=0;m<A.length;m++){A[m].x=C;if(w==null&&C>=0&&C+A[m].w>0){w=A[m]}if(C<u&&C+A[m].w<=u){s=A[m]}C+=A[m].w}if(D!=null){var E=A[D]}else{var E=null;if(y>0){if(w==null){if(A.length>0){E=A[A.length-1]}}else{if(w.ind>0&&A.length>=w.ind){E=A[w.ind-1]}}}else{if(s==null){if(A.length>0){E=A[0]}}else{if(A.length>s.ind){E=A[s.ind+1]}}}}if(E!=null){if(y>0){if(C<u){o.style[this.conf.align]=Math.min(0,parseInt(o.style[this.conf.align])+(u-C))+"px"}else{o.style[this.conf.align]=parseInt(o.style[this.conf.align])-E.x+"px"}}else{o.style[this.conf.align]=parseInt(o.style[this.conf.align])-E.x+u-E.w+"px"}}o=E=A=null};this._getNextVisible=function(n,m){return this._getNearVisible(n,m,"next")};this._getPrevVisible=function(n,m){return this._getNearVisible(n,m,"previous")};this._getFirstVisible=function(){return this._getNearVisible(null,false,"first")};this._getNearVisible=function(s,o,r){if(r=="first"){var q=this.tabsArea.childNodes[1].childNodes[0].childNodes[1];r="next"}else{if(s==null||this.t[s]==null){return(o?this._getFirstVisible():null)}var q=this.t[s].tab[r+"Sibling"]}var n=null;while(q!=null&&n==null){var m=q._tabId;if(m!=null&&n==null&&this.t[m].conf.visible){n=m}else{q=q[r+"Sibling"]}}q=null;return n};this._showTab=function(n,m){if(this.t[n]==null){return}if(this.t[n].conf.transActv==true){if(this.t[n].conf.transMode=="show"){return}}else{if(this.t[n].conf.visible==true){return}}if(this.conf.transProp!==false){this.t[n].conf.transActv=true;this.t[n].conf.transMode="show";this.t[n].conf.transProp=this.conf.transProp;this.t[n].conf.transActvId=(m?n:null);if(!this.t[n].conf.transEv){this.t[n].tab.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[n].conf.transEv=true}this.t[n].conf.visible=true;this.t[n].tab.className=this._tabCss(n);this.t[n].tab.style[this.conf.transProp]=this.conf.transValueWidth;this.t[n].tab.style.width=this.t[n].conf.width+"px";if(this.t[n].tab.clientWidth>=this.t[n].conf.width){this.t[n].tab.style.visibility="visible"}}else{this.t[n].conf.visible=true;this.t[n].tab.style.display="";if(m){this._setTabActive(n)}else{this._adjustTabs()}}};this._hideTab=function(s,m){if(this.t[s]==null){return}if(this.t[s].conf.transActv==true){if(this.t[s].conf.transMode=="hide"){return}}else{if(this.t[s].conf.visible!=true){return}}var n=false;if(this.conf.lastActive==s){this.conf.lastActive=null;this.t[s].conf.active=false;this.t[s].tab.className=this._tabCss(s);n=true}var q=this._getPrevVisible(s);var o=this._getNextVisible(s);var r=(n&&m!==false?(m==true?null:m)||o||q:null);if(this.conf.transProp!==false){this.t[s].conf.transActv=true;this.t[s].conf.transMode="hide";this.t[s].conf.transProp=this.conf.transProp;this.t[s].conf.transActvId=r;this.t[s].conf.visible=false;if(!this.t[s].conf.transEv){this.t[s].tab.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[s].conf.transEv=true}this.t[s].tab.style.visibility="hidden";this.t[s].tab.className=g._tabCss(s);this.t[s].tab.style[this.conf.transProp]=this.conf.transValueWidth;this.t[s].tab.style.width="0px"}else{this.t[s].tab.style.display="none";this.t[s].conf.visible=false;if(this.conf.contZone){this.t[s].cell.cell.style.visibility="hidden";this.t[s].cell.cell.style.top="-5000px"}if(r!=null){this._setTabActive(r)}this._adjustTabs();if(this.t[s].conf.remove){this._removeTab(s)}}};this._isTabVisible=function(m){return(this.t[m].conf.visible==true)};this._doOnTrEnd=function(){var o=this._tabId;if(g.t[o]==null){return}var m=g.t[o];var n=m.conf.transActvId;if(m.conf.transMode=="hide"){if(m.conf.remove){g._removeTab(o)}else{m.tab.style[m.conf.transProp]="";if(g.conf.contZone){m.cell.cell.style.visibility="hidden";m.cell.cell.style.top="-5000px"}m.conf.transActv=false}}else{if(m.conf.transMode=="show"){m.tab.style[m.conf.transProp]="";m.tab.style.visibility="visible";m.conf.transMode=null;m.conf.transActv=false}}if(n!=null){g._setTabActive(n)}else{g._adjustTabs()}m=null};this.enableTabCloseButton=function(m){this.conf.closeButton=window.dhx4.s2b(m)};this.unload=function(){this.conf.unloading=true;this.clearAll();this.t=null;if(this.tabsTextTest!=null){if(this.tabsTextTest.parentNode){this.tabsTextTest.parentNode.removeChild(this.tabsTextTest)}this.tabsTextTest=null}window.dhx4._enableDataLoading(this,null,null,null,"clear");this.tabsArea.childNodes[0].onclick=null;this.tabsArea.childNodes[2].onclick=null;this.tabsArea.onclick=null;this.tabsArea.onselectstart=null;this.tabsArea.parentNode.removeChild(this.tabsArea);this.tabsArea=null;this.tabsMode.parentNode.removeChild(this.tabsMode);this.tabsMode=null;this._unloadTop();window.dhx4._eventable(this,"clear");for(var m in this){this[m]=null}g=null};this.enableContentZone=function(m){this.conf.contZone=(m==true)};this.setSkin=function(n){this._setBaseSkin(n);this.conf.skin=n;if(this.tabsTextTest!=null){this.tabsTextTest.className="dhxtabbar_tabs_text_test_"+this.conf.skin}for(var m in this.t){this.t[m].cell._resetSizeState();if(this.t[m].conf.autowidth==true){this.t[m].conf.width=this._getLabelWidth(this.t[m].conf.text,this.t[m].conf.close);if(this.t[m].conf.visible){this.t[m].tab.style.width=this.t[m].conf.width+"px"}}}this.conf.tabsAreaOfs=null;this._fixTabsOfs();this.setSizes()};this.setAlign=function(m){m=(m=="left"?"left":"right");if(m==this.conf.align){this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";return}if(this.conf.transProp!==false){this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=""}this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="";this.conf.align=m;this.tabsArea.childNodes[1].childNodes[0].className="dhxtabbar_tabs_cont_"+this.conf.align+this.conf.tabsContCss;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";if(this.conf.transProp!==false){this.conf.transValuePos=this.conf.align+" "+this.conf.transSpeed;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=this.conf.transValuePos}};this._initObj=function(r){this.conf.initSeq=true;this.clearAll();var m=false;if(r.settings!=null){if(r.settings.skin!=null){this.setSkin(r.settings.skin)}if(r.settings.closeButton!=null){this.enableTabCloseButton(window.dhx4.s2b(r.settings.closeButton))}if(r.settings.align!=null){this.setAlign(r.settings.align)}if(r.settings.hrefmode=="ajax"){m=true}if(r.settings.hrefmode=="ajax-html"){m=true;this.conf.url_demand=true}}if(r.tabs!=null){for(var o=0;o<r.tabs.length;o++){var n=r.tabs[o];if(typeof(n.id)=="undefined"){n.id=window.dhx4.newId()}if(!isNaN(parseInt(n.width))){n.width=parseInt(n.width)}else{n.width=null}this.addTab(n.id,n.text||n.label||"",n.width,n.index,window.dhx4.s2b(n.selected)||window.dhx4.s2b(n.active),n.close);if(n.content!=null){this.cells(n.id).attachHTMLString(n.content)}else{if(n.href!=null){if(this.conf.url_demand==true){this.conf.urls[n.id]={href:n.href,ajax:m}}else{this.cells(n.id).attachURL(n.href,m)}}}if(typeof(n.enabled)!="undefined"&&window.dhx4.s2b(n.enabled)==false){this.tabs(n.id).disable()}else{if(typeof(n.disabled)!="undefined"&&window.dhx4.s2b(n.disabled)==true){this.tabs(n.id).disable()}}}}this.conf.initSeq=false;if(this.conf.arwMode=="auto"){this.setSizes()}if(this.conf.url_demand==true){this._loadURLOnDemand(this.conf.lastActive)}};this._xmlToObj=function(u){var s={settings:{},tabs:[]};var m=u.getElementsByTagName("tabbar")[0];if(m!=null){for(var v in {skin:1,align:1,closeButton:1,hrefmode:1}){if(m.getAttribute(v)!=null){s.settings[v]=m.getAttribute(v)}}var y=m.getElementsByTagName("tab");for(var n=0;n<y.length;n++){var o={text:(y[n].firstChild.nodeValue||"")};for(var v in {id:1,width:1,close:1,selected:1,active:1,enabled:1,disabled:1,href:1}){if(y[n].getAttribute(v)!=null){o[v]=y[n].getAttribute(v)}}var A=y[n].getElementsByTagName("content")[0];if(A!=null){o.content="";for(var x=0;x<A.childNodes.length;x++){o.content+=(A.childNodes[x].nodeValue||"")}}s.tabs.push(o)}}return s};dhx4._enableDataLoading(this,"_initObj","_xmlToObj","tabbar",{struct:true});var a=window.dhx4.transDetect();this.conf.transProp=a.transProp;this.conf.transEv=a.transEv;this.conf.transValueWidth="width "+this.conf.transSpeed;a=null;if(this.conf.transProp!==false){this.conf.transValuePos=this.conf.align+" "+this.conf.transSpeed;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=this.conf.transValuePos}this._callMainEvent=function(n,m){return this.callEvent(n,m)};window.dhx4._eventable(this);if(this.conf.autoload.json!=null){this.loadStruct(this.conf.autoload.json,this.conf.autoload.onload)}else{if(this.conf.autoload.xml!=null){this.loadStruct(this.conf.autoload.xml,this.conf.autoload.onload)}else{if(this.conf.autoload.tabs!=null){this.loadStruct({tabs:this.conf.autoload.tabs})}}}if(this.conf.autoload.arrows_mode!=null){this.setArrowsMode(this.conf.autoload.arrows_mode)}this._fixTabsOfs();this.setSizes();return this}dhtmlXTabBar.prototype=new dhtmlXCellTop();dhtmlXTabBar.prototype._fixTabsOfs=function(){this.conf.tabsOfs=(this.conf.skin=="dhx_web"?0:1)};dhtmlXTabBar.prototype.cells=dhtmlXTabBar.prototype.tabs=function(a){if(this.t[a]){return this.t[a].cell}return null};dhtmlXTabBar.prototype.getAllTabs=function(){var g=[];for(var c in this.t){g.push(c)}return g};dhtmlXTabBar.prototype._setTabActive=function(c,a){if(!this.t[c]||!this.t[c].conf.visible||this.t[c].conf.active){return}if(typeof(a)=="undefined"){a=true}if(a==true&&this.callEvent("onSelect",[c,this.conf.lastActive])!==true){return}this.setTabInActive();this.t[c].conf.active=true;if(this.conf.contZone){this.t[c].cell.cell.style.visibility="visible";this.t[c].cell.cell.style.top="0px";this.t[c].cell.cell.style.zIndex=1}this.t[c].tab.className=this._tabCss(c);this.conf.lastActive=c;this.setSizes();if(this.conf.url_demand==true){this._loadURLOnDemand(c)}};dhtmlXTabBar.prototype.setTabInActive=function(){if(this.conf.lastActive&&this.t[this.conf.lastActive]){this.t[this.conf.lastActive].conf.active=false;if(this.conf.contZone){this.t[this.conf.lastActive].cell.cell.style.visibility="hidden";this.t[this.conf.lastActive].cell.cell.style.top="-5000px";this.t[this.conf.lastActive].cell.cell.style.zIndex=0}this.t[this.conf.lastActive].tab.className=this._tabCss(this.conf.lastActive);this.conf.lastActive=null}};dhtmlXTabBar.prototype._isTabActive=function(a){return(a==this.conf.lastActive&&this.conf.lastActive!=null)};dhtmlXTabBar.prototype.getActiveTab=function(){return this.conf.lastActive};dhtmlXTabBar.prototype.goToNextTab=function(){var a=this._getNextVisible(this.conf.lastActive,true);if(a!=null){this._setTabActive(a)}};dhtmlXTabBar.prototype.goToPrevTab=function(){var a=this._getPrevVisible(this.conf.lastActive,true);if(a!=null){this._setTabActive(a)}};dhtmlXTabBar.prototype._enableTab=function(c,a){if(!this.t[c]||this.t[c].conf.enabled){return}this.t[c].conf.enabled=true;this.t[c].tab.className=this._tabCss(c);if(a==true){this._setTabActive(c)}};dhtmlXTabBar.prototype._disableTab=function(c,a){if(!this.t[c]||!this.t[c].conf.enabled){return}this.t[c].conf.enabled=false;this.t[c].tab.className=this._tabCss(c);if(a!==false&&this.conf.lastActive==c){if(a==true){a=this._getNextVisible(c)||this._getPrevVisible(c)}this._setTabActive(a)}};dhtmlXTabBar.prototype._isTabEnabled=function(a){return(this.t[a]!=null&&this.t[a].conf.enabled==true)};dhtmlXTabBar.prototype._setTabText=function(j,g,c){if(!this.t[j]){return}var a=false;if(typeof(c)=="undefined"||c==null){c=this._getLabelWidth(g,this.t[j].conf.close);a=true}this.t[j].tab.style.width=c+"px";this.t[j].tab.childNodes[0].innerHTML=g;this.t[j].conf.text=g;this.t[j].conf.width=c;this.t[j].conf.autowidth=a};dhtmlXTabBar.prototype._getTabText=function(a){if(!this.t[a]){return null}return this.t[a].conf.text};dhtmlXTabBar.prototype._removeTab=function(o,g,m){if(!this.t[o]){return}if(m!=true&&this.t[o].conf.remove!=true){this.t[o].conf.remove=true;this._hideTab(o,g);return}if(typeof(g)=="undefined"){g=true}var j=this._getNextVisible(o);var l=this._getPrevVisible(o);if(this.t[o].conf.transEv==true){this.t[o].tab.removeEventListener(this.conf.transEv,this._doOnTrEnd);this.t[o].conf.transEv=false}for(var c in this.t[o].conf){this.t[o].conf[c]=null}this.t[o].conf=null;delete this.t[o].conf;this.t[o].cell._unload();this.t[o].cell=null;this.t[o].tab.parentNode.removeChild(this.t[o].tab);this.t[o].tab=null;this.t[o]=null;delete this.t[o];if(this.conf.lastActive==o&&g!=false){this.conf.lastActive=null;var n=(g==true?(j||l||this._getFirstVisible()):g);if(n!=null){this._setTabActive(n)}}else{if(m!=true){this._adjustTabs()}}};dhtmlXTabBar.prototype.clearAll=function(){for(var c in this.t){this._removeTab(c,false,true)}this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px"};dhtmlXTabBar.prototype.moveTab=function(g,a){if(!this.t[g]||a<0){return}a+=1;var c=this.tabsArea.childNodes[1].firstChild;if(c.childNodes[a]!=this.t[g].tab){c.removeChild(this.t[g].tab);if(a>=c.childNodes.length){c.appendChild(this.t[g].tab)}else{c.insertBefore(this.t[g].tab,c.childNodes[a])}}c=null};dhtmlXTabBar.prototype._getIndex=function(j){var a=-1;var g=this.tabsArea.childNodes[1].firstChild;for(var c=1;c<g.childNodes.length;c++){if(g.childNodes[c]._tabId==j){a=c-1}}g=null;return a};dhtmlXTabBar.prototype.getNumberOfTabs=function(j){var g=0;for(var c in this.t){g+=(j!=true?1:(this.t[c].conf.visible==true?1:0))}return g};dhtmlXTabBar.prototype.forEachCell=dhtmlXTabBar.prototype.forEachTab=function(g){for(var c in this.t){g.apply(window,[this.t[c].cell])}};dhtmlXTabBar.prototype.enableAutoReSize=function(){this._initFSResize()};dhtmlXTabBar.prototype.setArrowsMode=function(a){a={auto:"auto",always:"always"}[String(a)];if(a==null||a==this.conf.mode){return}this.conf.arwMode=a;if(a=="always"){this.tabsArea.childNodes[0].className="dhxtabbar_tabs_ar_left";this.tabsArea.childNodes[2].className="dhxtabbar_tabs_ar_right"}this.setSizes()};dhtmlXTabBar.prototype._checkArrows=function(){var l=false;if(this.conf.arwMode=="auto"){var j=0;for(var g in this.t){j+=this.t[g].tab.offsetWidth}var c=this.tabsArea.childNodes[0];var m=this.tabsArea.childNodes[2];if(j>this.cont.offsetWidth){if(c.className.search(/dhxtabbar_tabs_ar_hidden/)>=0){c.className=c.className.replace(/\s{0,}dhxtabbar_tabs_ar_hidden/,"");m.className=m.className.replace(/\s{0,}dhxtabbar_tabs_ar_hidden/,"");l=true}}else{if(c.className.search(/dhxtabbar_tabs_ar_hidden/)<1){c.className+=" dhxtabbar_tabs_ar_hidden";m.className+=" dhxtabbar_tabs_ar_hidden";l=true}}c=m=null}return l};dhtmlXTabBar.prototype._loadURLOnDemand=function(a){if(a!=null&&this.conf.urls[a]!=null){this.cells(a).attachURL(this.conf.urls[a].href,this.conf.urls[a].ajax);this.conf.urls[a]=null}};window.dhtmlXTabBarCell=function(j,g){dhtmlXCellObject.apply(this,[j,"_tabbar"]);this.tabbar=g;this.conf.skin=this.tabbar.conf.skin;this.conf.tabbar_funcs={show:"_showTab",hide:"_hideTab",isVisible:"_isTabVisible",enable:"_enableTab",disable:"_disableTab",isEnabled:"_isTabEnabled",getIndex:"_getIndex",getText:"_getTabText",setText:"_setTabText",setActive:"_setTabActive",isActive:"_isTabActive",close:"_removeTab"};this._tabbarCall=function(a){return function(){var l=[this._idd];for(var m=0;m<arguments.length;m++){l.push(arguments[m])}return this.tabbar[a].apply(this.tabbar,l)}};for(var c in this.conf.tabbar_funcs){this[c]=this._tabbarCall(this.conf.tabbar_funcs[c])}this.attachEvent("_onCellUnload",function(){this.tabbar=null;for(var l in this.conf.tabbar_funcs){this[l]=null;this.conf.tabbar_funcs[l]=null}this.conf.tabbar_funcs=null});this.attachEvent("_onContentLoaded",function(){this.tabbar._callMainEvent("onContentLoaded",arguments);this.tabbar._callMainEvent("onTabContentLoaded",arguments)});this.attachEvent("_onContentAttach",function(){this.tabbar._adjustCell(this.tabbar.conf.lastActive)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="sidebar"){this._hideBorders()}})};window.dhtmlXTabBarCell.prototype=new dhtmlXCellObject();dhtmlXCellObject.prototype.attachTabbar=function(a){this.callEvent("_onBeforeContentAttach",["tabbar"]);if(typeof(a)=="string"){a={mode:a}}else{if(typeof(a)!="object"||a==null){a={}}}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:-1}}this._attachObject(c);a.skin=this.conf.skin;a.parent=c;this.dataType="tabbar";this.dataObj=new dhtmlXTabBar(a);a.parent=c=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXTabBarInitFromHTML(){var z=document.getElementsByTagName("div");for(var i=0;i<z.length;i++){if(z[i].className.indexOf("dhtmlxTabBar")!=-1){var conf={settings:{},tabs:[]};var n=z[i];var id=n.id;n.className="";var k=new Array();for(var j=0;j<n.childNodes.length;j++){if(n.childNodes[j].tagName&&n.childNodes[j].tagName!="!"){k[k.length]=n.childNodes[j]}}var skin=n.getAttribute("skin");if(skin!=null){conf.settings.skin=skin}var w=new dhtmlXTabBar({parent:id,mode:n.getAttribute("mode")});window[id]=w;acs=n.getAttribute("onbeforeinit");if(acs){eval(acs)}align=n.getAttribute("align");if(align){conf.settings.align=align}var cont={};for(var j=0;j<k.length;j++){var m=k[j];var tab={id:m.id,text:m.getAttribute("name"),width:m.getAttribute("width"),selected:m.getAttribute("selected"),active:m.getAttribute("active"),close:m.getAttribute("close")};var href=m.getAttribute("href");if(href){cont[m.id]={href:href}}else{cont[m.id]={cont:m}}conf.tabs.push(tab)}w.loadStruct(conf);for(var a in cont){if(cont[a].href){w.cells(a).attachURL(cont[a].href);cont[a].href=null}else{w.cells(a).attachObject(cont[a].cont);if(cont[a].cont.style.display=="none"){cont[a].cont.style.display=""}cont[a].cont=null}cont[a]=null}var selId=n.getAttribute("select");if(selId!=null){w.tabs(selId).setActive()}else{if(w.getActiveTab()==null){var v=w._getFirstVisible();if(v!=null){w.cells(v).setActive()}}}acs=n.getAttribute("oninit");if(acs){eval(acs)}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXTabBarInitFromHTML,false)}else{window.detachEvent("onload",dhtmlXTabBarInitFromHTML)}}if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXTabBarInitFromHTML,false)}else{window.attachEvent("onload",dhtmlXTabBarInitFromHTML)}function dhtmlXSideBar(c){var g=this;this.conf={skin:(c.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxsidebar")||"dhx_skyblue"),css:"dhxsidebar",width:c.width||200,scroll_size:12,scroll_mult:20,close_button:false,icons_path:c.icons_path||"",selected:null};this.setTemplate(c.template);window.dhtmlXCellTop.apply(this,[c.parent,(c==null?null:c.offsets)]);window.dhx4._eventable(this);if(window.navigator.msPointerEnabled==true){this.conf.touch_ms=true;this.conf.touch_start="MSPointerDown",this.conf.touch_end="MSPointerUp"}else{this.conf.touch_ms=false;this.conf.touch_start="touchstart",this.conf.touch_end="touchend"}this.side=document.createElement("DIV");this.side.className="dhxsidebar_side dhxsidebar_tpl_"+this.conf.tpl_name;this.side.innerHTML="<div class='dhxsidebar_side_items'></div>";this.cont.appendChild(this.side);window.setTimeout(function(){if(g!=null&&g.side!=null){g.side.firstChild.style.top="0px"}},1);this.arw=document.createElement("DIV");this.arw.className="dhxsidebar_arrows dhxsidebar_arrows_hidden";this.arw.innerHTML="<div class='dhxsidebar_arrow dhxsidebar_arrow_left'><div class='dhxsidebar_arrow_image'></div></div><div class='dhxsidebar_arrow dhxsidebar_arrow_right'><div class='dhxsidebar_arrow_image'></div></div>";this.cont.appendChild(this.arw);this._doOnArwClick=function(l){l=l||event;if(l.type!="click"&&l.preventDefault){l.preventDefault()}var j=l.target||l.srcElement;if(j.className.match(/dhxsidebar_arrow_image/)!=null){j=j.parentNode}if(j.className.match(/dhxsidebar_arrow_left/)!=null){g._scrollSide(-g.conf.scroll_size)}else{if(j.className.match(/dhxsidebar_arrow_right/)!=null){g._scrollSide(g.conf.scroll_size)}}j=null};if(typeof(window.addEventListener)=="function"){this.arw.addEventListener(this.conf.touch_start,this._doOnArwClick,false);this.arw.addEventListener("click",this._doOnArwClick,false)}else{this.arw.attachEvent("onclick",this._doOnArwClick)}this._doOnSideClick=function(l){l=l||event;var j=l.target||l.srcElement;var m=null;if(l.type=="touchstart"||l.type=="pointerdown"||l.type=="MSPointerDown"){if(l.preventDefault){l.preventDefault()}if(this.className.match(/dhxsidebar_touch/gi)==null){if(l.type=="touchstart"||(l.type=="pointerdown"&&l.pointerType=="touch")){this.className+=" dhxsidebar_touch"}}}while(j!=null&&m==null&&l.type!="pointerdown"&&l.type!="MSPointerDown"){if(typeof(j.className)!="undefined"&&j.className.match(/^dhxsidebar_item/)!=null&&typeof(j._idd)!="undefined"){m=j._idd}else{j=j.parentNode}}if(m!=null){g._setItemActive(m,true)}j=null};if(typeof(window.addEventListener)=="function"){this.side.addEventListener(this.conf.touch_start,this._doOnSideClick,false);this.side.addEventListener(this.conf.touch_end,this._doOnSideClick,false);this.side.addEventListener("mouseup",this._doOnSideClick,false)}else{this.side.attachEvent("onclick",this._doOnSideClick)}this.side.onmouseover=function(){this.className=this.className.replace(/\s*dhxsidebar_touch/gi,"")};this._doOnSideScroll=function(j){j=j||event;var l=(j.type=="mousewheel"?-j.wheelDelta:j.deltaY);g._scrollSide(l/Math.abs(l)*3)};this._scrollSide=function(j){var l=parseInt(this.side.firstChild.style.top||0)-j*this.conf.scroll_mult;if(l+this.side.firstChild.offsetHeight<this.side.clientHeight){l=this.side.clientHeight-this.side.firstChild.offsetHeight}if(l>0){l=0}this.side.firstChild.style.top=l+"px"};if(typeof(window.addEventListener)=="function"){this.side.addEventListener("wheel",this._doOnSideScroll,false)}else{this.side.attachEvent("onmousewheel",this._doOnSideScroll)}this.t={};this.s={};this._adjustCell=function(o){if(o==null){return}var j=this.conf.width;var l=this.cont.offsetWidth-j;var n=0;var m=this.cont.offsetHeight;if(o!=this.conf.selected){n=-5000;this.t[o].cell.cell.style.visibility="hidden";this.t[o].cell.cell.style.zIndex=0}this.t[o].cell._setSize(j,n,l,m)};var a=window.dhx4.transDetect();this.conf.transProp=a.transProp;this.conf.transEv=a.transEv;this.conf.transValue="all 0.1s";this._doOnTrEnd=function(l){var n=this._idd;if(g.t[n]==null){return}var j=g.t[n];var m=j.conf.transActvId;if(j.conf.transMode=="hide"){if(j.conf.remove==true){g._removeItem(n)}else{j.item.style[j.conf.transProp]="";j.cell.cell.style.visibility="hidden";j.cell.cell.style.top="-5000px";j.conf.transActv=false}}else{if(j.conf.transMode=="show"){j.item.style[j.conf.transProp]="";j.item.style.visibility="visible";j.conf.transMode=null;j.conf.transActv=false}}if(m!=null){g._setItemActive(m)}else{g._checkHeight()}j=null};this._initObj=function(j){this.clearAll();if(j.items!=null){this.addItem(j.items)}};this._xmlToObj=function(u){var l=[];var o=u.getElementsByTagName("sidebar");if(o!=null&&o[0]!=null){var m=o[0].getElementsByTagName("item");for(var s=0;s<m.length;s++){var n={};for(var j=0;j<m[s].attributes.length;j++){n[m[s].attributes[j].nodeName]=m[s].attributes[j].nodeValue}l.push(n)}}return{items:l}};dhx4._enableDataLoading(this,"_initObj","_xmlToObj","sidebar",{struct:true});this.unload=function(){this.conf.unloading=true;if(typeof(window.addEventListener)=="function"){this.side.removeEventListener("wheel",this._doOnSideScroll,false)}else{this.side.detachEvent("onmousewheel",this._doOnSideScroll)}this.clearAll();this.s=this.t=null;if(typeof(window.addEventListener)=="function"){this.arw.removeEventListener(this.conf.touch_start,this._doOnArwClick,false);this.arw.removeEventListener("click",this._doOnArwClick,false)}else{this.arw.detachEvent("onclick",this._doOnArwClick)}this.arw.parentNode.removeChild(this.arw);this.arw=null;if(typeof(window.addEventListener)=="function"){this.side.removeEventListener(this.conf.touch_start,this._doOnSideClick,false);this.side.removeEventListener(this.conf.touch_end,this._doOnSideClick,false);this.side.removeEventListener("click",this._doOnSideClick,false)}else{this.side.detachEvent("onclick",this._doOnSideClick)}this.side.onmouseover=null;this.side.parentNode.removeChild(this.side);this.side=null;this._unloadTop();window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");g=null};this.setSizes();if(c.items!=null){this._initObj(c)}else{if(c.json!=null){this.loadStruct(c.json,c.onload)}else{if(c.xml!=null){this.loadStruct(c.xml,c.onload)}}}return this}dhtmlXSideBar.prototype=new dhtmlXCellTop();dhtmlXSideBar.prototype._addItem=function(c){var j=(typeof(c.id)!="undefined"?c.id:window.dhx4.newId());if(c.type=="separator"){var g=document.createElement("DIV");g.className="dhxsidebar_sep";this.side.firstChild.appendChild(g);this.s[j]={sep:g};g=null;return}c.icons_path=this.conf.icons_path;var g=document.createElement("DIV");g.className="dhxsidebar_item";g.innerHTML=window.dhx4.template(this.conf.tpl_str,c);g._idd=j;this.side.firstChild.appendChild(g);g.ondragstart=function(){return false};var a=new dhtmlXSideBarCell(j,this);this.cont.appendChild(a.cell);this.t[j]={item:g,cell:a,init:c,conf:{selected:false,visible:true,close:close}};g=null;if(window.dhx4.s2b(c.selected)==true){this._setItemActive(j)}else{this._adjustCell(j)}this._checkHeight()};dhtmlXSideBar.prototype.addItem=function(a){if(!(a instanceof Array)){a=[a]}for(var c=0;c<a.length;c++){this._addItem(a[c])}};dhtmlXSideBar.prototype.items=dhtmlXSideBar.prototype.cells=function(a){if(this.t[a]!=null){return this.t[a].cell}return null};dhtmlXSideBar.prototype.forEachCell=dhtmlXSideBar.prototype.forEachItem=function(g){for(var c in this.t){if(typeof(g)=="function"){g.apply(window,[this.t[c].cell])}else{if(typeof(g)=="string"&&typeof(window[g])=="function"){window[g].apply(window,[this.t[c].cell])}}}};dhtmlXSideBar.prototype.getAllItems=function(){var g=[];for(var c in this.t){g.push(c)}return g};dhtmlXSideBar.prototype.getNumberOfItems=function(){return this.getAllItems().length};dhtmlXSideBar.prototype.clearAll=function(){for(var c in this.t){this._removeItem(c,false,true)}for(var c in this.s){this.removeSep(c)}};dhtmlXSideBar.prototype.setSizes=function(){this._adjustCont();this._adjustSide();this._checkHeight();this._adjustCell(this.conf.selected);this.callEvent("_onSetSizes",[])};dhtmlXSideBar.prototype.setSideWidth=function(a){this.conf.width=a;this.setSizes()};dhtmlXSideBar.prototype._adjustSide=function(){if(this.conf.side_ofs==null){this.conf.side_ofs={};this.side.style.width=this.conf.width+"px";this.side.style.height=this.cont.offsetHeight+"px";this.conf.side_ofs.w=this.side.offsetWidth-parseInt(this.side.style.width);this.conf.side_ofs.h=this.side.offsetHeight-parseInt(this.side.style.height)}this.side.style.width=this.conf.width-this.conf.side_ofs.w+"px";this.side.style.height=this.cont.offsetHeight-this.arw.offsetHeight-this.conf.side_ofs.h+"px";this.arw.style.width=this.side.style.width;this._scrollSide(0)};dhtmlXSideBar.prototype._checkHeight=function(){var a=(this.arw.className.match(/dhxsidebar_arrows_hidden/)!=null);if(this.conf.side_hfix==null){this.conf.side_hfix=this.side.offsetHeight-this.side.clientHeight}if(this.side.firstChild.offsetHeight>this.cont.clientHeight-this.conf.side_hfix){if(a==true){this.arw.className="dhxsidebar_arrows";this._adjustSide()}}else{if(a==false){this.arw.className="dhxsidebar_arrows dhxsidebar_arrows_hidden";this.side.firstChild.style.top="0px";this._adjustSide()}}};dhtmlXSideBar.prototype.removeSep=function(c){if(this.s[c]==null){return}this.side.firstChild.removeChild(this.s[c].sep);this.s[c].sep=null;this.s[c]=null;try{delete this.s[c]}catch(a){}};dhtmlXSideBar.prototype._setItemActive=function(g,c){if(this.conf.selected==g){return}if(typeof(c)=="undefined"){c=false}if(c==true&&this.callEvent("onBeforeSelect",[g,this.conf.selected])!==true){return}var a=null;if(this.conf.selected!=null){a=this.conf.selected;this._setItemInactive(this.conf.selected)}if(this.t[g]!=null){this.conf.selected=g;this.t[g].selected=true;this.t[g].item.className+=" dhxsidebar_item_selected";this.t[g].cell.cell.style.visibility="visible";this.t[g].cell.cell.style.top="0px";this.t[g].cell.cell.style.zIndex=1}else{this.conf.selected=null}this._adjustCell(g);if(c==true){this.callEvent("onSelect",[g,a])}};dhtmlXSideBar.prototype._setItemInactive=function(a){if(this.t[a]==null){return}this.t[a].selected=false;this.t[a].item.className=this.t[a].item.className.replace(/\s{0,}dhxsidebar_item_selected/gi,"");this.t[a].cell.cell.style.visibility="hidden";this.t[a].cell.cell.style.top="-5000px";this.t[a].cell.cell.style.zIndex=0};dhtmlXSideBar.prototype._isItemActive=function(a){return(this.conf.selected==a)};dhtmlXSideBar.prototype._getNextVisible=function(c,a){return this._getNearVisible(c,a,"next")};dhtmlXSideBar.prototype._getPrevVisible=function(c,a){return this._getNearVisible(c,a,"previous")};dhtmlXSideBar.prototype._getFirstVisible=function(){return this._getNearVisible(null,false,"first")};dhtmlXSideBar.prototype._getNearVisible=function(m,c,l){if(l=="first"){var g=this.side.firstChild.firstChild;l="next"}else{if(m==null||this.t[m]==null){return(c?this._getFirstVisible():null)}var g=this.t[m].item[l+"Sibling"]}var j=null;while(g!=null&&j==null){var a=g._idd;if(a!=null&&j==null&&this.t[a].conf.visible){j=a}else{g=g[l+"Sibling"]}}g=null;return j};dhtmlXSideBar.prototype.goToNextItem=function(a){var c=this._getNextVisible(this.conf.selected,true);if(c!=null){this._setItemActive(c,a)}};dhtmlXSideBar.prototype.goToPrevItem=function(a){var c=this._getPrevVisible(this.conf.selected,true);if(c!=null){this._setItemActive(c,a)}};dhtmlXSideBar.prototype.getActiveItem=function(){return this.conf.selected};dhtmlXSideBar.prototype.setTemplate=function(j,c){this.conf.tpl_name=(j!=null&&this.templates[j]!=null?j:"details");this.conf.tpl_str=this.templates[this.conf.tpl_name];if(c!=null){this.conf.icons_path=c}for(var g in this.t){this.t[g].init.icons_path=this.conf.icons_path;this.t[g].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[g].init)}if(this.side!=null){this.side.className="dhxsidebar_side dhxsidebar_tpl_"+this.conf.tpl_name}if(this._scrollSide!=null){this._scrollSide(0);this._checkHeight()}};dhtmlXSideBar.prototype.templates={details:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'><div class='dhxsidebar_item_text'>#text#</div>",tiles:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'><div class='dhxsidebar_item_text'>#text#</div>",icons:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'>",icons_text:"<div class='dhxsidebar_item_icon'><img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'></div><div class='dhxsidebar_item_text'>#text#</div>",text:"<div class='dhxsidebar_item_text'>#text#</div>"};window.dhtmlXSideBarCell=function(j,g){dhtmlXCellObject.apply(this,[j,"_sidebar"]);this.sidebar=g;this.conf.skin=this.sidebar.conf.skin;this.conf.sidebar_funcs={show:"_showItem",hide:"_hideItem",isVisible:"_isItemVisible",setActive:"_setItemActive",isActive:"_isItemActive",setText:"_setItemText",getText:"_getItemText",remove:"_removeItem"};this._sidebarCall=function(a){return function(){var l=[this._idd];for(var m=0;m<arguments.length;m++){l.push(arguments[m])}return this.sidebar[a].apply(this.sidebar,l)}};for(var c in this.conf.sidebar_funcs){this[c]=this._sidebarCall(this.conf.sidebar_funcs[c])}this.attachEvent("_onCellUnload",function(){this.sidebar=null;for(var l in this.conf.sidebar_funcs){this[l]=this.conf.sidebar_funcs[l]=null}this.conf.sidebar_funcs=null});this.attachEvent("_onContentLoaded",function(){this.sidebar.callEvent("onContentLoaded",arguments)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="tabbar"||a=="layout"||a=="acc"||a=="sidebar"){this._hideBorders()}if((this.conf.skin=="dhx_web"||this.conf.skin=="dhx_terrace")&&(a=="menu"||a=="toolbar"||a=="ribbon")){if(this.cell.className.match(/dhx_cell_cont_no_top/gi)==null){this.cell.className+=" dhx_cell_cont_no_top"}}})};dhtmlXSideBarCell.prototype=new dhtmlXCellObject();dhtmlXSideBar.prototype._setItemText=function(j,g){if(this.t[j]!=null){for(var c in g){this.t[j].init[c]=g[c]}this.t[j].init.icons_path=this.conf.icons_path;this.t[j].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[j].init)}};dhtmlXSideBar.prototype._getItemText=function(j){var g={};if(this.t[j]!=null){for(var c in this.t[j].init){g[c]=this.t[j].init[c]}}return g};dhtmlXSideBar.prototype._removeItem=function(o,n,l){if(this.t[o]==null){return}if(l!=true&&this.t[o].conf.remove!=true){this.t[o].conf.remove=true;this._hideItem(o,n);return}if(typeof(n)=="undefined"){n=true}var g=this._getNextVisible(o);var j=this._getPrevVisible(o);if(this.t[o].conf.transEv==true){this.t[o].item.removeEventListener(this.conf.transEv,this._doOnTrEnd);this.t[o].conf.transEv=false}this.t[o].cell._unload();this.t[o].cell=null;this.t[o].item.parentNode.removeChild(this.t[o].item);this.t[o].item=null;for(var c in this.t[o]){this.t[o][c]=null}this.t[o]=null;try{delete this.t[o]}catch(m){}if(this.conf.selected==o&&n!=false){this.conf.selected=null;var n=(n==true?(g||j||this._getFirstVisible()):n);if(n!=null){this._setItemActive(n)}}else{if(l!=true){this._checkHeight()}}};dhtmlXSideBar.prototype._showItem=function(c,a){if(this.t[c]==null||this.t[c].conf.visible==true||this.t[c].conf.transActv==true){return}if(this.conf.transProp!==false){this.t[c].conf.transActv=true;this.t[c].conf.transMode="show";this.t[c].conf.transProp=this.conf.transProp;this.t[c].conf.transActvId=(a?c:null);if(this.t[c].conf.transEv!=true){this.t[c].item.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[c].conf.transEv=true}this.t[c].conf.visible=true;this.t[c].item.style[this.conf.transProp]=this.conf.transValue;this.t[c].item.className="dhxsidebar_item"}else{this.t[c].conf.visible=true;this.t[c].item.style.display="";if(a==true){this._setItemActive(c)}else{this._checkHeight()}}};dhtmlXSideBar.prototype._hideItem=function(l,j){if(this.t[l]==null||this.t[l].conf.visible!=true||this.t[l].conf.transActv==true){return}var g=false;if(this.conf.selected==l){this.conf.selected=null;this.t[l].conf.active=false;this.t[l].item.className="dhxsidebar_item";g=true}var c=this._getPrevVisible(l);var a=this._getNextVisible(l);var j=(g&&j!==false?(j==true?null:j)||a||c:null);if(this.conf.transProp!==false){this.t[l].conf.transActv=true;this.t[l].conf.transMode="hide";this.t[l].conf.transProp=this.conf.transProp;this.t[l].conf.transActvId=j;this.t[l].conf.visible=false;if(this.t[l].conf.transEv!=true){this.t[l].item.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[l].conf.transEv=true}this.t[l].item.style[this.conf.transProp]=this.conf.transValue;this.t[l].item.className="dhxsidebar_item dhxsidebar_item_hidden"}else{this.t[l].item.style.display="none";this.t[l].conf.visible=false;this.t[l].cell.cell.style.visibility="hidden";this.t[l].cell.cell.style.top="-5000px";if(j!=null){this._setItemActive(j)}this._checkHeight();if(this.t[l].conf.remove==true){this._removeItem(l)}}};dhtmlXSideBar.prototype._isItemVisible=function(a){return(this.t[a].conf.visible==true)};dhtmlXCellObject.prototype.attachSidebar=function(a){this.callEvent("_onBeforeContentAttach",["sidebar"]);if(a==null){a={}}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof window.dhtmlXWindowsCell)){}else{if(this.conf.skin=="dhx_skyblue"){c._ofs={t:-1,r:-1,b:-1,l:-1}}if(this.conf.skin=="dhx_web"){if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:8}}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&(this instanceof window.dhtmlXLayoutCell)){c._ofs={t:2}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){c._ofs={t:8}}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:2}}}if(this.conf.skin=="dhx_terrace"){if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:-1}}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&(this instanceof window.dhtmlXLayoutCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1,r:-1,b:-1,l:-1}}}}this._attachObject(c);a.skin=this.conf.skin;a.parent=c;this.dataType="sidebar";this.dataObj=new dhtmlXSideBar(a);a.parent=c=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXWindows(o){var m=this;var j={};if(typeof(o)!="undefined"){for(var g in o){j[g]=o[g]}}o=null;this.conf={skin:window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxwins")||"dhx_skyblue",vp_pos_ofs:20,vp_custom:false,ofs_w:null,ofs_h:null,button_last:null,dblclick_tm:300,dblclick_last:null,dblclick_id:null,dblclick_mode:"minmax",dblclick_active:false,dblclick_ev:(navigator.userAgent.indexOf("MSIE 6.0")>=0||navigator.userAgent.indexOf("MSIE 7.0")>=0||navigator.userAgent.indexOf("MSIE 8.0")>=0),fr_cover:(navigator.userAgent.indexOf("MSIE 6.0")>=0)};var c=window.dhx4.transDetect();this.conf.tr={prop:c.transProp,ev:c.transEv,height_open:"height 0.2s cubic-bezier(0.25,0.1,0.25,1)",height_close:"height 0.18s cubic-bezier(0.25,0.1,0.25,1)",op_open:"opacity 0.16s ease-in",op_close:"opacity 0.2s ease-out",op_v_open:"1",op_v_close:"0.4"};if(!j.viewport){this.attachViewportTo(document.body)}else{if(j.viewport.object!=null){this.attachViewportTo(j.viewport.object)}else{if(j.viewport.left!=null&&j.viewport.top!=null&&j.viewport.width!=null&&j.viewport.height!=null){this.setViewport(j.viewport.left,j.viewport.top,j.viewport.width,j.viewport.height,j.viewport.parent)}else{this.attachViewportTo(document.body)}}}this.w={};this.createWindow=function(s,H,E,u,J){var q={};if(arguments.length==1&&typeof(s)=="object"){q=s}else{q.id=s;q.left=H;q.top=E;q.width=u;q.height=J;if(typeof(q.id)=="undefined"||q.id==null){q.id=window.dhx4.newId()}while(this.w[q.id]!=null){q.id=window.dhx4.newId()}}if(q.left==null){q.left=0}if(q.top==null){q.top=0}q.move=(q.move!=null&&window.dhx4.s2b(q.move)==false?false:(q.deny_move!=null&&window.dhx4.s2b(q.deny_move)==true?false:true));q.park=(q.park!=null&&window.dhx4.s2b(q.park)==false?false:(q.deny_park!=null&&window.dhx4.s2b(q.deny_park)==true?false:true));q.resize=(q.resize!=null&&window.dhx4.s2b(q.resize)==false?false:(q.deny_resize!=null&&window.dhx4.s2b(q.deny_resize)==true?false:true));q.keep_in_viewport=(q.keep_in_viewport!=null&&window.dhx4.s2b(q.keep_in_viewport));q.modal=(q.modal!=null&&window.dhx4.s2b(q.modal));q.center=(q.center!=null&&window.dhx4.s2b(q.center));q.text=(q.text!=null?q.text:(q.caption!=null?q.caption:"dhtmlxWindow"));q.header=(!(q.header!=null&&window.dhx4.s2b(q.header)==false));var K=document.createElement("DIV");K.className="dhxwin_active";this.vp.appendChild(K);K._isWindow=true;K._idd=q.id;var A=document.createElement("DIV");A.className="dhxwin_hdr";A.style.zIndex=0;A.innerHTML="<div class='dhxwin_icon'></div><div class='dhxwin_text'><div class='dhxwin_text_inside'>"+q.text+"</div></div><div class='dhxwin_btns'></div>";K.appendChild(A);A.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};A.oncontextmenu=function(a){a=a||event;a.cancelBubble=true;return false};A._isWinHdr=true;A.firstChild._isWinIcon=true;var v=document.createElement("DIV");v.className="dhxwin_brd";K.appendChild(v);var D=document.createElement("DIV");D.className="dhxwin_fr_cover";D.innerHTML="<iframe class='dhxwin_fr_cover_inner' frameborder='0' border='0'></iframe><div class='dhxwin_fr_cover_inner'></div>";K.appendChild(D);this.w[q.id]={win:K,hdr:A,brd:v,fr_cover:D,b:{},conf:{z_id:window.dhx4.newId(),actv:false,modal:false,maxed:false,parked:false,sticked:false,visible:true,header:true,text:q.text,keep_in_vp:q.keep_in_viewport,allow_move:q.move,allow_park:q.park,allow_resize:q.resize,max_w:null,max_h:null,min_w:80,min_h:80}};var w={help:{title:"Help",visible:false},stick:{title:"Stick",visible:false},park:{title:"Park",visible:true},minmax:{title:"Min/Max",visible:true},close:{title:"Close",visible:true}};for(var F in w){var C=new dhtmlXWindowsButton(this,q.id,F,w[F].title,false);if(w[F].visible==false){C.hide()}A.lastChild.appendChild(C.button);this.w[q.id].b[F]=C;C=null}this._winAdjustTitle(q.id);this.w[q.id].win.style.zIndex=window.dhx4.zim.reserve(this.w[q.id].conf.z_id);var I=new dhtmlXWindowsCell(q.id,this);this.w[q.id].win.insertBefore(I.cell,D);this.w[q.id].cell=I;if(typeof(window.addEventListener)=="function"){this.w[q.id].win.addEventListener("mousedown",this._winOnMouseDown,false);this.w[q.id].win.addEventListener("mouseup",this._winOnMouseDown,false);if(this.conf.dblclick_ev){this.w[q.id].win.addEventListener("dblclick",this._winOnMouseDown,false)}if(this.conf.dnd_evs!=null){this.w[q.id].win.addEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);if(window.navigator.msPointerEnabled!=true){this.w[q.id].win.addEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);this.w[q.id].win.addEventListener(this.conf.dnd_evs.end,this._winOnMouseDown,false)}}}else{this.w[q.id].win.attachEvent("onmousedown",this._winOnMouseDown);this.w[q.id].win.attachEvent("onmouseup",this._winOnMouseDown);if(this.conf.dblclick_ev){this.w[q.id].win.attachEvent("ondblclick",this._winOnMouseDown)}}this._winInitFRM(q.id);this._winSetPosition(q.id,q.left,q.top);this._winSetSize(q.id,q.width,q.height);this._winMakeActive(q.id);if(q.center==true){this.w[q.id].cell.center()}if(q.modal==true){this.w[q.id].cell.setModal(true)}if(q.header==false){this.w[q.id].cell.hideHeader()}f=K=A=v=D=I=null;return this.w[q.id].cell};this._winOnMouseDown=function(r){r=r||event;var a=r.target||r.srcElement;var q={press_type:r.type};if(r.type=="MSPointerDown"){m.conf.ev_skip=true}else{if(m.conf.ev_skip==true){m.conf.ev_skip=false;a=null;return}}while(a!=null&&a._isWindow!=true){if(typeof(a.className)!="undefined"&&q.mode==null){if(typeof(a._buttonName)!="undefined"){q.mode="button";q.button_name=a._buttonName}else{if(a._isWinHdr==true){q.mode="hdr"}else{if(a._isWinIcon==true){q.mode="icon"}}}}a=a.parentNode}if(q.mode==null){q.mode="win"}q.id=(a!=null&&a._isWindow==true?a._idd:null);a=null;if(q.id!=null){m.callEvent("_winMouseDown",[r,q])}};this._winOnParkTrans=function(q){if(q.stopPropagation){q.stopPropagation()}var a=m.w[this._idd];if(q.propertyName=="opacity"){m._winCellClearOpacity(this._idd)}if(q.propertyName=="height"&&a.conf.tr_mode=="park"){if(a.conf.tr_mode=="park"){a.win.style[m.conf.tr.prop]="";if(!a.conf.parked){m._winAdjustCell(this._idd);m._callMainEvent("onParkDown",this._idd);if(a.conf.keep_in_vp){m._winAdjustPosition(this._idd,a.conf.x,a.conf.y)}}else{a.hdr.style.zIndex=3;m._callMainEvent("onParkUp",this._idd)}}}a=null};this.unload=function(){this.conf.unloading=true;if(this._dndInitModule){this._dndUnloadModule()}for(var q in this.w){this._winClose(q)}this.w=null;if(this.cm!=null&&typeof(this._unloadContextMenu)=="function"){this._unloadContextMenu()}window.dhx4._eventable(this,"clear");this.attachViewportTo(null);for(var q in this.conf){this.conf[q]=null;delete this.conf[q]}for(var q in this){this[q]=null}m=q=null};window.dhx4._eventable(this);this.attachEvent("_winMouseDown",this._winMouseDownHandler);if(this._dndInitModule){this._dndInitModule()}if(j.wins!=null){for(var n=0;n<j.wins.length;n++){var l=j.wins[n];this.createWindow(l)}}j=null;return this}dhtmlXWindows.prototype.forEachWindow=function(g){for(var c in this.w){g.apply(window,[this.w[c].cell])}};dhtmlXWindows.prototype.window=function(a){if(this.w[a]!=null){return this.w[a].cell}return null};dhtmlXWindows.prototype.isWindow=function(a){return(this.w[a]!=null)};dhtmlXWindows.prototype.findByText=function(j){var g=[];for(var c in this.w){if((this.w[c].cell.getText()).indexOf(String(j))>=0){g.push(this.w[c])}}return g};dhtmlXWindows.prototype.setSkin=function(g){if(g==this.conf.skin){return}if(this.vp!=null){this.vp.className=String(this.vp.className).replace("dhxwins_vp_"+this.conf.skin," dhxwins_vp_"+g)}for(var c in this.w){this.w[c].cell._resetSizeState();this._winAdjustCell(c);this._winAdjustTitle(c)}this.conf.skin=g};dhtmlXWindows.prototype.getBottommostWindow=function(){return this._getTopBottomWin(false)};dhtmlXWindows.prototype.getTopmostWindow=function(){return this._getTopBottomWin(true)};dhtmlXWindows.prototype._getTopBottomWin=function(l){var j=null;for(var c in this.w){if(this.w[c].conf.visible){var g=false;if(j!=null){g=j.z>this.w[c].win.style.zIndex;if(l){g=!g}}if(j==null||g){j={win:this.w[c].cell,z:this.w[c].win.style.zIndex}}}}return(j?j.win:null)};dhtmlXWindows.prototype._winMakeActive=function(g,l){if(g!=null&&l!==true&&this.w[g].conf.actv==true){return}var x=[];var r=[{name:"modal",value:true},{name:"sticked",value:true},{name:"sticked",value:false}];var o={};for(var c=0;c<r.length;c++){var n=r[c].name;var j=r[c].value;var y=[];for(var u in this.w){var v=this.w[u];if(o[u]==null&&v.conf[n]===j&&v.conf.visible==true){if(g!=u){window.dhx4.zim.clear(v.conf.z_id);y.push([u,Number(v.win.style.zIndex)]);o[u]=true}}v=null}y.sort(function(w,q){return(w[1]<q[1]?1:-1)});if(g!=null&&this.w[g].conf[n]===j&&o[g]==null){window.dhx4.zim.clear(this.w[g].conf.z_id);var m=[[g,Number(this.w[g].win.style.zIndex)]];y=m.concat(y);o[g]=true}x=x.concat(y)}for(var c=x.length-1;c>=0;c--){var u=x[c][0];var v=this.w[u];v.win.style.zIndex=window.dhx4.zim.reserve(v.conf.z_id);if(v.conf.modal&&this.mcover!=null){for(var s in this.mcover){this.mcover[s].style.zIndex=v.win.style.zIndex}}this._winAdjustFRMZIndex(u);if(g==null&&c==0){g=u}v.conf.actv=(g==u);v.win.className=(v.conf.actv?"dhxwin_active":"dhxwin_inactive");v=null}if(g!=null&&this.conf.last_active!=g){this._callMainEvent("onFocus",g)}this.conf.last_active=g};dhtmlXWindows.prototype._vpPull={};dhtmlXWindows.prototype._vpPullAdd=function(){if(this.vp==null){return}var g=null;for(var c in this._vpPull){if(this._vpPull[c].vp==this.vp){this._vpPull[c].count++;g=c}}if(g==null){this._vpPull[window.dhx4.newId()]={vp:this.vp,count:1}}};dhtmlXWindows.prototype._vpPullRemove=function(){if(this.vp==null){return 0}var g=0;for(var c in this._vpPull){if(this._vpPull[c].vp==this.vp){g=--this._vpPull[c].count;if(g==0){this._vpPull[c].vp=null;this._vpPull[c].count=null;delete this._vpPull[c]}}}return g};dhtmlXWindows.prototype.attachViewportTo=function(l){var g=this._vpPullRemove();if(this.conf.vp_custom){while(this.vp.childNodes.length>0){this.vp.removeChild(this.vp.lastChild)}this.vp.parentNode.removeChild(this.vp);this.vp=null}else{if(this.vp!=null&&g==0){this.vp.className=String(this.vp.className).replace(new RegExp("\\s{1,}dhxwins_vp_"+this.conf.skin),"")}}if(l==null){this.vp=null}else{this.vp=(typeof(l)=="string"?document.getElementById(l):l);var j="dhxwins_vp_"+this.conf.skin;if(this.vp.className.indexOf(j)<0){this.vp.className+=" "+j}l=null;for(var c in this.w){this.vp.appendChild(this.w[c].win)}this.conf.vp_custom=false}if(this.vp==document.body){document.body.style.position="static"}this._vpPullAdd()};dhtmlXWindows.prototype.setViewport=function(c,m,j,a,l){var g=document.createElement("DIV");g.style.position="absolute";g.style.left=c+"px";g.style.top=m+"px";g.style.width=j+"px";g.style.height=a+"px";if(typeof(l)=="undefined"||l==null){l=document.body}else{if(typeof(l)=="string"){l=document.getElementById(l)}}l.appendChild(g);this.attachViewportTo(g);this.conf.vp_custom=true;l=g=null};dhtmlXWindows.prototype._winSetPosition=function(j,a,g){var c=this.w[j];if(c.conf.maxed){c.conf.lastMX+=(a-c.conf.x);c.conf.lastMY+=(g-c.conf.y)}c.conf.x=a;c.conf.y=g;c.win.style.left=c.conf.x+"px";c.win.style.top=c.conf.y+"px";this._winAdjustFRMPosition(j);c=null};dhtmlXWindows.prototype._winAdjustPosition=function(n,c,m){var g=this.w[n];if(typeof(c)=="undefined"){c=g.conf.x}if(typeof(m)=="undefined"){m=g.conf.y}var a=(g.conf.keep_in_vp?0:-g.conf.w+this.conf.vp_pos_ofs);var l=(g.conf.keep_in_vp?this.vp.clientWidth-g.conf.w:this.vp.clientWidth-this.conf.vp_pos_ofs);if(c<a){c=a}else{if(c>l){c=l}}var j=(g.conf.keep_in_vp?this.vp.clientHeight-g.conf.h:this.vp.clientHeight-this.conf.vp_pos_ofs);if(m<0){m=0}else{if(m>j){m=j}}if(c!=g.conf.x||m!=g.conf.y){this._winSetPosition(n,c,m)}g=null};dhtmlXWindows.prototype._winSetSize=function(o,m,g,n,c){var j=this.w[o];var a=(m!=null?m:j.conf.w);var l=(g!=null?g:j.conf.h);if(this.conf.ofs_w==null){j.win.style.width=a+"px";j.win.style.height=l+"px";this.conf.ofs_w=j.win.offsetWidth-a;this.conf.ofs_h=j.win.offsetHeight-l}if(j.conf.min_w!=null&&a<j.conf.min_w){a=j.conf.min_w}if(j.conf.max_w!=null&&a>j.conf.max_w){a=j.conf.max_w}if(!j.conf.parked&&j.conf.min_h!=null&&l<j.conf.min_h){l=j.conf.min_h}if(j.conf.max_h!=null&&l>j.conf.max_h){l=j.conf.max_h}if(j.conf.keep_in_vp){if(a>this.vp.clientWidth){a=this.vp.clientWidth}if(l>this.vp.clientHeight){l=this.vp.clientHeight}}j.win.style.width=a-this.conf.ofs_w+"px";j.win.style.height=l-this.conf.ofs_h+"px";j.conf.w=a;j.conf.h=l;this._winAdjustFRMSize(o);if(c){this._winAdjustPosition(o,j.conf.x,j.conf.y)}if(!j.conf.parked&&n!=true){this._winAdjustCell(o)}j=null};dhtmlXWindows.prototype._winMinmax=function(l,g){if(typeof(g)!="undefined"&&this.w[l].conf.maxed==g){return}if(this.w[l].conf.allow_resize==false){return}var c=this.w[l];if(c.conf.parked){this._winPark(l,false)}if(c.conf.maxed){this._winSetSize(l,c.conf.lastMW,c.conf.lastMH);this._winAdjustPosition(l,c.conf.lastMX,c.conf.lastMY);c.conf.maxed=false}else{var a=0;var j=0;if(c.conf.max_w!=null){a=c.conf.x+Math.round(c.conf.w-c.conf.max_w)/2}if(c.conf.max_h!=null){j=Math.max(c.conf.y+Math.round(c.conf.h-c.conf.max_h)/2,0)}c.conf.lastMX=c.conf.x;c.conf.lastMY=c.conf.y;c.conf.lastMW=c.conf.w;c.conf.lastMH=c.conf.h;this._winSetSize(l,this.vp.clientWidth,this.vp.clientHeight);this._winAdjustPosition(l,a,j);c.conf.maxed=true}c.b.minmax.setCss(c.conf.maxed?"minmaxed":"minmax");if(c.conf.maxed){this._callMainEvent("onMaximize",l)}else{this._callMainEvent("onMinimize",l)}c=null};dhtmlXWindows.prototype._winShow=function(c,a){if(this.w[c].conf.visible==true){return}this.w[c].win.style.display="";this.w[c].conf.visible=true;if(a==true||this.conf.last_active==null){this._winMakeActive(c,true)}this._callMainEvent("onShow",c)};dhtmlXWindows.prototype._winHide=function(c,a){if(this.w[c].conf.visible==false){return}this.w[c].win.style.display="none";this.w[c].conf.visible=false;if(this.w[c].conf.actv){this.w[c].conf.actv=false;this.w[c].win.className="dhxwin_inactive";this._winMakeActive(null,true)}this._callMainEvent("onHide",c)};dhtmlXWindows.prototype._winPark=function(g,a){if(this.w[g].conf.allow_park==false){return}if(this.w[g].conf.header==false){return}var c=this.w[g];if(a==true&&this.conf.tr.prop!==false){c.win.style[this.conf.tr.prop]=this.conf.tr[c.conf.parked?"height_open":"height_close"];if(!c.conf.tr_ev){c.win.addEventListener(this.conf.tr.ev,this._winOnParkTrans,false);c.conf.tr_ev=true}}if(c.conf.parked){c.hdr.className=String(c.hdr.className).replace(/\s{1,}dhxwin_hdr_parked/gi,"");c.hdr.style.zIndex=0;c.conf.parked=false;c.conf.tr_mode="park";this._winCellSetOpacity(g,"open",a);this._winSetSize(g,c.conf.w,c.conf.lastPH,(a==true&&this.conf.tr.prop!==false));if(!(a==true&&this.conf.tr.prop!==false)){this._callMainEvent("onParkDown",g);if(c.conf.keep_in_vp){this._winAdjustPosition(g,c.conf.x,c.conf.y)}}if(window.dhx4.isIE8==true&&this.conf.tr.prop==false&&c.cell.cell.className.match(/dhxwin_parked/)!=null){c.cell.cell.className=c.cell.cell.className.replace(/\s{0,}dhxwin_parked/gi,"")}}else{c.conf.lastPH=c.conf.h;c.hdr.className+=" dhxwin_hdr_parked";if(a==false||this.conf.tr.prop==false){c.hdr.style.zIndex=3}c.conf.parked=true;c.conf.tr_mode="park";this._winCellSetOpacity(g,"close",a);this._winSetSize(g,c.conf.w,c.hdr.offsetHeight+this.conf.ofs_h,(a==true&&this.conf.tr.prop!==false));if(!(a==true&&this.conf.tr.prop!==false)){this._callMainEvent("onParkUp",g)}if(window.dhx4.isIE8==true&&this.conf.tr.prop==false&&c.cell.cell.className.match(/dhxwin_parked/)==null){c.cell.cell.className+=" dhxwin_parked"}}c=null};dhtmlXWindows.prototype._winCellSetOpacity=function(n,m,g,l){var c=this.w[n].cell;for(var j in c.conf.idx){if({pr1:true,pr2:true}[j]!=true){if(g==true&&this.conf.tr.prop!=false){c.cell.childNodes[c.conf.idx[j]].style[this.conf.tr.prop]=this.conf.tr["op_"+m]}c.cell.childNodes[c.conf.idx[j]].style.opacity=this.conf.tr["op_v_"+m]}}c=null};dhtmlXWindows.prototype._winCellClearOpacity=function(j){var c=this.w[j].cell;for(var g in c.conf.idx){if({pr1:true,pr2:true}[g]!=true){if(this.conf.tr.prop!=false){c.cell.childNodes[c.conf.idx[g]].style[this.conf.tr.prop]=""}}}c=null};dhtmlXWindows.prototype._winStick=function(c,a){if(typeof(a)!="undefined"&&this.w[c].conf.sticked==a){return}this.w[c].conf.sticked=!this.w[c].conf.sticked;this.w[c].b.stick.setCss(this.w[c].conf.sticked?"sticked":"stick");this._winMakeActive(this.conf.last_active,true);if(this.w[c].conf.sticked){this._callMainEvent("onStick",c)}else{this._callMainEvent("onUnStick",c)}};dhtmlXWindows.prototype._winClose=function(j){if(this._callMainEvent("onClose",j)!==true&&this.conf.unloading!=true){return}var g=this.w[j];if(g.conf.fs_mode){g.cell.setToFullScreen(false)}if(g.conf.modal){this._winSetModal(j,false)}window.dhx4.zim.clear(g.conf.z_id);if(this.cm!=null&&this.cm.icon[j]!=null){this._detachContextMenu("icon",j,null)}if(typeof(window.addEventListener)=="function"){g.win.removeEventListener("mousedown",this._winOnMouseDown,false);g.win.removeEventListener("mouseup",this._winOnMouseDown,false);if(this.conf.dblclick_ev){g.win.removeEventListener("dblclick",this._winOnMouseDown,false)}if(this.conf.dnd_evs!=null){g.win.removeEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);if(window.navigator.msPointerEnabled!=true){g.win.removeEventListener(this.conf.dnd_evs.start,this._winOnMouseDown,false);g.win.removeEventListener(this.conf.dnd_evs.end,this._winOnMouseDown,false)}}}else{g.win.detachEvent("onmousedown",this._winOnMouseDown);g.win.detachEvent("onmouseup",this._winOnMouseDown);if(this.conf.dblclick_ev){g.win.attachEvent("ondblclick",this._winOnMouseDown)}}for(var c in g.b){this._winRemoveButton(j,c,true)}g.b=null;g.cell._unload();g.cell=null;g.brd.parentNode.removeChild(g.brd);g.brd=null;if(g.fr_cover!=null){g.fr_cover.parentNode.removeChild(g.fr_cover);g.fr_cover=null}if(g.fr_m_cover!=null){g.fr_m_cover.parentNode.removeChild(g.fr_m_cover);g.fr_m_cover=null}g.hdr._isWinHdr=true;g.hdr.firstChild._isWinIcon=true;g.hdr.onselectstart=null;g.hdr.parentNode.removeChild(g.hdr);g.hdr=null;for(var c in g.conf){g.conf[c]=null;delete g.conf[c]}g.conf=null;g.win._idd=null;g.win._isWindow=null;g.win.parentNode.removeChild(g.win);g.win=null;g=null;this.w[j]=null;delete this.w[j];if(!this.conf.unloading){this._winMakeActive(null,true)}};dhtmlXWindows.prototype._winSetModal=function(n,j,m){if(this.w[n].conf.modal==j){return}if(typeof(m)=="undefined"){m=true}var g=this.w[n];if(j==true&&g.conf.modal==false){if(this.conf.last_modal!=null){this._winSetModal(this.conf.last_modal,false,false)}if(this.mcover==null){var l=document.createElement("DIV");l.className="dhxwins_mcover";this.vp.insertBefore(l,g.fr_m_cover||g.win);this.mcover={d:l};if(this.conf.fr_cover){this.mcover.f=document.createElement("IFRAME");this.mcover.f.className="dhxwins_mcover";this.mcover.f.border=0;this.mcover.f.frameBorder=0;this.vp.insertBefore(this.mcover.f,l)}l=null}else{if(this.mcover.d.nextSibling!=(g.fr_m_cover||g.win)){this.vp.insertBefore(this.mcover.d,g.fr_m_cover||g.win);if(this.mcover.f!=null){this.vp.insertBefore(this.mcover.f,this.mcover.d)}}}g.conf.modal=true;this.conf.last_modal=n;this._winMakeActive(n,true)}else{if(j==false&&g.conf.modal==true){g.conf.modal=false;this.conf.last_modal=null;if(m&&this.mcover!=null){for(var c in this.mcover){this.vp.removeChild(this.mcover[c]);this.mcover[c]=null}this.mcover=null}}}g=null};dhtmlXWindows.prototype._winMouseDownHandler=function(g,c){var a=g.target||g.srcElement;if(g.button>=2){return}if(c.mode=="button"){if(c.press_type=="mousedown"){this.conf.button_last=c.button_name}else{if((c.press_type=="mouseup"&&c.button_name==this.conf.button_last)||c.press_type=="MSPointerDown"){this.conf.button_last=null;if(this._winButtonClick(c.id,c.button_name,g)!==true){return}}}}if((c.press_type=="mousedown"||c.press_type=="dblclick")&&c.mode=="hdr"){this.conf.dblclick_active=false;if(this.conf.dblclick_ev==true){if(c.press_type=="dblclick"){this.conf.dblclick_active=true}}else{if(this.conf.dblclick_last==null){this.conf.dblclick_last=new Date().getTime();this.dblclick_id=c.id}else{var a=new Date().getTime();if(this.conf.dblclick_last+this.conf.dblclick_tm>a&&this.dblclick_id==c.id){this.conf.dblclick_active=true;this.conf.dblclick_last=null;this.dblclick_id=null}else{this.conf.dblclick_last=a;this.dblclick_id=c.id}}}if(this.conf.dblclick_active){this._winDoHeaderDblClick(c.id);return}}if(c.press_type=="mousedown"||(this.conf.dnd_evs!=null&&c.press_type==this.conf.dnd_evs.start)){this._winMakeActive(c.id)}if(c.press_type=="touchend"){}};dhtmlXWindows.prototype._winDoHeaderDblClick=function(a){if(this.conf.dblclick_mode=="minmax"){this._winMinmax(a);return}if(this.conf.dblclick_mode=="park"){this._winPark(a,true);return}if(typeof(this.conf.dblclick_mode)=="function"){this.conf.dblclick_mode.apply(window,[a]);return}if(typeof(window[this.conf.dblclick_mode])=="function"){window[this.conf.dblclick_mode].apply(window,[a]);return}};dhtmlXWindows.prototype._winAdjustCell=function(c){var r=this.w[c];var q=1;var o=(r.conf.header?r.hdr.offsetHeight:1);var j=r.win.clientWidth-2;var s=r.win.clientHeight-o-1;r.brd.style.left=q+"px";r.brd.style.top=o+"px";if(r.conf.brd==null){r.brd.style.width=j+"px";r.brd.style.height=s+"px";r.conf.brd={w:j-r.brd.offsetWidth,h:s-r.brd.offsetHeight}}r.brd.style.width=j+r.conf.brd.w+"px";r.brd.style.height=s+r.conf.brd.h+"px";var g=5;var a=1+g;var n=(r.conf.header?o:o+g);var l=r.brd.clientWidth;var m=r.brd.clientHeight;r.cell._setSize(a,n,l,m);r.fr_cover.style.left=a+"px";r.fr_cover.style.top=n+"px";r.fr_cover.style.width=l+"px";r.fr_cover.style.height=m+"px";r=null};dhtmlXWindows.prototype._winAdjustTitle=function(j){var a=this.w[j].hdr.childNodes[0];var g=this.w[j].hdr.childNodes[1];var c=this.w[j].hdr.childNodes[2];g.style.paddingLeft=a.offsetWidth+12+"px";g.style.paddingRight=c.offsetWidth+10+"px";g=c=a=null};dhtmlXWindows.prototype._callMainEvent=function(c,j){var a=this.w[j];if(a.cell.checkEvent(c)){var g=a.cell._callMainEvent(c,[a.cell])}else{var g=this.callEvent(c,[a.cell])}a=null;return g};dhtmlXWindows.prototype._winInitFRM=function(g){if(this.conf.fr_cover!=true){return}var a=this.w[g];var c=document.createElement("IFRAME");c.className="dhxwin_main_fr_cover";c.border=0;c.frameBorder=0;c.style.zIndex=a.win.style.zIndex;a.win.parentNode.insertBefore(c,a.win);a.fr_m_cover=c;c=null};dhtmlXWindows.prototype._winAdjustFRMSize=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.width=a.conf.w+"px";a.fr_m_cover.style.height=a.conf.h+"px"}a=null};dhtmlXWindows.prototype._winAdjustFRMPosition=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.left=a.win.style.left;a.fr_m_cover.style.top=a.win.style.top}a=null};dhtmlXWindows.prototype._winAdjustFRMZIndex=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.zIndex=a.win.style.zIndex}a=null};function dhtmlXWindowsCell(l,j){dhtmlXCellObject.apply(this,[l,"_wins"]);this.wins=j;this.cell._winId=l;this.conf.skin=this.wins.conf.skin;this.attachEvent("_onCellUnload",function(){if(this._unloadResize){this._unloadResize()}window.dhx4._eventable(this.cell,"clear");this.cell._winId=null;this.wins=null;this.setText=null;this.getText=null;this.allowMove=null;this.denyMove=null;this.isMovable=null;this.allowResize=null;this.denyResize=null;this.isResizable=null;this.maximize=null;this.minimize=null;this.isMaximized=null;this.setPosition=null;this.getPosition=null;this.adjustPosition=null;this.park=null;this.isParked=null;this.allowPark=null;this.denyPark=null;this.isParkable=null;this.show=null;this.hide=null;this.isHidden=null;this.stick=null;this.unstick=null;this.isSticked=null;this.setDimension=null;this.getDimension=null;this.setMinDimension=null;this.getMinDimension=null;this.setMaxDimension=null;this.getMaxDimension=null;this.keepInViewport=null;this.center=null;this.centerOnScreen=null;this.bringToTop=null;this.bringToBottom=null;this.isOnTop=null;this.isOnBottom=null;this.showHeader=null;this.hideHeader=null;this.setModal=null;this.isModal=null;this.close=null;this._adjustByCont=null;this.button=null;this.addUserButton=null;this.removeUserButton=null;g=null});this.attachEvent("_onContentLoaded",function(){this.wins._callMainEvent("onContentLoaded",this._idd)});this.attachEvent("_onContentMouseDown",function(m,a){this.wins.callEvent("_winMouseDown",[a,{id:m,mode:"win"}])});this._callMainEvent=function(m,a){return this.callEvent(m,a)};this.conf.tr={};for(var c in this.wins.conf.tr){this.conf.tr[c]=this.wins.conf.tr[c]}if(this.conf.tr.prop!=false){}if(this._initResize){this._initResize()}window.dhx4._eventable(this.cell);var g=this;this.cell.attachEvent("_setCellSize",function(a,o){var m=g.wins.w[this._winId].conf.w-g.conf.size.w;var n=g.wins.w[this._winId].conf.h-g.conf.size.h;g.setDimension(a+m,o+n)});return this}dhtmlXWindowsCell.prototype=new dhtmlXCellObject();dhtmlXWindowsCell.prototype.setText=function(a){this.wins.w[this._idd].conf.text=a;this.wins.w[this._idd].hdr.childNodes[1].firstChild.innerHTML=a};dhtmlXWindowsCell.prototype.getText=function(){return this.wins.w[this._idd].conf.text};dhtmlXWindowsCell.prototype.allowMove=function(){this.wins.w[this._idd].conf.allow_move=true};dhtmlXWindowsCell.prototype.denyMove=function(){this.wins.w[this._idd].conf.allow_move=false};dhtmlXWindowsCell.prototype.isMovable=function(){return(this.wins.w[this._idd].conf.allow_move==true)};dhtmlXWindowsCell.prototype.allowResize=function(){this.wins.w[this._idd].conf.allow_resize=true;this.wins.w[this._idd].b.minmax.enable()};dhtmlXWindowsCell.prototype.denyResize=function(){this.wins.w[this._idd].conf.allow_resize=false;this.wins.w[this._idd].b.minmax.disable()};dhtmlXWindowsCell.prototype.isResizable=function(){return(this.wins.w[this._idd].conf.allow_resize==true)};dhtmlXWindowsCell.prototype.maximize=function(){this.wins._winMinmax(this._idd,true)};dhtmlXWindowsCell.prototype.minimize=function(){this.wins._winMinmax(this._idd,false)};dhtmlXWindowsCell.prototype.isMaximized=function(){return(this.wins.w[this._idd].conf.maxed==true)};dhtmlXWindowsCell.prototype.setPosition=function(a,c){this.wins._winSetPosition(this._idd,a,c)};dhtmlXWindowsCell.prototype.getPosition=function(){var a=this.wins.w[this._idd];var c=[a.conf.x,a.conf.y];a=null;return c};dhtmlXWindowsCell.prototype.adjustPosition=function(){this.wins._winAdjustPosition(this._idd)};dhtmlXWindowsCell.prototype.park=function(){this.wins._winPark(this._idd,true)};dhtmlXWindowsCell.prototype.isParked=function(){return(this.wins.w[this._idd].conf.parked==true)};dhtmlXWindowsCell.prototype.allowPark=function(){this.wins.w[this._idd].conf.allow_park=true;this.wins.w[this._idd].b.park.enable()};dhtmlXWindowsCell.prototype.denyPark=function(){this.wins.w[this._idd].conf.allow_park=false;this.wins.w[this._idd].b.park.disable()};dhtmlXWindowsCell.prototype.isParkable=function(){return(this.wins.w[this._idd].conf.allow_park==true)};dhtmlXWindowsCell.prototype.show=function(a){this.wins._winShow(this._idd,window.dhx4.s2b(a))};dhtmlXWindowsCell.prototype.hide=function(){this.wins._winHide(this._idd)};dhtmlXWindowsCell.prototype.isHidden=function(){return(this.wins.w[this._idd].conf.visible!=true)};dhtmlXWindowsCell.prototype.stick=function(){this.wins._winStick(this._idd,true)};dhtmlXWindowsCell.prototype.unstick=function(){this.wins._winStick(this._idd,false)};dhtmlXWindowsCell.prototype.isSticked=function(){return(this.wins.w[this._idd].conf.sticked==true)};dhtmlXWindowsCell.prototype.setDimension=function(g,a){var c=this.wins.w[this._idd];if(c.conf.parked){this.wins._winPark(this._idd,false)}if(c.conf.maxed){if(g!=null){c.conf.lastMW=g}if(a!=null){c.conf.lastMH=a}this.wins._winMinmax(this._idd)}else{this.wins._winSetSize(this._idd,g,a,false,true)}c=null};dhtmlXWindowsCell.prototype.getDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.w,a.conf.h];a=null;return c};dhtmlXWindowsCell.prototype.setMinDimension=function(g,a){var c=this.wins.w[this._idd];c.conf.min_w=g;c.conf.min_h=a;this.wins._winSetSize(this._idd,c.conf.w,c.conf.h);c=null};dhtmlXWindowsCell.prototype.getMinDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.min_w,a.conf.min_h];a=null;return c};dhtmlXWindowsCell.prototype.setMaxDimension=function(g,a){var c=this.wins.w[this._idd];c.conf.max_w=g;c.conf.max_h=a;this.wins._winSetSize(this._idd,c.conf.w,c.conf.h);c=null};dhtmlXWindowsCell.prototype.getMaxDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.max_w,a.conf.max_h];a=null;return c};dhtmlXWindowsCell.prototype.keepInViewport=function(a){this.wins.w[this._idd].conf.keep_in_vp=window.dhx4.s2b(a)};dhtmlXWindowsCell.prototype.center=function(){var g=this.wins.vp;var c=this.wins.w[this._idd];var a=Math.round((g.clientWidth-c.conf.w)/2);var j=Math.round((g.clientHeight-c.conf.h)/2);this.wins._winSetPosition(this._idd,a,j);g=c=null};dhtmlXWindowsCell.prototype.centerOnScreen=function(){var c=this.wins.w[this._idd];var m=window.dhx4.screenDim();var l=window.dhx4.absLeft(this.wins.vp);var j=window.dhx4.absTop(this.wins.vp);var g=this.wins.vp.parentNode;while(g!=null){if(g.scrollLeft){l=l-g.scrollLeft}if(g.scrollTop){j=j-g.scrollTop}g=g.parentNode}var a=Math.round((m.right-m.left-c.conf.w)/2);var n=Math.round((m.bottom-m.top-c.conf.h)/2);this.wins._winAdjustPosition(this._idd,a-l,n-j);d=c=null};dhtmlXWindowsCell.prototype.bringToTop=function(){this.wins._winMakeActive(this._idd,true)};dhtmlXWindowsCell.prototype.bringToBottom=function(){var a=(this.wins.w[this._idd].conf.actv?null:this.wins.conf.last_active);window.dhx4.zim.clear(this.wins.w[this._idd].conf.z_id);this.wins.w[this._idd].win.style.zIndex=0;this.wins._winMakeActive(a,true)};dhtmlXWindowsCell.prototype.isOnTop=function(){return(this.wins.w[this._idd].conf.actv==true)};dhtmlXWindowsCell.prototype.isOnBottom=function(){var g={id:null,z:+Infinity};for(var c in this.wins.w){if(this.wins.w[c].conf.visible&&this.wins.w[c].win.style.zIndex<g.z){g.id=c;g.z=this.wins.w[c].win.style.zIndex}}return(g.id==this._idd)};dhtmlXWindowsCell.prototype.showHeader=function(){var a=this.wins.w[this._idd];if(a.conf.header==false){a.hdr.className=String(a.hdr.className).replace(/\s{0,}dhxwin_hdr_hidden/gi,"");a.brd.className=String(a.brd.className).replace(/\s{0,}dhxwin_hdr_hidden/gi,"");this.conf.cells_cont=null;a.conf.brd=null;a.conf.header=true;this.wins._winAdjustCell(this._idd)}a=null};dhtmlXWindowsCell.prototype.hideHeader=function(){var a=this.wins.w[this._idd];if(a.conf.header==true){if(a.conf.parked){this.wins._winPark(this._idd,false)}a.hdr.className+=" dhxwin_hdr_hidden";a.brd.className+=" dhxwin_hdr_hidden";this.conf.cells_cont=null;a.conf.brd=null;a.conf.header=false;this.wins._winAdjustCell(this._idd)}a=null};dhtmlXWindowsCell.prototype.setModal=function(a){this.wins._winSetModal(this._idd,window.dhx4.s2b(a))};dhtmlXWindowsCell.prototype.isModal=function(){return(this.wins.w[this._idd].conf.modal==true)};dhtmlXWindowsCell.prototype._adjustByCont=function(a,c){a+=this.wins.w[this._idd].conf.w-this.conf.size.w;c+=this.wins.w[this._idd].conf.h-this.conf.size.h;this.wins._winSetSize(this._idd,a,c)};dhtmlXWindowsCell.prototype.close=function(){this.wins._winClose(this._idd)};dhtmlXWindowsCell.prototype.setIconCss=function(a){this.wins.w[this._idd].hdr.firstChild.className="dhxwin_icon "+a;this.wins._winAdjustTitle(this._idd)};dhtmlXWindowsCell.prototype.setToFullScreen=function(c){c=window.dhx4.s2b(c);var a=this.wins.w[this._idd];if(a.conf.fs_mode==c){a=null;return}if(this.wins.fsn==null){this.wins.fsn=document.createElement("DIV");this.wins.fsn.className=this.wins.vp.className+" dhxwins_vp_fs";document.body.appendChild(this.wins.fsn)}if(c){this.wins.fsn.appendChild(a.win);this.maximize();this.hideHeader()}else{this.wins.vp.appendChild(a.win);this.minimize();this.showHeader();if(this.wins.fsn.childNodes.length==0){this.wins.fsn.parentNode.removeChild(this.wins.fsn);this.wins.fsn=null}}a.conf.fs_mode=c;a=null};dhtmlXWindowsCell.prototype.button=function(a){if(a=="minmax1"||a=="minmax2"){a="minmax"}return this.wins.w[this._idd].b[a]};dhtmlXWindowsCell.prototype.addUserButton=function(m,l,g){var a=new dhtmlXWindowsButton(this.wins,this._idd,m,g,true);var j=null;var c=this.wins.w[this._idd].hdr.lastChild;if(isNaN(l)){l=0}else{if(l<0){l=0}}if(c.childNodes[l]!=null){j=c.childNodes[l]}if(j!=null){c.insertBefore(a.button,j)}else{c.appendChild(a.button)}this.wins.w[this._idd].b[m]=a;a=j=c=null;this.wins._winAdjustTitle(this._idd)};dhtmlXWindowsCell.prototype.removeUserButton=function(a){if(this.wins.w[this._idd].b[a]==null||this.wins.w[this._idd].b[a].conf.custom!=true){return}this.wins._winRemoveButton(this._idd,a)};window.dhtmlXWindowsButton=function(l,c,a,j,g){this.conf={wins:l,winId:c,name:a,enabled:true,visible:true,custom:true};this.button=document.createElement("DIV");this.button._buttonName=a;this.button.title=j;this.enable=function(){this.conf.enabled=true;this.setCss(this.conf.css)};this.disable=function(){this.conf.enabled=false;this.setCss(this.conf.css)};this.isEnabled=function(){return(this.conf.enabled==true)};this.show=function(){this.button.style.display="";this.conf.visible=true;this.conf.wins._winAdjustTitle(this.conf.winId)};this.hide=function(){this.button.style.display="none";this.conf.visible=false;this.conf.wins._winAdjustTitle(this.conf.winId)};this.isHidden=function(){return(this.conf.visible==false)};this.setCss=function(n){this.conf.css=n;var m=(this.conf.enabled?"":"_dis");this.button.className="dhxwin_button"+m+" dhxwin_button_"+this.conf.css+m};this._doOnClick=function(m){return this.callEvent("onClick",[this.conf.wins.w[this.conf.winId].cell,this])};this.unload=function(m){dhx4._eventable(this,"clear");this.button._buttonName=null;this.button.parentNode.removeChild(this.button);if(this.conf.wins.cm!=null&&this.conf.wins.cm.button[this.conf.winId]!=null&&this.conf.wins.cm.button[this.conf.winId][this.conf.name]!=null){this.conf.wins._detachContextMenu("button",this.conf.winId,this.conf.name)}this.button=null;this.enable=null;this.disable=null;this.isEnabled=null;this.show=null;this.hide=null;this.isHidden=null;this.setCss=null;this.unload=null;if(m!=true){this.conf.wins._winAdjustTitle(this.conf.winId)}this.conf.wins=null;this.conf.winId=null;this.conf=null};this.setCss(a);dhx4._eventable(this);return this};dhtmlXWindows.prototype._winButtonClick=function(g,a,c){if(!this.w[g].b[a].isEnabled()){return true}if(this.w[g].b[a]._doOnClick()!==true){return}if(a=="help"){this._callMainEvent("onHelp",g)}if(a=="park"){this._winPark(g,true)}if(a=="minmax"){this._winMinmax(g)}if(a=="stick"){this._winStick(g);return false}if(a=="close"){this._winClose(g);return false}return true};dhtmlXWindows.prototype._winRemoveButton=function(g,a,c){this.w[g].b[a].unload(c);this.w[g].b[a]=null;delete this.w[g].b[a]};dhtmlXWindows.prototype._dndInitModule=function(){var a=this;this.conf.dnd_tm=null;this.conf.dnd_time=0;if(window.navigator.msPointerEnabled==true){this.conf.dnd_evs={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}}else{this.conf.dnd_evs={start:"touchstart",move:"touchmove",end:"touchend"}}this._dndOnMouseDown=function(j,l){if(a.conf.dblclick_active){return}if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}if(a._callMainEvent("onBeforeMoveStart",l)!==true){return}a.conf.dnd={id:l,x:a._dndPos(j,"X"),y:a._dndPos(j,"Y"),ready:true,css:false,css_touch:false,css_vp:false,tr:null,mode:"def",moved:false,prevent:false};if(a.w[l].conf.keep_in_vp){a.conf.dnd.minX=0;a.conf.dnd.maxX=a.vp.clientWidth-a.w[l].conf.w;a.conf.dnd.minY=0;a.conf.dnd.maxY=a.vp.clientHeight-a.w[l].conf.h}else{a.conf.dnd.minX=-a.w[l].conf.w+a.conf.vp_pos_ofs;a.conf.dnd.maxX=a.vp.clientWidth-a.conf.vp_pos_ofs;a.conf.dnd.minY=0;a.conf.dnd.maxY=a.vp.clientHeight-a.conf.vp_pos_ofs}var c=["MozTransform","WebkitTransform","OTransform","msTransform","transform"];for(var g=0;g<c.length;g++){if(document.documentElement.style[c[g]]!=null&&a.conf.dnd.tr==null){a.conf.dnd.tr=c[g];a.conf.dnd.mode="tr"}}if(a.conf.dnd.mode=="tr"){a.w[l].win.style[a.conf.dnd.tr]="translate(0px,0px)"}if(j.type==a.conf.dnd_evs.start){if(a.conf.dnd.css_touch==false){a.w[l].win.className+=" dhxwin_dnd_touch";a.conf.dnd.css_touch=true}if(a.conf.dnd.css_vp==false){a.vp.className+=" dhxwins_vp_dnd";a.conf.dnd.css_vp=true}}else{a._dndInitEvents()}};this._dndOnMouseMove=function(l){l=l||event;var j=a.conf.dnd;var c=a._dndPos(l,"X")-j.x;var m=a._dndPos(l,"Y")-j.y;if(l.type==a.conf.dnd_evs.move){if(j.moved!=true&&(Math.abs(c)>20||Math.abs(m)>20)){if(a.conf.dnd_tm!=null){window.clearTimeout(a.conf.dnd_tm);a.conf.dnd_tm=null}window.removeEventListener(a.conf.dnd_evs.start,a._dndOnMouseMove,false);return}}if(j.ready!=true){return}var g=a.w[j.id];if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}if(j.css!=true){if(j.css_touch==false){g.win.className+=" dhxwin_dnd"}g.fr_cover.className+=" dhxwin_fr_cover_dnd";j.css=true}if(j.css_vp!=true){a.vp.className+=" dhxwins_vp_dnd";j.css_vp=true}j.newX=g.conf.x+c;j.newY=g.conf.y+m;if(j.mode=="tr"){j.newX=Math.min(Math.max(j.newX,j.minX),j.maxX);c=j.newX-g.conf.x;j.newY=Math.min(Math.max(j.newY,j.minY),j.maxY);m=j.newY-g.conf.y;g.win.style[j.tr]="translate("+c+"px,"+m+"px)"}else{if(j.newX<j.minX||j.newX>j.maxX){j.newX=Math.min(Math.max(j.newX,j.minX),j.maxX)}else{j.x=a._dndPos(l,"X")}if(j.newY<j.minY||j.newY>j.maxY){j.newY=Math.min(Math.max(j.newY,j.minY),j.maxY)}else{j.y=a._dndPos(l,"Y")}a._winSetPosition(j.id,j.newX,j.newY)}j.moved=true;g=j=null};this._dndOnMouseUp=function(j){j=j||event;if(a.conf.dnd!=null){var g=a.conf.dnd;var c=a.w[g.id];if(g.newX!=null){if(g.mode=="tr"){a._winSetPosition(g.id,g.newX,g.newY);c.win.style[g.tr]="translate(0px,0px)"}}if(g.css==true){if(g.css_touch==false){c.win.className=String(c.win.className).replace(/\s{0,}dhxwin_dnd/gi,"")}c.fr_cover.className=String(c.fr_cover.className).replace(/\s{0,}dhxwin_fr_cover_dnd/gi,"")}if(g.css_touch==true){c.win.className=String(c.win.className).replace(/\s{0,}dhxwin_dnd_touch/gi,"")}if(g.css_vp==true){a.vp.className=String(a.vp.className).replace(/\s{0,}dhxwins_vp_dnd/gi,"")}a._dndUnloadEvents();if(g.moved==true){a._callMainEvent("onMoveFinish",g.id)}else{a._callMainEvent("onMoveCancel",g.id)}c=g=a.conf.dnd=null}if(window.dhx4.isIE==true&&j.type==a.conf.dnd_evs.end&&window.navigator.msPointerEnabled==true){document.body.style.msTouchAction="";window.removeEventListener(a.conf.dnd_evs.end,a._dndOnMouseUp,false);window.removeEventListener(a.conf.dnd_evs.move,a._dndOnMouseMove,false);if(a.conf.dnd_tm!=null){window.clearTimeout(a.conf.dnd_tm)}a.conf.dnd_tm=null}};this._dndOnSelectStart=function(c){c=c||event;if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}return false};this._dndInitEvents=function(){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._dndOnMouseMove,false);window.addEventListener("mouseup",this._dndOnMouseUp,false);window.addEventListener("selectstart",this._dndOnSelectStart,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove);document.body.attachEvent("onmouseup",this._dndOnMouseUp);document.body.attachEvent("onselectstart",this._dndOnSelectStart)}};this._dndUnloadEvents=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._dndOnMouseMove,false);window.removeEventListener("mouseup",this._dndOnMouseUp,false);window.removeEventListener("selectstart",this._dndOnSelectStart,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove);document.body.detachEvent("onmouseup",this._dndOnMouseUp);document.body.detachEvent("onselectstart",this._dndOnSelectStart)}};this._dndUnloadModule=function(){this.detachEvent(this.conf.dnd_evid);this.conf.dnd_evid=null;this._dndOnMouseDown=null;this._dndOnMouseMove=null;this._dndOnMouseUp=null;this._dndOnSelectStart=null;this._dndInitEvents=null;this._dndUnloadEvents=null;this._dndInitModule=null;this._dndUnloadModule=null;a=null};this._dndPos=function(g,c){var j=g[this.conf.dnd_ev_prefix+c];if(j==null){j=e.touches[0][this.conf.dnd_ev_prefix+c]}return j};this.conf.dnd_evid=this.attachEvent("_winMouseDown",function(g,c){if(g.type==this.conf.dnd_evs.start){if(c.mode=="hdr"){if(this.w[c.id].conf.maxed&&this.w[c.id].conf.max_w==null&&this.w[c.id].conf.max_h==null){return}this.conf.dnd_ev_prefix="page";this.conf.dnd={x:this._dndPos(g,"X"),y:this._dndPos(g,"Y")};if(this.conf.dnd_time<1){this._dndOnMouseDown(g,c.id)}else{if(this.conf.dnd_tm!=null){window.clearTimeout(this.conf.dnd_tm)}this.conf.dnd_tm=window.setTimeout(function(){a._dndOnMouseDown(g,c.id)},this.conf.dnd_time)}if(window.dhx4.isIE==true&&window.navigator.msPointerEnabled==true){document.body.style.msTouchAction="none";window.addEventListener(this.conf.dnd_evs.end,this._dndOnMouseUp,false)}window.addEventListener(this.conf.dnd_evs.move,this._dndOnMouseMove,false)}return false}if(g.type==this.conf.dnd_evs.end){if(this.conf.dnd_tm!=null){window.clearTimeout(this.conf.dnd_tm);this.conf.dnd_tm=null}this._dndOnMouseUp();window.removeEventListener(this.conf.dnd_evs.move,this._dndOnMouseMove,false);return false}if(g.button>=2){return}this.conf.dnd_ev_prefix="client";if(!(c.mode=="hdr"&&g.type=="mousedown"&&this.w[c.id].conf.allow_move==true)){return}if(this.w[c.id].conf.maxed&&this.w[c.id].conf.max_w==null&&this.w[c.id].conf.max_h==null){return}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}this._dndOnMouseDown(g,c.id);return false})};dhtmlXWindowsCell.prototype._initResize=function(){var a=this;var c=navigator.userAgent;this.conf.resize={b_width:6,c_type:(c.indexOf("MSIE 10.0")>0||c.indexOf("MSIE 9.0")>0||c.indexOf("MSIE 8.0")>0||c.indexOf("MSIE 7.0")>0||c.indexOf("MSIE 6.0")>0)};this._rOnCellMouseMove=function(n){if(a.wins.conf.resize_actv==true||a.wins.w[a._idd].conf.allow_resize==false||a.conf.progress==true||a.wins.w[a._idd].conf.maxed==true||a.wins.w[a._idd].conf.fs_mode==true){var l=a.wins.w[a._idd].brd;if(l.style.cursor!="default"){l.style.cursor="default"}l=null;return}n=n||event;var v=a.wins.w[a._idd].brd;var g=a.conf.resize;var q=(a.wins.w[a._idd].conf.header==false);var s=n.clientX;var o=n.clientY;var j=window.dhx4.absLeft(v);var u=window.dhx4.absTop(v);var m="";if(s<=j+g.b_width){m="w"}else{if(s>=j+v.offsetWidth-g.b_width){m="e"}}if(o>=u+v.offsetHeight-g.b_width){m="s"+m}else{if(q&&o<=u+g.b_width){m="n"+m}}if(m==""){m=false}if(g.mode!=m){g.mode=m;if(m==false){v.style.cursor="default"}else{v.style.cursor=m+"-resize"}}v=g=null};this._rOnCellMouseDown=function(m){if(a.conf.resize.mode==false){return}if(a.conf.progress==true){return}if(a.wins.w[a._idd].conf.allow_resize==false){return}if(a.wins.w[a._idd].conf.fs_mode==true){return}if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}if(a.wins._callMainEvent("onBeforeResizeStart",a._idd)!==true){return}var g=a.wins.w[a._idd];var l=a.conf.resize;a.wins.conf.resize_actv=true;l.min_w=g.conf.min_w;l.min_h=g.conf.min_h;l.max_w=g.conf.max_w||+Infinity;l.max_h=g.conf.max_h||+Infinity;if(g.cell.dataType=="layout"&&g.cell.dataObj!=null&&typeof(g.cell.dataObj._getWindowMinDimension)=="function"){var j=g.cell.dataObj._getWindowMinDimension(g.cell);l.min_w=Math.max(j.w,l.min_w);l.min_h=Math.max(j.h,l.min_h)}l.vp_l=a.wins.conf.vp_pos_ofs;l.vp_r=a.wins.vp.clientWidth-a.wins.conf.vp_pos_ofs;l.vp_b=a.wins.vp.clientHeight-a.wins.conf.vp_pos_ofs;l.x=m.clientX;l.y=m.clientY;if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._rOnWinMouseMove,false);window.addEventListener("mouseup",a._rOnWinMouseUp,false);window.addEventListener("selectstart",a._rOnSelectStart,false)}else{document.body.attachEvent("onmousemove",a._rOnWinMouseMove);document.body.attachEvent("onmouseup",a._rOnWinMouseUp);document.body.attachEvent("onselectstart",a._rOnSelectStart)}l.resized=false;l.vp_cursor=a.wins.vp.style.cursor;a.wins.vp.style.cursor=l.mode+"-resize";g=l=null};this._rOnWinMouseMove=function(m){m=m||event;var j=a.wins.w[a._idd];var l=a.conf.resize;if(!l.resized){j.fr_cover.className+=" dhxwin_fr_cover_resize";l.resized=true}var g=m.clientX-l.x;var n=m.clientY-l.y;if(l.mode.indexOf("e")>=0){l.rw=Math.min(Math.max(j.conf.w+g,l.min_w),l.max_w);l.rx=null;if(j.conf.x+l.rw<l.vp_l){l.rw=l.vp_l-j.conf.x}else{if(j.conf.x+l.rw>a.wins.vp.clientWidth){l.rw=a.wins.vp.clientWidth-j.conf.x}}}else{if(l.mode.indexOf("w")>=0){l.rw=Math.min(Math.max(j.conf.w-g,l.min_w),l.max_w);l.rx=j.conf.x+j.conf.w-l.rw;if(l.rx<0){l.rw=l.rw+l.rx;l.rx=0}else{if(l.rx>l.vp_r){l.rw=l.rw-l.vp_r;l.rx=l.vp_r}}}}if(l.mode.indexOf("s")>=0){l.rh=Math.min(Math.max(j.conf.h+n,l.min_h),l.max_h);l.ry=null;if(j.conf.y+l.rh>a.wins.vp.clientHeight){l.rh=a.wins.vp.clientHeight-j.conf.y}}else{if(l.mode.indexOf("n")>=0){l.rh=Math.min(Math.max(j.conf.h-n,l.min_h),l.max_h);l.ry=j.conf.y+j.conf.h-l.rh;if(l.ry<0){l.rh=l.rh+l.ry;l.ry=0}else{if(l.ry>l.vp_b){l.rh=l.rh-l.vp_b;l.ry=l.vp_b}}}}a._rAdjustSizer();j=l=null};this._rOnWinMouseUp=function(){var j=a.conf.resize;var g=a.wins.w[a._idd];a.wins.conf.resize_actv=false;a.wins.vp.style.cursor=j.vp_cursor;g.fr_cover.className=String(g.fr_cover.className).replace(/\s{0,}dhxwin_fr_cover_resize/gi,"");if(j.resized){a.wins._winSetSize(a._idd,j.rw,j.rh);if(j.rx==null){j.rx=g.conf.x}if(j.ry==null){j.ry=g.conf.y}if(j.rx!=g.conf.x||j.ry!=g.conf.y){a.wins._winSetPosition(a._idd,j.rx,j.ry)}}if(j.obj!=null){j.obj.parentNode.removeChild(j.obj);j.obj=null}if(j.objFR!=null){j.objFR.parentNode.removeChild(j.objFR);j.objFR=null}if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._rOnWinMouseMove,false);window.removeEventListener("mouseup",a._rOnWinMouseUp,false);window.removeEventListener("selectstart",a._rOnSelectStart,false)}else{document.body.detachEvent("onmousemove",a._rOnWinMouseMove);document.body.detachEvent("onmouseup",a._rOnWinMouseUp);document.body.detachEvent("onselectstart",a._rOnSelectStart)}if(j.resized==true){if(a.dataType=="layout"&&a.dataObj!=null){a.dataObj.callEvent("onResize",[])}a.wins._callMainEvent("onResizeFinish",a._idd)}else{a.wins._callMainEvent("onResizeCancel",a._idd)}j.mode="";g=j=null};this._rOnSelectStart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false};this._rInitSizer=function(){var j=a.conf.resize;var g=a.wins.w[a._idd];j.obj=document.createElement("DIV");j.obj.className="dhxwin_resize";j.obj.style.zIndex=g.win.style.zIndex;j.obj.style.cursor=j.mode+"-resize";a.wins.vp.appendChild(j.obj);if(a.wins.conf.fr_cover==true){j.objFR=document.createElement("IFRAME");j.objFR.className="dhxwin_resize_fr_cover";j.objFR.style.zIndex=j.obj.style.zIndex;a.wins.vp.insertBefore(j.objFR,j.obj)}j.rx=g.conf.x;j.ry=g.conf.y;j.rw=g.conf.w;j.rh=g.conf.h;j=null};this._rAdjustSizer=function(){var g=a.conf.resize;if(!g.obj){this._rInitSizer()}g.obj.style.width=g.rw+"px";g.obj.style.height=g.rh+"px";if(g.rx!=null){g.obj.style.left=g.rx+"px"}if(g.ry!=null){g.obj.style.top=g.ry+"px"}if(g.objFR!=null){g.objFR.style.width=g.obj.style.width;g.objFR.style.height=g.obj.style.height;if(g.rx!=null){g.objFR.style.left=g.obj.style.left}if(g.ry!=null){g.objFR.style.top=g.obj.style.top}}g=null};if(typeof(window.addEventListener)=="function"){this.wins.w[this._idd].brd.addEventListener("mousemove",this._rOnCellMouseMove,false);this.wins.w[this._idd].brd.addEventListener("mousedown",this._rOnCellMouseDown,false)}else{this.wins.w[this._idd].brd.attachEvent("onmousemove",this._rOnCellMouseMove);this.wins.w[this._idd].brd.attachEvent("onmousedown",this._rOnCellMouseDown)}this._unloadResize=function(){if(typeof(window.addEventListener)=="function"){this.wins.w[this._idd].brd.removeEventListener("mousemove",this._rOnCellMouseMove,false);this.wins.w[this._idd].brd.removeEventListener("mousedown",this._rOnCellMouseDown,false)}else{this.wins.w[this._idd].brd.detachEvent("onmousemove",this._rOnCellMouseMove);this.wins.w[this._idd].brd.detachEvent("onmousedown",this._rOnCellMouseDown)}this._initResize=null;this._rOnCellMouseMove=null;this._rOnCellMouseDown=null;this._rOnWinMouseMove=null;this._rOnWinMouseUp=null;this._rOnSelectStart=null;this._rInitSizer=null;this._rAdjustSizer=null;this._unloadResize=null;this.conf.resize=null;a=null}};dhtmlXWindows.prototype.attachContextMenu=function(a){return this._renderContextMenu("icon",null,null,a)};dhtmlXWindows.prototype.getContextMenu=function(){if(this.cm!=null&&this.cm.global!=null){return this.cm.global}return null};dhtmlXWindows.prototype.detachContextMenu=function(){this._detachContextMenu("icon",null,null)};dhtmlXWindowsCell.prototype.attachContextMenu=function(a){return this.wins._renderContextMenu("icon",this._idd,null,a)};dhtmlXWindowsCell.prototype.getContextMenu=function(){if(this.wins.cm!=null&&this.wins.cm.icon[this._idd]!=null){return this.wins.cm.icon[this._idd]}return null};dhtmlXWindowsCell.prototype.detachContextMenu=function(){this.wins._detachContextMenu("icon",this._idd,null)};dhtmlXWindowsButton.prototype.attachContextMenu=function(a){return this.conf.wins._renderContextMenu("button",this.conf.winId,this.conf.name,a)};dhtmlXWindowsButton.prototype.getContextMenu=function(){if(this.conf.wins.cm==null||this.conf.wins.cm.button[this.conf.winId]==null){return null}if(this.conf.wins.cm.button[this.conf.winId][this.conf.name]!=null){return this.conf.wins.cm.button[this.conf.winId][this.conf.name]}return null};dhtmlXWindowsButton.prototype.detachContextMenu=function(){this.conf.wins._detachContextMenu("button",this.conf.winId,this.conf.name)};dhtmlXWindows.prototype._renderContextMenu=function(n,m,g,c){var j=this;var a=false;if(this.cm==null){this.cm={global:null,icon:{},button:{}};a=true}if(m==null){if(this.cm.global!=null){return}}else{if(n=="icon"){if(this.cm.icon[m]!=null){return}}else{if(n=="button"){if(this.cm.button[m]!=null&&this.cm.button[m][g]!=null){return}}}}if(c==null){c={}}c.parent=null;c.context=true;var l=new dhtmlXMenuObject(c);l.setAutoHideMode(false);l.attachEvent("onShow",function(){this.conf.wins_menu_open=true});l.attachEvent("onHide",function(){this.conf.wins_menu_open=false;j.conf.opened_menu=null});if(m==null){this.cm.global=l}else{if(n=="icon"){this.cm.icon[m]=l}else{if(n=="button"){if(this.cm.button[m]==null){this.cm.button[m]={}}this.cm.button[m][g]=l}}}if(a){this._showContextMenu=function(s,r){if(s.button>=2){return}if(r.mode=="icon"&&r.id!=null&&r.press_type=="mousedown"){var u=this.cm.icon[r.id]||this.cm.global;if(u==null){return}s.cancelBubble=true;var q=this.w[r.id].hdr.firstChild;if(u.conf.wins_menu_open&&this.conf.opened_menu==r.id){u.hideContextMenu()}else{this._hideContextMenu();u.showContextMenu(window.dhx4.absLeft(q),window.dhx4.absTop(q)+q.offsetHeight);this.conf.opened_menu=r.id}u=q=null}if(r.mode=="button"&&r.id!=null&&r.press_type=="mousedown"){if(this.cm.button[r.id]==null||this.cm.button[r.id][r.button_name]==null){return}s.cancelBubble=true;this.conf.button_last=null;var u=this.cm.button[r.id][r.button_name];var o=this.w[r.id].b[r.button_name].button;if(u.conf.wins_menu_open&&this.conf.opened_menu==r.id){u.hideContextMenu()}else{this._hideContextMenu();u.showContextMenu(window.dhx4.absLeft(o),window.dhx4.absTop(o)+o.offsetHeight);this.conf.opened_menu=r.id}u=o=null}};this._hideContextMenu=function(u){if(u!=null){u=u||event;if(u.type=="keydown"&&u.keyCode!=27){return}var s=u.target||u.srcElement;var q=true;while(s!=null&&q==true){if(s.className!=null&&s.className.search(/SubLevelArea_Polygon/)>=0){q=false}else{s=s.parentNode}}}if(q||u==null){if(j.cm.global!=null){j.cm.global.hideContextMenu()}for(var r in j.cm.icon){if(j.cm.icon[r]!=null){j.cm.icon[r].hideContextMenu()}}for(var r in j.cm.button){for(var o in j.cm.button[r]){if(j.cm.button[r][o]!=null){j.cm.button[r][o].hideContextMenu()}}}}};this._detachContextMenu=function(r,q,o){if(this.cm==null){return}if(q==null){if(this.cm.global!=null){this.cm.global.unload();this.cm.global=null}}else{if(r=="icon"){if(this.cm.icon[q]!=null){this.cm.icon[q].unload();this.cm.icon[q]=null}}else{if(r=="button"){if(this.cm.button[q]!=null&&this.cm.button[q][o]!=null){this.cm.button[q][o].unload();this.cm.button[q][o]=null}}}}};this.attachEvent("_winMouseDown",this._showContextMenu);if(typeof(window.addEventListener)=="function"){window.addEventListener("mousedown",this._hideContextMenu,false);window.addEventListener("keydown",this._hideContextMenu,false)}else{document.body.attachEvent("onmousedown",this._hideContextMenu);document.body.attachEvent("onkeydown",this._hideContextMenu)}this._unloadContextMenu=function(){this._detachContextMenu("icon",null,null);this.cm=null;if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._hideContextMenu,false);window.removeEventListener("keydown",this._hideContextMenu,false)}else{document.body.detachEvent("onmousedown",this._hideContextMenu);document.body.detachEvent("onkeydown",this._hideContextMenu)}j=null}}return l};if(!window.dhtmlx){window.dhtmlx={}}(function(){var r=null;function u(A,x){var y=A.callback;s(false);A.box.parentNode.removeChild(A.box);r=A.box=null;if(y){y(x)}}function a(y){if(r){y=y||event;var x=y.which||event.keyCode;if(dhtmlx.message.keyboard){if(x==13||x==32){u(r,true)}if(x==27){u(r,false)}}if(y.preventDefault){y.preventDefault()}return !(y.cancelBubble=true)}}if(document.attachEvent){document.attachEvent("onkeydown",a)}else{document.addEventListener("keydown",a,true)}function s(y){if(!s.cover){s.cover=document.createElement("DIV");s.cover.onkeydown=a;s.cover.className="dhx_modal_cover";document.body.appendChild(s.cover)}var x=document.body.scrollHeight;s.cover.style.display=y?"inline-block":"none"}function m(y,x){return"<div class='dhtmlx_popup_button' result='"+x+"' ><div>"+y+"</div></div>"}function g(y){if(!v.area){v.area=document.createElement("DIV");v.area.className="dhtmlx_message_area";v.area.style[v.position]="5px";document.body.appendChild(v.area)}v.hide(y.id);var x=document.createElement("DIV");x.innerHTML="<div>"+y.text+"</div>";x.className="dhtmlx-info dhtmlx-"+y.type;x.onclick=function(){if(y){v.hide(y.id)}y=null};if(v.position=="bottom"&&v.area.firstChild){v.area.insertBefore(x,v.area.firstChild)}else{v.area.appendChild(x)}if(y.expire>0){v.timers[y.id]=window.setTimeout(function(){v.hide(y.id)},y.expire)}v.pull[y.id]=x;x=null;return y.id}function n(y,C,F){var E=document.createElement("DIV");E.className=" dhtmlx_modal_box dhtmlx-"+y.type;E.setAttribute("dhxbox",1);var x="";if(y.width){E.style.width=y.width}if(y.height){E.style.height=y.height}if(y.title){x+='<div class="dhtmlx_popup_title">'+y.title+"</div>"}x+='<div class="dhtmlx_popup_text"><span>'+(y.content?"":y.text)+'</span></div><div  class="dhtmlx_popup_controls">';if(C){x+=m(y.ok||"OK",true)}if(F){x+=m(y.cancel||"Cancel",false)}if(y.buttons){for(var A=0;A<y.buttons.length;A++){x+=m(y.buttons[A],A)}}x+="</div>";E.innerHTML=x;if(y.content){var D=y.content;if(typeof D=="string"){D=document.getElementById(D)}if(D.style.display=="none"){D.style.display=""}E.childNodes[y.title?1:0].appendChild(D)}E.onclick=function(J){J=J||event;var I=J.target||J.srcElement;if(!I.className){I=I.parentNode}if(I.className=="dhtmlx_popup_button"){var H=I.getAttribute("result");H=(H=="true")||(H=="false"?false:H);u(y,H)}};y.box=E;if(C||F){r=y}return E}function w(C,D,F){var E=C.tagName?C:n(C,D,F);if(!C.hidden){s(true)}document.body.appendChild(E);var A=C.left||Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-E.offsetWidth)/2));var H=C.top||Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-E.offsetHeight)/2));if(C.position=="top"){E.style.top="-3px"}else{E.style.top=H+"px"}E.style.left=A+"px";E.onkeydown=a;E.focus();if(C.hidden){dhtmlx.modalbox.hide(E)}return E}function q(x){return w(x,true,false)}function c(x){return w(x,true,true)}function l(x){return w(x)}function o(y,x,A){if(typeof y!="object"){if(typeof x=="function"){A=x;x=""}y={text:y,type:x,callback:A}}return y}function j(A,y,x,C){if(typeof A!="object"){A={text:A,type:y,expire:x,id:C}}A.id=A.id||v.uid();A.expire=A.expire||v.expire;return A}dhtmlx.alert=function(){var x=o.apply(this,arguments);x.type=x.type||"confirm";return q(x)};dhtmlx.confirm=function(){var x=o.apply(this,arguments);x.type=x.type||"alert";return c(x)};dhtmlx.modalbox=function(){var x=o.apply(this,arguments);x.type=x.type||"alert";return l(x)};dhtmlx.modalbox.hide=function(x){while(x&&x.getAttribute&&!x.getAttribute("dhxbox")){x=x.parentNode}if(x){x.parentNode.removeChild(x);s(false);r=null}};var v=dhtmlx.message=function(C,A,y,D){C=j.apply(this,arguments);C.type=C.type||"info";var x=C.type.split("-")[0];switch(x){case"alert":return q(C);case"confirm":return c(C);case"modalbox":return l(C);default:return g(C);break}};v.seed=(new Date()).valueOf();v.uid=function(){return v.seed++};v.expire=4000;v.keyboard=true;v.position="top";v.pull={};v.timers={};v.hideAll=function(){for(var x in v.pull){v.hide(x)}};v.hide=function(y){var x=v.pull[y];if(x&&x.parentNode){window.setTimeout(function(){x.parentNode.removeChild(x);x=null},2000);x.className+=" hidden";if(v.timers[y]){window.clearTimeout(v.timers[y])}delete v.pull[y]}}})();if(!window.dhx){dhx={}}dhx.assert=function(c,a){if(!c){dhx.assert_error(a)}};dhx.assert_error=function(message){dhx.log("error",message);if(dhx.message&&typeof message=="string"){dhx.message({type:"debug",text:message,expire:-1})}if(dhx.debug!==false){eval("debugger;")}};dhx.assert_core_ready=function(){if(window.dhx_on_core_ready){dhx_on_core_ready()}};dhx.version="3.0";dhx.codebase="./";dhx.name="Core";dhx.clone=function(c){var a=dhx.clone._function;a.prototype=c;return new a()};dhx.clone._function=function(){};dhx.extend=function(g,c,a){dhx.assert(g,"Invalid mixing target");dhx.assert(c,"Invalid mixing source");if(g._dhx_proto_wait){dhx.PowerArray.insertAt.call(g._dhx_proto_wait,c,1);return g}for(var j in c){if(!g[j]||a){g[j]=c[j]}}if(c.defaults){dhx.extend(g.defaults,c.defaults)}if(c.$init){c.$init.call(g)}return g};dhx.copy=function(a){dhx.assert(a,"Invalid mixing target");if(arguments.length>1){var c=arguments[0];a=arguments[1]}else{var c=(dhx.isArray(a)?[]:{})}for(var g in a){if(a[g]&&typeof a[g]=="object"&&!dhx.isDate(a[g])){c[g]=(dhx.isArray(a[g])?[]:{});dhx.copy(c[g],a[g])}else{c[g]=a[g]}}return c};dhx.single=function(g){var a=null;var c=function(j){if(!a){a=new g({})}if(a._reinit){a._reinit.apply(a,arguments)}return a};return c};dhx.protoUI=function(){if(dhx.debug_proto){dhx.log("UI registered: "+arguments[0].name)}var g=arguments;var a=g[0].name;var c=function(l){if(!c){return dhx.ui[a].prototype}var n=c._dhx_proto_wait;if(n){var m=[n[0]];for(var j=1;j<n.length;j++){m[j]=n[j];if(m[j]._dhx_proto_wait){m[j]=m[j].call(dhx,m[j].name)}if(m[j].prototype&&m[j].prototype.name){dhx.ui[m[j].prototype.name]=m[j]}}dhx.ui[a]=dhx.proto.apply(dhx,m);if(c._dhx_type_wait){for(var j=0;j<c._dhx_type_wait.length;j++){dhx.Type(dhx.ui[a],c._dhx_type_wait[j])}}c=n=null}if(this!=dhx){return new dhx.ui[a](l)}else{return dhx.ui[a]}};c._dhx_proto_wait=Array.prototype.slice.call(arguments,0);return dhx.ui[a]=c};dhx.proto=function(){if(dhx.debug_proto){dhx.log("Proto chain:"+arguments[0].name+"["+arguments.length+"]")}var m=arguments;var l=m[0];var c=!!l.$init;var o=[];dhx.assert(l,"Invalid mixing target");for(var j=m.length-1;j>0;j--){dhx.assert(m[j],"Invalid mixing source");if(typeof m[j]=="function"){m[j]=m[j].prototype}if(m[j].$init){o.push(m[j].$init)}if(m[j].defaults){var g=m[j].defaults;if(!l.defaults){l.defaults={}}for(var a in g){if(dhx.isUndefined(l.defaults[a])){l.defaults[a]=g[a]}}}if(m[j].type&&l.type){for(var a in m[j].type){if(!l.type[a]){l.type[a]=m[j].type[a]}}}for(var n in m[j]){if(!l[n]){l[n]=m[j][n]}}}if(c){o.push(l.$init)}l.$init=function(){for(var r=0;r<o.length;r++){o[r].apply(this,arguments)}};var q=function(r){this.$ready=[];dhx.assert(this.$init,"object without init method");this.$init(r);if(this._parseSettings){this._parseSettings(r,this.defaults)}for(var s=0;s<this.$ready.length;s++){this.$ready[s].call(this)}};q.prototype=l;l=m=null;return q};dhx.bind=function(c,a){return function(){return c.apply(a,arguments)}};dhx.require=function(c,o,n){if(typeof c!="string"){var m=c.length||0;var l=o;if(!m){for(var a in c){m++}o=function(){m--;if(m===0){l.apply(this,arguments)}};for(var a in c){dhx.require(a,o,n)}}else{o=function(){if(m){m--;dhx.require(c[c.length-m-1],o,n)}else{return l.apply(this,arguments)}};o()}return}if(dhx._modules[c]!==true){if(c.substr(-4)==".css"){var j=dhx.html.create("LINK",{type:"text/css",rel:"stylesheet",href:dhx.codebase+c});document.head.appendChild(j);if(o){o.call(n||window)}return}var g=arguments[4];if(!o){dhx.exec(dhx.ajax().sync().get(dhx.codebase+c).responseText);dhx._modules[c]=true}else{if(!dhx._modules[c]){dhx._modules[c]=[[o,n]];dhx.ajax(dhx.codebase+c,function(s){dhx.exec(s);var r=dhx._modules[c];dhx._modules[c]=true;for(var q=0;q<r.length;q++){r[q][0].call(r[q][1]||window,!q)}})}else{dhx._modules[c].push([o,n])}}}};dhx._modules={};dhx.exec=function(code){if(window.execScript){window.execScript(code)}else{window.eval(code)}};dhx.wrap=function(c,a){if(!c){return a}return function(){var g=c.apply(this,arguments);a.apply(this,arguments);return g}};dhx.isUndefined=function(c){return typeof c=="undefined"};dhx.delay=function(j,c,g,a){return window.setTimeout(function(){var l=j.apply(c,(g||[]));j=c=g=null;return l},a||1)};dhx.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}this._seed++;return this._seed};dhx.toNode=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};dhx.toArray=function(a){return dhx.extend((a||[]),dhx.PowerArray,true)};dhx.toFunctor=function(str){return(typeof(str)=="string")?eval(str):str};dhx.isArray=function(a){return Array.isArray?Array.isArray(a):(Object.prototype.toString.call(a)==="[object Array]")};dhx.isDate=function(a){return a instanceof Date};dhx._events={};dhx.event=function(j,g,a,c){j=dhx.toNode(j);var l=dhx.uid();if(c){a=dhx.bind(a,c)}dhx._events[l]=[j,g,a];if(j.addEventListener){j.addEventListener(g,a,false)}else{if(j.attachEvent){j.attachEvent("on"+g,a)}}return l};dhx.eventRemove=function(c){if(!c){return}dhx.assert(this._events[c],"Removing non-existing event");var a=dhx._events[c];if(a[0].removeEventListener){a[0].removeEventListener(a[1],a[2],false)}else{if(a[0].detachEvent){a[0].detachEvent("on"+a[1],a[2])}}delete this._events[c]};dhx.log=function(c,g,a){if(arguments.length==1){g=c;c="log"}if(window.console&&console.log){c=c.toLowerCase();if(window.console[c]){window.console[c](g||"unknown error")}else{window.console.log(c+": "+g)}if(a){window.console.log(a)}}};dhx.log_full_time=function(a){dhx._start_time_log=new Date();dhx.log("Timing start ["+a+"]");window.setTimeout(function(){var c=new Date();dhx.log("Timing end ["+a+"]:"+(c.valueOf()-dhx._start_time_log.valueOf())/1000+"s")},1)};dhx.log_time=function(a){var g="_start_time_log"+a;if(!dhx[g]){dhx[g]=new Date();dhx.log("Info","Timing start ["+a+"]")}else{var c=new Date();dhx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhx[g].valueOf())/1000+"s");dhx[g]=null}};dhx.debug_code=function(a){a.call(dhx)};dhx.EventSystem={$init:function(){if(!this._evs_events){this._evs_events={};this._evs_handlers={};this._evs_map={}}},blockEvent:function(){this._evs_events._block=true},unblockEvent:function(){this._evs_events._block=false},mapEvent:function(a){dhx.extend(this._evs_map,a,true)},on_setter:function(a){if(a){for(var c in a){if(typeof a[c]=="function"){this.attachEvent(c,a[c])}}}},callEvent:function(g,l){if(this._evs_events._block){return true}g=g.toLowerCase();var j=this._evs_events[g.toLowerCase()];var a=true;if(dhx.debug){dhx.log("info","["+this.name+"] event:"+g,l)}if(j){for(var c=0;c<j.length;c++){if(j[c].apply(this,(l||[]))===false){a=false}}}if(this._evs_map[g]&&!this._evs_map[g].callEvent(g,l)){a=false}return a},attachEvent:function(c,a,j){dhx.assert(a,"Invalid event handler for "+c);c=c.toLowerCase();j=j||dhx.uid();a=dhx.toFunctor(a);var g=this._evs_events[c]||dhx.toArray();g.push(a);this._evs_events[c]=g;this._evs_handlers[j]={f:a,t:c};return j},detachEvent:function(j){if(!this._evs_handlers[j]){return}var c=this._evs_handlers[j].t;var a=this._evs_handlers[j].f;var g=this._evs_events[c];g.remove(a);delete this._evs_handlers[j]},hasEvent:function(a){a=a.toLowerCase();return this._evs_events[a]?true:false}};dhx.extend(dhx,dhx.EventSystem);dhx.PowerArray={removeAt:function(c,a){if(c>=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,g){if(!g&&g!==0){this.push(c)}else{var a=this.splice(g,(this.length-g));this[g]=c;this.push.apply(this,a)}},find:function(c){for(var a=0;a<this.length;a++){if(c==this[a]){return a}}return -1},each:function(a,g){for(var c=0;c<this.length;c++){a.call((g||this),this[c])}},map:function(a,g){for(var c=0;c<this.length;c++){this[c]=a.call((g||this),this[c])}return this},filter:function(a,g){for(var c=0;c<this.length;c++){if(!a.call((g||this),this[c])){this.splice(c,1);c--}}return this}};dhx.env={};(function(){if(navigator.userAgent.indexOf("Mobile")!=-1){dhx.env.mobile=true}if(dhx.env.mobile||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("Android")!=-1){dhx.env.touch=true}if(navigator.userAgent.indexOf("Opera")!=-1){dhx.env.isOpera=true}else{dhx.env.isIE=!!document.all;dhx.env.isFF=!document.all;dhx.env.isWebKit=(navigator.userAgent.indexOf("KHTML")!=-1);dhx.env.isSafari=dhx.env.isWebKit&&(navigator.userAgent.indexOf("Mac")!=-1)}if(navigator.userAgent.toLowerCase().indexOf("android")!=-1){dhx.env.isAndroid=true}dhx.env.transform=false;dhx.env.transition=false;var g={};g.names=["transform","transition"];g.transform=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];g.transition=["transition","WebkitTransition","MozTransition","OTransition","msTransition"];var o=document.createElement("DIV");for(var m=0;m<g.names.length;m++){var l=g[g.names[m]];for(var c=0;c<l.length;c++){if(typeof o.style[l[c]]!="undefined"){dhx.env[g.names[m]]=l[c];break}}}o.style[dhx.env.transform]="translate3d(0,0,0)";dhx.env.translate=(o.style[dhx.env.transform])?"translate3d":"translate";var n="";var a=false;if(dhx.env.isOpera){n="-o-";a="O"}if(dhx.env.isFF){n="-Moz-"}if(dhx.env.isWebKit){n="-webkit-"}if(dhx.env.isIE){n="-ms-"}dhx.env.transformCSSPrefix=n;dhx.env.transformPrefix=a||(dhx.env.transformCSSPrefix.replace(/-/gi,""));dhx.env.transitionEnd=((dhx.env.transformCSSPrefix=="-Moz-")?"transitionend":(dhx.env.transformPrefix+"TransitionEnd"))})();dhx.env.svg=(function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")})();dhx.html={_native_on_selectstart:0,denySelect:function(){if(!dhx._native_on_selectstart){dhx._native_on_selectstart=document.onselectstart}document.onselectstart=dhx.html.stopEvent},allowSelect:function(){if(dhx._native_on_selectstart!==0){document.onselectstart=dhx._native_on_selectstart||null}dhx._native_on_selectstart=0},index:function(c){var a=0;while(c=c.previousSibling){a++}return a},_style_cache:{},createCss:function(g){var j="";for(var c in g){j+=c+":"+g[c]+";"}var a=this._style_cache[j];if(!a){a="s"+dhx.uid();this.addStyle("."+a+"{"+j+"}");this._style_cache[j]=a}return a},addStyle:function(c){var a=document.createElement("style");a.setAttribute("type","text/css");a.setAttribute("media","screen");if(a.styleSheet){a.styleSheet.cssText=c}else{a.appendChild(document.createTextNode(c))}document.getElementsByTagName("head")[0].appendChild(a)},create:function(c,a,g){a=a||{};var j=document.createElement(c);for(var l in a){j.setAttribute(l,a[l])}if(a.style){j.style.cssText=a.style}if(a["class"]){j.className=a["class"]}if(g){j.innerHTML=g}return j},getValue:function(a){a=dhx.toNode(a);if(!a){return""}return dhx.isUndefined(a.value)?a.innerHTML:a.value},remove:function(c){if(c instanceof Array){for(var a=0;a<c.length;a++){this.remove(c[a])}}else{if(c&&c.parentNode){c.parentNode.removeChild(c)}}},insertBefore:function(c,g,a){if(!c){return}if(g&&g.parentNode){g.parentNode.insertBefore(c,g)}else{a.appendChild(c)}},locate:function(c,j){if(c.tagName){var a=c}else{c=c||event;var a=c.target||c.srcElement}while(a){if(a.getAttribute){var g=a.getAttribute(j);if(g){return g}}a=a.parentNode}return null},offset:function(j){if(j.getBoundingClientRect){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{y:Math.round(r),x:Math.round(g)}}else{var r=0,g=0;while(j){r=r+parseInt(j.offsetTop,10);g=g+parseInt(j.offsetLeft,10);j=j.offsetParent}return{y:r,x:g}}},posRelative:function(a){a=a||event;if(!dhx.isUndefined(a.offsetX)){return{x:a.offsetX,y:a.offsetY}}else{return{x:a.layerX,y:a.layerY}}},pos:function(a){a=a||event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}var c=((dhx.env.isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:a.clientX+c.scrollLeft-c.clientLeft,y:a.clientY+c.scrollTop-c.clientTop}},preventEvent:function(a){if(a&&a.preventDefault){a.preventDefault()}return dhx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=true;return false},addCss:function(c,a){c.className+=" "+a},removeCss:function(c,a){c.className=c.className.replace(RegExp(" "+a,"g"),"")}};dhx.ready=function(a){if(this._ready){a.call()}else{this._ready_code.push(a)}};dhx._ready_code=[];(function(){var a=document.getElementsByTagName("SCRIPT");dhx.assert(a.length,"Can't locate codebase");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhx.codebase=a.slice(0,a.length).join("/")+"/"}dhx.event(window,"load",function(){dhx4.callEvent("onReady",[]);dhx.delay(function(){dhx._ready=true;for(var c=0;c<dhx._ready_code.length;c++){dhx._ready_code[c].call()}dhx._ready_code=[]})})})();dhx.locale=dhx.locale||{};dhx.assert_core_ready();dhx.ready(function(){dhx.event(document.body,"click",function(a){dhx4.callEvent("onClick",[a||event])})});(function(){var g={};var c=new RegExp("(\\r\\n|\\n)","g");var a=new RegExp('(\\")',"g");dhx.Template=function(l){if(typeof l=="function"){return l}if(g[l]){return g[l]}l=(l||"").toString();if(l.indexOf("->")!=-1){l=l.split("->");switch(l[0]){case"html":l=dhx.html.getValue(l[1]);break;case"http":l=new dhx.ajax().sync().get(l[1],{uid:dhx.uid()}).responseText;break;default:break}}l=(l||"").toString();l=l.replace(c,"\\n");l=l.replace(a,'\\"');l=l.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');l=l.replace(/\{common\.([^}\(]*)\}/g,"\"+(common.$1||'')+\"");l=l.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"');l=l.replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"');l=l.replace("{obj}",'"+obj+"');l=l.replace(/#([^#'";, ]+)#/gi,'"+(obj.$1)+"');try{g[l]=Function("obj","common",'return "'+l+'";')}catch(j){dhx.assert_error("Invalid template:"+l)}return g[l]};dhx.Template.empty=function(){return""};dhx.Template.bind=function(j){return dhx.bind(dhx.Template(j),this)};dhx.Type=function(o,n){if(o._dhx_proto_wait){if(!o._dhx_type_wait){o._dhx_type_wait=[]}o._dhx_type_wait.push(n);return}if(typeof o=="function"){o=o.prototype}if(!o.types){o.types={"default":o.type};o.type.name="default"}var j=n.name;var m=o.type;if(j){m=o.types[j]=dhx.clone(n.baseType?o.types[n.baseType]:o.type)}for(var l in n){if(l.indexOf("template")===0){m[l]=dhx.Template(n[l])}else{m[l]=n[l]}}return j}})();dhx.Settings={$init:function(){this._settings=this.config={}},define:function(c,a){if(typeof c=="object"){return this._parseSeetingColl(c)}return this._define(c,a)},_define:function(c,a){var g=this[c+"_setter"];return this._settings[c]=g?g.call(this,a,c):a},_parseSeetingColl:function(g){if(g){for(var c in g){this._define(c,g[c])}}},_parseSettings:function(g,a){var c={};if(a){c=dhx.extend(c,a)}if(typeof g=="object"&&!g.tagName){dhx.extend(c,g,true)}this._parseSeetingColl(c)},_mergeSettings:function(a,g){for(var c in g){switch(typeof a[c]){case"object":a[c]=this._mergeSettings((a[c]||{}),g[c]);break;case"undefined":a[c]=g[c];break;default:break}}return a},debug_freid_c_id:true,debug_freid_a_name:true};dhx.ajax=function(a,c,g){if(arguments.length!==0){var j=new dhx.ajax();if(g){j.master=g}return j.get(a,null,c)}if(!this.getXHR){return new dhx.ajax()}return this};dhx.ajax.count=0;dhx.ajax.prototype={master:null,getXHR:function(){if(dhx.env.isIE){return new ActiveXObject("Microsoft.xmlHTTP")}else{return new XMLHttpRequest()}},send:function(l,q,n){var c=this.getXHR();if(!dhx.isArray(n)){n=[n]}if(typeof q=="object"){var m=[];for(var g in q){var o=q[g];if(o===null||o===dhx.undefined){o=""}m.push(g+"="+encodeURIComponent(o))}q=m.join("&")}if(q&&this.request==="GET"){l=l+(l.indexOf("?")!=-1?"&":"?")+q;q=null}c.open(this.request,l,!this._sync);if(this.request==="POST"){c.setRequestHeader("Content-type","application/x-www-form-urlencoded")}var j=this;c.onreadystatechange=function(){if(!c.readyState||c.readyState==4){if(dhx.debug_time){dhx.log_full_time("data_loading")}dhx.ajax.count++;if(n&&j){for(var a=0;a<n.length;a++){if(n[a]){var r=(n[a].success||n[a]);if(c.status>=400||(!c.status&&!c.responseText)){r=n[a].error}if(r){r.call((j.master||j),c.responseText,c.responseXML,c)}}}}if(j){j.master=null}n=j=null}};c.send(q||null);return c},get:function(a,g,c){if(arguments.length==2){c=g;g=null}this.request="GET";return this.send(a,g,c)},post:function(a,g,c){this.request="POST";return this.send(a,g,c)},put:function(a,g,c){this.request="PUT";return this.send(a,g,c)},del:function(a,g,c){this.request="DELETE";return this.send(a,g,c)},sync:function(){this._sync=true;return this},bind:function(a){this.master=a;return this}};dhx.send=function(g,c,n,m){var j=dhx.html.create("FORM",{target:(m||"_self"),action:g,method:(n||"POST")},"");for(var a in c){var l=dhx.html.create("INPUT",{type:"hidden",name:a,value:c[a]},"");j.appendChild(l)}j.style.display="none";document.body.appendChild(j);j.submit();document.body.removeChild(j)};dhx.AtomDataLoader={$init:function(a){this.data={};if(a){this._settings.datatype=a.datatype||"json";this.$ready.push(this._load_when_ready)}},_load_when_ready:function(){this._ready_for_data=true;if(this._settings.url){this.url_setter(this._settings.url)}if(this._settings.data){this.data_setter(this._settings.data)}},url_setter:function(a){if(!this._ready_for_data){return a}this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data){return a}this.parse(a,this._settings.datatype);return true},debug_freid_c_datatype:true,debug_freid_c_dataFeed:true,load:function(a,c){if(a.$proxy){a.load(this,typeof c=="string"?c:"json");return}this.callEvent("onXLS",[]);if(typeof c=="string"){this.data.driver=dhx.DataDriver[c];c=arguments[2]}else{if(!this.data.driver){this.data.driver=dhx.DataDriver.json}}var g=[{success:this._onLoad,error:this._onLoadError}];if(c){if(dhx.isArray(c)){g.push.apply(g,c)}else{g.push(c)}}return dhx.ajax(a,g,this)},parse:function(c,a){this.callEvent("onXLS",[]);this.data.driver=dhx.DataDriver[a||"json"];this._onLoad(c,null)},_onLoad:function(n,c,a,g){var l=this.data.driver;var j=l.toObject(n,c);if(j){var m=l.getRecords(j)[0];this.data=(l?l.getDetails(m):n)}else{this._onLoadError(n,c,a)}this.callEvent("onXLE",[])},_onLoadError:function(g,a,c){this.callEvent("onXLE",[]);this.callEvent("onLoadError",arguments);dhx4.callEvent("onLoadError",[g,a,c,this])},_check_data_feed:function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.callEvent("onXLS",[]);dhx.ajax(a,function(m,j,g){this._ignore_feed=true;var l=dhx.DataDriver.toObject(m,j);if(l){this.setValues(l.getDetails(l.getRecords()[0]))}else{this._onLoadError(m,j,g)}this._ignore_feed=false;this.callEvent("onXLE",[])},this);return false}};dhx.DataDriver={};dhx.DataDriver.json={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){try{eval("dhx.temp="+data)}catch(e){dhx.assert_error(e);return null}data=dhx.temp}if(data.data){var t=data.data.config={};for(var key in data){if(key!="data"){t[key]=data[key]}}data=data.data}return data},getRecords:function(a){if(a&&!dhx.isArray(a)){return[a]}return a},getDetails:function(a){if(typeof a=="string"){return{id:dhx.uid(),value:a}}return a},getInfo:function(c){var a=c.config;if(!a){return{}}return{_size:(a.total_count||0),_from:(a.pos||0),_parent:(a.parent||0),_config:(a.config),_key:(a.dhx_security)}},child:"data"};dhx.DataDriver.html={toObject:function(c){if(typeof c=="string"){var a=null;if(c.indexOf("<")==-1){a=dhx.toNode(c)}if(!a){a=document.createElement("DIV");a.innerHTML=c}return a.getElementsByTagName(this.tag)}return c},getRecords:function(c){var g=[];for(var a=0;a<c.childNodes.length;a++){var j=c.childNodes[a];if(j.nodeType==1){g.push(j)}}return g},getDetails:function(a){return dhx.DataDriver.xml.tagToObject(a)},getInfo:function(a){return{_size:0,_from:0}},tag:"LI"};dhx.DataDriver.jsarray={toObject:function(data){if(typeof data=="string"){eval("dhx.temp="+data);return dhx.temp}return data},getRecords:function(a){return a},getDetails:function(g){var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}}};dhx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(g){g=this.stringToArray(g);var a={};for(var c=0;c<g.length;c++){a["data"+c]=g[c]}return a},getInfo:function(a){return{_size:0,_from:0}},stringToArray:function(c){c=c.split(this.cell);for(var a=0;a<c.length;a++){c[a]=c[a].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"")}return c},row:"\n",cell:","};dhx.DataDriver.xml={_isValidXML:function(a){if(!a||!a.documentElement){return null}if(a.getElementsByTagName("parsererror").length){return null}return a},toObject:function(g,a){if(this._isValidXML(c)){return c}if(typeof g=="string"){var c=this.fromString(g.replace(/^[\s]+/,""))}else{c=g}if(this._isValidXML(c)){return c}return null},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(c){var a=this.xpath(c,this.config);if(a.length){a=this.assignTypes(this.tagToObject(a[0],{}))}else{a=null}return{_size:(c.documentElement.getAttribute("total_count")||0),_from:(c.documentElement.getAttribute("pos")||0),_parent:(c.documentElement.getAttribute("parent")||0),_config:a,_key:(c.documentElement.getAttribute("dhx_security")||null)}},xpath:function(j,q){if(window.XPathResult){var g=j;if(j.nodeName.indexOf("document")==-1){j=j.ownerDocument}var n=[];var c=j.evaluate(q,g,null,XPathResult.ANY_TYPE,null);var o=c.iterateNext();while(o){n.push(o);o=c.iterateNext()}return n}else{var m=true;try{if(typeof(j.selectNodes)=="undefined"){m=false}}catch(l){}if(m){return j.selectNodes(q)}else{var a=q.split("/").pop();return j.getElementsByTagName(a)}}},assignTypes:function(c){for(var a in c){var g=c[a];if(typeof g=="object"){this.assignTypes(g)}else{if(typeof g=="string"){if(g===""){continue}if(g=="true"){c[a]=true}else{if(g=="false"){c[a]=false}else{if(g==g*1){c[a]=c[a]*1}}}}}}return c},tagToObject:function(g,q){q=q||{};var l=false;var j=g.attributes;if(j&&j.length){for(var n=0;n<j.length;n++){q[j[n].name]=j[n].value}l=true}var c=g.childNodes;var o={};for(var n=0;n<c.length;n++){if(c[n].nodeType==1){var m=c[n].tagName;if(typeof q[m]!="undefined"){if(!dhx.isArray(q[m])){q[m]=[q[m]]}q[m].push(this.tagToObject(c[n],{}))}else{q[c[n].tagName]=this.tagToObject(c[n],{})}l=true}}if(!l){return this.nodeValue(g)}q.value=q.value||this.nodeValue(g);return q},nodeValue:function(a){if(a.firstChild){return a.firstChild.data}return""},fromString:function(g){try{if(window.DOMParser){return(new DOMParser()).parseFromString(g,"text/xml")}if(window.ActiveXObject){var a=new ActiveXObject("Microsoft.xmlDOM");a.loadXML(g);return a}}catch(c){dhx.assert_error(c);return null}dhx.assert_error("Load from xml string is not supported")}};dhx.DataLoader=dhx.proto({$init:function(a){a=a||"";this._ajax_queue=dhx.toArray();this.data=new dhx.DataStore();this.data.attachEvent("onClearAll",dhx.bind(this._call_onclearall,this));this.data.attachEvent("onServerConfig",dhx.bind(this._call_on_config,this));this.data.feed=this._feed},_feed:function(g,a,c){if(this._load_count){return this._load_count=[g,a,c]}else{this._load_count=true}this._feed_last=[g,a];this._feed_common.call(this,g,a,c)},_feed_common:function(j,c,g){var a=this.data.url;if(j<0){j=0}this.load(a+((a.indexOf("?")==-1)?"?":"&")+(this.dataCount()?("continue=true&"):"")+"start="+j+"&count="+c,[this._feed_callback,g])},_feed_callback:function(){var a=this._load_count;var c=this._feed_last;this._load_count=false;if(typeof a=="object"&&(a[0]!=c[0]||a[1]!=c[1])){this.data.feed.apply(this,a)}},load:function(a,c){var g=dhx.AtomDataLoader.load.apply(this,arguments);this._ajax_queue.push(g);if(!this.data.url){this.data.url=a}},loadNext:function(g,l,j,c,a){if(this._settings.datathrottle&&!a){if(this._throttle_request){window.clearTimeout(this._throttle_request)}this._throttle_request=dhx.delay(function(){this.loadNext(g,l,j,c,true)},this,0,this._settings.datathrottle);return}if(!l&&l!==0){l=this.dataCount()}this.data.url=this.data.url||c;if(this.callEvent("onDataRequest",[l,g,j,c])&&this.data.url){this.data.feed.call(this,l,g,j)}},_maybe_loading_already:function(c,g){var a=this._feed_last;if(this._load_count&&a){if(a[0]<=g&&(a[1]+a[0]>=c+g)){return true}}return false},_onLoad:function(j,c,a){this._ajax_queue.remove(a);var g=this.data.driver.toObject(j,c);if(g){this.data._parse(g)}else{return this._onLoadError(j,c,a)}this._call_onready();this.callEvent("onXLE",[])},removeMissed_setter:function(a){return this.data._removeMissed=a},scheme_setter:function(a){this.data.scheme(a)},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhx.bind(function(n,m){if(this._settings.dataFeed){var l={};if(!n&&!m){return}if(typeof n=="function"){if(!m){return}n(m,l)}else{l={text:m}}this.clearAll();var c=this._settings.dataFeed;var j=[];if(typeof c=="function"){return c.call(this,m,l)}for(var g in l){j.push("dhx_filter["+g+"]="+encodeURIComponent(l[g]))}this.load(c+(c.indexOf("?")<0?"?":"&")+j.join("&"),this._settings.datatype);return false}},this));return a},debug_freid_c_ready:true,debug_freid_c_datathrottle:true,_call_onready:function(){if(this._settings.ready&&!this._ready_was_used){var a=dhx.toFunctor(this._settings.ready);if(a){dhx.delay(a,this,arguments)}this._ready_was_used=true}},_call_onclearall:function(){for(var a=0;a<this._ajax_queue.length;a++){this._ajax_queue[a].abort()}this._ajax_queue=dhx.toArray()},_call_on_config:function(a){this._parseSeetingColl(a)}},dhx.AtomDataLoader);dhx.DataStore=function(){this.name="DataStore";dhx.extend(this,dhx.EventSystem);this.setDriver("json");this.pull={};this.order=dhx.toArray();this._marks={}};dhx.DataStore.prototype={setDriver:function(a){dhx.assert(dhx.DataDriver[a],"incorrect DataDriver");this.driver=dhx.DataDriver[a]},_parse:function(g,a){this.callEvent("onParse",[this.driver,g]);if(this._filter_order){this.filter()}var j=this.driver.getInfo(g);if(j._key){dhx.securityKey=j._key}if(j._config){this.callEvent("onServerConfig",[j._config])}var c=this.driver.getRecords(g);this._inner_parse(j,c);if(this._scheme_group&&this._group_processing){this._group_processing(this._scheme_group)}if(this._scheme_sort){this.blockEvent();this.sort(this._scheme_sort);this.unblockEvent()}this.callEvent("onStoreLoad",[this.driver,g]);this.refresh()},_inner_parse:function(c,o){var r=(c._from||0)*1;var n=true;var q=false;if(r===0&&this.order[0]){if(this._removeMissed){q={};for(var l=0;l<this.order.length;l++){q[this.order[l]]=true}}n=false;r=this.order.length}var g=0;for(var l=0;l<o.length;l++){var s=this.driver.getDetails(o[l]);var a=this.id(s);if(!this.pull[a]){this.order[g+r]=a;g++}else{if(n&&this.order[g+r]){g++}}if(this.pull[a]){dhx.extend(this.pull[a],s,true);if(this._scheme_update){this._scheme_update(this.pull[a])}if(q){delete q[a]}}else{this.pull[a]=s;if(this._scheme_init){this._scheme_init(s)}}}if(q){this.blockEvent();for(var m in q){this.remove(m)}this.unblockEvent()}if(!this.order[c._size-1]){this.order[c._size-1]=dhx.undefined}},id:function(a){return a.id||(a.id=dhx.uid())},changeId:function(c,a){if(this.pull[c]){this.pull[a]=this.pull[c]}this.pull[a].id=a;this.order[this.order.find(c)]=a;if(this._filter_order){this._filter_order[this._filter_order.find(c)]=a}if(this._marks[c]){this._marks[a]=this._marks[c];delete this._marks[c]}this.callEvent("onIdChange",[c,a]);if(this._render_change_id){this._render_change_id(c,a)}delete this.pull[c]},item:function(a){return this.pull[a]},update:function(c,a){if(dhx.isUndefined(a)){a=this.item(c)}if(this._scheme_update){this._scheme_update(a)}if(this.callEvent("onBeforeUpdate",[c,a])===false){return false}this.pull[c]=a;this.callEvent("onStoreUpdated",[c,a,"update"])},refresh:function(a){if(this._skip_refresh){return}if(a){this.callEvent("onStoreUpdated",[a,this.pull[a],"paint"])}else{this.callEvent("onStoreUpdated",[null,null,null])}},silent:function(c,a){this._skip_refresh=true;c.call(a||this);this._skip_refresh=false},getRange:function(j,g){if(j){j=this.indexById(j)}else{j=(this.$min||this.startOffset)||0}if(g){g=this.indexById(g)}else{g=Math.min(((this.$max||this.endOffset)||Infinity),(this.dataCount()-1));if(g<0){g=0}}if(j>g){var c=g;g=j;j=c}return this.getIndexRange(j,g)},getIndexRange:function(j,g){g=Math.min((g||Infinity),this.dataCount()-1);var a=dhx.toArray();for(var c=(j||0);c<=g;c++){a.push(this.item(this.order[c]))}return a},dataCount:function(){return this.order.length},exists:function(a){return !!(this.pull[a])},move:function(a,j){dhx.assert(a>=0&&j>=0,"DataStore::move","Incorrect indexes");var g=this.idByIndex(a);var c=this.item(g);this.order.removeAt(a);this.order.insertAt(g,Math.min(this.order.length,j));this.callEvent("onStoreUpdated",[g,c,"move"])},scheme:function(a){this._scheme={};this._scheme_init=a.$init;this._scheme_update=a.$update;this._scheme_serialize=a.$serialize;this._scheme_group=a.$group;this._scheme_sort=a.$sort;for(var c in a){if(c.substr(0,1)!="$"){this._scheme[c]=a[c]}}},sync:function(j,g,a){if(typeof j=="string"){j=$$("source")}if(typeof g!="function"){a=g;g=null}if(dhx.debug_bind){this.debug_sync_master=j;dhx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}this._backbone_source=false;if(j.name!="DataStore"){if(j.data&&j.data.name=="DataStore"){j=j.data}else{this._backbone_source=true}}var c=dhx.bind(function(o,l,n){if(this._backbone_source){if(!o){return}if(o.indexOf("change")===0){if(o=="change"){this.pull[l.id]=l.attributes;this.refresh(l.id);return}else{return}}if(o=="reset"){n=l}this.order=[];this.pull={};this._filter_order=null;for(var m=0;m<n.models.length;m++){var q=n.models[m].id;this.order.push(q);this.pull[q]=n.models[m].attributes}}else{this._filter_order=null;this.order=dhx.toArray([].concat(j.order));this.pull=j.pull}if(g){this.silent(g)}if(this._on_sync){this._on_sync()}if(dhx.debug_bind){dhx.log("[sync:request] "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id+" <= "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id)}this.callEvent("onSyncApply",[]);if(!a){this.refresh()}else{a=false}},this);if(this._backbone_source){j.bind("all",c)}else{this._sync_events=[j.attachEvent("onStoreUpdated",c),j.attachEvent("onIdChange",dhx.bind(function(l,m){this.changeId(l,m)},this))]}c()},add:function(m,c){if(this._scheme){for(var g in this._scheme){if(dhx.isUndefined(m[g])){m[g]=this._scheme[g]}}}if(this._scheme_init){this._scheme_init(m)}var n=this.id(m);var a=arguments[2]||this.order;var l=a.length;if(dhx.isUndefined(c)||c<0){c=l}if(c>l){dhx.log("Warning","DataStore:add","Index of out of bounds");c=Math.min(a.length,c)}if(this.callEvent("onBeforeAdd",[n,m,c])===false){return false}dhx.assert(!this.exists(n),"Not unique ID");this.pull[n]=m;a.insertAt(n,c);if(this._filter_order){var j=this._filter_order.length;if(!c&&this.order.length){j=0}this._filter_order.insertAt(n,j)}this.callEvent("onAfterAdd",[n,c]);this.callEvent("onStoreUpdated",[n,m,"add"]);return n},remove:function(g){if(dhx.isArray(g)){for(var a=0;a<g.length;a++){this.remove(g[a])}return}if(this.callEvent("onBeforeDelete",[g])===false){return false}dhx.assert(this.exists(g),"Not existing ID in remove command"+g);var c=this.item(g);this.order.remove(g);if(this._filter_order){this._filter_order.remove(g)}delete this.pull[g];if(this._marks[g]){delete this._marks[g]}this.callEvent("onAfterDelete",[g]);this.callEvent("onStoreUpdated",[g,c,"delete"])},clearAll:function(){this.pull={};this.order=dhx.toArray();this._filter_order=this.url=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){if(a>=this.order.length||a<0){dhx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);if(!this.pull[c]){dhx.log("Warning","DataStore::indexById Non-existing ID: "+c)}return a},next:function(c,a){return this.order[this.indexById(c)+(a||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(c,a){return this.order[this.indexById(c)-(a||1)]},sort:function(l,c,a){var g=l;if(typeof l=="function"){g={as:l,dir:c}}else{if(typeof l=="string"){g={by:l.replace(/#/g,""),dir:c,as:a}}}var j=[g.by,g.dir,g.as];if(!this.callEvent("onBeforeSort",j)){return}this._sort_core(g);this.refresh();this.callEvent("onAfterSort",j)},_sort_core:function(a){if(this.order.length){var g=this._sort._create(a);var c=this.getRange(this.first(),this.last());c.sort(g);this.order=c.map(function(j){dhx.assert(j,"Client sorting can't be used with dynamic loading");return this.id(j)},this)}},_filter_reset:function(a){if(this._filter_order&&!a){this.order=this._filter_order;delete this._filter_order}},_filter_core:function(g,l,c){var j=dhx.toArray();for(var a=0;a<this.order.length;a++){var m=this.order[a];if(g(this.item(m),l)){j.push(m)}}if(!c||!this._filter_order){this._filter_order=this.order}this.order=j},filter:function(j,g,a){if(!this.callEvent("onBeforeFilter",[j,g])){return}this._filter_reset(a);if(!this.order.length){return}if(j){var c=j;g=g||"";if(typeof j=="string"){j=j.replace(/#/g,"");if(typeof g=="function"){c=function(l){return g(l[j])}}else{g=g.toString().toLowerCase();c=function(m,l){dhx.assert(m,"Client side filtering can't be used with dynamic loading");return(m[j]||"").toString().toLowerCase().indexOf(l)!=-1}}}this._filter_core(c,g,a,this._filterMode)}this.refresh();this.callEvent("onAfterFilter",[])},each:function(g,c){for(var a=0;a<this.order.length;a++){g.call((c||this),this.item(this.order[a]))}},_methodPush:function(a,c){return function(){return a[c].apply(a,arguments)}},addMark:function(l,j,a,c){var g=this._marks[l]||{};this._marks[l]=g;if(!g[j]){g[j]=c||true;if(a){this.item(l).$css=(this.item(l).$css||"")+" "+j;this.refresh(l)}}return g[j]},removeMark:function(l,j,a){var g=this._marks[l];if(g&&g[j]){delete g[j]}if(a){var c=this.item(l).$css;if(c){this.item(l).$css=c.replace(j,"");this.refresh(l)}}},hasMark:function(g,c){var a=this._marks[g];return(a&&a[c])},provideApi:function(j,c){this.debug_bind_master=j;if(c){this.mapEvent({onbeforesort:j,onaftersort:j,onbeforeadd:j,onafteradd:j,onbeforedelete:j,onafterdelete:j,onbeforeupdate:j})}var g=["sort","add","remove","exists","idByIndex","indexById","item","update","refresh","dataCount","filter","next","previous","clearAll","first","last","serialize","sync","addMark","removeMark","hasMark"];for(var a=0;a<g.length;a++){j[g[a]]=this._methodPush(this,g[a])}},serialize:function(){var j=this.order;var a=[];for(var c=0;c<j.length;c++){var g=this.pull[j[c]];if(this._scheme_serialize){g=this._scheme_serialize(g);if(g===false){continue}}a.push(g)}return a},_sort:{_create:function(a){return this._dir(a.dir,this._by(a.by,a.as))},_as:{date:function(g,c){g=g-0;c=c-0;return g>c?1:(g<c?-1:0)},"int":function(g,c){g=g*1;c=c*1;return g>c?1:(g<c?-1:0)},string_strict:function(g,c){g=g.toString();c=c.toString();return g>c?1:(g<c?-1:0)},string:function(g,c){if(!c){return 1}if(!g){return -1}g=g.toString().toLowerCase();c=c.toString().toLowerCase();return g>c?1:(g<c?-1:0)}},_by:function(c,a){if(!c){return a}if(typeof a!="function"){a=this._as[a||"string"]}dhx.assert(a,"Invalid sorting method");return function(j,g){return a(j[c],g[c])}},_dir:function(c,a){if(c=="asc"||!c){return a}return function(j,g){return a(j,g)*-1}}}};dhx.BaseBind={debug_freid_ignore:{id:true},bind:function(l,j,g){if(typeof l=="string"){l=dhx.ui.get(l)}if(l._initBindSource){l._initBindSource()}if(this._initBindSource){this._initBindSource()}if(!l.getBindData){dhx.extend(l,dhx.BindSource)}if(!this._bind_ready){var m=this.render;if(this.filter){var c=this._settings.id;this.data._on_sync=function(){l._bind_updated[c]=false}}this.render=function(){if(this._in_bind_processing){return}this._in_bind_processing=true;var n=this.callEvent("onBindRequest");this._in_bind_processing=false;return m.apply(this,((n===false)?arguments:[]))};if(this.getValue||this.getValues){this.save=function(){if(this.validate&&!this.validate()){return}l.setBindData((this.getValue?this.getValue:this.getValues()),this._settings.id)}}this._bind_ready=true}l.addBind(this._settings.id,j,g);if(dhx.debug_bind){dhx.log("[bind] "+this.name+"@"+this._settings.id+" <= "+l.name+"@"+l._settings.id)}var a=this._settings.id;this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return l.getBindData(a)});if(!this._settings.dataFeed&&this.loadNext){this.data.attachEvent("onStoreLoad",function(){l._bind_updated[a]=false})}if(this.isVisible(this._settings.id)){this.refresh()}},unbind:function(a){return this._unbind(a)},_unbind:function(g){g.removeBind(this._settings.id);var c=(this._sync_events||(this.data?this.data._sync_events:0));if(c&&g.data){for(var a=0;a<c.length;a++){g.data.detachEvent(c[a])}}}};dhx.BindSource={$init:function(){this._bind_hash={};this._bind_updated={};this._ignore_binds={};this._bind_specific_rules(this)},saveBatch:function(a){this._do_not_update_binds=true;a.call(this);this._do_not_update_binds=false;this._update_binds()},setBindData:function(c,a){if(a){this._ignore_binds[a]=true}if(dhx.debug_bind){dhx.log("[bind:save] "+this.name+"@"+this._settings.id+" <= @"+a)}if(this.setValue){this.setValue(c)}else{if(this.setValues){this.setValues(c)}else{var g=this.getCursor();if(g){c=dhx.extend(this.item(g),c,true);this.update(g,c)}}}this.callEvent("onBindUpdate",[c,a]);if(this.save){this.save()}if(a){this._ignore_binds[a]=false}},getBindData:function(a,g){if(this._bind_updated[a]){return false}var c=dhx.ui.get(a);if(c.isVisible(c._settings.id)){this._bind_updated[a]=true;if(dhx.debug_bind){dhx.log("[bind:request] "+this.name+"@"+this._settings.id+" => "+c.name+"@"+c._settings.id)}this._bind_update(c,this._bind_hash[a][0],this._bind_hash[a][1]);if(g&&c.filter){c.refresh()}}},addBind:function(a,g,c){this._bind_hash[a]=[g,c]},removeBind:function(a){delete this._bind_hash[a];delete this._bind_updated[a];delete this._ignore_binds[a]},_bind_specific_rules:function(a){if(a.filter){dhx.extend(this,dhx.CollectionBind)}else{if(a.setValue){dhx.extend(this,dhx.ValueBind)}else{dhx.extend(this,dhx.RecordBind)}}},_update_binds:function(){if(!this._do_not_update_binds){for(var a in this._bind_hash){if(this._ignore_binds[a]){continue}this._bind_updated[a]=false;this.getBindData(a,true)}}},_bind_update_common:function(g,c,a){if(g.setValue){g.setValue(a?a[c]:a)}else{if(!g.filter){if(!a&&g.clear){g.clear()}else{if(g._check_data_feed(a)){g.setValues(dhx.clone(a))}}}else{g.data.silent(function(){this.filter(c,a)})}}g.callEvent("onBindApply",[a,c,this])}};dhx.DataValue=dhx.proto({name:"DataValue",isVisible:function(){return true},$init:function(a){this.data=""||a;var c=(a&&a.id)?a.id:dhx.uid();this._settings={id:c};dhx.ui.views[c]=this},setValue:function(a){this.data=a;this.callEvent("onChange",[a])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);dhx.DataRecord=dhx.proto({name:"DataRecord",isVisible:function(){return true},$init:function(a){this.data=a||{};var c=(a&&a.id)?a.id:dhx.uid();this._settings={id:c};dhx.ui.views[c]=this},getValues:function(){return this.data},setValues:function(a){this.data=a;this.callEvent("onChange",[a])},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind,dhx.AtomDataLoader,dhx.Settings);dhx.DataCollection=dhx.proto({name:"DataCollection",isVisible:function(){if(!this.data.order.length&&!this.data._filter_order&&!this._settings.dataFeed){return false}return true},$init:function(a){this.data.provideApi(this,true);var c=(a&&a.id)?a.id:dhx.uid();this._settings.id=c;dhx.ui.views[c]=this;this.data.attachEvent("onStoreLoad",dhx.bind(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},dhx.DataLoader,dhx.EventSystem,dhx.BaseBind,dhx.Settings);dhx.ValueBind={$init:function(){this.attachEvent("onChange",this._update_binds)},_bind_update:function(l,j,g){var c=this.getValue()||"";if(g){c=g(c)}if(l.setValue){l.setValue(c)}else{if(!l.filter){var a={};a[j]=c;if(l._check_data_feed(c)){l.setValues(a)}}else{l.data.silent(function(){this.filter(j,c)})}}l.callEvent("onBindApply",[c,j,this])}};dhx.RecordBind={$init:function(){this.attachEvent("onChange",this._update_binds)},_bind_update:function(g,c){var a=this.getValues()||null;this._bind_update_common(g,c,a)}};dhx.CollectionBind={$init:function(){this._cursor=null;this.attachEvent("onSelectChange",function(c){var a=this.getSelected();this.setCursor(a?(a.id||a):null)});this.attachEvent("onAfterCursorChange",this._update_binds);this.data.attachEvent("onStoreUpdated",dhx.bind(function(g,a,c){if(g&&g==this.getCursor()&&c!="paint"){this._update_binds()}},this));this.data.attachEvent("onClearAll",dhx.bind(function(){this._cursor=null},this));this.data.attachEvent("onIdChange",dhx.bind(function(c,a){if(this._cursor==c){this._cursor=a}},this))},setCursor:function(a){if(a==this._cursor||(a!==null&&!this.item(a))){return}this.callEvent("onBeforeCursorChange",[this._cursor]);this._cursor=a;this.callEvent("onAfterCursorChange",[a])},getCursor:function(){return this._cursor},_bind_update:function(g,c){var a=this.item(this.getCursor())||this._settings.defaultData||null;this._bind_update_common(g,c,a)}};if(!dhx.ui){dhx.ui={}}if(!dhx.ui.views){dhx.ui.views={};dhx.ui.get=function(a){if(a._settings){return a}return dhx.ui.views[a]}}dhtmlXDataStore=function(c){var g=new dhx.DataCollection(c);var a="_dp_init";g[a]=function(l){var j="_methods";l[j]=["dummy","dummy","changeId","dummy"];this.data._old_names={add:"inserted",update:"updated","delete":"deleted"};this.data.attachEvent("onStoreUpdated",function(o,m,n){if(o&&!l._silent){l.setUpdated(o,true,this._old_names[n])}});j="_getRowData";l[j]=function(r,m){var o=this.obj.data.item(r);var q={id:r};q[this.action_param]=this.obj.getUserData(r);if(o){for(var n in o){q[n]=o[n]}}return q};this.changeId=function(n,m){this.data.changeId(n,m);l._silent=true;this.data.callEvent("onStoreUpdated",[m,this.item(m),"update"]);l._silent=false};j="_clearUpdateFlag";l[j]=function(){};this._userdata={}};g.dummy=function(){};g.setUserData=function(m,j,l){this._userdata[m]=l};g.getUserData=function(l,j){return this._userdata[l]};g.dataFeed=function(j){this.define("dataFeed",j)};dhx.extend(g,dhx.BindSource);return g};if(window.dhtmlXDataView){dhtmlXDataView.prototype._initBindSource=function(){this.isVisible=function(){if(!this.data.order.length&&!this.data._filter_order&&!this._settings.dataFeed){return false}return true};var a="_settings";this._settings=this._settings||this[a];if(!this._settings.id){this._settings.id=dhx.uid()}this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this._settings.id]=this}}if(window.dhtmlXChart){dhtmlXChart.prototype._initBindSource=function(){this.isVisible=function(){if(!this.data.order.length&&!this.data._filtered_state&&!this._settings.dataFeed){return false}return true};var a="_settings";this._settings=this._settings||this[a];if(!this._settings.id){this._settings.id=dhx.uid()}this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this._settings.id]=this}}dhx.BaseBind.unsync=function(a){return dhx.BaseBind._unbind.call(this,a)};dhx.BaseBind.unbind=function(a){return dhx.BaseBind._unbind.call(this,a)};dhx.BaseBind.legacyBind=function(){return dhx.BaseBind.bind.apply(this,arguments)};dhx.BaseBind.legacySync=function(a,c){if(this._initBindSource){this._initBindSource()}if(a._initBindSource){a._initBindSource()}this.attachEvent("onAfterEditStop",function(g){this.save(g);return true});this.attachEvent("onDataRequest",function(l,j){for(var g=l;g<l+j;g++){if(!a.data.order[g]){a.loadNext(j,l);return false}}});this.save=function(m){if(!m){m=this.getCursor()}var l=this.item(m);var g=a.item(m);for(var j in l){if(j.indexOf("$")!==0){g[j]=l[j]}}a.refresh(m)};if(a&&a.name=="DataCollection"){return a.data.sync.apply(this.data,arguments)}else{return this.data.sync.apply(this.data,arguments)}};if(window.dhtmlXForm){dhtmlXForm.prototype.bind=function(a){dhx.BaseBind.bind.apply(this,arguments);a.getBindData(this._settings.id)};dhtmlXForm.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXForm.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this}};dhtmlXForm.prototype._check_data_feed=function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.load(a);return false};dhtmlXForm.prototype.setValues=dhtmlXForm.prototype.setFormData;dhtmlXForm.prototype.getValues=function(){return this.getFormData(false,true)};dhtmlXForm.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXForm.prototype.refresh=dhtmlXForm.prototype.isVisible=function(a){return true}}if(window.scheduler){if(!window.Scheduler){window.Scheduler={}}Scheduler.$syncFactory=function(a){a.sync=function(g,l){if(this._initBindSource){this._initBindSource()}if(g._initBindSource){g._initBindSource()}var j="_process_loading";var c=function(r){a.clearAll();var m=g.data.order;var q=g.data.pull;var n=[];for(var o=0;o<m.length;o++){if(l&&l.copy){n[o]=dhx.clone(q[m[o]])}else{n[o]=q[m[o]]}}a[j](n);a.callEvent("onSyncApply",[])};this.save=function(o){if(!o){o=this.getCursor()}var n=this.item(o);var m=g.item(o);if(this.callEvent("onStoreSave",[o,n,m])){dhx.extend(g.item(o),n,true);g.update(o)}};this.item=function(m){return this.getEvent(m)};this._sync_events=[g.data.attachEvent("onStoreUpdated",function(o,m,n){c.call(this)}),g.data.attachEvent("onIdChange",function(n,m){combo.changeOptionId(n,m)})];this.attachEvent("onEventChanged",function(m){this.save(m)});this.attachEvent("onEventAdded",function(n,m){if(!g.data.pull[n]){g.add(m)}});this.attachEvent("onEventDeleted",function(m){if(g.data.pull[m]){g.remove(m)}});c()};a.unsync=function(c){dhx.BaseBind._unbind.call(this,c)};a._initBindSource=function(){if(!this._settings){this._settings={id:dhx.uid()}}}};Scheduler.$syncFactory(window.scheduler)}if(window.dhtmlXCombo){dhtmlXCombo.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXCombo.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXCombo.unsync=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXCombo.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXCombo.prototype.sync=function(c,j){if(this._initBindSource){this._initBindSource()}if(c._initBindSource){c._initBindSource()}var g=this;var a=function(l){g.clearAll();g.addOption(this.serialize());g.callEvent("onSyncApply",[])};this._sync_events=[c.data.attachEvent("onStoreUpdated",function(n,l,m){a.call(this)}),c.data.attachEvent("onIdChange",function(m,l){g.changeOptionId(m,l)})];a.call(c)};dhtmlXCombo.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhx4._eventable(this.data);this.attachEvent("onChange",function(){this.callEvent("onSelectChange",[this.getSelectedValue()])});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}};dhtmlXCombo.prototype.item=function(a){return this.getOption(a)};dhtmlXCombo.prototype.getSelected=function(){return this.getSelectedValue()};dhtmlXCombo.prototype.isVisible=function(){if(!this.optionsArr.length&&!this._settings.dataFeed){return false}return true};dhtmlXCombo.prototype.refresh=function(){this.render(true)}}if(window.dhtmlXGridObject){dhtmlXGridObject.prototype.bind=function(a,g,c){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXGridObject.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXGridObject.prototype.unsync=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXGridObject.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXGridObject.prototype.sync=function(a,q){if(this._initBindSource){this._initBindSource()}if(a._initBindSource){a._initBindSource()}var c=this;var o="_parsing";var g="_parser";var m="_locator";var j="_process_store_row";var n="_get_store_data";this.save=function(r){if(!r){r=this.getCursor()}dhx.extend(a.item(r),this.item(r),true);a.update(r)};var l=function(x){var u=c.getCursor?c.getCursor():null;var w=0;if(c._legacy_ignore_next){w=c._legacy_ignore_next;c._legacy_ignore_next=false}else{c.clearAll()}var s=this.dataCount();if(s){c[o]=true;for(var r=w;r<s;r++){var v=this.order[r];if(!v){continue}if(w&&c.rowsBuffer[r]){continue}c.rowsBuffer[r]={idd:v,data:this.pull[v]};c.rowsBuffer[r][g]=c[j];c.rowsBuffer[r][m]=c[n];c.rowsAr[v]=this.pull[v]}if(!c.rowsBuffer[s-1]){c.rowsBuffer[s-1]=dhtmlx.undefined;c.xmlFileUrl=c.xmlFileUrl||this.url}if(c.pagingOn){c.changePage()}else{if(c._srnd&&c._fillers){c._update_srnd_view()}else{c.render_dataset();c.callEvent("onXLE",[])}}c[o]=false}if(u&&c.setCursor){c.setCursor(c.rowsAr[u]?u:null)}c.callEvent("onSyncApply",[])};this._sync_events=[a.data.attachEvent("onStoreUpdated",function(u,r,s){if(s=="delete"){c.deleteRow(u);c.data.callEvent("onStoreUpdated",[u,r,s])}else{if(s=="update"){c.callEvent("onSyncUpdate",[r,s]);c.update(u,r);c.data.callEvent("onStoreUpdated",[u,r,s])}else{if(s=="add"){c.callEvent("onSyncUpdate",[r,s]);c.add(u,r,this.indexById(u));c.data.callEvent("onStoreUpdated",[u,r,s])}else{l.call(this)}}}}),a.data.attachEvent("onStoreLoad",function(s,r){c.xmlFileUrl=a.data.url;c._legacy_ignore_next=s.getInfo(r)._from}),a.data.attachEvent("onIdChange",function(s,r){c.changeRowId(s,r)})];c.attachEvent("onDynXLS",function(u,s){for(var r=u;r<u+s;r++){if(!a.data.order[r]){a.loadNext(s,u);return false}}c._legacy_ignore_next=u;l.call(a.data)});l.call(a.data);c.attachEvent("onEditCell",function(r,w,u,s,v){if(r==2&&s!=v){this.save(w)}return true});c.attachEvent("onClearAll",function(){var r="_f_rowsBuffer";this[r]=null});if(q&&q.sort){c.attachEvent("onBeforeSorting",function(u,s,r){if(s=="connector"){return false}var v=this.getColumnId(u);a.sort("#"+v+"#",(r=="asc"?"asc":"desc"),(s=="int"?s:"string"));c.setSortImgState(true,u,r);return false})}if(q&&q.filter){c.attachEvent("onFilterStart",function(u,r){var s="_con_f_used";if(c[s]&&c[s].length){return false}a.data.silent(function(){a.filter();for(var v=0;v<u.length;v++){if(r[v]==""){continue}var w=c.getColumnId(u[v]);a.filter("#"+w+"#",r[v],v!=0)}});a.refresh();return false});c.collectValues=function(r){var s=this.getColumnId(r);return(function(w){var u=[];var v={};this.data.each(function(y){var x=y[w];if(!v[x]){v[x]=true;u.push(x)}});u.sort();return u}).call(a,s)}}if(q&&q.select){c.attachEvent("onRowSelect",function(r){a.setCursor(r)})}c.clearAndLoad=function(r){a.clearAll();a.load(r)}};dhtmlXGridObject.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(g){g.call(this)},this)};dhx4._eventable(this.data);var a="_cCount";for(var c=0;c<this[a];c++){if(!this.columnIds[c]){this.columnIds[c]="cell"+c}}this.attachEvent("onSelectStateChanged",function(g){this.callEvent("onSelectChange",[g])});this.attachEvent("onSelectionCleared",function(){this.callEvent("onSelectChange",[null])});this.attachEvent("onEditCell",function(g,j){if(g===2&&this.getCursor){if(j&&j==this.getCursor()){this._update_binds()}}return true});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}};dhtmlXGridObject.prototype.item=function(m){if(m===null){return null}var l=this.getRowById(m);if(!l){return null}var a="_attrs";var j=dhx.copy(l[a]);j.id=m;var g=this.getColumnsNum();for(var c=0;c<g;c++){j[this.columnIds[c]]=this.cells(m,c).getValue()}return j};dhtmlXGridObject.prototype.update=function(m,l){for(var j=0;j<this.columnIds.length;j++){var g=this.columnIds[j];if(!dhx.isUndefined(l[g])){this.cells(m,j).setValue(l[g])}}var c="_attrs";var a=this.getRowById(m)[c];for(var g in l){a[g]=l[g]}this.callEvent("onBindUpdate",[m])};dhtmlXGridObject.prototype.add=function(n,m,g){var a=[];for(var l=0;l<this.columnIds.length;l++){var j=this.columnIds[l];a[l]=dhx.isUndefined(m[j])?"":m[j]}this.addRow(n,a,g);var c="_attrs";this.getRowById(n)[c]=dhx.copy(m)};dhtmlXGridObject.prototype.getSelected=function(){return this.getSelectedRowId()};dhtmlXGridObject.prototype.isVisible=function(){var a="_f_rowsBuffer";if(!this.rowsBuffer.length&&!this[a]&&!this._settings.dataFeed){return false}return true};dhtmlXGridObject.prototype.refresh=function(){this.render_dataset()};dhtmlXGridObject.prototype.filter=function(m,l){if(this._settings.dataFeed){var j={};if(!m&&!l){return}if(typeof m=="function"){if(!l){return}m(l,j)}else{if(dhx.isUndefined(m)){j=l}else{j[m]=l}}this.clearAll();var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,l,j)}var g=[];for(var c in j){g.push("dhx_filter["+c+"]="+encodeURIComponent(j[c]))}this.load(a+(a.indexOf("?")<0?"?":"&")+g.join("&"));return false}if(l===null){return this.filterBy(0,function(){return false})}this.filterBy(0,function(n,o){return m.call(this,o,l)})}}if(window.dhtmlXTreeObject){dhtmlXTreeObject.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXTreeObject.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXTreeObject.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXTreeObject.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhx4._eventable(this.data);this.attachEvent("onSelect",function(a){this.callEvent("onSelectChange",[a])});this.attachEvent("onEdit",function(a,c){if(a===2){if(c&&c==this.getCursor()){this._update_binds()}}return true})}};dhtmlXTreeObject.prototype.item=function(a){if(a===null){return null}return{id:a,text:this.getItemText(a)}};dhtmlXTreeObject.prototype.getSelected=function(){return this.getSelectedItemId()};dhtmlXTreeObject.prototype.isVisible=function(){return true};dhtmlXTreeObject.prototype.refresh=function(){};dhtmlXTreeObject.prototype.filter=function(m,l){if(this._settings.dataFeed){var j={};if(!m&&!l){return}if(typeof m=="function"){if(!l){return}m(l,j)}else{if(dhx.isUndefined(m)){j=l}else{j[m]=l}}this.deleteChildItems(0);var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,[(data.id||data),data])}var g=[];for(var c in j){g.push("dhx_filter["+c+"]="+encodeURIComponent(j[c]))}this.loadXML(a+(a.indexOf("?")<0?"?":"&")+g.join("&"));return false}};dhtmlXTreeObject.prototype.update=function(c,a){if(!dhx.isUndefined(a.text)){this.setItemText(c,a.text)}}}function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=true;this.updateMode="cell";this._tMode="GET";this._headers=null;this._payload=null;this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"};this.enableUTFencoding(true);dhx4._eventable(this);return this}dataProcessor.prototype={setTransactionMode:function(c,a){if(typeof c=="object"){this._tMode=c.mode||this._tMode;this._headers=this._headers||c.headers;this._payload=this._payload||c.payload}else{this._tMode=c;this._tSend=a}if(this._tMode=="REST"){this._tSend=false;this._endnm=true}},escape:function(a){if(this._utf){return encodeURIComponent(a)}else{return escape(a)}},enableUTFencoding:function(a){this._utf=dhx4.s2b(a)},setDataColumns:function(a){this._columns=(typeof a=="string")?a.split(","):a},getSyncState:function(){return !this.updatedRows.length},enableDataNames:function(a){this._endnm=dhx4.s2b(a)},enablePartialDataSend:function(a){this._changed=dhx4.s2b(a)},setUpdateMode:function(c,a){this.autoUpdate=(c=="cell");this.updateMode=c;this.dnd=a},ignore:function(c,a){this._silent_mode=true;c.call(a||window);this._silent_mode=false},setUpdated:function(j,g,l){if(this._silent_mode){return}var c=this.findRow(j);l=l||"updated";var a=this.obj.getUserData(j,this.action_param);if(a&&l=="updated"){l=a}if(g){this.set_invalid(j,false);this.updatedRows[c]=j;this.obj.setUserData(j,this.action_param,l);if(this._in_progress[j]){this._in_progress[j]="wait"}}else{if(!this.is_invalid(j)){this.updatedRows.splice(c,1);this.obj.setUserData(j,this.action_param,"")}}if(!g){this._clearUpdateFlag(j)}this.markRow(j,g,l);if(g&&this.autoUpdate){this.sendData(j)}},_clearUpdateFlag:function(a){},markRow:function(m,g,l){var j="";var c=this.is_invalid(m);if(c){j=this.styles[c];g=true}if(this.callEvent("onRowMark",[m,g,l,c])){j=this.styles[g?l:"clear"]+j;this.obj[this._methods[0]](m,j);if(c&&c.details){j+=this.styles[c+"_cell"];for(var a=0;a<c.details.length;a++){if(c.details[a]){this.obj[this._methods[1]](m,a,j)}}}}},getState:function(a){return this.obj.getUserData(a,this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(g,c,a){if(a){c={value:c,details:a,toString:function(){return this.value.toString()}}}this._invalid[g]=c},checkBeforeUpdate:function(a){return true},sendData:function(a){if(this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)){return}if(this.obj.editStop){this.obj.editStop()}if(typeof a=="undefined"||this._tSend){return this.sendAllData()}if(this._in_progress[a]){return false}this.messages=[];if(this.getState(a)!=="deleted"){if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidationError",[a,this.messages])){return false}}this._beforeSendData(this._getRowData(a),a)},_beforeSendData:function(a,c){if(!this.callEvent("onBeforeUpdate",[c,this.getState(c),a])){return false}this._sendData(a,c)},serialize:function(j,l){if(typeof j=="string"){return j}if(typeof l!="undefined"){return this.serialize_one(j,"")}else{var a=[];var g=[];for(var c in j){if(j.hasOwnProperty(c)){a.push(this.serialize_one(j[c],c+this.post_delim));g.push(c)}}a.push("ids="+this.escape(g.join(",")));if(dhtmlx.security_key){a.push("dhx_security="+dhtmlx.security_key)}return a.join("&")}},serialize_one:function(j,c){if(typeof j=="string"){return j}var a=[];for(var g in j){if(j.hasOwnProperty(g)){if((g=="id"||g==this.action_param)&&this._tMode=="REST"){continue}a.push(this.escape((c||"")+g)+"="+this.escape(j[g]))}}return a.join("&")},_sendData:function(l,m){if(!l){return}if(!this.callEvent("onBeforeDataSending",m?[m,this.getState(m),l]:[null,null,l])){return false}if(m){this._in_progress[m]=(new Date()).valueOf()}var r=this;var q=function(u){var w=[];if(m){w.push(m)}else{if(l){for(var v in l){w.push(v)}}}return r.afterUpdate(r,u,w)};var c=this.serverProcessor+(this._user?(dhtmlx.url(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");if(this._tMode=="GET"){dhx4.ajax.get(c+((c.indexOf("?")!=-1)?"&":"?")+this.serialize(l,m),q)}else{if(this._tMode=="POST"){dhx4.ajax.post(c,this.serialize(l,m),q)}else{if(this._tMode=="REST"){var g=this.getState(m);var j=c.replace(/(\&|\?)editing\=true/,"");var n=j.split("?");if(n[1]){n[1]="?"+n[1]}var o="";var a="post";if(g=="inserted"){o=this.serialize(l,m)}else{if(g=="deleted"){a="DELETE";j=n[0]+m+n[1]}else{a="PUT";o=this.serialize(l,m);j=n[0]+m+n[1]}}if(this._payload){for(var s in this._payload){j=j+(j.indexOf("?")===-1?"?":"&")+this.escape(s)+"="+this.escape(this._payload[s])}}dhx4.ajax.query({url:j,method:a,headers:this._headers,data:o,callback:q})}}}this._waitMode++},sendAllData:function(){if(!this.updatedRows.length){return}this.messages=[];var c=true;for(var a=0;a<this.updatedRows.length;a++){if(this.getState(this.updatedRows[a])!=="deleted"){c&=this.checkBeforeUpdate(this.updatedRows[a])}}if(!c&&!this.callEvent("onValidationError",["",this.messages])){return false}if(this._tSend){this._sendData(this._getAllData())}else{for(var a=0;a<this.updatedRows.length;a++){if(!this._in_progress[this.updatedRows[a]]){if(this.is_invalid(this.updatedRows[a])){continue}this._beforeSendData(this._getRowData(this.updatedRows[a]),this.updatedRows[a]);if(this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)){return}}}}},_getAllData:function(j){var c={};var a=false;for(var g=0;g<this.updatedRows.length;g++){var l=this.updatedRows[g];if(this._in_progress[l]||this.is_invalid(l)){continue}if(!this.callEvent("onBeforeUpdate",[l,this.getState(l),this._getRowData(l)])){continue}c[l]=this._getRowData(l,l+this.post_delim);a=true;this._in_progress[l]=(new Date()).valueOf()}return a?c:null},setVerificator:function(c,a){this.mandatoryFields[c]=a||(function(g){return(g!=="")})},clearVerificator:function(a){this.mandatoryFields[a]=false},findRow:function(c){var a=0;for(a=0;a<this.updatedRows.length;a++){if(c==this.updatedRows[a]){break}}return a},defineAction:function(a,c){if(!this._uActions){this._uActions=[]}this._uActions[a]=c},afterUpdateCallback:function(c,n,m,l){var a=c;var j=(m!="error"&&m!="invalid");if(!j){this.set_invalid(c,m)}if((this._uActions)&&(this._uActions[m])&&(!this._uActions[m](l))){return(delete this._in_progress[a])}if(this._in_progress[a]!="wait"){this.setUpdated(c,false)}var g=c;switch(m){case"inserted":case"insert":if(n!=c){this.obj[this._methods[2]](c,n);c=n}break;case"delete":case"deleted":this.obj.setUserData(c,this.action_param,"true_deleted");this.obj[this._methods[3]](c);delete this._in_progress[a];return this.callEvent("onAfterUpdate",[c,m,n,l]);break}if(this._in_progress[a]!="wait"){if(j){this.obj.setUserData(c,this.action_param,"")}delete this._in_progress[a]}else{delete this._in_progress[a];this.setUpdated(n,true,this.obj.getUserData(c,this.action_param))}this.callEvent("onAfterUpdate",[g,m,n,l])},afterUpdate:function(o,n,a){if(window.JSON){try{var u=JSON.parse(n.xmlDoc.responseText);var j=u.action||this.getState(a)||"updated";var c=u.sid||a[0];var g=u.tid||a[0];o.afterUpdateCallback(c,g,j,u);o.finalizeUpdate();return}catch(q){}}var s=dhx4.ajax.xmltop("data",n.xmlDoc);if(!s||s.tagName=="DIV"){return this.cleanUpdate(a)}var r=dhx4.ajax.xpath("//data/action",s);if(!r.length){return this.cleanUpdate(a)}for(var m=0;m<r.length;m++){var l=r[m];var j=l.getAttribute("type");var c=l.getAttribute("sid");var g=l.getAttribute("tid");o.afterUpdateCallback(c,g,j,l)}o.finalizeUpdate()},cleanUpdate:function(c){if(c){for(var a=0;a<c.length;a++){delete this._in_progress[c[a]]}}},finalizeUpdate:function(){if(this._waitMode){this._waitMode--}if((this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length){this.sendData()}this.callEvent("onAfterUpdateFinish",[]);if(!this.updatedRows.length){this.callEvent("onFullSync",[])}},init:function(a){this.obj=a;if(this.obj._dp_init){this.obj._dp_init(this)}},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(a){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(g,c){g=g||2000;this._user=c||(new Date()).valueOf();this._need_update=false;this._loader=null;this._update_busy=false;this.attachEvent("onAfterUpdate",function(j,m,n,l){this.afterAutoUpdate(j,m,n,l)});this.attachEvent("onFullSync",function(){this.fullSync()});var a=this;window.setInterval(function(){a.loadUpdate()},g)},afterAutoUpdate:function(a,g,j,c){if(g=="collision"){this._need_update=true;return false}else{return true}},fullSync:function(){if(this._need_update==true){this._need_update=false;this.loadUpdate()}return true},getUpdates:function(a,c){if(this._update_busy){return false}else{this._update_busy=true}this._loader=this._loader||new dtmlXMLLoaderObject(true);this._loader.async=true;this._loader.waitCall=c;this._loader.loadXML(a)},_v:function(a){if(a.firstChild){return a.firstChild.nodeValue}return""},_a:function(a){var g=[];for(var c=0;c<a.length;c++){g[c]=this._v(a[c])}return g},loadUpdate:function(){var c=this;var a=this.obj.getUserData(0,"version");var g=this.serverProcessor+dhtmlx.url(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+a].join("&");g=g.replace("editing=true&","");this.getUpdates(g,function(){var m=c._loader.doXPath("//userdata");c.obj.setUserData(0,"version",c._v(m[0]));var j=c._loader.doXPath("//update");if(j.length){c._silent_mode=true;for(var n=0;n<j.length;n++){var l=j[n].getAttribute("status");var q=j[n].getAttribute("id");var o=j[n].getAttribute("parent");switch(l){case"inserted":c.callEvent("insertCallback",[j[n],q,o]);break;case"updated":c.callEvent("updateCallback",[j[n],q,o]);break;case"deleted":c.callEvent("deleteCallback",[j[n],q,o]);break}}c._silent_mode=false}c._update_busy=false;c=null})}};if(window.dataProcessor&&!dataProcessor.prototype.init_original){dataProcessor.prototype.init_original=dataProcessor.prototype.init;dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",true);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"}};
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/dhtmlx_deprecated.js b/portal/static/unbound_reservation_static/lib/dhtmlx_deprecated.js
new file mode 100644 (file)
index 0000000..04bd530
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Product Name: dhtmlxSuite 
+Version: 4.2 
+Edition: Standard 
+License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
+Copyright UAB Dinamenta http://www.dhtmlx.com
+*/
+
+dhtmlXCalendarObject.prototype.draw=function(){this.show()};dhtmlXCalendarObject.prototype.close=function(){this.hide()};dhtmlXCalendarObject.prototype.setYearsRange=function(){};dhtmlXCombo.prototype.loadXML=function(a,b){this.load(a,b)};dhtmlXCombo.prototype.loadXMLString=function(a){this.load(a)};dhtmlXCombo.prototype.enableOptionAutoHeight=function(){};dhtmlXCombo.prototype.enableOptionAutoPositioning=function(){};dhtmlXCombo.prototype.enableOptionAutoWidth=function(){};dhtmlXCombo.prototype.destructor=function(){this.unload()};dhtmlXCombo.prototype.render=function(){};dhtmlXCombo.prototype.setOptionHeight=function(){};dhtmlXCombo.prototype.attachChildCombo=function(){};dhtmlXCombo.prototype.setAutoSubCombo=function(){};window.dhtmlXColorPickerInput=function(){return dhtmlXColorPicker.apply(window,arguments)};dhtmlXColorPicker.prototype.init=function(){};dhtmlXColorPicker.prototype.setOnSelectHandler=function(a){if(typeof a=="function"){this.attachEvent("onSelect",a)}};dhtmlXColorPicker.prototype.setOnCancelHandler=function(a){if(typeof a=="function"){this.attachEvent("onCancel",a)}};dhtmlXColorPicker.prototype._mergeLangModules=function(){if(typeof dhtmlxColorPickerLangModules!="object"){return}for(var a in dhtmlxColorPickerLangModules){this.i18n[a]=dhtmlxColorPickerLangModules[a]}};window.dhtmlxColorPickerLangModules=dhtmlXColorPicker.prototype.i18n;dhtmlXColorPicker.prototype.close=function(){this.hide()};dhtmlXColorPicker.prototype.setImagePath=function(a){};dhtmlXMenuObject.prototype.loadXML=function(a,b){this.loadStruct(a,b)};dhtmlXMenuObject.prototype.loadXMLString=function(b,a){this.loadStruct(b,a)};dhtmlXMenuObject.prototype.setIconPath=function(a){this.setIconsPath(a)};dhtmlXMenuObject.prototype.setImagePath=function(){};dhtmlXToolbarObject.prototype.loadXML=function(a,b){this.loadStruct(a,b)};dhtmlXToolbarObject.prototype.loadXMLString=function(b,a){this.loadStruct(b,a)};dhtmlXToolbarObject.prototype.setIconPath=function(a){this.setIconsPath(a)};dhtmlXTreeObject.prototype.addPath=function(b,e,c,h){this.activatePaths();c=c||{};var d=[];var g=null;var f=this._idpull[e];var a=this._idpull[b];while(a!=g){d.push({open:this._getOpenState(f),from:f.id,size:(g?this._getIndex(g):0),to:(g?g.id:null),style:"border-left:"+(c.width||1)+"px "+(c.mode||"solid")+" "+(c.color||"red")+"; border-bottom:"+(c.width||1)+"px "+(c.mode||"solid")+" "+(c.color||"red")+";"});g=f;f=f.parentObject}while(!h||this._pathspull[h]){h=(h||0)+1}this._pathspull[h]={path:d,id:h};this._paths.push(this._pathspull[h]);this._renderPath(this._pathspull[h])};dhtmlXTreeObject.prototype.activatePaths=function(a){var b=this;this.attachEvent("onOpenEnd",function(){for(var c=0;c<b._paths.length;c++){b._clearPath(b._paths[c]);b._renderPath(b._paths[c])}});this.attachEvent("onXLE",function(e){var d=dhx4.ajax.xpath("//pathend",e);var h=dhx4.ajax.xpath("//pathstart",e);var g={};for(var f=0;f<h.length;f++){g[h[f].getAttribute("id")]=h[f]}for(var f=0;f<h.length;f++){var c=d[f].parentNode;var j=g[d[f].getAttribute("id")];this.addPath(j.parentNode.getAttribute("id"),c.getAttribute("id"),{color:j.getAttribute("color"),mode:j.getAttribute("mode"),width:j.getAttribute("width")},j.getAttribute("id"))}});if(a){this._halfHeight=a}else{if(this._idpull[0].childsCount){this._halfHeight=Math.floor(this._idpull[0].childNodes[0].span.parentNode.offsetHeight/2)}}if(!this._halfHeight){this._halfHeight=9}this.activatePaths=function(){}};dhtmlXTreeObject.prototype._clearPath=function(c){for(var b=c.path.length-1;b>0;b--){var a=c.path[b];if(a._html){a._html.parentNode.removeChild(a._html)}a._html=null}};dhtmlXTreeObject.prototype._renderPath=function(g){var k=this._idpull[g.path[g.path.length-1].from].span.parentNode.parentNode;var f=(_isIE?9:8)+this._halfHeight;var e=(_isIE?27:27);while(k.offsetParent!=this.allTree){f+=k.offsetTop;e+=k.offsetLeft;k=k.offsetParent}for(var b=g.path.length-1;b>0;b--){var a=g.path[b];var h=document.createElement("div");if(!this._idpull[a.to].tr.offsetHeight){return}var j=this._idpull[a.to].tr.offsetTop;h.style.cssText="position:absolute; z-index:1; width:"+(_isIE?10:8)+"px; height:"+(j-9)+"px; left:"+e+"px; top:"+f+"px;"+a.style;f+=j;e+=18;this.allTree.appendChild(h);a._html=h}};dhtmlXTreeObject.prototype.deletePath=function(c){var b=this._pathspull[c];if(b){this._clearPath(b);delete this._pathspull[c];for(var a=0;a<this._paths.length;a++){if(this._paths[a]==b){return this._paths.splice(a,1)}}}};dhtmlXTreeObject.prototype.deleteAllPaths=function(b){for(var a=this._paths.length-1;a>=0;a--){this.deletePath(this._paths[a].id)}};dhtmlXTreeObject.prototype._paths=[];dhtmlXTreeObject.prototype._pathspull={};dhtmlXTreeObject.prototype.enableSmartRendering=function(){this.enableSmartXMLParsing(true);this._srnd=true;this.itemHeight=18;var a=this;this.allTree.onscroll=function(){if(a._srndT){return}a._srndT=window.setTimeout(function(){a._srndT=null;a._renderState()},300)};this.attachEvent("onXLE",function(){a._renderState()});this._singleTimeSRND()};dhtmlXTreeObject.prototype._renderState=function(){if(!this._idpull[this.rootId]._sready){this.prepareSR(this.rootId,true)}var b=this.allTree.scrollTop;var c=Math.floor(b/this.itemHeight);var a=Math.ceil(this.allTree.offsetHeight/this.itemHeight);this._group_render=true;this._getItemByPos(b,this.itemHeight,a,null,false,this._renderItemSRND);this._group_render=false};dhtmlXTreeObject.prototype._renderItemSRND=function(k,j){if(!k.span){k.span=-1;var f=k.parentObject.htmlNode.childNodes[0].childNodes;var e=j*this.itemHeight;var l=null;for(var c=1;c<f.length;c++){l=f[c];var g=l.nodem?this.itemHeight:(l.offsetHeight||parseInt(l.childNodes[1].firstChild.style.height));e-=g;if(e<0){if(e==-1){e++;continue}var d=l.childNodes[1].firstChild;d.style.height=(parseInt(d.style.height)-(g-Math.abs(e)+this.itemHeight))+"px";if(Math.abs(e)!=g){var n=this._drawNewHolder(e+g,true);l.parentNode.insertBefore(n,l)}l.tr={nextSibling:l};break}}if(d&&d.style.height!="0px"&&!l.offsetHeight){var m=this._hAdI;this._hAdI=true}this._parseItem(k._sxml,k.parentObject,null,l);if(d&&d.style.height!="0px"&&!l.offsetHeight){this._hAdI=m}if(k.unParsed){this._correctPlus(k)}if(d&&d.style.height=="0px"){l.parentNode.removeChild(l)}}};dhtmlXTreeObject.prototype._buildSRND=function(b,a){if(b.parentObject){this._globalIdStorageFind(b.parentObject.id)}if(!this._idpull[this.rootId]._sready){this.prepareSR(this.rootId,true)}this._renderItemSRND(b,this._getIndex(b));if((b.unParsed)&&(!a)){this.reParse(b,0)}if(!b.prepareSR){this.prepareSR(b.id)}};dhtmlXTreeObject.prototype._getIndex=function(c){for(var b=0;b<c.parentObject.childsCount;b++){if(c.parentObject.childNodes[b]==c){return b}}};dhtmlXTreeObject.prototype.prepareSR=function(a,c){a=this._idpull[a];if(a._sready){return}var b=this._drawNewHolder(this.itemHeight*a.childsCount,c);a.htmlNode.childNodes[0].appendChild(b);a._sready=true};dhtmlXTreeObject.prototype._drawNewHolder=function(e,g){var d=document.createElement("TR");var a=document.createElement("TD");var c=document.createElement("TD");var f=document.createElement("DIV");f.innerHTML="&nbsp;";a.appendChild(f);d.appendChild(c);d.appendChild(a);if(!g){d.style.display="none"}f.style.height=e+"px";return d};dhtmlXTreeObject.prototype._getNextNodeSR=function(a,b){if((!b)&&(a.childsCount)){return a.childNodes[0]}if(a==this.htmlNode){return -1}if((a.tr)&&(a.tr.nextSibling)&&(a.tr.nextSibling.nodem)){return a.tr.nextSibling.nodem}return this._getNextNode(a.parentObject,true)};dhtmlXTreeObject.prototype._getItemByPos=function(k,e,b,d,a,g){if(!d){this._pos_c=k;d=this._idpull[this.rootId]}for(var c=0;c<d.childsCount;c++){this._pos_c-=e;if(this._pos_c<=0){a=true}if(a){g.apply(this,[d.childNodes[c],c]);b--}if(b<0){return b}if(d.childNodes[c]._open){b=this._getItemByPos(null,e,b,d.childNodes[c],a,g);if(b<0){return b}}}return b};dhtmlXTreeObject.prototype._addItemSRND=function(b,f,e){var c=this._idpull[b];var a=c.childsCount;var d=c.childNodes;d[a]=new dhtmlXTreeItemObject(f,"",c,this,null,1);itemId=d[a].id;d[a]._sxml=e.clone();c.childsCount++};dhtmlXTreeObject.prototype._singleTimeSRND=function(){this._redrawFrom=function(){};var a=dhtmlXTreeItemObject;this._singleTimeSRND=function(){};window.dhtmlXTreeItemObject=function(g,c,d,b,e,f){if(!b._srnd){return a.call(this,g,c,d,b,e,f)}this.htmlNode="";this.acolor="";this.scolor="";this.tr=0;this.childsCount=0;this.tempDOMM=0;this.tempDOMU=0;this.dragSpan=0;this.dragMove=0;this.span=0;this.closeble=1;this.childNodes=new Array();this.userData=new cObject();this.checkstate=0;this.treeNod=b;this.label=c;this.parentObject=d;this.actionHandler=e;this.images=new Array(b.imageArray[0],b.imageArray[1],b.imageArray[2]);this.id=b._globalIdStorageAdd(g,this);if(g==b.rootId){if(this.treeNod.checkBoxOff){this.htmlNode=this.treeNod._createItem(1,this,f)}else{this.htmlNode=this.treeNod._createItem(0,this,f)}this.htmlNode.objBelong=this}return this};this.setCheckSR=this.setCheck;this.setCheck=function(c,b){this._globalIdStorageFind(c);return this.setCheckSR(c,b)};this._get_srnd_p=function(e){var d=[];while(e!=this.rootId){var b=this.getParentId(e);for(var c=0;c<this._idpull[b].childsCount;c++){if(this._idpull[b].childNodes[c].id==e){d.push([b,c]);break}}e=b}d.reverse();return d};this._get_srnd_p_last=function(f,d,b){d=d||[];var e=0;while(true){var c=this._idpull[f];if(c._sxml&&this.findStrInXML(c._sxml.d,"text",b)){this._globalIdStorageFind(c.id)}var e=c.childsCount;if(!e){break}d.push([f,e-1]);f=c.childNodes[e-1].id}return d};this._get_prev_srnd=function(e,b){var c;if(!e.length){e.push.apply(e,this._get_srnd_p_last(this.rootId,null,b));c=e[e.length-1];return this._idpull[c[0]].childNodes[c[1]]}c=e[e.length-1];if(c[1]){c[1]--;var d=this._idpull[c[0]].childNodes[c[1]];this._get_srnd_p_last(d.id,e,b);var c=e[e.length-1];return this._idpull[c[0]].childNodes[c[1]]}else{e.pop();if(!e.length){return this._get_prev_srnd(e,b)}var c=e[e.length-1];return this._idpull[c[0]].childNodes[c[1]]}};this._get_next_srnd=function(e,c){if(!e.length){e.push([this.rootId,0]);return this._idpull[this.rootId].childNodes[0]}var b=e[e.length-1];var d=this._idpull[b[0]].childNodes[b[1]];if(d.childsCount&&!c){e.push([d.id,0]);return d.childNodes[0]}b[1]++;var d=this._idpull[b[0]].childNodes[b[1]];if(d){return d}e.pop();if(!e.length){return this.htmlNode}return this._get_next_srnd(e,true)};this._findNodeByLabel=function(b,f,d){var b=b.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");b=new RegExp(b.replace(/([\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if(!d){d=this._selected[0];if(!d){d=this.htmlNode}}var c=d;var e=this._get_srnd_p(c.id);while(d=(f?this._get_prev_srnd(e,b):this._get_next_srnd(e))){if(d.label){if(d.label.search(b)!=-1){return d}}else{if(d._sxml){if(d._sxml.get("text").search(b)!=-1){return d}if(this.findStrInXML(d._sxml.d,"text",b)){this._globalIdStorageFind(d.id)}}}if((d.unParsed)&&(this.findStrInXML(d.unParsed.d,"text",b))){this.reParse(d)}if(c.id==d.id){break}if(f&&e.length==1&&e[0][1]==0){break}}return null};this.deleteChildItems=function(b){if(this.rootId==b){this._selected=new Array();this._idpull={};this._p=this._pos_c=this._pullSize=null;this.allTree.removeChild(this.htmlNode.htmlNode);this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree.insertBefore(this.htmlNode.htmlNode,this.selectionBar);if(_isFF){this.allTree.childNodes[0].width="100%";this.allTree.childNodes[0].style.overflow="hidden"}}};this._HideShow=function(c,g){if((this.XMLsource)&&(!c.XMLload)){if(g==1){return}c.XMLload=1;this._loadDynXML(c.id);return}if(!c.span){this._buildSRND(c)}if(c.unParsed){this.reParse(c);this.prepareSR(c.id)}if(c.childsCount==0){return}var f=c.htmlNode.childNodes[0].childNodes;var b=f.length;if(b>1){if(((f[1].style.display!="none")||(g==1))&&(g!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";var e="none";c._open=false}else{var e="";c._open=true}for(var d=1;d<b;d++){f[d].style.display=e}this._renderState()}this._correctPlus(c)}};dhtmlXGridObject.prototype.hidePivot=function(a){if(this._pgridCont){if(this._pgrid){this._pgrid.destructor()}var b=this._pgridCont.parentNode;b.innerHTML="";if(b.parentNode==this.entBox){this.entBox.removeChild(b)}this._pgrid=this._pgridSelect=this._pUNI=this._pgridCont=null}};dhtmlXGridObject.prototype.makePivot=function(j,a){a=a||{};this.hidePivot();if(!j){var j=document.createElement("DIV");j.style.cssText="position:absolute; top:0px; left:0px;background-color:white;";j.style.height=this.entBox.offsetHeight+"px";j.style.width=this.entBox.offsetWidth+"px";if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}this.entBox.appendChild(j)}if(typeof(j)!="object"){j=document.getElementById(j)}if(a.column_list){this._column_list=a.column_list}else{this._column_list=[];for(var g=0;g<this.hdr.rows[1].cells.length;g++){this._column_list.push(this.hdr.rows[1].cells[g][_isIE?"innerText":"textContent"])}}var h=this;j.innerHTML="<table cellspacing='0' cellpadding='0'><tr><td style='width:160px' align='center'></td><td>&nbsp;&nbsp;&nbsp;</td><td></td></tr></table><div></div>";var f=this.makePivotSelect(this._column_list);f.style.width="80px";f.onchange=function(){if(this.value!=-1){h._pivotS.value=this.value}else{h._pivotS.value=""}h._reFillPivotLists();h._renderPivot2()};var e=this.makePivotSelect(this._column_list);e.onchange=function(){if(this.value!=-1){h._pivotS.x=this.value}else{h._pivotS.x=""}h._reFillPivotLists();h._renderPivot()};var d=this.makePivotSelect(this._column_list);d.onchange=function(){if(this.value!=-1){h._pivotS.y=this.value}else{h._pivotS.y=""}h._reFillPivotLists();h._renderPivot()};var c=this.makePivotSelect(["Sum","Min","Max","Average","Count"],-1);c.style.width="70px";c.onchange=function(){if(this.value!=-1){h._pivotS.action=this.value}else{h._pivotS.action=null}h._renderPivot2()};if(a.readonly){f.disabled=e.disabled=d.disabled=c.disabled=true}j.firstChild.rows[0].cells[0].appendChild(c);j.firstChild.rows[0].cells[0].appendChild(f);j.firstChild.rows[0].cells[2].appendChild(e);var b=j.childNodes[1];b.style.width=j.offsetWidth+"px";b.style.height=j.offsetHeight-20+"px";b.style.overflow="hidden";this._pgridCont=b;this._pgridSelect=[f,e,d,c];this._pData=this._fetchPivotData();this._pUNI=[];this._pivotS={action:(a.action||"0"),value:(typeof a.value!="undefined"?(a.value||"0"):null),x:(typeof a.x!="undefined"?(a.x||"0"):null),y:(typeof a.y!="undefined"?(a.y||"0"):null)};f.value=this._pivotS.value;e.value=this._pivotS.x;d.value=this._pivotS.y;c.value=this._pivotS.action;h._reFillPivotLists();this._renderPivot()};dhtmlXGridObject.prototype._fetchPivotData=function(){var e=[];for(var b=0;b<this._cCount;b++){var c=[];for(var a=0;a<this.rowsCol.length;a++){if(this.rowsCol[a]._cntr){continue}c.push(this.cells2(a,b).getValue())}e.push(c)}return e};dhtmlXGridObject.prototype._renderPivot=function(){if(_isIE){this._pgridSelect[2].removeNode(true)}if(this._pgrid){this._pgrid.destructor()}this._pgrid=new dhtmlXGridObject(this._pgridCont);this._pgrid.setImagePath(this.imgURL);this._pgrid.attachEvent("onBeforeSelect",function(){return false});if(this._pivotS.x){var a=this._getUniList(this._pivotS.x);var d=[160];for(var c=0;c<a.length;c++){d.push(100)}a=[""].concat(a);this._pgrid.setHeader(a);this._pgrid.setInitWidths(d.join(","))}else{this._pgrid.setHeader("");this._pgrid.setInitWidths("160")}this._pgrid.init();this._pgrid.setEditable(false);this._pgrid.setSkin(this.entBox.className.replace("gridbox gridbox_",""));var b=this._pgrid.hdr.rows[1].cells[0];if(b.firstChild&&b.firstChild.tagName=="DIV"){b=b.firstChild}b.appendChild(this._pgridSelect[2]);this._pgrid.setSizes();if(this._pivotS.y){var a=this._getUniList(this._pivotS.y);for(var c=0;c<a.length;c++){this._pgrid.addRow(this._pgrid.uid(),[a[c]],-1)}}else{this._pgrid.addRow(1,"not ready",1)}this._renderPivot2()};dhtmlXGridObject.prototype._pivot_action_0=function(n,m,l,d,o,j){var k=0;var g=j[n];var f=j[m];var e=j[l];for(var h=g.length-1;h>=0;h--){if(g[h]==d&&f[h]==o){k+=this.parseFloat(e[h])}}return k};dhtmlXGridObject.prototype._pivot_action_1=function(m,l,k,d,n,j){ret=9999999999;var g=j[m];var f=j[l];var e=j[k];for(var h=g.length-1;h>=0;h--){if(g[h]==d&&f[h]==n){ret=Math.min(this.parseFloat(e[h]),ret)}}if(ret==9999999999){ret=""}return ret};dhtmlXGridObject.prototype._pivot_action_2=function(m,l,k,d,n,j){ret=-9999999999;var g=j[m];var f=j[l];var e=j[k];for(var h=g.length-1;h>=0;h--){if(g[h]==d&&f[h]==n){ret=Math.max(this.parseFloat(e[h]),ret)}}if(ret==-9999999999){ret=""}return ret};dhtmlXGridObject.prototype._pivot_action_3=function(o,n,m,d,p,j){var l=0;var k=0;var g=j[o];var f=j[n];var e=j[m];for(var h=g.length-1;h>=0;h--){if(g[h]==d&&f[h]==p){l+=this.parseFloat(e[h]);k++}}return k?l/k:""};dhtmlXGridObject.prototype._pivot_action_4=function(o,n,m,d,p,j){var l=0;var k=0;var g=j[o];var f=j[n];var e=j[m];for(var h=g.length-1;h>=0;h--){if(g[h]==d&&f[h]==p){l++}}return l};dhtmlXGridObject.prototype.parseFloat=function(a){a=parseFloat(a);if(isNaN(a)){return 0}return a};dhtmlXGridObject.prototype._renderPivot2=function(){if(!(this._pivotS.x&&this._pivotS.y&&this._pivotS.value&&this._pivotS.action)){return}var d=this["_pivot_action_"+this._pivotS.action];var a=this._getUniList(this._pivotS.x);var e=this._getUniList(this._pivotS.y);for(var c=0;c<a.length;c++){for(var b=0;b<e.length;b++){this._pgrid.cells2(b,c+1).setValue(Math.round(d(this._pivotS.x,this._pivotS.y,this._pivotS.value,a[c],e[b],this._pData)*100)/100)}}};dhtmlXGridObject.prototype._getUniList=function(c){if(!this._pUNI[c]){var e={};var b=[];for(var d=this._pData[c].length-1;d>=0;d--){e[this._pData[c][d]]=true}for(var f in e){if(e[f]===true){b.push(f)}}this._pUNI[c]=b.sort()}return this._pUNI[c]};dhtmlXGridObject.prototype._fillPivotList=function(e,d,c,a){if(!c){c={};a=-1}e.innerHTML="";e.options[e.options.length]=new Option("-select-",-1);for(var b=0;b<d.length;b++){if(c[b]||d[b]===null){continue}e.options[e.options.length]=new Option(d[b],b)}e.value=parseInt(a)};dhtmlXGridObject.prototype._reFillPivotLists=function(){var e=[];var b=[];for(var d=0;d<3;d++){e.push(this._pgridSelect[d]);b.push(e[d].value)}var c=this._reFfillPivotLists;var a={};a[b[1]]=a[b[2]]=true;this._fillPivotList(e[0],this._column_list,a,b[0]);a={};a[b[0]]=a[b[2]]=true;this._fillPivotList(e[1],this._column_list,a,b[1]);a={};a[b[1]]=a[b[0]]=true;this._fillPivotList(e[2],this._column_list,a,b[2]);this._reFfillPivotLists=c};dhtmlXGridObject.prototype.makePivotSelect=function(b,a){var c=document.createElement("SELECT");this._fillPivotList(c,b,a);c.style.cssText="width:150px; height:20px; font-family:Tahoma; font-size:8pt; font-weight:normal;";return c};function eXcell_dec(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){return parseFloat(this.cell.innerHTML.replace(/,/g,""))};this.setValue=function(h){var f="0,000.00";if(h=="0"){this.setCValue(f.replace(/.*(0\.[0]+)/,"$1"),h);return}var g=f.substr(f.indexOf(".")+1).length;h=Math.round(h*Math.pow(10,g)).toString();var b="";var d=0;var e=false;for(var c=h.length-1;c>=0;c--){d++;b=h.charAt(c)+b;if(!e&&d==g){b="."+b;d=0;e=true}if(e&&d==3&&c!=0&&h.charAt(c-1)!="-"){b=","+b;d=0}}this.setCValue(b,h)}}eXcell_dec.prototype=new eXcell_ed;function eXcell_cor(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.combo=this.grid.getCombo(this.cell._cellIndex);this.editable=true}this.shiftNext=function(){var b=this.list.options[this.list.selectedIndex+1];if(b){b.selected=true}this.obj.value=this.list.value;return true};this.shiftPrev=function(){var b=this.list.options[this.list.selectedIndex-1];if(b){b.selected=true}this.obj.value=this.list.value;return true};this.edit=function(){this.val=this.getValue();this.text=this.cell.innerHTML._dhx_trim();var d=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(g){(g||event).cancelBubble=true};this.obj.value=this.text;this.list=document.createElement("SELECT");this.list.editor_obj=this;this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=d[0]+"px";this.list.style.top=d[1]+this.cell.offsetHeight+"px";this.list.onclick=function(i){var h=i||window.event;var g=h.target||h.srcElement;if(g.tagName=="OPTION"){g=g.parentNode}if(g.value!=-1){g.editor_obj._byClick=true;g.editor_obj.editable=false;g.editor_obj.grid.editStop()}else{h.cancelBubble=true;g.editor_obj.obj.value="";g.editor_obj.obj.focus()}};var b=this.combo.getKeys();var f=0;this.list.options[0]=new Option(this.combo.get(b[0]),b[0]);this.list.options[0].selected=true;for(var c=1;c<b.length;c++){var e=this.combo.get(b[c]);this.list.options[this.list.options.length]=new Option(e,b[c]);if(b[c]==this.val){f=this.list.options.length-1}}document.body.appendChild(this.list);this.list.size="6";this.cstate=1;if(this.editable){this.cell.innerHTML=""}else{this.obj.style.width="1px";this.obj.style.height="1px"}this.cell.appendChild(this.obj);this.list.options[f].selected=true;if(this.editable){this.obj.focus();this.obj.focus()}if(!this.editable){this.obj.style.visibility="hidden"}};this.getValue=function(){return((this.cell.combo_value==window.undefined)?"":this.cell.combo_value)};this.getText=function(){return this.cell.innerHTML};this.getState=function(){return{prev:this.cell.__prev,now:this.cell.__now}};this.detach=function(){if(this.val!=this.getValue()){this.cell.wasChanged=true}if(this.list.parentNode!=null){if((this.obj.value._dhx_trim()!=this.text)||(this._byClick)){var b=this.list.value;if(!this._byClick){this.combo.values[this.combo.keys._dhx_find(b)]=this.obj.value}this.setValue(b)}else{this.setValue(this.val)}}if(this.list.parentNode){this.list.parentNode.removeChild(this.list)}if(this.obj.parentNode){this.obj.parentNode.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_cor.prototype=new eXcell;eXcell_cor.prototype.setValue=function(b){if((b||"").toString()._dhx_trim()==""){b=null}var a=this.grid.getCombo(this.cell._cellIndex).get(b);if((b==-1)&&(a=="")){this.combo.values[this.combo.keys._dhx_find(-1)]="Create new value";b=null}if(b!==null){this.setCValue(a,b)}else{this.setCValue("&nbsp;",b)}this.cell.__prev=this.cell.__now;this.cell.__now={key:b,value:a};this.cell.combo_value=b};function eXcell_wbut(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){var h=this.getValue().toString();this.obj=document.createElement("INPUT");this.obj.readOnly=true;this.obj.style.width="60px";this.obj.style.height=(this.cell.offsetHeight-(this.grid.multiLine?5:4))+"px";this.obj.style.border="0px";this.obj.style.margin="0px";this.obj.style.padding="0px";this.obj.style.overflow="hidden";this.obj.style.fontSize=_isKHTML?"10px":"12px";this.obj.style.fontFamily="Arial";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(i){(i||event).cancelBubble=true};this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(i){if(!i){i=event}i.cancelBubble=true;return true};this.obj.style.textAlign=this.cell.align;this.obj.value=h;this.obj.focus();this.obj.focus();this.cell.appendChild(document.createTextNode(" "));var e=document.createElement("input");if(_isIE){e.style.height=(this.cell.offsetHeight-(this.grid.multiLine?5:4))+"px";e.style.lineHeight="5px"}else{e.style.fontSize="8px";e.style.width="10px";e.style.marginTop="-5px"}e.type="button";e.name="Lookup";e.value="...";var f=this.obj;var b=this.cell.cellIndex;var d=this.cell.parentNode.idd;var g=this.grid;var c=this;this.dhx_m_func=this.grid.getWButFunction(this.cell._cellIndex);e.onclick=function(i){c.dhx_m_func(c,c.cell.parentNode.idd,c.cell._cellIndex,h)};this.cell.appendChild(e)};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_wbut.prototype=new eXcell;dhtmlXGridObject.prototype.getWButFunction=function(a){if(this._wbtfna){return this._wbtfna[a]}else{return(function(){})}};dhtmlXGridObject.prototype.setWButFunction=function(a,b){if(!this._wbtfna){this._wbtfna=new Array()}this._wbtfna[a]=b};function eXcell_passw(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.innerHTML="";this.cell.atag="INPUT";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.style.height=(this.cell.offsetHeight-(_isIE?6:4))+"px";this.obj.className="dhx_combo_edit";this.obj.type="password";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(b){(b||event).cancelBubble=true};this.obj.onmousedown=function(b){(b||event).cancelBubble=true};this.obj.value=this.cell._rval||"";this.cell.appendChild(this.obj);if(_isFF){this.obj.style.overflow="visible";if((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){this.obj.style.height="36px";this.obj.style.overflow="scroll"}}this.obj.onselectstart=function(b){if(!b){b=event}b.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};this.getValue=function(){return this.cell._rval};this.setValue=function(c){var b="*****";this.cell.innerHTML=b;this.cell._rval=c};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_passw.prototype=new eXcell;function eXcell_num(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(b){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement(_isKHTML?"INPUT":"TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(c){(c||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(c){if(!c){c=event}c.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}else{return this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)}};this.setValue=function(d){var c=new RegExp("[a-z]|[A-Z]","i");if(d.match(c)){d="&nbsp;"}this.cell.innerHTML=d};this.detach=function(){var c=this.obj.value;this.setValue(c);return this.val!=this.getValue()}}eXcell_num.prototype=new eXcell;function eXcell_mro(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){}}eXcell_mro.prototype=new eXcell;eXcell_mro.prototype.getValue=function(){return this.cell.childNodes[0].innerHTML._dhx_trim()};eXcell_mro.prototype.setValue=function(a){if(!this.cell.childNodes.length){this.cell.style.whiteSpace="normal";this.cell.innerHTML="<div style='height:100%; white-space:nowrap; overflow:hidden;'></div>"}if(!a||a.toString()._dhx_trim()==""){a="&nbsp;"}this.cell.childNodes[0].innerHTML=a};function eXcell_liveedit(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.inputObj.focus();this.cell.inputObj.focus()};this.detach=function(){this.setValue(this.cell.inputObj.value)};this.getValue=function(){return this.cell.inputObj?this.cell.inputObj.value:""};this.destructor=function(){};this.onFocus=function(){var b=this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex]);if(b===false){this.cell.inputObj.blur()}};this.onBlur=function(){var b=this.grid.callEvent("onEditCell",[2,this.cell.parentNode.idd,this.cell._cellIndex]);this.detach()};this.onChange=function(){var b=this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,this.cell.inputObj.value]);this.detach()}}eXcell_liveedit.prototype=new eXcell_ed;eXcell_liveedit.prototype.setValue=function(b){var a=this;this.cell.innerHTML='<input type="text" value="" style="width:100%;" />';this.cell.inputObj=this.cell.firstChild;this.cell.inputObj=this.cell.firstChild;this.cell.inputObj.value=b;this.cell.inputObj.onfocus=function(){a.onFocus()};this.cell.inputObj.onblur=function(){a.onFocus()};this.cell.inputObj.onchange=function(){a.onChange()}};if(window.eXcell_math){eXcell_liveedit.prototype.setValueA=eXcell_liveedit.prototype.setValue;eXcell_liveedit.prototype.setValue=eXcell_math.prototype._NsetValue}function eXcell_limit(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.style.height=(this.cell.offsetHeight-(_isIE?6:4))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(b){(b||event).cancelBubble=true};this.obj.onmousedown=function(b){(b||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);if(_isFF){this.obj.style.overflow="visible";if((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){this.obj.style.height="36px";this.obj.style.overflow="scroll"}}this.obj.onkeypress=function(b){if(this.value.length>=15){return false}};this.obj.onselectstart=function(b){if(!b){b=event}b.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}else{return this.cell.innerHTML.toString()._dhx_trim()}};this.setValue=function(b){if(b.length>15){this.cell.innerHTML=b.substring(0,14)}else{this.cell.innerHTML=b}};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_limit.prototype=new eXcell;if(window.dhtmlxHierarchy){if(window.dhtmlXCellObject){dhtmlXCellObject.prototype.attachPropertyGrid=function(){var a=this.attachGrid();new dhtmlXPropertyGrid(a);return a}}function eXcell_tree_property(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.isDisabled=function(){return true};this.getValue=function(){return this.cell.parentNode.valTag.innerHTML}}eXcell_tree_property.prototype=new eXcell_tree;eXcell_tree_property.prototype.setValue=function(a){if(this.cell.parentNode.imgTag){return this.setLabel(a)}if((this.grid._tgc.iconTree==null)||(this.grid._tgc.iconTree!=this.grid.iconTree)){var d={};d.imst="<img src='"+this.grid.iconTree;d.imsti="<img src='"+(this.grid.iconURL||this.grid.iconTree);d.imact="' align='absmiddle'  onclick='this."+(_isKHTML?"":"parentNode.")+"parentNode.parentNode.parentNode.parentNode.grid.doExpand(this);event.cancelBubble=true;' class='property_image'>";d.plus=d.imst+"plus.gif"+d.imact;d.minus=d.imst+"minus.gif"+d.imact;d.blank=d.imst+"blank.gif"+d.imact;d.start="<div style=' overflow:hidden; white-space : nowrap; height:"+(_isIE?20:19)+"px;'>";d.itemim="<span "+(_isFF?"style='position:relative; top:2px;'":"")+"id='nodeval'>";d.close="</span><div class='property_space'></div></div>";this.grid._tgc=d}var e=this.grid._h2;var d=this.grid._tgc;var c=this.cell.parentNode.idd;var f=this.grid._h2.get[c];if(this.grid.kidsXmlFile||this.grid._slowParse){f.has_kids=(f.has_kids||(this.cell.parentNode._attrs.xmlkids&&(f.state!="minus")));f._xml_await=!!f.has_kids}f.image=f.image||(this.cell._attrs.image||"leaf.gif");f.label=a;var b=[d.start];if(f.has_kids){b.push(d.plus);f.state="plus"}else{b.push(d.imst+f.state+".gif"+d.imact+d.itemim)}b.push(f.label);b.push(d.close);this.cell.innerHTML=b.join("");this.cell.style.paddingLeft="0px";this.cell.parentNode.imgTag=this.cell.childNodes[0].childNodes[0];this.cell.parentNode.valTag=this.cell.childNodes[0].childNodes[1];if(f.childs.length){this.grid.getRowById(this.cell.parentNode.idd)._attrs["class"]=" dhx_parent_row ";this.cell.nextSibling.style.borderLeft="1px solid #D4D0C8"}if(_isKHTML){this.cell.vAlign="top"}if(f.parent.id!=0&&f.parent.state=="plus"){this.grid._updateTGRState(f.parent,false);this.cell.parentNode._skipInsert=true}this.grid.callEvent("onCellChanged",[c,this.cell._cellIndex,a])}}function eXcell_list(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.innerHTML="<select style='width:100%;' ></select>";this.obj=this.cell.firstChild;this.obj.onclick=function(f){(f||event).cancelBubble=true};this.obj.onmousedown=function(f){(f||event).cancelBubble=true};this.obj.onkeydown=function(g){var f=(g||event);if(f.keyCode==9||f.keyCode==13){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:f.keyCode,shiftKey:f.shiftKey,srcElement:"0"});return false}f.cancelBubble=true};var b=this;this.obj.onchange=function(){b.grid.editStop();b=null};var d=this.getAttribute("values").split(",");for(var c=0;c<d.length;c++){this.obj.options[c]=new Option(d[c],d[c])}this.obj.value=this.cell._val;this.obj.focus()};this.getValue=function(){return this.cell._val};this.detach=function(){var c=this.obj.value;var b=this.obj.selectedIndex;this.setValue(b==-1?"":this.obj.options[b].value);return c!=this.getValue()}}eXcell_list.prototype=new eXcell;eXcell_list.prototype.setValue=function(a){this.cell._val=a;if(!a||a.toString()._dhx_trim()==""){this.cell._clearCell=true;this.setCValue("&nbsp","")}else{this.cell._clearCell=false;this.setCValue(this.grid._aplNF(a,this.cell._cellIndex))}};function dhtmlXPropertyGrid(a){var b;if(a.objBox){b=a}else{b=new dhtmlXGridObject(a)}b.setHeader("Name,Value");b.setColAlign("left,left");if(window.dhtmlxHierarchy){b.setColTypes("tree_property,ro");b.isTreeGrid=function(){return true};b.enableSmartXMLParsing(false)}else{b.setColTypes("ro,ro")}b.setColSorting("na,na");b.setInitWidths("*,*");b.setNoHeader(true);b.setSkin("dhx_skyblue");b.entBox.className+=" gridbox_property";b.i18n.validation_error="Value is incorrect";b.attachEvent("onRowSelect",function(d,c){if(!this.editor){this.selectCell(this.getRowIndex(d),1);this.editCell()}});b.attachEvent("onBeforeSelect",function(c){if(this._block_selection){return false}return true});b.attachEvent("onRowCreated",function(d,c){if(!this._h2||!this._h2.get[d].childs.length){c.childNodes[1].style.backgroundColor="white"}});b.attachEvent("onEditCell",function(f,j,h,e,g){if(f==1&&this.editor&&this.editor.obj&&this.editor.obj.select){this.editor.obj.select()}if(f==2&&g!=e){var i=this.cells(j,1).getAttribute("validate");var c=true;switch(i){case"int":c=(parseFloat(e)==e);break}if(c){this._block_selection=false;this.callEvent("onPropertyChanged",[this.cells(j,0).getValue(),e,g])}else{alert(this.i18n.validation_error);this._block_selection=true;var d=this;window.setTimeout(function(){d.selectCell(j,h);d.editCell()},1)}}return true});b._key_events.k13_0_0=b._key_events.k9_0_0=b._key_events.k40_0_0;b.getProperties=function(){this.editStop(true);var c={};this.forEachRow(function(d){c[this.cells(d,0).getValue()]=this.cells(d,1).getValue()});return c};b.setProperties=function(c){this.editStop();this.forEachRow(function(e){var d=this.cells(e,0).getValue();if(typeof c[d]!="undefined"){this.cells(e,1).setValue(c[d])}});this.callEvent("onPropertyChanged",[])};return b}dhtmlXForm.prototype.getItemsList=function(){var d=[];var c=[];for(var b in this.itemPull){var e=null;if(this.itemPull[b]._group){e=this.itemPull[b]._group}else{e=b.replace(this.idPrefix,"")}if(c[e]!=true){d.push(e)}c[e]=true}return d};dhtmlXForm.prototype.setItemText=function(){this.setItemLabel.apply(this,arguments)};dhtmlXForm.prototype.getItemText=function(){return this.getItemLabel.apply(this,arguments)};dhtmlXForm.prototype.loadStructString=function(b,a){this.loadStruct(b,a)};dhtmlXAccordion.prototype.setEffect=function(a){};dhtmlXAccordion.prototype.setIcon=function(b,a){this.cells(b).setIcon(a)};dhtmlXAccordion.prototype.clearIcon=function(a){this.cells(a).clearIcon()};dhtmlXAccordion.prototype.setActive=function(a){this.cells(a).open()};dhtmlXAccordion.prototype.isActive=function(a){return this.cells(a).isOpened()};dhtmlXAccordion.prototype.openItem=function(a){this.cells(a).open()};dhtmlXAccordion.prototype.closeItem=function(a){this.cells(a).close()};dhtmlXAccordion.prototype.moveOnTop=function(a){this.cells(a).moveOnTop()};dhtmlXAccordion.prototype.setItemHeight=function(a){this.cells(id).setHeight(a)};dhtmlXAccordion.prototype.setText=function(b,a){this.cells(b).setText(a)};dhtmlXAccordion.prototype.getText=function(){return this.cells(id).getText()};dhtmlXAccordion.prototype.showItem=function(a){this.cells(a).show()};dhtmlXAccordion.prototype.hideItem=function(a){this.cells(a).hide()};dhtmlXAccordion.prototype.isItemHidden=function(a){return !this.cells(a).isVisible()};dhtmlXAccordion.prototype.loadJSON=function(a,b){this.loadStruct(a,b)};dhtmlXAccordion.prototype.loadXML=function(a,b){this.loadStruct(a,b)};dhtmlXAccordion.prototype.setSkinParameters=function(a,b){if(a!=null){this.setOffset(a)}};dhtmlXLayoutObject.prototype.listViews=function(){return this.listPatterns()};dhtmlXLayoutObject.prototype.setEffect=function(){};dhtmlXLayoutObject.prototype.getEffect=function(){};dhtmlXLayoutObject.prototype.dockWindow=function(a){this.cells(a).dock()};dhtmlXLayoutObject.prototype.unDockWindow=function(a){this.cells(a).undock()};dhtmlXLayoutObject.prototype.setCollapsedText=function(b,a){this.cells(b).setCollapsedText(a)};dhtmlXLayoutObject.prototype.getIdByIndex=function(a){if(a<0||a>this.items.length-1){return null}var b=null;this.forEachItem(function(c){if(b==null&&c==this.items[a]){b=c.conf.name}});return b};dhtmlXLayoutObject.prototype.getIndexById=function(d){var a=this.cells(d);var b=-1;for(var c=0;c<this.items.length;c++){if(a==this.items[c]){b=c}}return b};dhtmlXLayoutObject.prototype.showPanel=function(a){this.cells(a).showHeader()};dhtmlXLayoutObject.prototype.hidePanel=function(a){this.cells(a).hideHeader()};dhtmlXLayoutObject.prototype.isPanelVisible=function(a){return this.cells(a).isHeaderVisible()};dhtmlXLayoutObject.prototype.setImagePath=function(){};dhtmlXLayoutCell.prototype.getIndex=function(){return this.conf.index};dhtmlXTabBar.prototype.destructor=function(){this.unload()};dhtmlXTabBar.prototype.normalize=function(){};dhtmlXTabBar.prototype.setStyle=function(){};dhtmlXTabBar.prototype.setContent=function(b,a){this.cells(b).attachObject(a)};dhtmlXTabBar.prototype.setContentHTML=function(b,a){this.cells(b).attachHTMLString(a)};dhtmlXTabBar.prototype.setHrefMode=function(a){this._hrfmode=a};dhtmlXTabBar.prototype.setContentHref=function(b,a){if(!this._hrfmode){this._hrfmode="iframe"}switch(this._hrfmode){case"iframes":case"iframe":case"iframes-on-demand":this.cells(b).attachURL(a);break;case"ajax":case"ajax-html":this.cells(b).attachURL(a,true);break}};dhtmlXTabBar.prototype.setMargin=function(){};dhtmlXTabBar.prototype.setOffset=function(){};dhtmlXTabBar.prototype.setImagePath=function(b,a){};dhtmlXTabBar.prototype.setSkinColors=function(b,a){};dhtmlXTabBar.prototype.tabWindow=function(a){return this.cells(a).getFrame()};dhtmlXTabBar.prototype.setCustomStyle=function(){};dhtmlXTabBar.prototype.enableScroll=function(){};dhtmlXTabBar.prototype.enableForceHiding=function(){};dhtmlXTabBar.prototype.setSize=function(a,b){this.base.style.width=a+"px";this.base.style.height=b+"px";this.setSizes()};dhtmlXTabBar.prototype.enableAutoSize=function(){};dhtmlXTabBar.prototype.adjustOuterSize=function(){this.setSizes()};dhtmlXTabBar.prototype.showInnerScroll=function(c){for(var b in this.t){if(c==null||c==b){this.t[b].cell.showInnerScroll()}}};dhtmlXTabBar.prototype.loadXML=function(a,b){this.loadStruct.apply(this,[a,b])};dhtmlXTabBar.prototype.loadXMLString=function(b,a){this.loadStruct.apply(this,[b,a])};dhtmlXTabBar.prototype.hideTab=function(b,a){this.tabs(b).hide(a)};dhtmlXTabBar.prototype.showTab=function(b,a){this.tabs(b).show(a)};dhtmlXTabBar.prototype.enableTab=function(a){this.tabs(a).enable()};dhtmlXTabBar.prototype.disableTab=function(a){this.tabs(a).disable()};dhtmlXTabBar.prototype.getIndex=function(a){return this.tabs(a).getIndex()};dhtmlXTabBar.prototype.getLabel=function(a){return this.tabs(a).getText()};dhtmlXTabBar.prototype.setLabel=function(b,a){this.tabs(b).setText(a)};dhtmlXTabBar.prototype.setTabActive=function(a){this.tabs(a).setActive()};dhtmlXTabBar.prototype.removeTab=function(a){this.tabs(a).close()};dhtmlXTabBar.prototype.forceLoad=function(a){this.tabs(a).reloadURL()};dhtmlXWindows.prototype.enableAutoViewport=function(){};dhtmlXWindows.prototype.setImagePath=function(){};dhtmlXWindows.prototype.setEffect=function(){};dhtmlXWindows.prototype.getEffect=function(){};dhtmlXWindowsCell.prototype.setToFullScreen=function(){};dhtmlXWindowsCell.prototype.setIcon=function(){};dhtmlXWindowsCell.prototype.getIcon=function(){};dhtmlXWindowsCell.prototype.restoreIcon=function(){};dhtmlXWindowsCell.prototype.clearIcon=function(){};
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/dhtmlxform.js b/portal/static/unbound_reservation_static/lib/dhtmlxform.js
new file mode 100644 (file)
index 0000000..a11f718
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+Product Name: dhtmlxForm 
+Version: 4.0.3 
+Edition: Standard 
+License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
+Copyright UAB Dinamenta http://www.dhtmlx.com
+*/
+
+if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.0.3",skin:null,skinDetect:function(b){var c=document.createElement("DIV");c.className=b+"_skin_detect";if(document.body.firstChild){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c.offsetWidth;c.parentNode.removeChild(c);c=null;return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[a]||null},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var c=this.first();for(var b in this.data){c=Math.max(c,this.data[b])}return c},reserve:function(a){this.data[a]=this.last()+this.step;return this.data[a]},clear:function(a){if(this.data[a]!=null){this.data[a]=null;delete this.data[a]}}},s2b:function(a){return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},trim:function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")},template:function(b,c,a){return b.replace(/#([a-zA-Z0-9_-]{1,})#/g,function(f,d){if(d.length>0&&typeof(c[d])!="undefined"){if(a==true){return window.dhx4.trim(c[d])}return String(c[d])}return""})},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).top},_aOfsSum:function(a){var c=0,b=0;while(a){c=c+parseInt(a.offsetTop);b=b+parseInt(a.offsetLeft);a=a.offsetParent}return{top:c,left:b}},_aOfsRect:function(d){var h=d.getBoundingClientRect();var i=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||i.scrollTop;var f=window.pageXOffset||b.scrollLeft||i.scrollLeft;var g=b.clientTop||i.clientTop||0;var j=b.clientLeft||i.clientLeft||0;var l=h.top+a-g;var c=h.left+f-j;return{top:Math.round(l),left:Math.round(c)}},_aOfs:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfsSum(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(d){if(this._isObj(d)){var c={};for(var b in d){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}else{var c=[];for(var b=0;b<d.length;b++){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}return c},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=0);var b={};b.left=document.body.scrollLeft;b.right=b.left+(window.innerWidth||document.body.clientWidth);b.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);b.bottom=b.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return b},selectTextRange:function(d,g,b){d=(typeof(d)=="string"?document.getElementById(d):d);var a=d.value.length;g=Math.max(Math.min(g,a),0);b=Math.min(b,a);if(d.setSelectionRange){try{d.setSelectionRange(g,b)}catch(f){}}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",g);c.moveEnd("character",b-a);try{c.select()}catch(f){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var c={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var b in c){if(this.transData.transProp==false&&document.documentElement.style[b]!=null){this.transData.transProp=b;this.transData.transEv=c[b]}}c=null}return this.transData}};window.dhx4.isIE=(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE6=(window.XMLHttpRequest==null&&navigator.userAgent.indexOf("MSIE")>=0);window.dhx4.isIE7=(navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"post",get:function(a,b){this._call("GET",a,null,true,b)},getSync:function(a){return this._call("GET",a,null,false)},post:function(b,a,c){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){c=a;a=""}else{a=String(a)}}this._call("POST",b,a,true,c)},postSync:function(b,a){a=(a==null?"":String(a));return this._call("POST",b,a,false)},getLong:function(a,b){this._call("GET",a,null,true,b,{url:a})},postLong:function(b,a,c){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){c=a;a=""}this._call("POST",b,a,true,c,{url:b,postData:a})},_call:function(i,b,a,g,f,d){var c=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var h=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(g==true){c.onreadystatechange=function(){if((c.readyState==4&&c.status==200)||(h==true&&c.readyState==3)){window.setTimeout(function(){if(typeof(f)=="function"){f.apply(window,[{xmlDoc:c}])}if(d!=null){if(typeof(d.postData)!="undefined"){dhx4.ajax.postLong(d.url,d.postData,f)}else{dhx4.ajax.getLong(d.url,f)}}f=null;c=null},1)}}}if(i=="GET"&&this.cache!=true){b+=(b.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()}c.open(i,b,g);if(i=="POST"){c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(this.cache!=true){a+=(a.length>0?"&":"")+"dhxr"+new Date().getTime()}}else{a=null}c.setRequestHeader("X-Requested-With","XMLHttpRequest");c.send(a);if(!g){return{xmlDoc:c}}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(obj,initObj,xmlToJson,xmlRootTag,mode){if(mode=="clear"){for(var a in obj._dhxdataload){obj._dhxdataload[a]=null;delete obj._dhxdataload[a]}obj._loadData=null;obj._dhxdataload=null;obj.load=null;obj.loadStruct=null;obj=null;return}obj._dhxdataload={initObj:initObj,xmlToJson:xmlToJson,xmlRootTag:xmlRootTag,onBeforeXLS:null};obj._loadData=function(data,loadParams,onLoad){if(arguments.length==2){onLoad=loadParams;loadParams=null}var obj=null;if(arguments.length==3){onLoad=arguments[2]}if(typeof(data)=="string"){var k=data.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var tag=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(tag.test(k.replace(/^<\?xml[^\?]*\?>\s*/,""))){if(window.DOMParser){obj=(new window.DOMParser()).parseFromString(data,"text/xml")}else{if(typeof(window.ActiveXObject)!="undefined"){obj=new window.ActiveXObject("Microsoft.XMLDOM");obj.async="false";obj.loadXML(data)}}if(obj!=null){obj=this[this._dhxdataload.xmlToJson].apply(this,[obj])}}if(obj==null&&(k.match(/^\{.*\}$/)!=null||k.match(/^\[.*\]$/)!=null)){try{eval("dhx4.temp="+k)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj==null){this.callEvent("onXLS",[]);var params=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var k=this._dhxdataload.onBeforeXLS.apply(this,[data]);if(k!=null&&typeof(k)=="object"){if(k.url!=null){data=k.url}if(k.params!=null){for(var a in k.params){params.push(a+"="+encodeURIComponent(k.params[a]))}}}}var t=this;var callBack=function(r){var obj=null;if((r.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(r.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){obj=t[t._dhxdataload.xmlToJson].apply(t,[r.xmlDoc.responseXML])}else{try{eval("dhx4.temp="+r.xmlDoc.responseText)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj!=null){t[t._dhxdataload.initObj].apply(t,[obj,data])}t.callEvent("onXLE",[]);if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(t,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(t,[])}}}callBack=onLoad=null;obj=r=t=null};params=params.join("&")+(typeof(loadParams)=="string"?"&"+loadParams:"");if(dhx4.ajax.method=="post"){dhx4.ajax.post(data,params,callBack)}else{if(dhx4.ajax.method=="get"){dhx4.ajax.get(data+(data.indexOf("?")>0?"":"")+params,callBack)}}return}}else{if(typeof(data.documentElement)=="object"||(typeof(data.tagName)!="undefined"&&typeof(data.getElementsByTagName)!="undefined"&&data.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){obj=this[this._dhxdataload.xmlToJson].apply(this,[data])}else{obj=window.dhx4._copyObj(data)}}if(obj!=null){this[this._dhxdataload.initObj].apply(this,[obj])}if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(this,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(this,[])}}onLoad=null}};if(mode!=null){var k={struct:"loadStruct",data:"load"};for(var a in mode){if(mode[a]==true){obj[k[a]]=function(){return this._loadData.apply(this,arguments)}}}}obj=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,b){if(b=="clear"){a.detachAllEvents();a.dhxevs=null;a.attachEvent=null;a.detachEvent=null;a.checkEvent=null;a.callEvent=null;a.detachAllEvents=null;a=null;return}a.dhxevs={data:{}};a.attachEvent=function(c,f){c=String(c).toLowerCase();if(!this.dhxevs.data[c]){this.dhxevs.data[c]={}}var d=window.dhx4.newId();this.dhxevs.data[c][d]=f;return d};a.detachEvent=function(g){for(var d in this.dhxevs.data){var f=0;for(var c in this.dhxevs.data[d]){if(c==g){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}else{f++}}if(f==0){this.dhxevs.data[d]=null;delete this.dhxevs.data[d]}}};a.checkEvent=function(c){c=String(c).toLowerCase();return(this.dhxevs.data[c]!=null)};a.callEvent=function(d,g){d=String(d).toLowerCase();if(this.dhxevs.data[d]==null){return true}var f=true;for(var c in this.dhxevs.data[d]){f=this.dhxevs.data[d][c].apply(this,g)&&f}return f};a.detachAllEvents=function(){for(var d in this.dhxevs.data){for(var c in this.dhxevs.data[d]){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}this.dhxevs.data[d]=null;delete this.dhxevs.data[d]}};a=null}}dhtmlx=function(c){for(var b in c){dhtmlx[b]=c[b]}return dhtmlx};dhtmlx.extend_api=function(a,d,c){var b=window[a];if(!b){return}window[a]=function(h){if(h&&typeof h=="object"&&!h.tagName){var g=b.apply(this,(d._init?d._init(h):arguments));for(var f in dhtmlx){if(d[f]){this[d[f]](dhtmlx[f])}}for(var f in h){if(d[f]){this[d[f]](h[f])}else{if(f.indexOf("on")==0){this.attachEvent(f,h[f])}}}}else{var g=b.apply(this,arguments)}if(d._patch){d._patch(this)}return g||this};window[a].prototype=b.prototype;if(c){dhtmlXHeir(window[a].prototype,c)}};dhtmlxAjax={get:function(a,c){var b=new dtmlXMLLoaderObject(true);b.async=(arguments.length<3);b.waitCall=c;b.loadXML(a);return b},post:function(a,c,d){var b=new dtmlXMLLoaderObject(true);b.async=(arguments.length<4);b.waitCall=d;b.loadXML(a,true,c);return b},getSync:function(a){return this.get(a,null,true)},postSync:function(a,b){return this.post(a,b,null,true)}};function dtmlXMLLoaderObject(b,d,c,a){this.xmlDoc="";if(typeof(c)!="undefined"){this.async=c}else{this.async=true}this.onloadAction=b||null;this.mainObject=d||null;this.waitCall=null;this.rSeed=a||false;return this}dtmlXMLLoaderObject.count=0;dtmlXMLLoaderObject.prototype.waitLoadFunction=function(b){var a=true;this.check=function(){if((b)&&(b.onloadAction!=null)){if((!b.xmlDoc.readyState)||(b.xmlDoc.readyState==4)){if(!a){return}a=false;dtmlXMLLoaderObject.count++;if(typeof b.onloadAction=="function"){b.onloadAction(b.mainObject,null,null,null,b)}if(b.waitCall){b.waitCall.call(this,b);b.waitCall=null}}}};return this.check};dtmlXMLLoaderObject.prototype.getXMLTopNode=function(c,a){if(typeof this.xmlDoc.status=="undefined"||this.xmlDoc.status<400){if(this.xmlDoc.responseXML){var b=this.xmlDoc.responseXML.getElementsByTagName(c);if(b.length==0&&c.indexOf(":")!=-1){var b=this.xmlDoc.responseXML.getElementsByTagName((c.split(":"))[1])}var d=b[0]}else{var d=this.xmlDoc.documentElement}if(d){this._retry=false;return d}if(!this._retry&&_isIE){this._retry=true;var a=this.xmlDoc;this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),true);return this.getXMLTopNode(c,a)}}dhtmlxError.throwError("LoadXML","Incorrect XML",[(a||this.xmlDoc),this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(b,a){if(!_isIE){var c=new DOMParser();this.xmlDoc=c.parseFromString(b,"text/xml")}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=this.async;this.xmlDoc.onreadystatechange=function(){};this.xmlDoc.loadXML(b)}if(a){return}if(this.onloadAction){this.onloadAction(this.mainObject,null,null,null,this)}if(this.waitCall){this.waitCall();this.waitCall=null}};dtmlXMLLoaderObject.prototype.loadXML=function(c,b,a,d){if(this.rSeed){c+=((c.indexOf("?")!=-1)?"&":"?")+"a_dhx_rSeed="+(new Date()).valueOf()}this.filePath=c;if((!_isIE)&&(window.XMLHttpRequest)){this.xmlDoc=new XMLHttpRequest()}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP")}if(this.async){this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this)}this.xmlDoc.open(b?"POST":"GET",c,this.async);if(d){this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")");this.xmlDoc.setRequestHeader("Content-type","text/xml")}else{if(b){this.xmlDoc.setRequestHeader("Content-type",(this.contenttype||"application/x-www-form-urlencoded"))}}this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(null||a);if(!this.async){(new this.waitLoadFunction(this))()}};dtmlXMLLoaderObject.prototype.destructor=function(){this._filterXPath=null;this._getAllNamedChilds=null;this._retry=null;this.async=null;this.rSeed=null;this.filePath=null;this.onloadAction=null;this.mainObject=null;this.xmlDoc=null;this.doXPath=null;this.doXPathOpera=null;this.doXSLTransToObject=null;this.doXSLTransToString=null;this.loadXML=null;this.loadXMLString=null;this.doSerialization=null;this.xmlNodeToJSON=null;this.getXMLTopNode=null;this.setXSLParamValue=null;return null};dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(d){var c={};for(var b=0;b<d.attributes.length;b++){c[d.attributes[b].name]=d.attributes[b].value}c._tagvalue=d.firstChild?d.firstChild.nodeValue:"";for(var b=0;b<d.childNodes.length;b++){var a=d.childNodes[b].tagName;if(a){if(!c[a]){c[a]=[]}c[a].push(this.xmlNodeToJSON(d.childNodes[b]))}}return c};function callerFunction(a,b){this.handler=function(c){if(!c){c=window.event}a(c,b);return true};return this.handler}function getAbsoluteLeft(a){return getOffset(a).left}function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){var c=0,b=0;while(a){c=c+parseInt(a.offsetTop);b=b+parseInt(a.offsetLeft);a=a.offsetParent}return{top:c,left:b}}function getOffsetRect(d){var h=d.getBoundingClientRect();var i=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||i.scrollTop;var f=window.pageXOffset||b.scrollLeft||i.scrollLeft;var g=b.clientTop||i.clientTop||0;var j=b.clientLeft||i.clientLeft||0;var l=h.top+a-g;var c=h.left+f-j;return{top:Math.round(l),left:Math.round(c)}}function getOffset(a){if(a.getBoundingClientRect){return getOffsetRect(a)}else{return getOffsetSum(a)}}function convertStringToBoolean(a){if(typeof(a)=="string"){a=a.toLowerCase()}switch(a){case"1":case"true":case"yes":case"y":case 1:case true:return true;break;default:return false}}function getUrlSymbol(a){if(a.indexOf("?")!=-1){return"&"}else{return"?"}}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop){return window.dhtmlDragAndDrop}this.lastLanding=0;this.dragNode=0;this.dragStartNode=0;this.dragStartObject=0;this.tempDOMU=null;this.tempDOMM=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if((a||window.event)&&(a||event).button==2){return}if(window.dhtmlDragAndDrop.waitDrag){window.dhtmlDragAndDrop.waitDrag=0;document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;return false}if(window.dhtmlDragAndDrop.dragNode){window.dhtmlDragAndDrop.stopDrag(a)}window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=new Date().valueOf();if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlDragAndDropObject.prototype.callDrag=function(c){if(!c){c=window.event}dragger=window.dhtmlDragAndDrop;if((new Date()).valueOf()-dragger.downtime<100){return}if(!dragger.dragNode){if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,c);if(!dragger.dragNode){return dragger.stopDrag()}dragger.dragNode.onselectstart=function(){return false};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else{return dragger.stopDrag(c,true)}}if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var a=dragger.gldragNode;if(dragger.gldragNode.old){a=dragger.gldragNode.old}a.parentNode.removeChild(a);var b=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var f=document.createElement("Div");f.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=f.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);b.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=c.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=c.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!c.srcElement){var d=c.target}else{d=c.srcElement}dragger.checkLanding(d,c)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(f){if(window.name){var c=parent.frames[window.name].frameElement.offsetParent;var d=0;var b=0;while(c){d+=c.offsetLeft;b+=c.offsetTop;c=c.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);d+=a.split("_")[0]*1;b+=a.split("_")[1]*1}if(f){return d+"_"+b}else{this.fx=d}this.fy=b}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(b,a){if((b)&&(b.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=b;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,a.clientX,a.clientY,a);this.lastLanding_scr=(_isIE?a.srcElement:a.target)}else{if((b)&&(b.tagName!="BODY")){this.checkLanding(b.parentNode,a)}else{if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding,a.clientX,a.clientY,a)}this.lastLanding=0;if(this._onNotFound){this._onNotFound()}}}};dhtmlDragAndDropObject.prototype.stopDrag=function(b,c){dragger=window.dhtmlDragAndDrop;if(!c){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:b.target))}}dragger.lastLanding=null;if((dragger.dragNode)&&(dragger.dragNode.parentNode==document.body)){dragger.dragNode.parentNode.removeChild(dragger.dragNode)}dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(c){if(c){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=c)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window)}}catch(b){}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=c)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}}catch(b){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(c,d){if(c){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=c.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=c.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=c.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=c.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(d))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=c)){parent.dhtmlDragAndDrop.initFrameRoute(window)}}catch(b){}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=c)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.initFrameRoute(window,((!c||d)?1:0))}}catch(b){}}};_isFF=false;_isIE=false;_isOpera=false;_isKHTML=false;_isMacOS=false;_isChrome=false;_FFrv=false;_KHTMLrv=false;_OperaRv=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){_isChrome=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;_FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if((navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat"){_isIE=8}}else{if(navigator.appName=="Netscape"&&navigator.userAgent.indexOf("Trident")!=-1){_isIE=8}else{_isFF=true;_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}}dtmlXMLLoaderObject.prototype.doXPath=function(c,f,d,j){if(_isKHTML||(!_isIE&&!window.XPathResult)){return this.doXPathOpera(c,f)}if(_isIE){if(!f){if(!this.xmlDoc.nodeName){f=this.xmlDoc.responseXML}else{f=this.xmlDoc}}if(!f){dhtmlxError.throwError("LoadXML","Incorrect XML",[(f||this.xmlDoc),this.mainObject])}if(d!=null){f.setProperty("SelectionNamespaces","xmlns:xsl='"+d+"'")}if(j=="single"){return f.selectSingleNode(c)}else{return f.selectNodes(c)||new Array(0)}}else{var a=f;if(!f){if(!this.xmlDoc.nodeName){f=this.xmlDoc.responseXML}else{f=this.xmlDoc}}if(!f){dhtmlxError.throwError("LoadXML","Incorrect XML",[(f||this.xmlDoc),this.mainObject])}if(f.nodeName.indexOf("document")!=-1){a=f}else{a=f;f=f.ownerDocument}var h=XPathResult.ANY_TYPE;if(j=="single"){h=XPathResult.FIRST_ORDERED_NODE_TYPE}var g=new Array();var b=f.evaluate(c,a,function(l){return d},h,null);if(h==XPathResult.FIRST_ORDERED_NODE_TYPE){return b.singleNodeValue}var i=b.iterateNext();while(i){g[g.length]=i;i=b.iterateNext()}return g}};function _dhtmlxError(b,a,c){if(!this.catches){this.catches=new Array()}return this}_dhtmlxError.prototype.catchError=function(b,a){this.catches[b]=a};_dhtmlxError.prototype.throwError=function(b,a,c){if(this.catches[b]){return this.catches[b](b,a,c)}if(this.catches.ALL){return this.catches.ALL(b,a,c)}alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);return null};window.dhtmlxError=new _dhtmlxError();dtmlXMLLoaderObject.prototype.doXPathOpera=function(c,a){var f=c.replace(/[\/]+/gi,"/").split("/");var d=null;var b=1;if(!f.length){return[]}if(f[0]=="."){d=[a]}else{if(f[0]==""){d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(f[b].replace(/\[[^\]]*\]/g,""));b++}else{return[]}}for(b;b<f.length;b++){d=this._getAllNamedChilds(d,f[b])}if(f[b-1].indexOf("[")!=-1){d=this._filterXPath(d,f[b-1])}return d};dtmlXMLLoaderObject.prototype._filterXPath=function(f,d){var h=new Array();var d=d.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,"");for(var g=0;g<f.length;g++){if(f[g].getAttribute(d)){h[h.length]=f[g]}}return h};dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(f,d){var l=new Array();if(_isKHTML){d=d.toUpperCase()}for(var h=0;h<f.length;h++){for(var g=0;g<f[h].childNodes.length;g++){if(_isKHTML){if(f[h].childNodes[g].tagName&&f[h].childNodes[g].tagName.toUpperCase()==d){l[l.length]=f[h].childNodes[g]}}else{if(f[h].childNodes[g].tagName==d){l[l.length]=f[h].childNodes[g]}}}}return l};function dhtmlXHeir(f,d){for(var g in d){if(typeof(d[g])=="function"){f[g]=d[g]}}return f}function dhtmlxEvent(b,c,a){if(b.addEventListener){b.addEventListener(c,a,false)}else{if(b.attachEvent){b.attachEvent("on"+c,a)}}}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(b,c,d){if(!d){d=this.xslDoc}if(d.responseXML){d=d.responseXML}var a=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+b+"']",d,"http://www.w3.org/1999/XSL/Transform","single");if(a!=null){a.firstChild.nodeValue=c}};dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(d,b){if(!d){d=this.xslDoc}if(d.responseXML){d=d.responseXML}if(!b){b=this.xmlDoc}if(b.responseXML){b=b.responseXML}if(!_isIE){if(!this.XSLProcessor){this.XSLProcessor=new XSLTProcessor();this.XSLProcessor.importStylesheet(d)}var a=this.XSLProcessor.transformToDocument(b)}else{var a=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(d,a)}catch(c){a=b.transformNode(d)}}return a};dtmlXMLLoaderObject.prototype.doXSLTransToString=function(c,b){var a=this.doXSLTransToObject(c,b);if(typeof(a)=="string"){return a}return this.doSerialization(a)};dtmlXMLLoaderObject.prototype.doSerialization=function(b){if(!b){b=this.xmlDoc}if(b.responseXML){b=b.responseXML}if(!_isIE){var a=new XMLSerializer();return a.serializeToString(b)}else{return b.xml}};dhtmlxEventable=function(obj){obj.attachEvent=function(name,catcher,callObj){name="ev_"+name.toLowerCase();if(!this[name]){this[name]=new this.eventCatcher(callObj||this)}return(name+":"+this[name].addEvent(catcher))};obj.callEvent=function(name,arg0){name="ev_"+name.toLowerCase();if(this[name]){return this[name].apply(this,arg0)}return true};obj.checkEvent=function(name){return(!!this["ev_"+name.toLowerCase()])};obj.eventCatcher=function(obj){var dhx_catch=[];var z=function(){var res=true;for(var i=0;i<dhx_catch.length;i++){if(dhx_catch[i]!=null){var zr=dhx_catch[i].apply(obj,arguments);res=res&&zr}}return res};z.addEvent=function(ev){if(typeof(ev)!="function"){ev=eval(ev)}if(ev){return dhx_catch.push(ev)-1}return false};z.removeEvent=function(id){dhx_catch[id]=null};return z};obj.detachEvent=function(id){if(id!=false){var list=id.split(":");this[list[0]].removeEvent(list[1])}};obj.detachAllEvents=function(){for(var name in this){if(name.indexOf("ev_")==0){this.detachEvent(name);this[name]=null}}};obj=null};function dhtmlXCalendarObject(g,m){this.i={};var c=null;if(typeof(g)=="string"){var d=document.getElementById(g)}else{var d=g}if(d&&typeof(d)=="object"&&d.tagName&&String(d.tagName).toLowerCase()!="input"){c=d}d=null;if(typeof(g)!="object"||!g.length){g=[g]}for(var b=0;b<g.length;b++){if(typeof(g[b])=="string"){g[b]=(document.getElementById(g[b])||null)}if(g[b]!=null&&g[b].tagName&&String(g[b].tagName).toLowerCase()=="input"){this.i[window.dhx4.newId()]={input:g[b]}}else{if(!(g[b] instanceof Array)&&g[b] instanceof Object&&(g[b].input!=null||g[b].button!=null)){if(g[b].input!=null&&typeof(g[b].input)=="string"){g[b].input=document.getElementById(g[b].input)}if(g[b].button!=null&&typeof(g[b].button)=="string"){g[b].button=document.getElementById(g[b].button)}this.i[window.dhx4.newId()]=g[b]}}g[b]=null}this.conf={skin:(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhtmlxcalendar")||"dhx_skyblue"),zi:window.dhx4.newId(),touch:(typeof(window.ontouchstart)!="undefined")};this.setSkin=function(n,a){if(this.conf.skin==n&&!a){return}this.conf.skin=n;this.base.className="dhtmlxcalendar_"+this.conf.skin;this._ifrSize()};this.base=document.createElement("DIV");this.base.style.display="none";this.base.appendChild(document.createElement("DIV"));if(c!=null){this._hasParent=true;c.appendChild(this.base);c=null}else{document.body.appendChild(this.base)}this.setParent=function(a){if(this._hasParent){if(typeof(a)=="object"){a.appendChild(this.base)}else{if(typeof(a)=="string"){document.getElementById(a).appendChild(this.base)}}}};this.setSkin(this.conf.skin,true);if(this.conf.touch){this.base.ontouchstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}a.cancelBubble=true}}else{this.base.onclick=function(a){a=a||event;a.cancelBubble=true};this.base.onmousedown=function(){return false}}this.loadUserLanguage=function(p){if(!this.langData[p]){return}this.lang=p;this.setWeekStartDay(this.langData[this.lang].weekstart);this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");if(this.msCont){var o=0;for(var n=0;n<this.msCont.childNodes.length;n++){for(var a=0;a<this.msCont.childNodes[n].childNodes.length;a++){this.msCont.childNodes[n].childNodes[a].innerHTML=this.langData[this.lang].monthesSNames[o++]}}}};this.contMonth=document.createElement("DIV");this.contMonth.className="dhtmlxcalendar_month_cont";this.contMonth.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.firstChild.appendChild(this.contMonth);var h=document.createElement("UL");h.className="dhtmlxcalendar_line";this.contMonth.appendChild(h);var l=document.createElement("LI");l.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";l.innerHTML="<div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left\";'></div><span></span><div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right\";'></div>";h.appendChild(l);var f=this;l[this.conf.touch?"ontouchstart":"onclick"]=function(p){p=p||event;var n=(p.target||p.srcElement);if(n.className&&n.className.indexOf("dhtmlxcalendar_month_arrow")===0){f._hideSelector();var o=(n.parentNode.firstChild==n?-1:1);var a=new Date(f._activeMonth);f._drawMonth(new Date(f._activeMonth.getFullYear(),f._activeMonth.getMonth()+o,1,0,0,0,0));f._evOnArrowClick([a,new Date(f._activeMonth)]);return}if(n.className&&n.className=="dhtmlxcalendar_month_label_month"){p.cancelBubble=true;f._showSelector("month",Math.round(n.offsetLeft+n.offsetWidth/2),n.offsetTop+n.offsetHeight+2,"selector_month",true);return}if(n.className&&n.className=="dhtmlxcalendar_month_label_year"){p.cancelBubble=true;f._showSelector("year",Math.round(n.offsetLeft+n.offsetWidth/2),n.offsetTop+n.offsetHeight+2,"selector_year",true);return}f._hideSelector()};this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.firstChild.appendChild(this.contDays);this.setWeekStartDay=function(a){if(a==0){a=7}this._wStart=Math.min(Math.max((isNaN(a)?1:a),1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var p=document.createElement("UL");p.className="dhtmlxcalendar_line";this.contDays.appendChild(p)}else{var p=this.contDays.firstChild}var n=this._wStart;var o=this.langData[this.lang].daysSNames;o.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var r=0;r<8;r++){if(p.childNodes[r]==null){var a=document.createElement("LI");p.appendChild(a)}else{var a=p.childNodes[r]}if(r==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="<div class='dhtmlxcalendar_label'>"+(this.langData[this.lang].weekname||"w")+"</div>"}else{a.className="dhtmlxcalendar_cell"+(n>=6?" dhtmlxcalendar_day_weekday_cell":"")+(r==1?"_first":"");a.innerHTML=o[n];if(++n>7){n=1}}}if(this._activeMonth!=null){this._drawMonth(this._activeMonth)}};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.firstChild.appendChild(this.contDates);this.contDates[this.conf.touch?"ontouchend":"onclick"]=function(r){r=r||event;var n=(r.target||r.srcElement);if(n.parentNode!=null&&n.parentNode._date!=null){n=n.parentNode}if(n._date!=null&&!n._css_dis){var p=f._activeDate.getHours();var o=f._activeDate.getMinutes();var q=n._date;if(f.checkEvent("onBeforeChange")){if(!f.callEvent("onBeforeChange",[new Date(n._date.getFullYear(),n._date.getMonth(),n._date.getDate(),p,o)])){return}}if(f._activeDateCell!=null){f._activeDateCell._css_date=false;f._updateCellStyle(f._activeDateCell._q,f._activeDateCell._w)}var a=(f._activeDate.getFullYear()+"_"+f._activeDate.getMonth()!=q.getFullYear()+"_"+q.getMonth());f._nullDate=false;f._activeDate=new Date(q.getFullYear(),q.getMonth(),q.getDate(),p,o);f._activeDateCell=n;f._activeDateCell._css_date=true;f._activeDateCell._css_hover=false;f._updateCellStyle(f._activeDateCell._q,f._activeDateCell._w);if(a){f._drawMonth(f._activeDate)}if(f._activeInp&&f.i[f._activeInp]&&f.i[f._activeInp].input!=null){f.i[f._activeInp].input.value=f._dateToStr(new Date(f._activeDate.getTime()))}if(!f._hasParent){f._hide()}f._evOnClick([new Date(f._activeDate.getTime())])}};if(!this.conf.touch){this.contDates.onmouseover=function(n){n=n||event;var a=(n.target||n.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(f._lastHover==a||a._css_hover){return}a._css_hover=true;f._updateCellStyle(a._q,a._w);f._lastHover=a;f._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),n]);a=null}};this.contDates.onmouseout=function(a){f._clearDayHover(a||event)}}this._lastHover=null;this._clearDayHover=function(a){if(!this._lastHover){return}this._lastHover._css_hover=false;this._updateCellStyle(this._lastHover._q,this._lastHover._w);f._evOnMouseOut([new Date(this._lastHover._date.getFullYear(),this._lastHover._date.getMonth(),this._lastHover._date.getDate(),0,0,0,0),a]);this._lastHover=null};for(var b=0;b<6;b++){var h=document.createElement("UL");h.className="dhtmlxcalendar_line";this.contDates.appendChild(h);for(var j=0;j<=7;j++){var l=document.createElement("LI");if(j==0){l.className="dhtmlxcalendar_cell_wn"}else{l.className="dhtmlxcalendar_cell"}h.appendChild(l)}}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.base.firstChild.appendChild(this.contTime);this.showTime=function(){this.contTime.style.display="";this._ifrSize()};this.hideTime=function(){this.contTime.style.display="none";this._ifrSize()};var h=document.createElement("UL");h.className="dhtmlxcalendar_line";this.contTime.appendChild(h);var l=document.createElement("LI");l.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";l.innerHTML="<div class='dhtmlxcalendar_time_img'></div><span class='dhtmlxcalendar_label_hours'></span><span class='dhtmlxcalendar_label_colon'> : </span><span class='dhtmlxcalendar_label_minutes'></span>";h.appendChild(l);l[this.conf.touch?"ontouchstart":"onclick"]=function(o){o=o||event;var a=(o.target||o.srcElement);if(a.tagName!=null&&a.tagName.toLowerCase()=="span"&&a._par==true&&a.parentNode!=null){a=a.parentNode}if(a.className&&a.className=="dhtmlxcalendar_label_hours"){o.cancelBubble=true;var n=f.contMonth.offsetHeight+f.contDays.offsetHeight+f.contDates.offsetHeight+a.offsetTop;f._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),n-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){o.cancelBubble=true;if(f._minutesInterval==1){var p=f.getFormatedDate("%i");a.innerHTML="<span class='dhtmlxcalendar_selected_date'>"+p.charAt(0)+"</span>"+p.charAt(1);a.firstChild._par=true;f._selectorMode=1}var n=f.contMonth.offsetHeight+f.contDays.offsetHeight+f.contDates.offsetHeight+a.offsetTop;f._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),n-2,"selector_minutes",true);return}f._hideSelector()};this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(n){this._nullDate=(typeof(n)=="undefined"||n===""||!n);if(!(n instanceof Date)){n=this._strToDate(String(n||""));if(n=="Invalid Date"){n=new Date()}}var a=n.getTime();if(this._isOutOfRange(a)){return}this._activeDate=new Date(a);this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleHours();this._updateVisibleMinutes()};this.getDate=function(n){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(n){return this._dateToStr(a)}return a};this._drawMonth=function(u){if(!(u instanceof Date)){return}if(isNaN(u.getFullYear())){u=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(u.getFullYear(),u.getMonth(),1,0,0,0,0);this._activeDateCell=null;var s=new Date(this._activeMonth.getTime());var o=s.getDay();var y=o-this._wStart;if(y<0){y=y+7}s.setDate(s.getDate()-y);var B=u.getMonth();var C=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var r=0;for(var n=0;n<6;n++){var t=this._wStart;for(var A=0;A<=7;A++){if(A==0){var z=this.getWeekNumber(new Date(s.getFullYear(),s.getMonth(),s.getDate()+r,0,0,0,0));this.contDates.childNodes[n].childNodes[A].innerHTML="<div class='dhtmlxcalendar_label'>"+z+"</div>"}else{var a=new Date(s.getFullYear(),s.getMonth(),s.getDate()+r,0,0,0,0);var x=a.getDay();var p=a.getTime();var v="dhtmlxcalendar_label";if(this._tipData[p]!=null){if(this._tipData[p].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[n].childNodes[A].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[n].childNodes[A].setAttribute("title",this._tipData[p].text)}if(this._tipData[p].showIcon){v+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[n].childNodes[A].removeAttribute("title")}this.contDates.childNodes[n].childNodes[A].innerHTML="<div class='"+v+"'>"+a.getDate()+"</div>";this.contDates.childNodes[n].childNodes[A]._date=new Date(p);this.contDates.childNodes[n].childNodes[A]._q=n;this.contDates.childNodes[n].childNodes[A]._w=A;this.contDates.childNodes[n].childNodes[A]._css_month=(a.getMonth()==B);this.contDates.childNodes[n].childNodes[A]._css_date=(!this._nullDate&&p==C);this.contDates.childNodes[n].childNodes[A]._css_weekend=(t>=6);this.contDates.childNodes[n].childNodes[A]._css_dis=this._isOutOfRange(p);this.contDates.childNodes[n].childNodes[A]._css_holiday=(this._holidays[p]==true);this._updateCellStyle(n,A);if(p==C){this._activeDateCell=this.contDates.childNodes[n].childNodes[A]}if(++t>7){t=1}r++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(u)};this._updateCellStyle=function(p,a){var o=this.contDates.childNodes[p].childNodes[a];var n="dhtmlxcalendar_cell dhtmlxcalendar_cell";n+=(o._css_month?"_month":"");n+=(o._css_date?"_date":"");n+=(o._css_weekend?"_weekend":"");n+=(o._css_holiday?"_holiday":"");n+=(o._css_dis?"_dis":"");n+=(o._css_hover&&!o._css_dis?"_hover":"");o.className=n;o=null};this._minutesInterval=5;this._initSelector=function(u,p){if(!this._selCover){this._selCover=document.createElement("DIV");this._selCover.className="dhtmlxcalendar_selector_cover";this.base.firstChild.appendChild(this._selCover)}if(!this._sel){this._sel=document.createElement("DIV");this._sel.className="dhtmlxcalendar_selector_obj";this.base.firstChild.appendChild(this._sel);this._sel.appendChild(document.createElement("TABLE"));this._sel.firstChild.className="dhtmlxcalendar_selector_table";this._sel.firstChild.cellSpacing=0;this._sel.firstChild.cellPadding=0;this._sel.firstChild.border=0;this._sel.firstChild.appendChild(document.createElement("TBODY"));this._sel.firstChild.firstChild.appendChild(document.createElement("TR"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.childNodes[0].className="dhtmlxcalendar_selector_cell_left";this._sel.firstChild.firstChild.firstChild.childNodes[1].className="dhtmlxcalendar_selector_cell_middle";this._sel.firstChild.firstChild.firstChild.childNodes[2].className="dhtmlxcalendar_selector_cell_right";this._sel.firstChild.firstChild.firstChild.childNodes[0].innerHTML="&nbsp;";this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML="&nbsp;";if(!this.conf.touch){this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_left"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"};this._sel.onmouseover=function(w){w=w||event;var q=(w.target||w.srcElement);if(q._cell===true){if(f._selHover!=q){f._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";f._selHover=q}}};this._sel.onmouseout=function(){f._clearSelHover()}}this._sel.firstChild.firstChild.firstChild.childNodes[0][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;f._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;f._scrollYears(1)};this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[u]==true){return}if(u=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var n=0;for(var a=0;a<4;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(t);for(var v=0;v<3;v++){var x=document.createElement("LI");x.innerHTML=this.langData[this.lang].monthesSNames[n];x.className="dhtmlxcalendar_selector_cell";t.appendChild(x);x._month=n;x._cell=true;this._msCells[n++]=x}}this.msCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){f._hideSelector();f._updateActiveMonth();f._drawMonth(new Date(f._activeMonth.getFullYear(),q._month,1,0,0,0,0));f._doOnSelectorChange()}}}if(u=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(t);for(var v=0;v<3;v++){var x=document.createElement("LI");x.className="dhtmlxcalendar_selector_cell";x._cell=true;t.appendChild(x)}}this.ysCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){f._hideSelector();f._drawMonth(new Date(q._year,f._activeMonth.getMonth(),1,0,0,0,0));f._doOnSelectorChange()}}}if(u=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var n=0;for(var a=0;a<4;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(t);for(var v=0;v<6;v++){var x=document.createElement("LI");x.innerHTML=this._fixLength(n,2);x.className="dhtmlxcalendar_selector_cell";t.appendChild(x);x._hours=n;x._cell=true;this._hsCells[n++]=x}}this.hsCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){f._hideSelector();f._activeDate.setHours(q._hours);f._updateActiveHours();f._updateVisibleHours();f._doOnSelectorChange()}}}if(u=="minutes"){var s=4;var o=3;var r=2;if(this._minutesInterval==1){if(this._selectorMode==1){s=2;o=3;r=1}else{s=2;o=5;r=1;p+="5"}}if(this._minutesInterval==10){s=2}if(this._minutesInterval==15){s=1;o=4;p+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var n=0;for(var a=0;a<s;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(t);for(var v=0;v<o;v++){var x=document.createElement("LI");x.innerHTML=(r>1?this._fixLength(n,r):n);x.className="dhtmlxcalendar_selector_cell";t.appendChild(x);x._minutes=n;x._cell=true;this._rsCells[n]=x;n+=this._minutesInterval}}this.rsCont[this.conf.touch?"ontouchstart":"onclick"]=function(y){y=y||event;y.cancelBubble=true;var w=(y.target||y.srcElement);if(w._minutes!=null){if(f._minutesInterval==1){var q=f.getFormatedDate("%i");if(f._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}f._activeDate.setMinutes(Number(q));f._hideSelector();if(f._selectorMode==1){f._updateVisibleMinutes(true);f._selectorMode=2;f._showSelector("minutes",f._sel._x,f._sel._y,"selector_minutes",true);f._updateActiveMinutes();return}else{f._selectorMode=1}}else{f._hideSelector();f._activeDate.setMinutes(w._minutes);f._updateActiveMinutes()}f._updateVisibleMinutes();f._doOnSelectorChange()}}}this._sel._ta[u]=true};this._showSelector=function(q,n,r,p,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&q==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){n+=12}if(!this._sel||!this._sel._ta[q]){this._initSelector(q,p)}if(q!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=n;this._sel._y=r;this._sel.style.visibility="hidden";this._sel.style.display="";this._selCover.style.width=this.base.offsetWidth-2+"px";this._selCover.style.top=this.contMonth.offsetHeight+"px";this._selCover.style.height=this.contDates.offsetHeight+this.contDays.offsetHeight-1+"px";this._selCover.style.display="";this._sel._t=q;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+p;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(q=="year"?"":"none");var o=Math.max(0,n-Math.round(this._sel.offsetWidth/2));if(o+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){o=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=o+"px";if(q=="hours"||q=="minutes"){this._sel.style.top=r-this._sel.offsetHeight+"px"}else{this._sel.style.top=r+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(q)};this._doOnSelectorShow=function(a){if(a=="month"){this._updateActiveMonth()}if(a=="year"){this._updateYearsList(this._activeMonth)}if(a=="hours"){this._updateActiveHours()}if(a=="minutes"){this._updateActiveMinutes()}};this._hideSelector=function(a){if(!this._sel){return}this._sel.style.display="none";this._sel.style.visible="hidden";this._selCover.style.display="none";if(this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i");this._unloadSelector("minutes")}};this._isSelectorVisible=function(){if(!this._sel){return false}return(this._sel.style.display!="none")};this._doOnSelectorChange=function(a){this.callEvent("onChange",[new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),this._activeDate.getMinutes(),this._activeDate.getSeconds()),a===true])};this._clearSelHover=function(){if(!this._selHover){return}this._selHover.className=String(this._selHover.className.replace(/dhtmlxcalendar_selector_cell_hover/gi,""));this._selHover=null};this._unloadSelector=function(o){if(!this._sel){return}if(!this._sel._ta[o]){return}if(o=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var n in this._msCells){this._msCells[n]._cell=null;this._msCells[n]._month=null;this._msCells[n].parentNode.removeChild(this._msCells[n]);this._msCells[n]=null}this._msCells=null;while(this.msCont.childNodes.length>0){this.msCont.removeChild(this.msCont.lastChild)}this.msCont.parentNode.removeChild(this.msCont);this.msCont=null}if(o=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var n in this._ysCells){this._ysCells[n]._cell=null;this._ysCells[n]._year=null;this._ysCells[n].parentNode.removeChild(this._ysCells[n]);this._ysCells[n]=null}this._ysCells=null;while(this.ysCont.childNodes.length>0){this.ysCont.removeChild(this.ysCont.lastChild)}this.ysCont.parentNode.removeChild(this.ysCont);this.ysCont=null}if(o=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var n in this._hsCells){this._hsCells[n]._cell=null;this._hsCells[n]._hours=null;this._hsCells[n].parentNode.removeChild(this._hsCells[n]);this._hsCells[n]=null}this._hsCells=null;while(this.hsCont.childNodes.length>0){this.hsCont.removeChild(this.hsCont.lastChild)}this.hsCont.parentNode.removeChild(this.hsCont);this.hsCont=null}if(o=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var n in this._rsCells){this._rsCells[n]._cell=null;this._rsCells[n]._minutes=null;this._rsCells[n].parentNode.removeChild(this._rsCells[n]);this._rsCells[n]=null}this._rsCells=null;while(this.rsCont.childNodes.length>0){this.rsCont.removeChild(this.rsCont.lastChild)}this.rsCont.parentNode.removeChild(this.rsCont);this.rsCont=null}this._sel._ta[o]=null};this.setMinutesInterval=function(a){if(!(a==1||a==5||a==10||a==15)){return}this._minutesInterval=a;this._unloadSelector("minutes")};this._updateActiveMonth=function(){if(typeof(this._msActive)!="undefined"&&typeof(this._msCells[this._msActive])!="undefined"){this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell"}this._msActive=this._activeMonth.getMonth();this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateActiveYear=function(){var a=this._activeMonth.getFullYear();if(this._ysCells[a]){this._ysCells[a].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateYearsList=function(s){for(var o in this._ysCells){this._ysCells[o]=null;delete this._ysCells[o]}var p=12*Math.floor(s.getFullYear()/12);for(var r=0;r<4;r++){for(var n=0;n<3;n++){this.ysCont.childNodes[r].childNodes[n].innerHTML=p;this.ysCont.childNodes[r].childNodes[n]._year=p;this.ysCont.childNodes[r].childNodes[n].className="dhtmlxcalendar_selector_cell";this._ysCells[p++]=this.ysCont.childNodes[r].childNodes[n]}}this._updateActiveYear()};this._scrollYears=function(a){var o=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var n=new Date(o,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(n)};this._updateActiveHours=function(){if(typeof(this._hsActive)!="undefined"&&typeof(this._hsCells[this._hsActive])!="undefined"){this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell"}this._hsActive=this._activeDate.getHours();this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleHours=function(){this.contTime.firstChild.firstChild.childNodes[1].innerHTML=this._fixLength(this._activeDate.getHours(),2)};this._updateActiveMinutes=function(){if(this._rsActive!=null&&typeof(this._rsActive)!="undefined"&&typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell"}if(this._minutesInterval==1){this._rsActive=(this.getFormatedDate("%i").toString()).charAt(this._selectorMode==1?0:1)}else{this._rsActive=this._activeDate.getMinutes()}if(typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateVisibleMinutes=function(n){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(n==true){a=a.charAt(0)+"<span class='dhtmlxcalendar_selected_date'>"+a.charAt(1)+"</span>"}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(n==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,n){while(String(a).length<n){a="0"+String(a)}return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(q){var p={};if(this._strToDate!=null){for(var n in this.i){if(this.i[n].input!=null&&this.i[n].input.value.length>0){var r=this._strToDate(this.i[n].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(r instanceof Date){p[n]=r}}}}this._dateFormat=q;var o=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var s=a.replace(/%/,"");switch(s){case"n":case"h":case"j":case"g":case"G":return"\\d{1,2}";case"m":case"d":case"H":case"i":case"s":case"y":return"\\d{2}";case"Y":return"\\d{4}";case"M":return"("+f.langData[f.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+f.langData[f.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM"}return a});this._dateFormatRE=new RegExp(o,"i");for(var n in p){this.i[n].input.value=this._dateToStr(p[n])}p=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._getInd=function(o,a){for(var n=0;n<a.length;n++){if(a[n].toLowerCase()==o){return n}}return -1};this._updateDateStr=function(n){if(!this._dateFormatRE||!n.match(this._dateFormatRE)){return}if(n==this.getFormatedDate()){return}var a=this._strToDate(n);if(!(a instanceof Date)){return}if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this._nullDate=false;this._activeDate=a;this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleMinutes();this._updateVisibleHours();if(this._sel&&this._isSelectorVisible()){this._doOnSelectorShow(this._sel._t)}this._doOnSelectorChange(true)};this.showMonth=function(a){if(typeof(a)=="string"){a=this._strToDate(a)}if(!(a instanceof Date)){return}this._drawMonth(a)};this.setFormatedDate=function(q,r,n,p){var o=this._strToDate(r,q);if(p){return o}this.setDate(o)};this.getFormatedDate=function(n,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,n)};this.getWeekNumber=function(q){if(typeof(q)=="string"){q=this._strToDate(q)}if(!(q instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var v=this._wStart;var p=v+7;var u=4;var n=new Date(q.getFullYear(),0,1,0,0,0,0);var o=n.getDay();if(o==0){o=7}if(u<v){u+=7;o+=7}var s=0;if(o>=v&&o<=u){}else{s=1}var r=o-v;var t=new Date(q.getFullYear(),0,1-r+s*7,0,0,0,0);var x=604800000;var a=new Date(q.getFullYear(),q.getMonth(),q.getDate()+1,0,0,0,0);var w=Math.ceil((a.getTime()-t.getTime())/x);return w};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(o){if(!o&&this._hasParent){this._show();return}if(typeof(o)=="object"&&typeof(o._dhtmlxcalendar_uid)!="undefined"&&this.i[o._dhtmlxcalendar_uid]==o){this._show(o._dhtmlxcalendar_uid);return}if(typeof(o)=="undefined"){for(var n in this.i){if(!o){o=n}}}if(!o){return}this._show(o)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,n){this._px=null;this._py=null;if(a=="right"||a=="bottom"){this.pos=a}else{this.pos="int";if(typeof(a)!="undefined"&&!isNaN(a)){this.base.style.left=a+"px";this._px=a}if(typeof(n)!="undefined"&&!isNaN(n)){this.base.style.top=n+"px";this._py=n}this._ifrSize()}};this._show=function(s,a){if(a===true&&this._activeInp==s&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!s){if(this._px&&this._py){this.base.style.left=this._px+"px";this.base.style.top=this._py+"px"}else{this.base.style.left="0px";this.base.style.top="0px"}}else{if(this.base.className.indexOf("dhtmlxcalendar_in_input")==-1){this.base.className+=" dhtmlxcalendar_in_input"}var p=(this.i[s].input||this.i[s].button);var n=(navigator.appVersion.indexOf("MSIE")!=-1);var q=Math.max((n?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var o=q+(n?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);if(this.pos=="right"){this.base.style.left=this._getLeft(p)+p.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(p),o-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var r=this._getTop(p)+p.offsetHeight+1;if(r+this.base.offsetHeight>o){r=this._getTop(p)-this.base.offsetHeight}this.base.style.left=this._getLeft(p)+"px";this.base.style.top=r+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=s;p=null}this._hideSelector();this.base.style.visibility="visible";this.base.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this._ifrSize();if(this._ifr){this._ifr.style.display=""}this.callEvent("onShow",[])};this._hide=function(){this._hideSelector();this.base.style.display="none";window.dhx4.zim.clear(this.conf.zi);if(this.base.className.indexOf("dhtmlxcalendar_in_input")>=0){this.base.className=this.base.className.replace(/\s{0,}dhtmlxcalendar_in_input/gi,"")}this._activeInp=null;if(this._ifr){this._ifr.style.display="none"}this.callEvent("onHide",[])};this._isVisible=function(){return(this.base.style.display!="none")};this._getLeft=function(a){return this._posGetOffset(a).left};this._getTop=function(a){return this._posGetOffset(a).top};this._posGetOffsetSum=function(a){var o=0,n=0;while(a){o=o+parseInt(a.offsetTop);n=n+parseInt(a.offsetLeft);a=a.offsetParent}return{top:o,left:n}};this._posGetOffsetRect=function(p){var s=p.getBoundingClientRect();var t=document.body;var n=document.documentElement;var a=window.pageYOffset||n.scrollTop||t.scrollTop;var q=window.pageXOffset||n.scrollLeft||t.scrollLeft;var r=n.clientTop||t.clientTop||0;var u=n.clientLeft||t.clientLeft||0;var v=s.top+a-r;var o=s.left+q-u;return{top:Math.round(v),left:Math.round(o)}};this._posGetOffset=function(a){return this[a.getBoundingClientRect?"_posGetOffsetRect":"_posGetOffsetSum"](a)};this._rangeActive=false;this._rangeFrom=null;this._rangeTo=null;this._rangeSet={};this.setInsensitiveDays=function(o){var a=this._extractDates(o);for(var n=0;n<a.length;n++){this._rangeSet[new Date(a[n].getFullYear(),a[n].getMonth(),a[n].getDate(),0,0,0,0).getTime()]=true}this._drawMonth(this._activeMonth)};this.clearInsensitiveDays=function(){this._clearRangeSet();this._drawMonth(this._activeMonth)};this._holidays={};this.setHolidays=function(n){if(n==null){this._clearHolidays()}else{if(n!=null){var a=this._extractDates(n);for(var o=0;o<a.length;o++){this._holidays[new Date(a[o].getFullYear(),a[o].getMonth(),a[o].getDate(),0,0,0,0).getTime()]=true}}}this._drawMonth(this._activeMonth)};this._extractDates=function(o){if(typeof(o)=="string"||o instanceof Date){o=[o]}var n=[];for(var p=0;p<o.length;p++){if(typeof(o[p])=="string"){var s=o[p].split(",");for(var a=0;a<s.length;a++){n.push(this._strToDate(s[a]))}}else{if(o[p] instanceof Date){n.push(o[p])}}}return n};this._clearRange=function(){this._rangeActive=false;this._rangeType=null;this._rangeFrom=null;this._rangeTo=null};this._clearRangeSet=function(){for(var n in this._rangeSet){this._rangeSet[n]=null;delete this._rangeSet[n]}};this._clearHolidays=function(){for(var n in this._holidays){this._holidays[n]=null;delete this._holidays[n]}};this._isOutOfRange=function(n){if(this._rangeSet[n]==true){return true}if(this._rangeActive){if(this._rangeType=="in"&&(n<this._rangeFrom||n>this._rangeTo)){return true}if(this._rangeType=="out"&&(n>=this._rangeFrom&&n<=this._rangeTo)){return true}if(this._rangeType=="from"&&n<this._rangeFrom){return true}if(this._rangeType=="to"&&n>this._rangeTo){return true}}var a=new Date(n);if(this._rangeWeek){if(this._rangeWeekData[a.getDay()]===true){return true}}if(this._rangeMonth){if(this._rangeMonthData[a.getDate()]===true){return true}}if(this._rangeYear){if(this._rangeYearData[a.getMonth()+"_"+a.getDate()]===true){return true}}return false};this.clearSensitiveRange=function(){this._clearRange();this._drawMonth(this._activeMonth)};this.setSensitiveRange=function(p,o,a){var n=false;if(p!=null&&o!=null){if(!(p instanceof Date)){p=this._strToDate(p)}if(!(o instanceof Date)){o=this._strToDate(o)}if(p.getTime()>o.getTime()){return}this._rangeFrom=new Date(p.getFullYear(),p.getMonth(),p.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";n=true}if(!n&&p!=null&&o==null){if(!(p instanceof Date)){p=this._strToDate(p)}this._rangeFrom=new Date(p.getFullYear(),p.getMonth(),p.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";n=true}if(!n&&p==null&&o!=null){if(!(o instanceof Date)){o=this._strToDate(o)}this._rangeFrom=null;this._rangeTo=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";n=true}if(n){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(n,a){if(n!=null&&a!=null){if(!(n instanceof Date)){n=this._strToDate(n)}if(!(a instanceof Date)){a=this._strToDate(a)}if(n.getTime()>a.getTime()){return}this._rangeFrom=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="out";this._drawMonth(this._activeMonth);return}if(n!=null&&a==null){this.setSensitiveRange(null,n,true);return}if(n==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(s,r){if(s=="week"){if(typeof(r)!="object"&&typeof(r.length)=="undefined"){r=[r]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var n in this._rangeWeekData){this._rangeWeekData[n]=false;delete this._rangeWeekData[n]}for(var p=0;p<r.length;p++){this._rangeWeekData[r[p]]=true;if(r[p]==7){this._rangeWeekData[0]=true}}this._rangeWeek=true}if(s=="month"){if(typeof(r)!="object"&&typeof(r.length)=="undefined"){r=[r]}if(!this._rangeMonthData){this._rangeMonthData={}}for(var n in this._rangeMonthData){this._rangeMonthData[n]=false;delete this._rangeMonthData[n]}for(var p=0;p<r.length;p++){this._rangeMonthData[r[p]]=true}this._rangeMonth=true}if(s=="year"){var o=this._extractDates(r);if(!this._rangeYearData){this._rangeYearData={}}for(var n in this._rangeYearData){this._rangeYearData[n]=false;delete this._rangeYearData[n]}for(var p=0;p<o.length;p++){this._rangeYearData[o[p].getMonth()+"_"+o[p].getDate()]=true}this._rangeYear=true}this._drawMonth(this._activeMonth)};this.enableDays=function(a){if(a=="week"){this._rangeWeek=false}if(a=="month"){this._rangeMonth=false}if(a=="year"){this._rangeYear=false}this._drawMonth(this._activeMonth)};this._tipData={};this._tipTM=null;this._tipTMTime=400;this._tipEvs=false;this._tipPopup=null;this._tipCellDate=null;this._tipCellDim=null;this.setTooltip=function(o,s,u,a){var p=this._extractDates(o);for(var r=0;r<p.length;r++){var n=new Date(p[r].getFullYear(),p[r].getMonth(),p[r].getDate(),0,0,0,0).getTime();this._tipData[n]={text:s,showIcon:u,usePopup:a}}this._drawMonth(this._activeMonth)};this.clearTooltip=function(n){var o=this._extractDates(n);for(var p=0;p<o.length;p++){var a=new Date(o[p].getFullYear(),o[p].getMonth(),o[p].getDate(),0,0,0,0).getTime();this._tipData[a]=null;delete this._tipData[a]}this._drawMonth(this._activeMonth)};this._initTooltipPopup=function(){if(this._tipEvs){return}this.attachEvent("onMouseOver",function(n){var a=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime();if(this._tipData[a]!=null){if(this._tipTM){window.clearTimeout(this._tipTM)}this._tipCellDate=n;this._tipCellDim=this.getCellDimension(n);this._tipText=this._tipData[a].text;this._tipTM=window.setTimeout(this._showTooltipPopup,this._tipTMTime)}});this.attachEvent("onMouseOut",this._hideTooltipPopup);this._tipEvs=true};this._showTooltipPopup=function(p,a,q,n,o){if(!f._tipPopup){f._tipPopup=new dhtmlXPopup({mode:"top"})}f._tipPopup.attachHTML(f._tipText);f._tipPopup.show(f._tipCellDim.x,f._tipCellDim.y,f._tipCellDim.w,f._tipCellDim.h);f.callEvent("onPopupShow",[f._tipCellDate])};this._hideTooltipPopup=function(){if(this._tipTM){window.clearTimeout(this._tipTM)}if(this._tipPopup!=null&&this._tipPopup.isVisible()){this._tipPopup.hide();this.callEvent("onPopupHide",[this._tipCellDate])}};this.getPopup=function(){return this._tipPopup};this.getCellDimension=function(o){if(typeof(o)=="string"){o=this._strToDate(o)}if(!(o instanceof Date)){return null}var r=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();var n=null;for(var s=0;s<this.contDates.childNodes.length;s++){for(var a=0;a<this.contDates.childNodes[s].childNodes.length;a++){var u=this.contDates.childNodes[s].childNodes[a];if(u._date!=null&&u._date.getTime()==r){n={x:this._getLeft(u),y:this._getTop(u),w:u.offsetWidth,h:u.offsetHeight}}u=null}}return n};this._updateFromInput=function(a){if(this._nullInInput&&((a.value).replace(/\s/g,"")).length==0){if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[null])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this.setDate(null)}else{this._updateDateStr(a.value)}a=null};this._doOnClick=function(n){n=n||event;var a=(n.target||n.srcElement);if(a._dhtmlxcalendar_uid&&a._dhtmlxcalendar_uid!=f._activeInp&&f._isVisible()&&f._activeInp){f._hide();return}if(!a._dhtmlxcalendar_uid||!f.i[a._dhtmlxcalendar_uid]){if(f._isSelectorVisible()){f._hideSelector()}else{if(!f._hasParent&&f._isVisible()){f._hide()}}}};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13){if(f._isSelectorVisible()){f._hideSelector()}else{if(f._isVisible()&&!f._hasParent){f._hide()}}}};this._doOnInpClick=function(n){n=n||event;var a=(n.target||n.srcElement);if(!a._dhtmlxcalendar_uid){return}if(!f._listenerEnabled){f._updateFromInput(a)}f._show(a._dhtmlxcalendar_uid,true)};this._doOnInpKeyUp=function(n){n=n||event;var a=(n.target||n.srcElement);if(n.keyCode==13||!a._dhtmlxcalendar_uid){return}if(!f._listenerEnabled){f._updateFromInput(a)}};this._doOnBtnClick=function(n){n=n||event;var a=(n.target||n.srcElement);if(!a._dhtmlxcalendar_uid){return}if(f.i[a._dhtmlxcalendar_uid].input!=null){f._updateFromInput(f.i[a._dhtmlxcalendar_uid].input)}f._show(a._dhtmlxcalendar_uid,true)};this._doOnUnload=function(){if(f&&f.unload){f.unload()}};if(typeof(window.addEventListener)=="function"){document.body.addEventListener((this.conf.touch?"touchstart":"click"),f._doOnClick,false);window.addEventListener("keydown",f._doOnKeyDown,false);window.addEventListener("unload",f._doOnUnload,false)}else{document.body.attachEvent("onclick",f._doOnClick);document.body.attachEvent("onkeydown",f._doOnKeyDown);window.attachEvent("onunload",f._doOnUnload)}this.attachObj=function(o){var n=window.dhx4.newId();if(typeof(o)=="string"){this.i[n]={input:document.getElementById(o)}}else{if(typeof(o.tagName)!="undefined"){this.i[n]={input:o}}else{if(typeof(o)=="object"&&(o.input!=null||o.button!=null)){this.i[n]={};if(o.input!=null){this.i[n].input=(typeof(o.input)=="string"?document.getElementById(o.input):o.input)}if(o.button!=null){this.i[n].button=(typeof(o.button)=="string"?document.getElementById(o.button):o.button)}}}}this._attachEventsToObject(n);return n};this.detachObj=function(p){var o=null;if(this.i[p]!=null){o=p}else{if(typeof(p)=="string"){p=document.getElementById(p);o=p._dhtmlxcalendar_uid}else{if(typeof(p.tagName)!="undefined"){o=p._dhtmlxcalendar_uid}else{if(typeof(p)=="object"&&(p.input!=null||p.button!=null)){if(o==null&&p.input!=null){o=(typeof(p.input)=="string"?document.getElementById(p.input):p.input)._dhtmlxcalendar_uid}if(o==null&&p.button!=null){o=(typeof(p.button)=="string"?document.getElementById(p.button):p.button)._dhtmlxcalendar_uid}}}}}if(o!=null&&this.i[o]!=null){this._detachEventsFromObject(o);for(var n in this.i[n]){this.i[o][n]._dhtmlxcalendar_uid=null;this.i[o][n]=null;delete this.i[o][n]}this.i[o]=null;delete this.i[o];return true}return false};this._attachEventsToObject=function(n){if(this.i[n].button!=null){this.i[n].button._dhtmlxcalendar_uid=n;if(typeof(window.addEventListener)=="function"){this.i[n].button.addEventListener((this.conf.touch?"touchstart":"click"),f._doOnBtnClick,false)}else{this.i[n].button.attachEvent("onclick",f._doOnBtnClick)}}else{if(this.i[n].input!=null){this.i[n].input._dhtmlxcalendar_uid=n;if(typeof(window.addEventListener)=="function"){this.i[n].input.addEventListener((this.conf.touch?"touchstart":"click"),f._doOnInpClick,false);this.i[n].input.addEventListener("keyup",f._doOnInpKeyUp,false)}else{this.i[n].input.attachEvent("onclick",f._doOnInpClick);this.i[n].input.attachEvent("onkeyup",f._doOnInpKeyUp)}}}};this._detachEventsFromObject=function(n){if(this.i[n].button!=null){if(typeof(window.addEventListener)=="function"){this.i[n].button.removeEventListener((this.conf.touch?"touchstart":"click"),f._doOnBtnClick,false)}else{this.i[n].button.detachEvent("onclick",f._doOnBtnClick)}}else{if(this.i[n].input!=null){if(typeof(window.addEventListener)=="function"){this.i[n].input.removeEventListener((this.conf.touch?"touchstart":"click"),f._doOnInpClick,false);this.i[n].input.removeEventListener("keyup",f._doOnInpKeyUp,false)}else{this.i[n].input.detachEvent("onclick",f._doOnInpClick);this.i[n].input.detachEvent("onkeyup",f._doOnInpKeyUp)}}}};this.enableListener=function(a){if(!a){return}if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",f._listenerEvFocus,false);a.addEventListener("blur",f._listenerEvBlur,false)}else{a.attachEvent("onfocus",f._listenerEvFocus);a.attachEvent("onblur",f._listenerEvBlur)}a=null};this.disableListener=function(a){if(!a){return}a._f0=false;if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",f._listenerEvFocus,false);a.removeEventListener("blur",f._listenerEvBlur,false)}else{a.detachEvent("onfocus",f._listenerEvFocus);a.detachEvent("onblur",f._listenerEvBlur)}a=null};this._startListener=function(a){if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(a._v1)=="undefined"){a._v1=a.value}if(a._v1!=a.value){this._updateFromInput(a);a._v1=a.value}if(a._f0){this._tmListener=window.setTimeout(function(){f._startListener(a)},100)}};this._listenerEvFocus=function(n){n=n||event;var a=n.target||n.srcElement;a._f0=true;f._startListener(a);a=null};this._listenerEvBlur=function(n){n=n||event;var a=n.target||n.srcElement;a._f0=false;a=null};for(var i in this.i){this._attachEventsToObject(i)}window.dhx4._eventable(this);this._evOnArrowClick=function(a){return this.callEvent("onArrowClick",a)};this._evOnClick=function(a){return this.callEvent("onClick",a)};this._evOnMouseOut=function(a){return this.callEvent("onMouseOut",a)};this._evOnMouseOver=function(a){return this.callEvent("onMouseOver",a)};this.unload=function(){this._activeDate=null;this._activeDateCell=null;this._activeInp=null;this._activeMonth=null;this._dateFormat=null;this._dateFormatRE=null;this._lastHover=null;if(this._tmListener){window.clearTimeout(this._tmListener)}this._tmListener=null;if(typeof(window.addEventListener)=="function"){document.body.removeEventListener((this.conf.touch?"touchstart":"click"),f._doOnClick,false);window.removeEventListener("keydown",f._doOnKeyDown,false);window.removeEventListener("unload",f._doOnUnload,false)}else{document.body.detachEvent("onclick",f._doOnClick);document.body.detachEvent("onkeydown",f._doOnKeyDown);window.detachEvent("onunload",f._doOnKeyDown)}this._doOnClick=null;this._doOnKeyDown=null;this._doOnUnload=null;for(var n in this.i){this.i[n]._dhtmlxcalendar_uid=null;this._detachEventsFromObject(n);this.disableListener(this.i[n].input);this.i[n]=null;delete this.i[n]}this.i=null;this._doOnInpClick=null;this._doOnInpKeyUp=null;window.dhx4._eventable(this,"clear");this.contMonth.onselectstart=null;this.contMonth.firstChild.firstChild.onclick=null;this.contMonth.firstChild.firstChild.ontouchstart=null;this.contMonth.firstChild.firstChild.firstChild.onmouseover=null;this.contMonth.firstChild.firstChild.firstChild.onmouseout=null;this.contMonth.firstChild.firstChild.lastChild.onmouseover=null;this.contMonth.firstChild.firstChild.lastChild.onmouseout=null;while(this.contMonth.firstChild.firstChild.childNodes.length>0){this.contMonth.firstChild.firstChild.removeChild(this.contMonth.firstChild.firstChild.lastChild)}this.contMonth.firstChild.removeChild(this.contMonth.firstChild.firstChild);this.contMonth.removeChild(this.contMonth.firstChild);this.contMonth.parentNode.removeChild(this.contMonth);this.contMonth=null;while(this.contDays.firstChild.childNodes.length>0){this.contDays.firstChild.removeChild(this.contDays.firstChild.lastChild)}this.contDays.removeChild(this.contDays.firstChild);this.contDays.parentNode.removeChild(this.contDays);this.contDays=null;this.contDates.onclick=null;this.contDates.ontouchstart=null;this.contDates.onmouseover=null;this.contDates.onmouseout=null;while(this.contDates.childNodes.length>0){while(this.contDates.lastChild.childNodes.length>0){this.contDates.lastChild.lastChild._css_date=null;this.contDates.lastChild.lastChild._css_month=null;this.contDates.lastChild.lastChild._css_weekend=null;this.contDates.lastChild.lastChild._css_hover=null;this.contDates.lastChild.lastChild._date=null;this.contDates.lastChild.lastChild._q=null;this.contDates.lastChild.lastChild._w=null;this.contDates.lastChild.removeChild(this.contDates.lastChild.lastChild)}this.contDates.removeChild(this.contDates.lastChild)}this.contDates.parentNode.removeChild(this.contDates);this.contDates=null;this.contTime.firstChild.firstChild.onclick=null;this.contTime.firstChild.firstChild.ontouchstart=null;while(this.contTime.firstChild.firstChild.childNodes.length>0){this.contTime.firstChild.firstChild.removeChild(this.contTime.firstChild.firstChild.lastChild)}this.contTime.firstChild.removeChild(this.contTime.firstChild.firstChild);this.contTime.removeChild(this.contTime.firstChild);this.contTime.parentNode.removeChild(this.contTime);this.contTime=null;this._lastHover=null;this._unloadSelector("month");this._unloadSelector("year");this._unloadSelector("hours");this._unloadSelector("minutes");if(this._selCover){this._selCover.parentNode.removeChild(this._selCover);this._selCover=null}if(this._sel){for(var n in this._sel._ta){this._sel._ta[n]=null}this._sel._ta=null;this._sel._t=null;this._sel.onmouseover=null;this._sel.onmouseout=null;while(this._sel.firstChild.firstChild.firstChild.childNodes.length>0){this._sel.firstChild.firstChild.firstChild.lastChild.onclick=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseover=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseout=null;this._sel.firstChild.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild.lastChild)}this._sel.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild);this._sel.firstChild.removeChild(this._sel.firstChild.firstChild);while(this._sel.childNodes.length>0){this._sel.removeChild(this._sel.lastChild)}this._sel.parentNode.removeChild(this._sel);this._sel=null}this.base.onclick=null;this.base.onmousedown=null;this.base.ontouchstart=null;this.base.onmouseout=null;this.base.parentNode.removeChild(this.base);this.base=null;this._clearDayHover=null;this._clearSelHover=null;this._doOnSelectorChange=null;this._doOnSelectorShow=null;this._drawMonth=null;this._fixLength=null;this._getLeft=null;this._getTop=null;this._ifrSize=null;this._hide=null;this._hideSelector=null;this._initSelector=null;this._isSelectorVisible=null;this._isVisible=null;this._posGetOffset=null;this._posGetOffsetRect=null;this._posGetOffsetSum=null;this._scrollYears=null;this._show=null;this._showSelector=null;this._strToDate=null;this._updateActiveHours=null;this._updateActiveMinutes=null;this._updateActiveMonth=null;this._updateActiveYear=null;this._updateCellStyle=null;this._updateDateStr=null;this._updateVisibleHours=null;this._updateVisibleMinutes=null;this._updateYearsList=null;this.enableIframe=null;this.hide=null;this.hideTime=null;this.setDate=null;this.setDateFormat=null;this.setYearsRange=null;this.show=null;this.showTime=null;this.unload=null;if(this._tipPopup!=null){this._tipPopup.unload();this._tipPopup=null}for(var n in this){delete this[n]}n=f=null};this.setDate(this._activeDate);return this}dhtmlXCalendarObject.prototype.lang="en";dhtmlXCalendarObject.prototype.langData={en:{dateformat:"%Y-%m-%d",hdrformat:"%F %Y",monthesFNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthesSNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysFNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysSNames:["Su","Mo","Tu","We","Th","Fr","Sa"],weekstart:1,weekname:"w"}};dhtmlXCalendarObject.prototype._buildMonthHdr=function(f){var b=this;var d=function(g){return(String(g).length==1?"0"+String(g):g)};var a=function(g,h){return"<span class='dhtmlxcalendar_month_label_"+g+"'>"+h+"</span>"};var c=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(g){switch(g){case"%m":return a("month",d(f.getMonth()+1));case"%n":return a("month",f.getMonth()+1);case"%M":return a("month",b.langData[b.lang].monthesSNames[f.getMonth()]);case"%F":return a("month",b.langData[b.lang].monthesFNames[f.getMonth()]);case"%y":return a("year",d(f.getYear()%100));case"%Y":return a("year",f.getFullYear());case"%%":return"%";default:return g}});b=d=a=null;return c};dhtmlXCalendarObject.prototype.enableIframe=function(a){if(a==true){if(!this._ifr){this._ifr=document.createElement("IFRAME");this._ifr.frameBorder=0;this._ifr.border=0;this._ifr.setAttribute("src","javascript:false;");this._ifr.className="dhtmlxcalendar_ifr";this._ifr.onload=function(){this.onload=null;this.contentWindow.document.open("text/html","replace");this.contentWindow.document.write("<html><head><style>html,body{width:100%;height:100%;overflow:hidden;margin:0px;}</style></head><body</body></html>")};this.base.parentNode.insertBefore(this._ifr,this.base);this._ifrSize()}}else{if(this._ifr){this._ifr.parentNode.removeChild(this._ifr);this._ifr=null}}};dhtmlXCalendarObject.prototype._ifrSize=function(){if(this._ifr){this._ifr.style.left=this.base.style.left;this._ifr.style.top=this.base.style.top;this._ifr.style.width=this.base.offsetWidth+"px";this._ifr.style.height=this.base.offsetHeight+"px"}};dhtmlxCalendarObject=dhtmlXCalendarObject;dhtmlXCalendarObject.prototype._strToDate=function(g,s){s=(s||this._dateFormat);s=s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var u=[];var l=[];s=s.replace(/%[a-z]/gi,function(f){switch(f){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":l.push(f);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":l.push(f);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":l.push(f);return"(\\d{1,2})";case"%Y":l.push(f);return"(\\d{4})";case"%a":l.push(f);return"(\\[am|pm])";case"%A":l.push(f);return"(\\[AM|PM])"}return f});var x=new RegExp(s);var m=g.match(x);if(m==null||m.length-1!=l.length){return"Invalid Date"}for(var b=1;b<m.length;b++){u.push(m[b])}var c={"%y":1,"%Y":1,"%n":2,"%m":2,"%M":2,"%F":2,"%d":3,"%j":3,"%a":4,"%A":4,"%H":5,"%G":5,"%h":5,"%g":5,"%i":6,"%s":7};var n={};var i={};for(var b=0;b<l.length;b++){if(typeof(c[l[b]])!="undefined"){var d=c[l[b]];if(!n[d]){n[d]=[];i[d]=[]}n[d].push(u[b]);i[d].push(l[b])}}u=[];l=[];for(var b=1;b<=7;b++){if(n[b]!=null){for(var o=0;o<n[b].length;o++){u.push(n[b][o]);l.push(i[b][o])}}}var j=this;var a=new Date();a.setDate(1);a.setMinutes(0);a.setSeconds(0);for(var b=0;b<u.length;b++){switch(l[b]){case"%d":case"%j":case"%n":case"%m":case"%Y":case"%H":case"%G":case"%i":case"%s":if(!isNaN(u[b])){a[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds"}[l[b]]](Number(u[b])+(l[b]=="%m"||l[b]=="%n"?-1:0))}break;case"%M":case"%F":var h=this._getInd(u[b].toLowerCase(),j.langData[j.lang][{"%M":"monthesSNames","%F":"monthesFNames"}[l[b]]]);if(h>=0){a.setMonth(h)}break;case"%y":if(!isNaN(u[b])){var t=Number(u[b]);a.setFullYear(t+(t>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(u[b])){var t=Number(u[b]);if(t<=12&&t>=0){a.setHours(t+(this._getInd("pm",u)>=0?(t==12?0:12):(t==12?-12:0)))}}break}}j=null;return a};dhtmlXCalendarObject.prototype._dateToStr=function(g,d){var c=this;if(g instanceof Date){var f=function(h){return(String(h).length==1?"0"+String(h):h)};var a=function(h){switch(h){case"%d":return f(g.getDate());case"%j":return g.getDate();case"%D":return c.langData[c.lang].daysSNames[g.getDay()];case"%l":return c.langData[c.lang].daysFNames[g.getDay()];case"%m":return f(g.getMonth()+1);case"%n":return g.getMonth()+1;case"%M":return c.langData[c.lang].monthesSNames[g.getMonth()];case"%F":return c.langData[c.lang].monthesFNames[g.getMonth()];case"%y":return f(g.getYear()%100);case"%Y":return g.getFullYear();case"%g":return(g.getHours()+11)%12+1;case"%h":return f((g.getHours()+11)%12+1);case"%G":return g.getHours();case"%H":return f(g.getHours());case"%i":return f(g.getMinutes());case"%s":return f(g.getSeconds());case"%a":return(g.getHours()>11?"pm":"am");case"%A":return(g.getHours()>11?"PM":"AM");case"%%":"%";default:return h}};var b=String(d||this._dateFormat).replace(/%[a-zA-Z]/g,a)}c=null;return(b||String(g))};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(b){var a=this;this.leftCalendar=new dhtmlXCalendarObject(b);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(b);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(c){a._updateRange("rightCalendar",c,null);a._evOnClick(["left",c])});this.rightCalendar.attachEvent("onClick",function(c){a._updateRange("leftCalendar",null,c);a._evOnClick(["right",c])});this.leftCalendar.attachEvent("onBeforeChange",function(c){return a._evOnBeforeChange(["left",c])});this.rightCalendar.attachEvent("onBeforeChange",function(c){return a._evOnBeforeChange(["right",c])});this.show=function(){this.leftCalendar.show();this.rightCalendar.base.style.marginLeft=this.leftCalendar.base.offsetWidth-1+"px";this.rightCalendar.show()};this.hide=function(){this.leftCalendar.hide();this.rightCalendar.hide()};this.setDateFormat=function(c){this.leftCalendar.setDateFormat(c);this.rightCalendar.setDateFormat(c)};this.setDates=function(d,c){if(d!=null){this.leftCalendar.setDate(d)}if(c!=null){this.rightCalendar.setDate(c)}this._updateRange()};this._updateRange=function(c,f,d){if(arguments.length==3){(c=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(f,d)}else{this.leftCalendar.setSensitiveRange(null,this.rightCalendar.getDate());this.rightCalendar.setSensitiveRange(this.leftCalendar.getDate(),null)}};this.getFormatedDate=function(){return this.leftCalendar.getFormatedDate.apply(this.leftCalendar,arguments)};this.unload=function(){window.dhx4._eventable(this,"clear");this.leftCalendar.unload();this.rightCalendar.unload();this.leftCalendar=this.rightCalendar=null;this._updateRange=null;this._evOnClick=null;this._evOnBeforeChange=null;this.show=null;this.hide=null;this.setDateFormat=null;this.setDates=null;this.getFormatedDate=null;this.unload=null;a=null};this._evOnClick=function(c){return this.callEvent("onClick",c)};this._evOnBeforeChange=function(c){return this.callEvent("onBeforeChange",c)};window.dhx4._eventable(this);return this};function dhtmlXCombo(g,l,c,i,f){var h=this;var d=null;var m=null;if(typeof(g)=="object"&&!g.tagName){d=g;g=d.parent;c=d.width;l=d.name;i=d.mode;m=d.skin}this.cont=(typeof(g)=="string"?document.getElementById(g):g);this.conf={skin:null,form_name:l||"dhxcombo",combo_width:(parseInt(c)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(i)=="string"&&typeof(this.modes[i])!="undefined"?i:"option"),opts_count:8,opts_count_min:3,opts_width:null,item_h:null,list_zi_id:window.dhx4.newId(),allow_free_text:true,allow_empty_value:true,enabled:true,img_path:"",img_def:"",img_def_dis:true,template:{input:"#text#",option:"#text#"},f_mode:false,f_url:false,f_cache:false,f_cache_data:{},f_dyn:false,f_dyn_end:false,f_mask:"",f_ac:true,f_ac_text:"",f_server_tm:null,f_server_last:"",last_hover:null,last_selected:null,last_match:null,last_text:"",last_value:"",tm_hover:null,tm_confirm_blur:null,clear_click:false,clear_blur:false,clear_bsp:false,clear_key:false,sp:{dhx_skyblue:{list_ofs:1},dhx_web:{list_ofs:0},dhx_terrace:{list_ofs:1}}};this.conf.combo_image=(this.modes[this.conf.opts_type].image==true);this.t={};this.base=document.createElement("DIV");this.base.style.width=this.conf.combo_width+"px";this.base.innerHTML="<input type='text' class='dhxcombo_input' style='width:"+(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px;"+(this.conf.combo_image?"margin-left:23px;":"")+"' autocomplete='off'><input type='hidden' value=''><input type='hidden' value='false'><div class='dhxcombo_select_button'><div class='dhxcombo_select_img'></div></div>"+(this.conf.combo_image?"<div class='dhxcombo_top_image'>"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"</div>":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this.setSkin(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcombo")||"dhx_skyblue");this._updateTopImage=function(a){if(!this.conf.combo_image){return}if(a!=null){this.base.lastChild.innerHTML=this.t[a].obj.getTopImage(this.t[a].item,this.conf.enabled)}else{this.base.lastChild.innerHTML=this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)}};this._filterOpts=function(v){if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}var o=String(this.base.firstChild.value).replace(new RegExp(this.conf.f_ac_text+"$","i"),"");if(this.conf.f_server_last==o.toLowerCase()){this._checkForMatch();return}if(this.conf.f_url!=null&&this.checkEvent("onDynXLS")){this.conf.f_server_last=o.toLowerCase();this.callEvent("onDynXLS",[o]);return}if(this.conf.f_url!=null){if(o.length==0){this.conf.f_server_last=o.toLowerCase();this.clearAll();return}if(this.conf.f_cache==true&&this.conf.f_cache_data[o]!=null){this.clearAll();this.conf.f_server_last=o.toLowerCase();for(var s=0;s<this.conf.f_cache_data[o].data.length;s++){this.load(this.conf.f_cache_data[o].data[s])}if(this.conf.f_dyn){this.conf.f_dyn_end=this.conf.f_cache_data[o].dyn_end;this.conf.f_mask=this.conf.f_cache_data[o].mask}if(v!==true){this._showList(true);this._checkForMatch()}}else{this.conf.f_server_tm=window.setTimeout(function(){h.conf.f_server_last=o.toLowerCase();h.conf.f_mask=o;var q="mask="+encodeURIComponent(o);if(h.conf.f_dyn){q+="&pos=0";h.conf.f_dyn_end=false}var a=function(x){if(h.conf.f_cache){if(!h.conf.f_cache_data[o]){h.conf.f_cache_data[o]={data:[],dyn_end:false,mask:o}}h.conf.f_cache_data[o].data.push(x.xmlDoc.responseXML)}h.clearAll();h.load(x.xmlDoc.responseXML);if(h.conf.f_ac&&h.conf.f_mode=="start"&&h.conf.clear_bsp==false&&h.list.firstChild!=null){var w=h.list.firstChild._optId;var y=String(h.t[w].obj.getText(h.list.firstChild,true));if(String(y).toLowerCase().indexOf(String(o).toLowerCase())===0){h.base.firstChild.value=y;h._selectRange(o.length,y.length)}}if(v!==true){h._showList(true);h._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(h.conf.f_url,q,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(h.conf.f_url+(String(h.conf.f_url).indexOf("?")>=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=o.toLowerCase();var p=(o.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+o,"i"));var u=null;for(var n in this.t){var t=this.t[n].obj.getText(this.t[n].item,true);if(p===true||p.test(t)==true){this.t[n].item.style.display="";if(u==null&&o.length>0){u=String(this.t[n].obj.getText(this.t[n].item,true))}}else{this.t[n].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&u!=null){this.conf.f_ac_text=u.replace(new RegExp("^"+o,"i"),"");this.base.firstChild.value=u;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}if(this.conf.f_mode=="between"&&this.conf.clear_bsp==true){this._checkForMatch(true)}if(v!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}this.addOption(a.options)};this._xmlToObj=function(x,z){var D={options:[]};var A=(z==true?x:x.getElementsByTagName("complete"));if(A.length>0){var p=A[0].childNodes;for(var o=0;o<p.length;o++){if(typeof(p[o].tagName)!="undefined"){if(String(p[o].tagName).toLowerCase()=="template"){for(var C=0;C<p[o].childNodes.length;C++){if(p[o].childNodes[C].tagName!=null){var v=p[o].childNodes[C].tagName;if(typeof(this.conf.template[v])!="undefined"){this.conf.template[v]=(p[o].childNodes[C].firstChild!=null?p[o].childNodes[C].firstChild.nodeValue:"")}}}}if(String(p[o].tagName).toLowerCase()=="option"){var u=false;if(z==true){u=(window.dhx4.s2b(p[o].selected)||p[o].getAttribute("selected")!=null)}else{u=window.dhx4.s2b(p[o].getAttribute("selected"))}var r={value:p[o].getAttribute("value"),text:(p[o].firstChild!=null?p[o].firstChild.nodeValue:""),selected:u,checked:window.dhx4.s2b(p[o].getAttribute("checked"))};for(var B in {img:1,img_dis:1,img_src:1,img_src_dis:1}){if(p[o].getAttribute(B)!=null){r[B]=p[o].getAttribute(B)}}for(var C=0;C<p[o].childNodes.length;C++){if(p[o].childNodes[C].tagName!=null&&String(p[o].childNodes[C].tagName).toLowerCase()=="text"){r.text={};var s=p[o].childNodes[C];for(var y=0;y<s.childNodes.length;y++){if(s.childNodes[y].tagName!=null){r.text[s.childNodes[y].tagName]=(s.childNodes[y].firstChild!=null?s.childNodes[y].firstChild.nodeValue:"")}}}}D.options.push(r)}}}A=p=null}return D};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","complete",{data:true});window.dhx4._eventable(this);this._getNearItem=function(o,n){var a=null;while(o!=null){o=o[n<0?"previousSibling":"nextSibling"];if(a==null&&o!=null&&o.style.display==""&&o._optId!=null){a=o;o=null}}return a};this.setName(this.conf.form_name);this._doOnListMouseMove=function(n){n=n||event;var a=n.target||n.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){if(h.conf.tm_hover){window.clearTimeout(h.conf.tm_hover)}h._setSelected(a._optId)}a=a.parentNode}a=null};this._doOnListMouseDown=function(a){a=a||event;a.cancelBubble=true;h.conf.clear_click=true;window.setTimeout(function(){h.base.firstChild.focus()},1)};this._doOnListMouseUp=function(o){o=o||event;var a=o.target||o.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){var n=true;if(typeof(h.t[a._optId].obj.optionClick)=="function"&&h.t[a._optId].obj.optionClick(a,o,h)!==true){n=false}if(n){h._setSelected(a._optId,null,true);h._confirmSelect("click")}}a=a.parentNode}a=null};this._doOnListMouseOut=function(a){if(h.conf.tm_hover){window.clearTimeout(h.conf.tm_hover)}h.conf.tm_hover=window.setTimeout(function(){var n=h.conf.last_match||h.conf.last_selected;if(h.conf.last_match==null&&h.t[n]!=null){if(h.base.firstChild.value!=h.t[n].obj.getText(h.t[n].item,true)){n=null}}h._setSelected(n,null,true)},1)};this._doOnBaseMouseDown=function(r){if(!h.conf.enabled){return}h.conf.clear_click=true;r=r||event;var n=r.target||r.srcElement;if(n!=this.firstChild){window.setTimeout(function(){h.base.firstChild.focus()},1);var q=n;while(q!=this&&q!=null){if(q==this.lastChild){if(typeof(h.modes[h.conf.opts_type].topImageClick)=="function"){var o=(h.conf.last_hover||h.conf.last_selected);var a=(o!=null?h.t[o].item:null);if(h.modes[h.conf.opts_type].topImageClick(a,h)!==true){o=a=null;return}}q=null}else{q=q.parentNode}}}if(h._isListVisible()){h._hideList()}else{if(n!=this.firstChild){h.conf.clear_blur=true}h._showList();h._setSelected(h.conf.last_selected,true,true)}n=null};this._doOnBodyMouseDown=function(){if(h.conf.clear_click){h.conf.clear_click=false;return}h._confirmSelect("blur")};this._doOnInputFocus=function(){h.conf.clear_blur=false;if(h.conf.tm_confirm_blur){window.clearTimeout(h.conf.tm_confirm_blur)}if(h.conf.combo_focus==false){h.conf.combo_focus=true;h.callEvent("onFocus",[])}};this._doOnInputBlur=function(){if(h.conf.clear_blur==true){h.conf.clear_blur=false;return}if(h.conf.tm_confirm_blur){window.clearTimeout(h.conf.tm_confirm_blur)}h.conf.tm_confirm_blur=window.setTimeout(function(){if(h.conf.clear_click==false){h._confirmSelect("blur");h.conf.combo_focus=false;h.callEvent("onBlur",[])}},20)};this._doOnInputKeyUp=function(a){a=a||event;if(h.conf.f_mode!=false){h.conf.clear_bsp=(a.keyCode==8||a.keyCode==46);h._filterOpts();return}else{h._checkForMatch()}};this._doOnInputKeyDown=function(a){a=a||event;if((a.keyCode==38||a.keyCode==40)&&!a.ctrlKey&&!a.shiftKey&&!a.altKey){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;h._keyOnUpDown(a.keyCode==38?-1:1)}if(a.keyCode==113){if(!h._isListVisible()){h._showList();if(h.base.firstChild.value==h.conf.last_text){h._setSelected(h.conf.last_selected,true,true);h.base.firstChild.value=h.conf.last_text;h.conf.f_server_last=h.base.firstChild.value.toLowerCase()}else{h.conf.f_server_last=h.base.firstChild.value.toLowerCase();if(h.conf.f_mode==false){h._checkForMatch()}}}else{}}if(a.keyCode==27){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;h._cancelSelect()}if(a.keyCode==13){if(a.preventDefault){a.preventDefault()}h._confirmSelect("kbd")}h.conf.clear_key=true;h.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(h.conf.clear_key){h.conf.clear_key=false;return}a=a||event;h.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var n=null;if(this.conf.last_hover){n=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){n=this.t[this.conf.last_selected].item}}if(!n&&this._getListVisibleCount()==0){return}if(n!=null&&n.style.display!=""){n=null}this._showList();if(n!=null){if(this.t[n._optId].obj.isSelected(n)){n=this._getNearItem(n,a)}}else{n=this.list.firstChild;if(n.style.display!=""){n=this._getNearItem(n,1)}}if(n==null){return}this._setSelected(n._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[n._optId].obj.getText(n,true)}else{var o=String(this.t[n._optId].obj.getText(n,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(o.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=o.substring(this.conf.f_server_last.length,o.length);this.base.firstChild.value=o;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=o;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=o;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}n=null};this.conf.evs_nodes=[{node:document.body,evs:{mousedown:"_doOnBodyMouseDown"}},{node:this.base,evs:{mousedown:"_doOnBaseMouseDown"}},{node:this.base.firstChild,evs:{keyup:"_doOnInputKeyUp",keydown:"_doOnInputKeyDown",keypress:"_doOnInputKeyPress",focus:"_doOnInputFocus",blur:"_doOnInputBlur"}},{node:this.list,evs:{mousemove:"_doOnListMouseMove",mousedown:"_doOnListMouseDown",mouseup:"_doOnListMouseUp",mouseout:"_doOnListMouseOut"}}];for(var b=0;b<this.conf.evs_nodes.length;b++){for(var j in this.conf.evs_nodes[b].evs){if(window.addEventListener){this.conf.evs_nodes[b].node.addEventListener(j,this[this.conf.evs_nodes[b].evs[j]],false)}else{this.conf.evs_nodes[b].node.attachEvent("on"+j,this[this.conf.evs_nodes[b].evs[j]])}}}this.unload=function(){this.clearAll();this.t=null;for(var o=0;o<this.conf.evs_nodes.length;o++){for(var n in this.conf.evs_nodes[o].evs){if(window.addEventListener){this.conf.evs_nodes[o].node.removeEventListener(n,this[this.conf.evs_nodes[o].evs[n]],false)}else{this.conf.evs_nodes[o].node.detachEvent("on"+n,this[this.conf.evs_nodes[o].evs[n]])}this.conf.evs_nodes[o].evs[n]=null;delete this.conf.evs_nodes[o].evs[n]}this.conf.evs_nodes[o].node=null;this.conf.evs_nodes[o].evs=null;delete this.conf.evs_nodes[o].node;delete this.conf.evs_nodes[o].evs;this.conf.evs_nodes[o]=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");this.DOMelem_input=this.DOMelem_button=this.DOMlist=null;for(var n in this.conf){this.conf[n]=null;delete this.conf[n]}this.conf=null;this.base.parentNode.removeChild(this.base);this.list.parentNode.removeChild(this.list);this.base=this.list=this.cont=null;this.modes=null;for(var n in this){if(typeof(this[n])=="function"){this[n]=null}}h=null};this.DOMelem_input=this.base.firstChild;this.DOMelem_button=this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)];this.DOMlist=this.list;this.DOMelem=this.base;this.DOMParent=g;g=null;if(d!=null){if(d.filter!=null){if(typeof(d.filter)=="string"){this.enableFilteringMode(true,d.filter,window.dhx4.s2b(d.filter_cache),window.dhx4.s2b(d.filter_sub_load))}else{this.enableFilteringMode(true)}}if(d.image_path!=null){this.setImagePath(d.image_path)}if(d.default_image!=null||d.default_image_dis!=null){this.setDefaultImage(d.default_image,d.default_image_dis)}if(d.items||d.options){this.addOption(d.items||d.options)}if(d.xml||d.json){this.load(d.xml||d.json)}if(typeof(d.readonly)!="undefined"){this.readonly(d.readonly)}d=null}return this}function dhtmlXComboFromSelect(c){if(typeof(c)=="string"){c=document.getElementById(c)}var b=c.offsetWidth;var l=c.getAttribute("name")||null;var d=document.createElement("SPAN");c.parentNode.insertBefore(d,c);var g=c.getAttribute("mode")||c.getAttribute("opt_type")||"option";var f=new dhtmlXCombo(d,l,b,g);d=null;var i=c.getAttribute("imagePath");if(i){f.setImagePath(i)}var j=c.getAttribute("defaultImage");var h=c.getAttribute("defaultImageDis");if(window.dhx4.s2b(h)==true){h=true}if(j!=null||h!=null){f.setDefaultImage(j,h)}var a=f._xmlToObj([c],true);if(a.options.length>0){f.addOption(a.options)}a=null;c.parentNode.removeChild(c);c=null;return f}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a+"_new_value"};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true")}else{this.base.firstChild.removeAttribute("readOnly")}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(c){for(var b in c){if(typeof(this.conf.template[b])!="undefined"){this.conf.template[b]=String(c[b])}}for(var b in this.t){this.t[b].obj.setText(this.t[b].item,this.t[b].item._conf.text)}this._confirmSelect()};dhtmlXCombo.prototype.setSkin=function(a){if(a==this.conf.skin){return}this.conf.skin=a;this.base.className="dhxcombo_"+this.conf.skin+(this.conf.enabled?"":" dhxcombo_disabled");this.list.className="dhxcombolist_"+this.conf.skin};dhtmlXCombo.prototype.getInput=function(){return this.base.firstChild};dhtmlXCombo.prototype.getButton=function(){return this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)]};dhtmlXCombo.prototype.getList=function(){return this.list};dhtmlXCombo.prototype.getBase=function(){return this.base};dhtmlXCombo.prototype.getParent=function(){return this.DOMParent};dhtmlXCombo.prototype.forEachOption=function(a){for(var b=0;b<this.list.childNodes.length;b++){a.apply(window,[this._getOption(this.list.childNodes[b]._optId,b)])}};dhtmlXCombo.prototype.setFocus=function(){if(this.conf.enabled){this.base.firstChild.focus()}};dhtmlXCombo.prototype.setFontSize=function(a,b){if(a!=null){this.base.firstChild.style.fontSize=a}if(b!=null){this.list.style.fontSize=b}};dhtmlXCombo.prototype.getOption=function(f){var g=null;var c=null;for(var d=0;d<this.list.childNodes.length;d++){if(g==null){var b=this.list.childNodes[d]._optId;if(this.t[b].obj.getValue(this.t[b].item)==f){g=b;c=d}}}return(g==null?null:this._getOption(g,c))};dhtmlXCombo.prototype.getOptionByIndex=function(a){if(a<0){return null}if(this.list.childNodes[a]==null){return null}return this._getOption(this.list.childNodes[a]._optId,a)};dhtmlXCombo.prototype.getOptionByLabel=function(f){var g=null;var c=null;for(var d=0;d<this.list.childNodes.length;d++){if(g==null){var b=this.list.childNodes[d]._optId;if(this.t[b].obj.getText(this.t[b].item,true)==f){g=b;c=d}}}return(g==null?null:this._getOption(g,c))};dhtmlXCombo.prototype.getSelectedIndex=function(){return this._getOptionProp(this.conf.last_selected,"index",-1)};dhtmlXCombo.prototype.getSelectedText=function(){return this._getOptionProp(this.conf.last_selected,"text","")};dhtmlXCombo.prototype.getSelectedValue=function(){return this._getOptionProp(this.conf.last_selected,"value",null)};dhtmlXCombo.prototype.getActualValue=function(){return this.base.childNodes[1].value};dhtmlXCombo.prototype.getComboText=function(){return this.base.childNodes[0].value};dhtmlXCombo.prototype.getIndexByValue=function(b){var a=this.getOption(b);return(a!=null?a.index:-1)};dhtmlXCombo.prototype.setComboText=function(a){this.conf.last_text=this.base.firstChild.value=a;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()};dhtmlXCombo.prototype.setComboValue=function(b){var a=this.getOption(b);if(a!=null){this.selectOption(a.index)}else{this.conf.last_value=b;this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="true"}};dhtmlXCombo.prototype.selectOption=function(b,c,a){if(b<0||b>=this.list.childNodes.length){return}var d=this.list.childNodes[b]._optId;this._setSelected(d,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelect("script")};dhtmlXCombo.prototype.enable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));if(this.conf.enabled==a){return}this.conf.enabled=a;if(a){this.base.className="dhxcombo_"+this.conf.skin;this.base.firstChild.removeAttribute("disabled")}else{this._hideList();this.base.className="dhxcombo_"+this.conf.skin+" dhxcombo_disabled";this.base.firstChild.setAttribute("disabled","true")}this._updateTopImage(this.conf.last_selected)};dhtmlXCombo.prototype.disable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));this.enable(!a)};dhtmlXCombo.prototype.isEnabled=function(){return(this.conf.enabled==true)};dhtmlXCombo.prototype.show=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.base.style.display=(a==true?"":"none")};dhtmlXCombo.prototype.hide=function(a){if(typeof(a)=="undefined"){a=true}this.show(!a)};dhtmlXCombo.prototype.isVisible=function(){return(this.base.style.display=="")};dhtmlXCombo.prototype.enableFilteringMode=function(d,b,a,c){if(d==true||d=="between"){this.conf.f_mode=(d==true?"start":"between");if(b!=null){this.conf.f_url=b;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(c)}else{this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}}else{this.conf.f_mode=false;this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}};dhtmlXCombo.prototype.filter=function(b){for(var c=0;c<this.list.childNodes.length;c++){var a=b.apply(window,[this._getOption(this.list.childNodes[c]._optId,c)]);this.list.childNodes[c].style.display=(a===true?"":"none")}};dhtmlXCombo.prototype.sort=function(c){var a=[];for(var b=0;b<this.list.childNodes.length;b++){var d=this.list.childNodes[b]._optId;a.push([d,this._getOption(d,b)])}if(c=="asc"||c=="desc"){k=true;a.sort(function(g,f){g=g[1].text_option.toLowerCase();f=f[1].text_option.toLowerCase();var h=(c=="asc"?1:-1);return(g>f?h:-1*h)})}else{if(typeof(c)=="function"||typeof(window[c])=="function"){if(typeof(window[c])=="function"){c=window[c]}a.sort(function(g,f){return c.apply(window,[g[1],f[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var b=0;b<a.length;b++){this.list.appendChild(this.t[a[b][0]].item)}};dhtmlXCombo.prototype.enableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.conf.f_ac=a};dhtmlXCombo.prototype.disableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.enableAutocomplete(!a)};dhtmlXCombo.prototype.allowFreeText=function(a){this.conf.allow_free_text=(typeof(a)=="undefined"?true:window.dhx4.s2b(a))};dhtmlXCombo.prototype._checkForMatch=function(d){var a=window.dhx4.trim(this.base.firstChild.value).toLowerCase();var f=null;var b=this.list.firstChild;while(b!=null){if(b.style.display==""&&b._optId!=null){var c=window.dhx4.trim(this.t[b._optId].obj.getText(b,true)).toLowerCase();if(a==c){f=b._optId;b=null}}if(b!=null){b=b.nextSibling}}if(this.conf.last_match==null){if(f!=null){this._setSelected(f,true,true);this.conf.last_match=f}else{if(this.conf.f_mode!="between"||d==true){this._setSelected(null,true,true);this.conf.last_match=null}}}else{if(f!=null){if(f!=this.conf.last_match){this._setSelected(f,true,true);this.conf.last_match=f}}else{this._setSelected(null,true,true);this.conf.last_match=null}}};dhtmlXCombo.prototype._selectRange=function(b,a){if(this.conf.combo_focus==true){window.dhx4.selectTextRange(this.base.firstChild,b,a)}};dhtmlXCombo.prototype.openSelect=function(){if(!this._isListVisible()){this._showList()}};dhtmlXCombo.prototype.closeAll=function(){this._hideList()};dhtmlXCombo.prototype._showList=function(a){if(this._getListVisibleCount()==0){if(a&&this._isListVisible()){this._hideList()}return}if(this._isListVisible()){this._checkListHeight();return}this.list.style.zIndex=window.dhx4.zim.reserve(this.conf.list_zi_id);this.list.style.visibility="hidden";this.list.style.display="";this.list.style.width=Math.max(this.conf.opts_width||0,this.conf.combo_width)+"px";this.list.style.top=window.dhx4.absTop(this.base)+this.base.offsetHeight-1+"px";this.list.style.left=window.dhx4.absLeft(this.base)+"px";this._checkListHeight();this.list.style.visibility="visible";this.callEvent("onOpen",[])};dhtmlXCombo.prototype._hideList=function(){if(!this._isListVisible()){return}window.dhx4.zim.clear(this.conf.list_zi_id);this.list.style.display="none";this.conf.clear_click=false;this.callEvent("onClose",[])};dhtmlXCombo.prototype._isListVisible=function(){return(this.list.style.display=="")};dhtmlXCombo.prototype._getListVisibleCount=function(){var a=0;for(var b=0;b<this.list.childNodes.length;b++){a+=(this.list.childNodes[b].style.display==""?1:0)}return a};dhtmlXCombo.prototype._checkListHeight=function(){if(!this._isListVisible()){return}if(this.conf.item_h==null){var j=this.list.firstChild;while(j!=null){if(j.style.display==""){this.conf.item_h=j.offsetHeight;j=null}else{j=j.nextSibling}}j=null}var l=window.dhx4.screenDim();var f=window.dhx4.absTop(this.base);var a=this.base.offsetHeight;var b=Math.max(0,Math.floor((f-l.top)/this.conf.item_h));var i=Math.max(0,Math.floor((l.bottom-(f+a))/this.conf.item_h));var m=this._getListVisibleCount();if(i<Math.min(this.conf.opts_count_min,m)&&b>i){i=null}var g=Math.min((i==null?b:i),this.conf.opts_count,m);var c=(g<m?(g*this.conf.item_h)+"px":"");var d=this.conf.sp[this.conf.skin].list_ofs;this.list.style.height=c;this.list.style.top=(i==null?f-this.list.offsetHeight+d:f+a-d)+"px"};dhtmlXCombo.prototype._scrollToItem=function(f){var d=this.t[f].item.offsetTop;var c=d+this.t[f].item.offsetHeight;var b=this.list.scrollTop;var a=b+this.list.clientHeight;if(d<b){this.list.scrollTop=d}else{if(c>a){this.list.scrollTop=c-this.list.clientHeight}}};dhtmlXCombo.prototype._setSelected=function(g,f,b){if(b){this._updateTopImage(g)}if(g!=null&&this.conf.last_hover==g){if(f){this._scrollToItem(g)}return}if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null;if(g==null){this.callEvent("onSelectionChange",[])}}if(g!=null){this.t[g].obj.setSelected(this.t[g].item,true);this.conf.last_hover=g;this.callEvent("onSelectionChange",[]);if(this.t[g].item==this.t[g].item.parentNode.lastChild&&this.conf.f_url!=null&&this.conf.f_dyn==true&&!this.conf.f_dyn_end){var d="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(i){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(i.xmlDoc.responseXML)}var h=a.list.childNodes.length;a.load(i.xmlDoc.responseXML);if(h==a.list.childNodes.length){a.conf.f_dyn_end=true;if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].dyn_end=true}}c=a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.f_url,d,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+d,c)}}}if(f){this._scrollToItem(g)}}};dhtmlXCombo.prototype.addOption=function(g,h,b,a,d){var c=null;if(!(g instanceof Array)){var i=this._renderOption({value:g,text:h,css:b,img:a});if(c==null&&window.dhx4.s2b(d)==true){c=i}}else{for(var f=0;f<g.length;f++){if(g[f] instanceof Array){i=this._renderOption({value:g[f][0],text:g[f][1],css:g[f][2],img:g[f][3]});if(c==null&&window.dhx4.s2b(g[f][4])==true){c=i}}else{var i=this._renderOption(g[f]);if(c==null&&window.dhx4.s2b(g[f].selected)==true){c=i}}}}if(c!=null){this._setSelected(c,this._isListVisible(),true);this._confirmSelect("onInit")}};dhtmlXCombo.prototype.updateOption=function(a,c,b,d){var f=this._getOptionId(a);if(f==null){return}this.t[f].obj.update(this.t[f].item,{value:c,text:b,css:d});if(this.conf.last_selected==f){this.conf.last_text=this.base.firstChild.value=this.t[f].obj.getText(this.t[f].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}};dhtmlXCombo.prototype.deleteOption=function(d){for(var b in this.t){var c=this.t[b].obj.getValue(this.t[b].item);if(c==d){this._removeOption(b)}}if(this._isListVisible()){this._showList(true)}};dhtmlXCombo.prototype.clearAll=function(){for(var b in this.t){this._removeOption(b)}if(this.conf.tm_hover){window.clearTimeout(this.conf.tm_hover)}this.conf.last_hover=null;this.conf.last_selected=null;this.list.scrollTop=0;this._hideList()};dhtmlXCombo.prototype._renderOption=function(b){var c=window.dhx4.newId();var a=document.createElement("DIV");a._optId=c;a._tpl=this.conf.template;if(typeof(b.img)=="undefined"&&typeof(b.img_src)!="undefined"){b.img=b.img_src;delete b.img_src}if(typeof(b.img_dis)=="undefined"&&typeof(b.img_src_dis)!="undefined"){b.img_dis=b.img_src_dis;delete b.img_src_dis}b.img_path=this.conf.img_path;b.img_def=this.conf.img_def;b.img_def_dis=this.conf.img_def_dis;this.list.appendChild(a);this.t[a._optId]={obj:this.modes[this.conf.opts_type].render(a,b),item:a,conf:{type:this.conf.opts_type}};a=null;return c};dhtmlXCombo.prototype._removeOption=function(a){this.t[a].obj.destruct(this.t[a].item);this.t[a].obj=null;this.t[a].item.parentNode.removeChild(this.t[a].item);this.t[a].item=null;this.t[a].conf=null;this.t[a]=null;delete this.t[a];if(this.conf.last_hover==a){this.conf.last_hover=null}if(this.conf.last_selected==a){this.conf.last_selected=null;this._confirmSelect("onDelete")}};dhtmlXCombo.prototype._confirmSelect=function(b){var a=false;if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}if(this.conf.last_hover!=null){a=a||(this.conf.last_value!=this._getOptionValue(this.conf.last_hover));this.conf.last_match=this.conf.last_selected=this.conf.last_hover;this.conf.last_value=this._getOptionValue(this.conf.last_selected);this.conf.last_text=this.base.firstChild.value=this.t[this.conf.last_selected].obj.getText(this.t[this.conf.last_selected].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="false"}else{if(this.conf.allow_free_text||(this.base.firstChild.value==""&&this.conf.allow_empty_value)){a=a||(this.conf.last_text!=this.base.firstChild.value);this.conf.last_match=this.conf.last_value=this.conf.last_selected=null;this.conf.last_text=this.base.firstChild.value;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_text;this.base.childNodes[2].value="true"}else{this._cancelSelect();this._updateTopImage(this.conf.last_selected);return}}if(this.conf.f_ac&&this.conf.f_mode=="start"){this.conf.f_ac_text="";if(b!="blur"){this._selectRange(this.base.firstChild.value.length,this.base.firstChild.value.length)}}this._hideList();if(a==true&&b!="onInit"&&b!="onDelete"){this.callEvent("onChange",[this.conf.last_value,this.conf.last_text])}};dhtmlXCombo.prototype._cancelSelect=function(){this._hideList();this.base.firstChild.value=this.conf.last_text;if(this.conf.f_mode!=false){this._filterOpts(true)}};dhtmlXCombo.prototype._getOption=function(h,d){if(!this.t[h]){return null}if(typeof(d)=="undefined"){d=-1}if(d<0){for(var g=0;g<this.list.childNodes.length;g++){if(d<0&&this.list.childNodes[g]._optId==h){d=g}}}var f={value:this.t[h].obj.getValue(this.t[h].item),text:this.t[h].obj.getText(this.t[h].item),text_input:this.t[h].obj.getText(this.t[h].item,true),text_option:this.t[h].obj.getText(this.t[h].item,null,true),css:this.t[h].obj.getCss(this.t[h].item),selected:(h==this.conf.last_selected),index:d};if(typeof(this.t[h].obj.getExtraData)=="function"){var c=this.t[h].obj.getExtraData(this.t[h].item);for(var b in c){if(typeof(f[b])=="undefined"){f[b]=c[b]}}}return f};dhtmlXCombo.prototype._getOptionProp=function(d,c,b){if(d!=null){var a=this._getOption(d);if(a!=null){return a[c]}}return b};dhtmlXCombo.prototype._getOptionId=function(b){var d=null;for(var a=0;a<this.list.childNodes.length;a++){if(d==null){var c=this.list.childNodes[a]._optId;if(b==this.t[c].obj.getValue(this.t[c].item)){d=c}}}return d};dhtmlXCombo.prototype._getOptionValue=function(a){return this._getOptionProp(a,"value",null)};dhtmlXCombo.prototype.setSize=function(a){this.conf.combo_width=parseInt(a);this.base.style.width=this.conf.combo_width+"px";this.base.firstChild.style.width=(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px";this.base.firstChild.style.marginLeft=(this.conf.combo_image?"23px":"0px")};dhtmlXCombo.prototype.setOptionWidth=function(a){this.conf.opts_width=(parseInt(a)||null)};dhtmlXCombo.prototype.modes={};dhtmlXCombo.prototype.doWithItem=function(a,h,f,c){var g=(a>=0&&a<this.list.childNodes.length?this.list.childNodes[a]._optId:null);if(g==null){return null}if(typeof(this.t[g].obj[h])!="function"){return null}var d=[this.t[g].item];for(var b=2;b<arguments.length;b++){d.push(arguments[b])}return this.t[g].obj[h].apply(this.t[g].obj,d)};function dhtmlXComboExtend(d,c){for(var b in dhtmlXCombo.prototype.modes[c]){if(typeof(dhtmlXCombo.prototype.modes[d][b])=="undefined"){dhtmlXCombo.prototype.modes[d][b]=dhtmlXCombo.prototype.modes[c][b]}}}dhtmlXCombo.prototype.modes.option={image:false,option_css:"dhxcombo_option_text",render:function(a,b){a._conf={value:b.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.option_css+"'>&nbsp;</div>";if(b.css!=null){a.lastChild.style.cssText=b.css;a._conf.css=b.css}this.setText(a,b.text);return this},destruct:function(a){a._conf=null},update:function(a,b){a._conf.value=b.value;a._conf.css=b.css;a.lastChild.style.cssText=b.css;this.setText(a,b.text)},setText:function(b,c){b._conf.text=c;var a=(typeof(c)=="object"?window.dhx4.template(b._tpl.option,b._conf.text,true):window.dhx4.trim(b._conf.text||""));b.lastChild.innerHTML=(a.length==0?"&nbsp;":a)},getText:function(c,a,b){if(window.dhx4.s2b(a)&&typeof(c._conf.text)=="object"){return window.dhx4.template(c._tpl.input,c._conf.text,true)}if(window.dhx4.s2b(b)&&typeof(c._conf.text)=="object"){return window.dhx4.template(c._tpl.option,c._conf.text,true)}return c._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,b){a.className="dhxcombo_option"+(b?" dhxcombo_option_selected":"")},isSelected:function(a){return String(a.className).indexOf("dhxcombo_option_selected")>=0},getExtraData:function(a){return{type:"option"}}};dhtmlXCombo.prototype.modes.checkbox={image:true,image_css:"dhxcombo_checkbox dhxcombo_chbx_#state#",option_css:"dhxcombo_option_text dhxcombo_option_text_chbx",render:function(a,b){a._conf={value:b.value,css:"",checked:window.dhx4.s2b(b.checked)};a.className="dhxcombo_option";a.innerHTML="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";a.firstChild._optChbxId=a._optId;if(b.css!=null){a.lastChild.style.cssText+=b.css;a._conf.css=b.css}this.setText(a,b.text);return this},setChecked:function(a,b){a._conf.checked=window.dhx4.s2b(b);a.firstChild.className=String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(d,c,f){var b=true;var a=(c.target||c.srcElement);while(b==true&&a!=null&&a!=d){if(a._optChbxId!=null){if(f.callEvent("onCheck",[d._conf.value,!d._conf.checked])===true){this.setChecked(d,!this.isChecked(d))}b=false}else{a=a.parentNode}}a=f=d=null;return b},getTopImage:function(b,a){return""},topImageClick:function(a,b){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,b){this.doWithItem(a,"setChecked",b)};dhtmlXCombo.prototype.getChecked=function(a,d){var b=[];for(var c=0;c<this.list.childNodes.length;c++){if(this.isChecked(c)){b.push(this._getOptionProp(this.list.childNodes[c]._optId,"value",""))}}return b};dhtmlXCombo.prototype.isChecked=function(a){return this.doWithItem(a,"isChecked")};dhtmlXCombo.prototype.modes.image={image:true,image_css:"dhxcombo_image",option_css:"dhxcombo_option_text dhxcombo_option_text_image",render:function(a,b){a._conf={value:b.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.image_css+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";if(b.css!=null){a.lastChild.style.cssText+=b.css;a._conf.css=b.css}this.setText(a,b.text);this.setImage(a,b.img,b.img_dis,b.img_path,b.img_def,b.img_def_dis);return this},update:function(a,b){a._conf.value=b.value;a._conf.css=b.css;a.lastChild.style.cssText=b.css;this.setText(a,b.text);this.setImage(a,b.img,b.img_dis,b.img_path,b.img_def,b.img_def_dis)},setImage:function(c,a,f,g,d,b){if(a!=null&&a.length>0){a=g+a}else{if(d!=null&&d.length>0){a=g+d}else{a=null}}if(f!=null&&f.length>0){f=g+f}else{if(b!=null&&b.length>0){f=g+b}else{if(b==true){f=a}else{f=null}}}c._conf.img=a;c._conf.img_dis=f;c.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(d,c){var b=(c?"img":"img_dis");if(d!=null&&d._conf[b]!=null){return"<div class='"+this.image_css+"' style='background-image:url("+d._conf[b]+");'></div>"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,b){if(a!=null){this.conf.img_def=a}if(b!=null){this.conf.img_def_dis=b}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXForm(f,d,g){this.idef={position:"label-left",labelWidth:"auto",labelHeight:"auto",inputWidth:"auto",inputHeight:"auto",labelAlign:"left",noteWidth:"auto",offsetTop:0,offsetLeft:0,blockOffset:20};this.idef_const={offsetNested:20};this.apos_css={"label-left":"dhxform_item_label_left","label-right":"dhxform_item_label_right","label-top":"dhxform_item_label_top","label-bottom":"dhxform_item_label_bottom",absolute:"dhxform_item_absolute"};this.align_css={left:"dhxform_label_align_left",center:"dhxform_label_align_center",right:"dhxform_label_align_right"};var c=this;this.setSkin=function(a){this.skin=a;this.cont.className="dhxform_obj_"+this.skin;this.cont.style.fontSize=(a=="dhx_terrace"?"13px":"12px");this._updateBlocks();this.forEachItem(function(i){var h=c.getItemType(i);if(typeof(c.items[h])!="undefined"&&typeof(c.items[h].setSkin)=="function"){c.doWithItem(i,"setSkin",a)}})};this.skin=(g||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_form")||"dhx_skyblue");this.separator=",";this.live_validate=false;this._type="checkbox";this._rGroup="default";this._idIndex={};this._indexId=[];this.cont=(typeof(f)=="object"?f:document.getElementById(f));if(!f._isNestedForm){this._parentForm=true;this.cont.style.fontSize=(this.skin=="dhx_terrace"?"13px":"12px");this.cont.className="dhxform_obj_"+this.skin;this.setFontSize=function(a){this.cont.style.fontSize=a;this._updateBlocks()};this.getForm=function(){return this};this.cont.onkeypress=function(h){h=(h||event);if(h.keyCode==13){var a=(h.target||h.srcElement);if(typeof(a.tagName)!="undefined"&&String(a.tagName).toLowerCase()=="textarea"&&!h.ctrlKey){return}c.callEvent("onEnter",[])}}}this.b_index=null;this.base=[];this._prepare=function(o,p){if(this.b_index==null){this.b_index=0}else{this.b_index++}var j=null;var h=null;if(p!=null){if(p<0){p=0}var m=0;for(var a=0;a<this.cont.childNodes.length;a++){for(var n=0;n<this.cont.childNodes[a].childNodes.length;n++){if(h==null&&this.cont.childNodes[a].childNodes[n]._isNestedForm!=true){if(m==p){j=this.cont.childNodes[a].nextSibling;h=this.cont.childNodes[a].childNodes[n]}m++}}}}this.base[this.b_index]=document.createElement("DIV");this.base[this.b_index].className="dhxform_base";if(typeof(o)!="undefined"){this.base[this.b_index].style.cssText+=" margin-left:"+o+"px!important;"}if(j!=null){this.cont.insertBefore(this.base[this.b_index],j);j=null}else{this.cont.appendChild(this.base[this.b_index])}if(h!=null){while(h!=null){var l=h;h=h.nextSibling;this.base[this.b_index].appendChild(l);l=null}}};this.setSizes=function(){};this._mergeSettings=function(n){var j=-1;var l={type:"settings"};for(var h in this.idef){l[h]=this.idef[h]}for(var m=0;m<n.length;m++){if(typeof(n[m])!="undefined"&&n[m].type=="settings"){for(var h in n[m]){l[h]=n[m][h]}j=m}}n[j>=0?j:n.length]=l;return n};this._genStr=function(a){var h="";var j="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var i=0;i<a;i++){h+=j.charAt(Math.floor(Math.random()*j.length))}return h};this.idPrefix="dhxForm_"+this._genStr(12)+"_";this._rId=(this._parentForm?this._genStr(12)+"_":f._rId);this.objPull={};this.itemPull={};this._ic=0;this._addItem=function(x,l,r,n,u,y,t){if(this.items[x]._index){this.getForm()._indexId.push(l);this.getForm()._idIndex[l]={ind:this.getForm()._indexId.length-1}}if(!x){x=this._type}if(x=="list"&&u!=null&&this.itemPull[this.idPrefix+u]!=null&&typeof(this.itemPull[this.idPrefix+u]._addSubListNode)=="function"){var v=this.itemPull[this.idPrefix+u]._addSubListNode()}else{if(x=="newcolumn"){var v={}}else{var m=this.base[this.b_index];var h=null;if(typeof(y)!="undefined"&&!isNaN(y)&&x!="list"){y=Math.max(parseInt(y),0)+1;for(var A=0;A<this.cont.childNodes.length;A++){for(var i=0;i<this.cont.childNodes[A].childNodes.length;i++){if(h==null&&this.cont.childNodes[A].childNodes[i]._isNestedForm!=true){y--;if(y==0){h=this.cont.childNodes[A].childNodes[i];m=this.cont.childNodes[A]}}}}}else{if(x=="list"){for(var z in this.itemPull){if(z==this.idPrefix+l){h=this.itemPull[z].nextSibling;if(this.itemPull[z]._listBase!=null&&this.itemPull[z]._listBase.length>0){h=this.itemPull[z]._listBase[this.itemPull[z]._listBase.length-1]}}}}}var v=document.createElement("DIV");if(t==true&&h!=null){h=h.nextSibling}if(h!=null){m.insertBefore(v,h)}else{m.appendChild(v)}}}v._idd=l;v._rId=this._rId;if(typeof(v.style)!="undefined"){if(typeof(r.offsetLeft)=="undefined"&&this.idef.offsetLeft>0){r.offsetLeft=this.idef.offsetLeft}if(typeof(r.offsetTop)=="undefined"&&this.idef.offsetTop>0){r.offsetTop=this.idef.offsetTop}var o="";if(typeof(r.offsetLeft)!="undefined"){o+=" padding-left:"+r.offsetLeft+"px!important;"}if(typeof(r.offsetTop)!="undefined"){o+=" padding-top:"+r.offsetTop+"px!important;"}v.style.cssText+=o}if(x=="block"){if(isNaN(r.blockOffset)){r.blockOffset=this.idef.blockOffset}}if(x=="list"){if(typeof(v._ofsNested)=="undefined"){v._ofsNested=this.idef_const.offsetNested}if(n!=null){v._sId=n}var s=this.items[x].render(v,this.skin);if(!this.itemPull[this.idPrefix+l]._listObj){this.itemPull[this.idPrefix+l]._listObj=[]}if(!this.itemPull[this.idPrefix+l]._list){this.itemPull[this.idPrefix+l]._list=[]}if(!this.itemPull[this.idPrefix+l]._listBase){this.itemPull[this.idPrefix+l]._listBase=[]}(this.itemPull[this.idPrefix+l]._listObj).push(s[0]);(this.itemPull[this.idPrefix+l]._list).push(s[1]);(this.itemPull[this.idPrefix+l]._listBase).push(v);s[1].checkEvent=function(a){return c.checkEvent(a)};s[1].callEvent=function(a,p){return c.callEvent(a,p)};s[1].getForm=function(){return c.getForm()};s[1]._initObj(this._mergeSettings(r));if(v._inBlcok){v.className+=" in_block"}return s[1]}if(x=="newcolumn"){this._prepare(r.offset,y);return}if(x=="label"&&this._ic++==0){r._isTopmost=true}r.position=this.apos_css[(!r.position||!this.apos_css[r.position]?this.idef.position:r.position)];v.className=r.position+(typeof(r.className)=="string"?" "+r.className:"");if(!r.labelWidth){r.labelWidth=this.idef.labelWidth}if(!r.labelHeight){r.labelHeight=this.idef.labelHeight}if(typeof(r.wrap)!="undefined"){r.wrap=window.dhx4.s2b(r.wrap)}r.labelAlign=(this.align_css[r.labelAlign]?this.align_css[r.labelAlign]:this.align_css[this.idef.labelAlign]);r.inputWidth=(r.width?r.width:(r.inputWidth?r.inputWidth:this.idef.inputWidth));if(!r.inputHeight){r.inputHeight=this.idef.inputHeight}if(typeof(r.note)!="undefined"){if(r.note.length!=null&&r.note[0]!=null){r.note=r.note[0]}if(typeof(r.note.width)=="undefined"){r.note.width=this.idef.noteWidth}if(r.note.width=="auto"){r.note.width=r.inputWidth}}v.checkEvent=function(a){return c.checkEvent(a)};v.callEvent=function(a,p){return c.callEvent(a,p)};v.getForm=function(){return c.getForm()};v._autoCheck=function(a){c._autoCheck(a)};if(typeof(r.readonly)=="string"){r.readonly=window.dhx4.s2b(r.readonly)}if(typeof(r.autoStart)=="string"){r.autoStart=window.dhx4.s2b(r.autoStart)}if(typeof(r.autoRemove)=="string"){r.autoRemove=window.dhx4.s2b(r.autoRemove)}if(typeof(r.titleScreen)=="string"){r.titleScreen=window.dhx4.s2b(r.titleScreen)}if(typeof(r.info)=="string"){r.info=window.dhx4.s2b(r.info)}if(typeof(r.hidden)=="string"){r.hidden=window.dhx4.s2b(r.hidden)}if(typeof(r.checked)=="string"){r.checked=window.dhx4.s2b(r.checked)}if(typeof(r.userdata)!="undefined"){for(var z in r.userdata){this.getForm().setUserData(l,z,r.userdata[z])}}if(r.validate){if(typeof(r.validate!="undefined")&&(typeof(r.validate)=="function"||typeof(window[r.validate])=="function")){v._validate=[r.validate]}else{v._validate=String(r.validate).split(this.separator)}}if(typeof(r.required)!="undefined"){if(typeof(r.required)=="string"){r.required=window.dhx4.s2b(r.required)}v._required=(r.required==true)}if(v._required){if(!v._validate){v._validate=[]}var j=false;for(i=0;i<v._validate.length;i++){j=(j||(v._validate[i]=="NotEmpty"))}if(!j){v._validate.push("NotEmpty")}}v._ll=(r.position==this.apos_css["label-left"]||r.position==this.apos_css["label-top"]);this.objPull[this.idPrefix+l]=this.items[x].render(v,r);this.itemPull[this.idPrefix+l]=v};this._initObj=function(l,i){if(typeof(l.data)!="undefined"){var m=null;if(typeof(i)!="undefined"){m=i.match(/(\?|\&)id\=([a-z0-9_\-]*)/i);if(m!=null&&m[0]!=null){m=m[0].split("=")[1]}}if(this.callEvent("onBeforeDataLoad",[m,window.dhx4._copyObj(l.data)])===true){this.formId=m;this._last_load_data=l;this.setFormData(l.data);this.resetDataProcessor("updated")}return}this._prepare();for(var j=0;j<l.length;j++){if(typeof(l[j])!="undefined"&&l[j].type=="settings"){for(var h in l[j]){this.idef[h]=l[j][h]}}}for(var j=0;j<l.length;j++){this._prepareItem(l[j])}this._autoCheck()};this._prepareItem=function(l,o,j){var i=(l!=null&&l.type!=null?l.type:"");if(this.items[i]){if(!l.name){l.name=this._genStr(12)}var n=l.name;if(this.objPull[this.idPrefix+n]!=null||i=="radio"){n=this._genStr(12)}var m=l;m.label=m.label||"";m.value=m.value;m.checked=window.dhx4.s2b(m.checked);m.disabled=window.dhx4.s2b(m.disabled);m.name=m.name||this._genStr(12);m.options=m.options||[];m.rows=m.rows||"none";m.uid=this._genStr(12);this._addItem(i,n,m,null,null,o,j);o=null;if(this._parentEnabled===false){this._disableItem(n)}for(var h=0;h<m.options.length;h++){if(m.options[h].list!=null){if(!m.options[h].value){m.options[h].value=this._genStr()}var a=this._addItem("list",n,m.options[h].list,m.options[h].value,null);a._subSelect=true;a._subSelectId=m.options[h].value}}if(l.list!=null){if(!l.listParent){l.listParent=m.name}var a=this._addItem("list",n,l.list,null,l.listParent)}}};this._xmlSubItems={item:"list",option:"options",note:"note",userdata:"_userdata"};this._xmlToObject=function(s,h){if(typeof(h)=="undefined"){h=true}if(h){var u=s.getElementsByTagName("items");u=(u!=null&&u[0]!=null?u[0]:null);var i=s.getElementsByTagName("data");i=(i!=null&&i[0]!=null?i[0]:null)}else{u=s}var r=(h?[]:{});if(u!=null){for(var l=0;l<u.childNodes.length;l++){if(typeof(u.childNodes[l].tagName)!="undefined"){var m=u.childNodes[l].tagName;if(this._xmlSubItems[m]!=null){var n=this._xmlSubItems[m];if(typeof(r[n])=="undefined"){r[n]=[]}var p={};for(var z=0;z<u.childNodes[l].attributes.length;z++){var v=u.childNodes[l].attributes[z].name;var t=u.childNodes[l].attributes[z].value;p[v]=t}if(n=="note"){p.text=u.childNodes[l].firstChild.nodeValue}if(n=="_userdata"){p.value=u.childNodes[l].firstChild.nodeValue}var o=this._xmlToObject(u.childNodes[l],false);for(var x in o){if(x=="_userdata"){if(!p.userdata){p.userdata={}}for(var z=0;z<o[x].length;z++){p.userdata[o[x][z].name]=o[x][z].value}}else{p[x]=o[x]}}if(h){r.push(p)}else{r[n].push(p)}}}}}if(i!=null){r={data:{}};for(var l=0;l<i.childNodes.length;l++){if(typeof(i.childNodes[l].tagName)!="undefined"){var j=i.childNodes[l].tagName;var y=(i.childNodes[l].firstChild!=null?i.childNodes[l].firstChild.nodeValue:"");r.data[j]=y}}}return r};this._autoCheck=function(m){if(this._locked===true){m=false}else{if(typeof(m)=="undefined"){m=true}}for(var j in this.itemPull){var n=(m&&(this.itemPull[j]._udis!==true));this[n?"_enableItem":"_disableItem"](this.itemPull[j]._idd);if(this.getForm()._idIndex[this.itemPull[j]._idd]!=null){this.getForm()._idIndex[this.itemPull[j]._idd].enabled=n}var i=(n&&(typeof(this.itemPull[j]._checked)=="boolean"?this.itemPull[j]._checked:true));if(this.itemPull[j]._list){for(var p=0;p<this.itemPull[j]._list.length;p++){var o=true;if(this.itemPull[j]._list[p]._subSelect==true){o=false;var l=this.getItemValue(this.itemPull[j]._idd);if(!(typeof(l)=="object"&&typeof(l.length)=="number")){l=[l]}for(var h=0;h<l.length;h++){o=(l[h]==this.itemPull[j]._list[p]._subSelectId)||o}this.itemPull[j]._listObj[p][o?"show":"hide"](this.itemPull[j]._listBase[p])}this.itemPull[j]._list[p]._autoCheck(i&&o)}}}};this.doWithItem=function(j,h,r,p,o,n){if(typeof(j)=="object"){var t=j[0];var s=j[1];var u=null;var m=null;for(var l in this.itemPull){if((this.itemPull[l]._value==s||s===null)&&this.itemPull[l]._group==t){return this.objPull[l][h](this.itemPull[l],r,p,o,n)}if(this.itemPull[l]._list!=null&&!m){for(var i=0;i<this.itemPull[l]._list.length;i++){m=this.itemPull[l]._list[i].doWithItem(j,h,r,p,o)}}}if(m!=null){return m}else{if(h=="getType"){return this.doWithItem(j[0],"getType")}}}else{if(!this.itemPull[this.idPrefix+j]){var m=null;for(var l in this.itemPull){if(this.itemPull[l]._list&&!m){for(var i=0;i<this.itemPull[l]._list.length;i++){if(m==null){m=this.itemPull[l]._list[i].doWithItem(j,h,r,p,o,n)}}}}return m}else{return this.objPull[this.idPrefix+j][h](this.itemPull[this.idPrefix+j],r,p,o,n)}}};this._removeItem=function(h,a){if(a!=null){h=this.doWithItem([h,a],"destruct")}else{this.doWithItem(h,"destruct")}this._clearItemData(h)};this._clearItemData=function(j){if(this.itemPull[this.idPrefix+j]){j=this.idPrefix+j;try{this.objPull[j]=null;this.itemPull[j]=null;delete this.objPull[j];delete this.itemPull[j]}catch(i){}}else{for(var a in this.itemPull){if(this.itemPull[a]._list){for(var h=0;h<this.itemPull[a]._list.length;h++){this.itemPull[a]._list[h]._clearItemData(j)}}}}};this.isItem=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isExist")};this.getItemType=function(h,a){h=[h,(a||null)];return this.doWithItem(h,"getType")};this.forEachItem=function(i){for(var h in this.objPull){if(this.objPull[h].t=="radio"){i(this.itemPull[h]._group,this.itemPull[h]._value)}else{i(String(h).replace(this.idPrefix,""))}if(this.itemPull[h]._list){for(var j=0;j<this.itemPull[h]._list.length;j++){this.itemPull[h]._list[j].forEachItem(i)}}}};this.setItemLabel=function(i,a,h){if(h!=null){i=[i,a]}else{h=a}this.doWithItem(i,"setText",h)};this.getItemLabel=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"getText")};this._enableItem=function(a){this.doWithItem(a,"enable")};this._disableItem=function(a){this.doWithItem(a,"disable")};this._isItemEnabled=function(a){return this.doWithItem(a,"isEnabled")};this.checkItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"check");this._autoCheck()};this.uncheckItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"unCheck");this._autoCheck()};this.isItemChecked=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isChecked")};this.getCheckedValue=function(a){return this.doWithItem([a,null],"getChecked")};this._getRGroup=function(m,l){for(var h in this.itemPull){if(this.itemPull[h]._group==m&&(l==null||this.itemPull[h]._value==l)){return this.itemPull[h]._idd}if(this.itemPull[h]._list!=null){for(var j=0;j<this.itemPull[h]._list.length;j++){var i=this.itemPull[h]._list[j]._getRGroup(m,l);if(i!=null){return i}}}}return null};this.setItemValue=function(h,a){if(this.getItemType(h)=="radio"){if(this._getRGroup(h,a)!=null){this.checkItem(h,a)}else{this.uncheckItem(h,this.getCheckedValue(h))}return null}return this.doWithItem(h,"setValue",a)};this.getItemValue=function(h,a){if(this.getItemType(h)=="radio"){return this.getCheckedValue(h)}return this.doWithItem(h,"getValue",a)};this.updateValues=function(){this._updateValues()};this.showItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"show")};this.hideItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"hide")};this.isItemHidden=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isHidden")};this.getOptions=function(a){return this.doWithItem(a,"getOptions")};this.setItemWidth=function(h,a){this.doWithItem(h,"setWidth",a)};this.getItemWidth=function(a){return this.doWithItem(a,"getWidth")};this.setItemHeight=function(h,a){this.doWithItem(h,"setHeight",a)};this.setItemFocus=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"setFocus")};this._updateValues=function(){for(var h in this.itemPull){if(this.objPull[h]&&typeof(this.objPull[h].updateValue)=="function"){this.objPull[h].updateValue(this.itemPull[h])}if(this.itemPull[h]._list){for(var i=0;i<this.itemPull[h]._list.length;i++){this.itemPull[h]._list[i]._updateValues()}}}};this._getItemByName=function(l){for(var h in this.itemPull){if(this.itemPull[h]._idd==l){return this.itemPull[h]}if(this.itemPull[h]._list!=null){for(var j=0;j<this.itemPull[h]._list.length;j++){var i=this.itemPull[h]._list[j]._getItemByName(l);if(i!=null){return i}}}}return null};this._resetValidateCss=function(a){a.className=(a.className).replace(a._vcss,"");a._vcss=null};this.setValidateCss=function(a,j,i){var h=this[this.getItemType(a)=="radio"?"_getRGroup":"_getItemByName"](a);if(!h){return}if(h._vcss!=null){this._resetValidateCss(h)}h._vcss=(typeof(i)=="string"?i:"validate_"+(j===true?"ok":"error"));h.className+=" "+h._vcss};this.resetValidateCss=function(i){for(var h in this.itemPull){if(this.itemPull[h]._vcss!=null){this._resetValidateCss(this.itemPull[h])}if(this.itemPull[h]._list!=null){for(var j=0;j<this.itemPull[h]._list.length;j++){this.itemPull[h]._list[j].resetValidateCss()}}}};this.validate=function(h){if(this.callEvent("onBeforeValidate",[])==false){return}var a=true;this.forEachItem(function(j,l){if(typeof(l)!="undefined"){j=[j,l]}var i=c.doWithItem(j,"_validate");if(typeof(i)!="boolean"){i=true}a=i&&a});this.callEvent("onAfterValidate",[a]);return a};this.validateItem=function(a,h){if(typeof(h)!="undefined"){a=[a,h]}return this.doWithItem(a,"_validate")};this.enableLiveValidation=function(a){this.live_validate=(a==true)};this.setReadonly=function(h,a){this.doWithItem(h,"setReadonly",a)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};this.getFirstActive=function(h){for(var j=0;j<this._indexId.length;j++){var a=true;if(h==true){var i=this.getItemType(this._indexId[j]);if(!dhtmlXForm.prototype.items[i].setFocus){a=false}}if(a&&this._idIndex[this._indexId[j]].enabled){return this._indexId[j]}}return null};this.setFocusOnFirstActive=function(){var a=this.getFirstActive(true);if(a!=null){this.setItemFocus(a)}};this.enableItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"userEnable");this._autoCheck()};this.disableItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"userDisable");this._autoCheck()};this.isItemEnabled=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isUserEnabled")};this.clear=function(){var h={};this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");for(var i in this.itemPull){var j=this.itemPull[i]._idd;if(this.itemPull[i]._type=="ch"){this.uncheckItem(j)}if(this.itemPull[i]._type in {ta:1,editor:1,calendar:1,pw:1,hd:1}){this.setItemValue(j,"")}if(this.itemPull[i]._type=="combo"){this.itemPull[i]._apiChange=true;var o=this.getCombo(j);o.selectOption(0);o=null;this.itemPull[i]._apiChange=false}if(this.itemPull[i]._type=="se"){var m=this.getOptions(j);if(m.length>0){m[0].selected=true}}if(this.itemPull[i]._type=="ra"){var l=this.itemPull[i]._group;if(!h[l]){this.checkItem(l,this.doWithItem(j,"_getFirstValue"));h[l]=true}}if(this.itemPull[i]._list){for(var n=0;n<this.itemPull[i]._list.length;n++){this.itemPull[i]._list[n].clear()}}if(this["setFormData_"+this.itemPull[i]._type]){this["setFormData_"+this.itemPull[i]._type](j,"")}}h=null;if(this._parentForm){this._autoCheck()}this.resetValidateCss()};this.unload=function(){window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");for(var h in this.objPull){this._removeItem(String(h).replace(this.idPrefix,""))}if(this._ccTm){window.clearTimeout(this._ccTm)}this._formLS=null;for(var i=0;i<this.base.length;i++){while(this.base[i].childNodes.length>0){this.base[i].removeChild(this.base[i].childNodes[0])}if(this.base[i].parentNode){this.base[i].parentNode.removeChild(this.base[i])}this.base[i]=null}this.base=null;this.cont.onkeypress=null;this.cont.className="";this.cont=null;for(var h in this){this[h]=null}c=null};for(var b in this.items){this.items[b].t=b;if(typeof(this.items[b]._index)=="undefined"){this.items[b]._index=true}if(!this.items[b].show){this.items[b].show=function(a){a.style.display="";if(a._listObj){for(var h=0;h<a._listObj.length;h++){a._listObj[h].show(a._listBase[h])}}}}if(!this.items[b].hide){this.items[b].hide=function(a){a.style.display="none";if(a._listObj){for(var h=0;h<a._listObj.length;h++){a._listObj[h].hide(a._listBase[h])}}}}if(!this.items[b].isHidden){this.items[b].isHidden=function(a){return(a.style.display=="none")}}if(!this.items[b].userEnable){this.items[b].userEnable=function(a){a._udis=false}}if(!this.items[b].userDisable){this.items[b].userDisable=function(a){a._udis=true}}if(!this.items[b].isUserEnabled){this.items[b].isUserEnabled=function(a){return(a._udis!==true)}}if(!this.items[b].getType){this.items[b].getType=function(){return this.t}}if(!this.items[b].isExist){this.items[b].isExist=function(){return true}}if(!this.items[b]._validate){this.items[b]._validate=function(i){if(!i._validate||!i._enabled){return true}if(i._type=="ch"){var m=(this.isChecked(i)?this.getValue(i):0)}else{var m=this.getValue(i)}var h=true;for(var l=0;l<i._validate.length;l++){var a="is"+i._validate[l];if((m==null||m.length==0)&&a!="isNotEmpty"&&i._type!="container"){}else{var j=dhtmlxValidation[a];if(i._type=="container"&&typeof(j)=="function"){j=function(){return true}}if(typeof(j)!="function"&&typeof(i._validate[l])=="function"){j=i._validate[l]}if(typeof(j)!="function"&&typeof(window[i._validate[l]])=="function"){j=window[i._validate[l]]}h=((typeof(j)=="function"?j(m,i._idd):new RegExp(i._validate[l]).test(m))&&h);j=null}}if(!(i.callEvent("onValidate"+(h?"Success":"Error"),[i._idd,m,h])===false)){i.getForm().setValidateCss(i._idd,h)}return h}}}this._locked=false;this._doLock=function(h){var a=(h===true?true:false);if(this._locked==a){return}else{this._locked=a}this._autoCheck(!this._locked)};this.lock=function(){this._doLock(true)};this.unlock=function(){this._doLock(false)};this.isLocked=function(){return this._locked};this.setNumberFormat=function(j,h,a,i){return this.doWithItem(j,"setNumberFormat",h,a,i)};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObject","items",{struct:true,data:true});window.dhx4._eventable(this);this.attachEvent("_onButtonClick",function(a,h){this.callEvent("onButtonClick",[a,h])});this._updateBlocks=function(){this.forEachItem(function(a){if(c.getItemType(a)=="block"||c.getItemType(a)=="combo"){c.doWithItem(a,"_setCss",c.skin,c.cont.style.fontSize)}})};this._isObj=function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")};this._copyObj=function(j){if(this._isObj(j)){var i={};for(var h in j){if(typeof(j[h])=="object"&&j[h]!=null){i[h]=this._copyObj(j[h])}else{i[h]=j[h]}}}else{var i=[];for(var h=0;h<j.length;h++){if(typeof(j[h])=="object"&&j[h]!=null){i[h]=this._copyObj(j[h])}else{i[h]=j[h]}}}return i};if(d!=null&&typeof(d)=="object"){this._initObj(this._copyObj(d))}if(this._parentForm){this._updateBlocks()}this._ccActive=false;this._ccTm=null;return this}dhtmlXForm.prototype.getInput=function(a){return this.doWithItem(a,"getInput")};dhtmlXForm.prototype.getSelect=function(a){return this.doWithItem(a,"getSelect")};dhtmlXForm.prototype.items={};dhtmlXForm.prototype.items.checkbox={render:function(a,b){a._type="ch";a._enabled=true;a._checked=false;a._value=(typeof(b.value)=="undefined"?null:String(b.value));a._ro=(b.readonly==true);if(b._autoInputWidth!==false){b.inputWidth=14}this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","TEXT",true,true,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var c=document.createElement("DIV");c.className="dhxform_img chbx0";a.appendChild(c);if(!isNaN(b.inputLeft)){a.childNodes[a._ll?1:0].style.left=parseInt(b.inputLeft)+"px"}if(!isNaN(b.inputTop)){a.childNodes[a._ll?1:0].style.top=parseInt(b.inputTop)+"px"}a.childNodes[a._ll?1:0].appendChild(c);a.childNodes[a._ll?1:0].firstChild.value=String(b.value);a._updateImgNode=function(f,g){var d=f.childNodes[f._ll?1:0].lastChild;d.className=(g?"dhxform_actv_c":"dhxform_img")+" "+(f._checked?"chbx1":"chbx0");f=d=null};a._doOnFocus=function(d){d.getForm().callEvent("onFocus",[d._idd])};a._doOnBlur=function(d){d.getForm().callEvent("onBlur",[d._idd])};a._doOnKeyUpDown=function(f,d){this.callEvent(f,[this.childNodes[this._ll?0:1].childNodes[0],d,this._idd])};if(b.checked==true){this.check(a)}if(b.hidden==true){this.hide(a)}if(b.disabled==true){this.userDisable(a)}this.doAttachEvents(a);return this},destruct:function(a){a._doOnFocus=a._doOnBlur=a._updateImgNode=null;this.doUnloadNestedLists(a);this.doDestruct(a)},doAddLabel:function(b,c){var a=document.createElement("DIV");a.className="dhxform_label "+c.labelAlign;if(c.wrap==true){a.style.whiteSpace="normal"}if(b._ll){b.insertBefore(a,b.firstChild)}else{b.appendChild(a)}if(typeof(c.tooltip)!="undefined"){a.title=c.tooltip}a.innerHTML="<div class='dhxform_label_nav_link' onfocus='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,true);this.parentNode.parentNode._doOnFocus(this.parentNode.parentNode);' onblur='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,false);this.parentNode.parentNode._doOnBlur(this.parentNode.parentNode);' onkeypress='var e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;if(e.preventDefault)e.preventDefault();else e.returnValue=false;_dhxForm_doClick(this,\"mousedown\");return false;}' onkeyup='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyUp\",e);' onkeydown='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyDown\",e);' "+(window.dhx4.isIPad?"ontouchstart='var e=event;e.preventDefault();_dhxForm_doClick(this,\"mousedown\");' ":"")+"role='link' tabindex='0'>"+c.label+(c.info?"<span class='dhxform_info'>[?]</span>":"")+(b._required?"<span class='dhxform_item_required'>*</span>":"")+"</div>";if(!isNaN(c.labelWidth)){a.firstChild.style.width=parseInt(c.labelWidth)+"px"}if(!isNaN(c.labelHeight)){a.firstChild.style.height=parseInt(c.labelHeight)+"px"}if(!isNaN(c.labelLeft)){a.style.left=parseInt(c.labelLeft)+"px"}if(!isNaN(c.labelTop)){a.style.top=parseInt(c.labelTop)+"px"}},doAddInput:function(q,d,b,j,l,f,g){var a=document.createElement("DIV");a.className="dhxform_control";if(q._ll){q.appendChild(a)}else{q.insertBefore(a,q.firstChild)}var o=document.createElement(b);o.className=g;o.name=q._idd;o._idd=q._idd;o.id=d.uid;if(typeof(j)=="string"){o.type=j}if(b=="INPUT"||b=="TEXTAREA"){o.onkeyup=function(p){p=p||event;q.callEvent("onKeyUp",[this,p,this._idd])};o.onkeydown=function(p){p=p||event;q.callEvent("onKeyDown",[this,p,this._idd])}}a.appendChild(o);if(d.readonly){this.setReadonly(q,true)}if(d.hidden==true){this.hide(q)}if(d.disabled==true){this.userDisable(q)}if(l){if(!isNaN(d.inputLeft)){a.style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){a.style.top=parseInt(d.inputTop)+"px"}}var n="";var h=false;if(f){if(!isNaN(d.inputWidth)){n+="width:"+parseInt(d.inputWidth)+"px;";h=true}if(!isNaN(d.inputHeight)){n+="height:"+parseInt(d.inputHeight)+"px;"}}if(typeof(d.style)=="string"){n+=d.style}o.style.cssText=n;if(d.maxLength){o.setAttribute("maxLength",d.maxLength)}if(d.connector){o.setAttribute("connector",d.connector)}if(h&&{input:1,password:1,select:1,calendar:1,colorpicker:1}[this.t]){if(dhtmlXForm.prototype.items[this.t]._dim==null){var m=parseInt(o.style.width);var c=(dhx4.isFF||dhx4.isIE?o.offsetWidth:o.clientWidth);dhtmlXForm.prototype.items[this.t]._dim=c-m}o.style.width=parseInt(o.style.width)-dhtmlXForm.prototype.items[this.t]._dim+"px"}if(typeof(d.note)=="object"){var i=document.createElement("DIV");i.className="dhxform_note";i.style.width=(isNaN(d.note.width)?o.offsetWidth:parseInt(d.note.width))+"px";i._w=d.note.width;i.innerHTML=d.note.text;a.appendChild(i);i=null}},doUnloadNestedLists:function(a){if(!a._list){return}for(var b=0;b<a._list.length;b++){a._list[b].unload();a._list[b]=null;a._listObj[b]=null;a._listBase[b].parentNode.removeChild(a._listBase[b]);a._listBase[b]=null}a._list=null;a._listObj=null;a._listBase=null},doDestruct:function(a){a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._group=null;a.onselectstart=null;a.childNodes[a._ll?1:0].onmousedown=null;a.childNodes[a._ll?1:0].ontouchstart=null;a.childNodes[a._ll?0:1].onmousedown=null;a.childNodes[a._ll?0:1].ontouchstart=null;a.childNodes[a._ll?0:1].childNodes[0].onfocus=null;a.childNodes[a._ll?0:1].childNodes[0].onblur=null;a.childNodes[a._ll?0:1].childNodes[0].onkeypress=null;a.childNodes[a._ll?0:1].childNodes[0].onkeyup=null;a.childNodes[a._ll?0:1].childNodes[0].onkeydown=null;a.childNodes[a._ll?0:1].childNodes[0].onmousedown=null;a.childNodes[a._ll?0:1].childNodes[0].ontouchstart=null;a.childNodes[a._ll?0:1].removeChild(a.childNodes[a._ll?0:1].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAttachEvents:function(b){var a=this;b.childNodes[b._ll?1:0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(d){d=d||event;if(d.preventDefault){d.preventDefault()}var c=(d.target||d.srcElement);if(!this.parentNode._enabled||this.parentNode._ro||(typeof(c.className)!="undefined"&&c.className=="dhxform_note")){d.cancelBubble=true;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}a.doClick(this.parentNode)};b.childNodes[b._ll?0:1].childNodes[0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(d){d=d||event;if(d.preventDefault){d.preventDefault()}if(!this.parentNode.parentNode._enabled){d.cancelBubble=true;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}var c=d.target||d.srcElement;if(typeof(c.className)!="undefined"&&c.className=="dhxform_info"){this.parentNode.parentNode.callEvent("onInfo",[this.parentNode.parentNode._idd]);d.cancelBubble=true;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}a.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();if(!a._enabled||a._ro){return}if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._checked])!==true){return}}this.setChecked(a,!a._checked);a._autoCheck();a.callEvent("onChange",[a._idd,a._value,a._checked])},doCheckValue:function(a){if(a._checked&&a._enabled){a.childNodes[a._ll?1:0].firstChild.name=String(a._idd);a.childNodes[a._ll?1:0].firstChild.value=this.getValue(a)}else{a.childNodes[a._ll?1:0].firstChild.name="";a.childNodes[a._ll?1:0].firstChild.value=""}},setChecked:function(a,b){a._checked=(b===true?true:false);a.childNodes[a._ll?1:0].lastChild.className=a.childNodes[a._ll?1:0].lastChild.className.replace(/chbx[0-1]{1}/gi,"")+(a._checked?" chbx1":" chbx0");this.doCheckValue(a)},check:function(a){this.setChecked(a,true)},unCheck:function(a){this.setChecked(a,false)},isChecked:function(a){return a._checked},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=0;a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("disabled");this.doCheckValue(a)},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=-1;a.childNodes[a._ll?0:1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,b){a.childNodes[a._ll?0:1].childNodes[0].innerHTML=b+(a._required?"<span class='dhxform_item_required'>*</span>":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},setValue:function(a,b){this.setChecked(a,(b===true||parseInt(b)==1||b=="true"||a._value===b))},getValue:function(a,b){if(b=="realvalue"){return a._value}return((typeof(a._value)=="undefined"||a._value==null)?(a._checked?1:0):a._value)},setReadonly:function(a,b){a._ro=(b===true)},isReadonly:function(a){return a._ro},setFocus:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus()}};dhtmlXForm.prototype.items.radio={input:{},r:{},firstValue:{},render:function(c,d,b){c._type="ra";c._enabled=true;c._checked=false;c._group=d.name;c._value=d.value;c._uid=b;c._ro=(d.readonly==true);c._rName=c._rId+c._group;this.r[c._idd]=c;d.inputWidth=14;this.doAddLabel(c,d);this.doAddInput(c,d,"INPUT","TEXT",true,true,"dhxform_textarea");c.childNodes[c._ll?1:0].className+=" dhxform_img_node";var f=document.createElement("DIV");f.className="dhxform_img rdbt0";c.appendChild(f);if(!isNaN(d.inputLeft)){c.childNodes[c._ll?1:0].style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){c.childNodes[c._ll?1:0].style.top=parseInt(d.inputTop)+"px"}c.childNodes[c._ll?1:0].appendChild(f);c.childNodes[c._ll?1:0].firstChild.name="";c.childNodes[c._ll?1:0].firstChild.value="";c._updateImgNode=function(h,i){var g=h.childNodes[h._ll?1:0].lastChild;g.className=(i?"dhxform_actv_r":"dhxform_img")+" "+(h._checked?"rdbt1":"rdbt0");h=g=null};c._doOnFocus=function(g){g.getForm().callEvent("onFocus",[g._group,g._value])};c._doOnBlur=function(g){g.getForm().callEvent("onBlur",[g._group,g._value])};c._doOnKeyUpDown=function(h,g){this.callEvent(h,[this.childNodes[this._ll?0:1].childNodes[0],g,this._group,this._value])};if(this.input[c._rName]==null){var a=document.createElement("INPUT");a.type="HIDDEN";a.name=d.name;a.firstValue=c._value;c.appendChild(a);this.input[c._rName]=a}if(!this.firstValue[c._rName]){this.firstValue[c._rName]=d.value}if(d.checked==true){this.check(c)}if(d.hidden==true){this.hide(c)}if(d.disabled==true){this.userDisable(c)}this.doAttachEvents(c);return this},destruct:function(d,f){if(d.lastChild==this.input[d._rName]){var c=false;for(var b in this.r){if(!c&&this.r[b]._group==d._group&&this.r[b]._idd!=d._idd){this.r[b].appendChild(this.input[d._rName]);c=true}}if(!c){this.input[d._rName].parentNode.removeChild(this.input[d._rName]);this.input[d._rName]=null;this.firstValue[d._rName]=null}}var g=d._idd;d._doOnFocus=d._doOnBlur=d._updateImgNode=null;this.doUnloadNestedLists(d);this.doDestruct(d);return g},doClick:function(b){b.childNodes[b._ll?0:1].childNodes[0].focus();if(!(b._enabled&&!b._checked)){return}if(b._ro){return}var a=[b._group,b._value,true];if(b.checkEvent("onBeforeChange")){if(b.callEvent("onBeforeChange",a)!==true){return}}this.setChecked(b,true);b.getForm()._autoCheck();b.callEvent("onChange",a)},doCheckValue:function(c){var d=null;for(var b in this.r){if(this.r[b]._checked&&this.r[b]._group==c._group&&this.r[b]._rId==c._rId){d=this.r[b]._value}}if(d!=null&&this.r[b]._enabled){this.input[c._rName].name=String(c._group);this.input[c._rName].value=d}else{this.input[c._rName].name="";this.input[c._rName].value=""}this.input[c._rName]._value=d},setChecked:function(f,g){g=(g===true);for(var b in this.r){if(this.r[b]._group==f._group&&this.r[b]._rId==f._rId){var d=false;if(this.r[b]._idd==f._idd){if(this.r[b]._checked!=g){this.r[b]._checked=g;d=true}}else{if(this.r[b]._checked){this.r[b]._checked=false;d=true}}if(d){var c=this.r[b].childNodes[this.r[b]._ll?1:0].childNodes[1];c.className=c.className.replace(/rdbt[0-1]{1}/gi,"")+(this.r[b]._checked?" rdbt1":" rdbt0");c=null}}}this.doCheckValue(f)},getChecked:function(a){return this.input[a._rName]._value},_getFirstValue:function(a){return this.firstValue[a._rName]},_getId:function(a){return a._idd},setValue:function(a,b){}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doDestruct:1,doUnloadNestedLists:1,doAttachEvents:1,check:1,unCheck:1,isChecked:1,enable:1,disable:1,isEnabled:1,setText:1,getText:1,getValue:1,setReadonly:1,isReadonly:1,setFocus:1}){dhtmlXForm.prototype.items.radio[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.select={render:function(a,b){a._type="se";a._enabled=true;a._value=null;a._newValue=null;if(window.dhx4.isFF||window.dhx4.isIE&&typeof(b.inputWidth)=="number"){b.inputWidth=Number(b.inputWidth)}this.doAddLabel(a,b);this.doAddInput(a,b,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,b);if(b.connector!=null){this.doLoadOptsConnector(a,b.connector)}if(typeof(b.value)!="undefined"&&b.value!=null){this.setValue(a,b.value)}return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._newValue=null;a.onselectstart=null;a.childNodes[a._ll?1:0].childNodes[0].onclick=null;a.childNodes[a._ll?1:0].childNodes[0].onkeydown=null;a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a.childNodes[a._ll?1:0].childNodes[0].onfocus=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;a.childNodes[a._ll?1:0].childNodes[0].onkeyup=null;a.childNodes[a._ll?1:0].removeChild(a.childNodes[a._ll?1:0].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAddLabel:function(b,c){var a=document.createElement("DIV");a.className="dhxform_label "+c.labelAlign;a.innerHTML="<label for='"+c.uid+"'>"+c.label+(c.info?"<span class='dhxform_info'>[?]</span>":"")+(b._required?"<span class='dhxform_item_required'>*</span>":"")+"</label>";if(c.wrap==true){a.style.whiteSpace="normal"}if(typeof(c.tooltip)!="undefined"){a.title=c.tooltip}b.appendChild(a);if(typeof(c.label)=="undefined"||c.label==null||c.label.length==0){a.style.display="none"}if(!isNaN(c.labelWidth)){a.style.width=parseInt(c.labelWidth)+"px"}if(!isNaN(c.labelHeight)){a.style.height=parseInt(c.labelHeight)+"px"}if(!isNaN(c.labelLeft)){a.style.left=parseInt(c.labelLeft)+"px"}if(!isNaN(c.labelTop)){a.style.top=parseInt(c.labelTop)+"px"}if(c.info){a.onclick=function(f){f=f||event;var d=f.target||f.srcElement;if(typeof(d.className)!="undefined"&&d.className=="dhxform_info"){this.parentNode.callEvent("onInfo",[this.parentNode._idd]);f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false}}}},doAttachEvents:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];var b=this;a.onclick=function(){b.doOnChange(this)};a.onkeydown=function(d){d=d||event;b.doOnChange(this);this.parentNode.parentNode.callEvent("onKeyDown",[this,d,this.parentNode.parentNode._idd])};a.onchange=function(){b.doOnChange(this)};a.onkeyup=function(d){d=d||event;this.parentNode.parentNode.callEvent("onKeyUp",[this,d,this.parentNode.parentNode._idd])};a=null;this.doAttachChangeLS(c)},doAttachChangeLS:function(b){var a=b.childNodes[b._ll?1:0].childNodes[0];a.onfocus=function(){var c=this.parentNode.parentNode;c.getForm()._ccActivate(c._idd,this,c.getForm().getItemValue(c._idd,true));c.getForm().callEvent("onFocus",[c._idd]);c=null};a.onblur=function(){var c=this.parentNode.parentNode;c.getForm()._ccDeactivate(c._idd);c.getForm().callEvent("onBlur",[c._idd]);c=null};a=null},doValidate:function(a){if(a.getForm().live_validate){this._validate(a)}},doLoadOpts:function(h,f,j){var i=h.childNodes[h._ll?1:0].childNodes[0];var a=f.options;var d=false;for(var b=0;b<a.length;b++){var g=a[b].text||a[b].label;if(!g||typeof(g)=="undefined"){g=""}var c=new Option(g,a[b].value);if(typeof(a[b].img_src)=="string"){c.setAttribute("img_src",a[b].img_src)}i.options.add(c);if(typeof(a[b].selected)!="undefined"&&window.dhx4.s2b(a[b].selected)==true){c.selected=true;h._value=a[b].value;d=true}if(typeof(a[b].checked)!="undefined"&&window.dhx4.s2b(a[b].checked)==true){c.setAttribute("checked","1")}if(typeof(a[b].img)!="undefined"){c.setAttribute("img",a[b].img)}if(typeof(a[b].img_dis)!="undefined"){c.setAttribute("img_dis",a[b].img_dis)}}if(!d&&i.selectedIndex>=0){h._value=i.options[i.selectedIndex].value}if(j===true){h.callEvent("onOptionsLoaded",[h._idd])}this._checkNoteWidth(h)},doLoadOptsConnector:function(c,a){var b=this;c._connector_working=true;window.dhx4.ajax.get(a,function(h){h=h.xmlDoc.responseXML;if(h==null){return}var d=h.getElementsByTagName("data");if(d==null||d[0]==null){return}d=d[0];var g=[];for(var i=0;i<d.childNodes.length;i++){if(typeof(d.childNodes[i].tagName)!="undefined"&&String(d.childNodes[i].tagName).toLowerCase()=="item"){var f=d.childNodes[i];g.push({label:f.getAttribute("label"),value:f.getAttribute("value"),selected:(f.getAttribute("selected")!=null)});f=null}}b.doLoadOpts(c,{options:g},true);c._connector_working=false;if(c._connector_value!=null){b.setValue(c,c._connector_value);c._connector_value=null}b=c=null})},doOnChange:function(c){var a=c.parentNode.parentNode;a._newValue=(c.selectedIndex>=0?c.options[c.selectedIndex].value:null);if(a._newValue!=a._value){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._newValue])!==true){for(var b=0;b<c.options.length;b++){if(c.options[b].value==a._value){c.options[b].selected=true}}return}}a._value=a._newValue;a.callEvent("onChange",[a._idd,a._value]);if(a._type=="se"&&a.getForm().live_validate){this._validate(a)}}a._autoCheck()},setText:function(a,b){if(!b){b=""}a.childNodes[a._ll?0:1].childNodes[0].innerHTML=b+(a._required?"<span class='dhxform_item_required'>*</span>":"");a.childNodes[a._ll?0:1].style.display=(b.length==0||b==null?"none":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("disabled")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?1:0].childNodes[0].setAttribute("disabled",true)},getOptions:function(a){return a.childNodes[a._ll?1:0].childNodes[0].options},setValue:function(b,d){if(b._connector_working){b._connector_value=d;return}var a=this.getOptions(b);for(var c=0;c<a.length;c++){if(a[c].value==d){a[c].selected=true;b._value=a[c].value}}if(b._list!=null&&b._list.length>0){b.getForm()._autoCheck()}b.getForm()._ccReload(b._idd,b._value)},getValue:function(c){var a=-1;var b=this.getOptions(c);for(var d=0;d<b.length;d++){if(b[d].selected){a=b[d].value}}return a},setWidth:function(b,a){b.childNodes[b._ll?1:0].childNodes[0].style.width=a+"px"},getSelect:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setFocus:function(a){a.childNodes[a._ll?1:0].childNodes[0].focus()},_checkNoteWidth:function(b){var a;if(b.childNodes[b._ll?1:0].childNodes[1]!=null){a=b.childNodes[b._ll?1:0].childNodes[1];if(a.className!=null&&a.className.search(/dhxform_note/gi)>=0&&a._w=="auto"){a.style.width=b.childNodes[b._ll?1:0].childNodes[0].offsetWidth+"px"}}a=null}};(function(){for(var b in {doAddInput:1,doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.select[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(d,g,h){var b=d.childNodes[d._ll?1:0].childNodes[0];b.multiple=true;if(!isNaN(g.size)){b.size=Number(g.size)}d._value=[];d._newValue=[];var c=g.options;for(var f=0;f<c.length;f++){var a=new Option(c[f].text||c[f].label,c[f].value);b.options.add(a);if(c[f].selected==true||c[f].selected=="true"){a.selected=true;d._value.push(c[f].value)}}if(h===true){d.callEvent("onOptionsLoaded",[d._idd])}this._checkNoteWidth(d)},doAttachEvents:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];var b=this;a.onfocus=function(){b.doOnChange(this);var d=this.parentNode.parentNode;d.getForm().callEvent("onFocus",[d._idd]);d=null};a.onblur=function(){b.doOnChange(this);var d=this.parentNode.parentNode;d.getForm().callEvent("onBlur",[d._idd]);d=null};a.onclick=function(){b.doOnChange(this);var d=this.parentNode.parentNode;d._autoCheck();d=null}},doOnChange:function(d){var b=d.parentNode.parentNode;b._newValue=[];for(var c=0;c<d.options.length;c++){if(d.options[c].selected){b._newValue.push(d.options[c].value)}}if((b._value).sort().toString()!=(b._newValue).sort().toString()){if(b.checkEvent("onBeforeChange")){if(b.callEvent("onBeforeChange",[b._idd,b._value,b._newValue])!==true){var a={};for(var c=0;c<b._value.length;c++){a[b._value[c]]=true}for(var c=0;c<d.options.length;c++){d.options[c].selected=(a[d.options[c].value]==true)}a=null;return}}b._value=[];for(var c=0;c<b._newValue.length;c++){b._value.push(b._newValue[c])}b.callEvent("onChange",[b._idd,b._value])}b._autoCheck()},setValue:function(c,f){var a={};if(typeof(f)=="string"){f=f.split(",")}if(typeof(f)!="object"){f=[f]}for(var d=0;d<f.length;d++){a[f[d]]=true}var b=this.getOptions(c);for(var d=0;d<b.length;d++){b[d].selected=(a[b[d].value]==true)}c._autoCheck()},getValue:function(c){var a=[];var b=this.getOptions(c);for(var d=0;d<b.length;d++){if(b[d].selected){a.push(b[d].value)}}return a}};(function(){for(var b in dhtmlXForm.prototype.items.select){if(!dhtmlXForm.prototype.items.multiselect[b]){dhtmlXForm.prototype.items.multiselect[b]=dhtmlXForm.prototype.items.select[b]}}})();dhtmlXForm.prototype.items.input={render:function(h,i){var g=(!isNaN(i.rows));h._type="ta";h._enabled=true;this.doAddLabel(h,i);this.doAddInput(h,i,(g?"TEXTAREA":"INPUT"),(g?null:"TEXT"),true,true,"dhxform_textarea");this.doAttachEvents(h);if(g){h.childNodes[h._ll?1:0].childNodes[0].rows=Number(i.rows)+(window.dhx4.isIE6?1:0)}if(typeof(i.numberFormat)!="undefined"){var f,d=null,j=null;if(typeof(i.numberFormat)!="string"){f=i.numberFormat[0];d=i.numberFormat[1]||null;j=i.numberFormat[2]||null}else{f=i.numberFormat;if(typeof(i.groupSep)=="string"){d=i.groupSep}if(typeof(i.decSep)=="string"){j=i.decSep}}this.setNumberFormat(h,f,d,j,false)}this.setValue(h,i.value);return this},doAttachEvents:function(b){var a=this;if(b._type=="ta"||b._type=="se"||b._type=="pw"){b.childNodes[b._ll?1:0].childNodes[0].onfocus=function(){var c=this.parentNode.parentNode;if(c._df!=null){this.value=c._value||""}c.getForm()._ccActivate(c._idd,this,this.value);c.getForm().callEvent("onFocus",[c._idd]);c=null}}b.childNodes[b._ll?1:0].childNodes[0].onblur=function(){var c=this.parentNode.parentNode;c.getForm()._ccDeactivate(c._idd);a.updateValue(c,true);if(c.getForm().live_validate){a._validate(c)}c.getForm().callEvent("onBlur",[c._idd]);c=null}},updateValue:function(c,a){var d=c.childNodes[c._ll?1:0].childNodes[0].value;if(!a&&c._df!=null&&d==this._getFmtValue(c,d)){return}var b=this;if(c._value!=d){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,d])!==true){if(c._df!=null){b.setValue(c,c._value)}else{c.childNodes[c._ll?1:0].childNodes[0].value=c._value}return}}if(c._df!=null){b.setValue(c,d)}else{c._value=d}c.callEvent("onChange",[c._idd,d]);return}if(c._df!=null){this.setValue(c,c._value)}},setValue:function(c,d){c._value=(typeof(d)!="undefined"&&d!=null?d:"");var b=(String(c._value)||"");var a=c.childNodes[c._ll?1:0].childNodes[0];if(c._df!=null&&typeof(this._getFmtValue)=="function"){b=this._getFmtValue(c,b)}if(a.value!=b){a.value=b;c.getForm()._ccReload(c._idd,b)}a=null},getValue:function(a){var b=a.getForm();if(b._formLS&&b._formLS[a._idd]!=null){this.updateValue(a)}b=null;return(typeof(a._value)!="undefined"&&a._value!=null?a._value:"")},setReadonly:function(a,b){a._ro=(b===true);if(a._ro){a.childNodes[a._ll?1:0].childNodes[0].setAttribute("readOnly","true")}else{a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("readOnly")}},isReadonly:function(a){if(!a._ro){a._ro=false}return a._ro},getInput:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setNumberFormat:function(g,i,d,j,b){if(typeof(b)!="boolean"){b=true}if(i==""){g._df=null;if(b){this.setValue(g,g._value)}return true}if(typeof(i)!="string"){return}var a=i.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(a==null||a.length!=4){return false}g._df={i_len:false,i_sep:(typeof(d)=="string"?d:","),d_len:false,d_sep:(typeof(j)=="string"?j:"."),s_bef:(typeof(a[1])=="string"?a[1]:""),s_aft:(typeof(a[3])=="string"?a[3]:"")};var h=a[2].split(".");if(h[1]!=null){g._df.d_len=h[1].length}var c=h[0].split(",");if(c.length>1){g._df.i_len=c[c.length-1].length}if(b){this.setValue(g,g._value)}return true},_getFmtValue:function(item,v){var r=v.match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(r!=null&&r.length==5){var v0="";if(r[1]!=null){v0+=r[1]}v0+=item._df.s_bef;if(item._df.i_len!==false){var i=0;var v1="";for(var q=r[2].length-1;q>=0;q--){v1=""+r[2].charAt(q)+v1;if(++i==item._df.i_len&&q>0){v1=item._df.i_sep+v1;i=0}}v0+=v1}else{v0+=r[2]}if(item._df.d_len!==false){if(r[4]==null){r[4]=""}while(r[4].length<item._df.d_len){r[4]+="0"}eval("dhx4.temp = new RegExp(/\\d{"+item._df.d_len+"}/);");var t1=(r[4]).match(dhx4.temp);if(t1!=null){v0+=item._df.d_sep+t1}dhx4.temp=t1=null}v0+=item._df.s_aft;return v0}return v}};(function(){for(var b in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setFocus:1}){dhtmlXForm.prototype.items.input[b]=dhtmlXForm.prototype.items.select[b]}})();dhtmlXForm.prototype.items.password={render:function(a,b){a._type="pw";a._enabled=true;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","PASSWORD",true,true,"dhxform_textarea");this.doAttachEvents(a);this.setValue(a,b.value);return this}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doAttachEvents:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,setValue:1,getValue:1,updateValue:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.password[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.file={render:function(c,d){c._type="fl";c._enabled=true;this.doAddLabel(c,d);this.doAddInput(c,d,"INPUT","FILE",true,false,"dhxform_textarea");var a=c.childNodes[c._ll?1:0].childNodes[0];var b=this;a.onfocus=function(){var f=this.parentNode.parentNode;f.getForm().callEvent("onFocus",[f._idd]);f=null};a.onblur=function(){var f=this.parentNode.parentNode;if(f.getForm().live_validate){b._validate(f)}f.getForm().callEvent("onBlur",[f._idd]);f=null};a=null;c.childNodes[c._ll?1:0].childNodes[0].onchange=function(){c.callEvent("onChange",[c._idd,this.value])};return this},setValue:function(){},getValue:function(a){return a.childNodes[a._ll?1:0].childNodes[0].value}};(function(){for(var b in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.file[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.label={_index:false,render:function(b,c){b._type="lb";b._enabled=true;b._checked=true;var a=document.createElement("DIV");a.className="dhxform_txt_label2"+(c._isTopmost?" topmost":"");a.innerHTML=c.label;b.appendChild(a);if(c.hidden==true){this.hide(b)}if(c.disabled==true){this.userDisable(b)}if(!isNaN(c.labelWidth)){a.style.width=parseInt(c.labelWidth)+"px"}if(!isNaN(c.labelHeight)){a.style.height=parseInt(c.labelHeight)+"px"}if(!isNaN(c.labelLeft)){a.style.left=parseInt(c.labelLeft)+"px"}if(!isNaN(c.labelTop)){a.style.top=parseInt(c.labelTop)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._autoCheck=null;a._enabled=null;a._type=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.onselectstart=null;a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false},setText:function(a,b){a.firstChild.innerHTML=b},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.label[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.button={render:function(c,d){c._type="bt";c._enabled=true;c._name=d.name;c.className=String(c.className).replace("item_label_top","item_label_left").replace("item_label_right","item_label_left");if(!isNaN(d.width)){var a=Math.max(d.width,10)}var b=(typeof(a)!="undefined");c._doOnKeyUpDown=function(g,f){this.callEvent(g,[this.childNodes[0].childNodes[0],f,this._idd])};c.innerHTML='<div class="dhxform_btn" role="link" tabindex="0" dir="ltr"><div class="dhxform_btn_txt" '+(b?' style="width:'+a+'px;"':"")+">"+d.value+"</div></div>";if(!isNaN(d.inputLeft)){c.childNodes[0].style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){c.childNodes[0].style.top=parseInt(d.inputTop)+"px"}if(d.hidden==true){this.hide(c)}if(d.disabled==true){this.userDisable(c)}if(typeof(d.tooltip)!="undefined"){c.firstChild.title=d.tooltip}c.onselectstart=function(f){f=f||event;f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.firstChild.onselectstart=function(f){f=f||event;f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.firstChild.onkeypress=function(f){f=f||event;if((f.keyCode==32||f.charCode==32||f.keyCode==13||f.charCode==13)&&!this.parentNode._busy){this.parentNode._busy=true;f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"]);return false}};c.firstChild.ontouchstart=function(){e=e||event;e.preventDefault();if(!this.parentNode._busy){this.parentNode._busy=true;_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"])}};c.firstChild.onfocus=function(){this.parentNode._doOnFocus(this.parentNode)};c.firstChild.onblur=function(){_dhxForm_doClick(this.childNodes[0],"mouseout");this.parentNode._doOnBlur(this.parentNode)};c.firstChild.onkeyup=function(f){this.parentNode._doOnKeyUpDown("onKeyUp",f||event)};c.firstChild.onkeydown=function(f){this.parentNode._doOnKeyUpDown("onKeyDown",f||event)};c.firstChild.onmouseover=function(){var f=this.parentNode;if(!f._enabled){return}this._isOver=true;this.className="dhxform_btn dhxform_btn_over";f=null};c.firstChild.onmouseout=function(){var f=this.parentNode;if(!f._enabled){return}this.className="dhxform_btn";this._allowClick=false;this._pressed=false;this._isOver=false;f=null};c.firstChild.onmousedown=function(g){g=g||event;if(g.button>=2){return}if(this._pressed){return}var f=this.parentNode;if(!f._enabled){return}this.className="dhxform_btn dhxform_btn_pressed";this._allowClick=true;this._pressed=true;f=null};c.firstChild.onmouseup=function(g){g=g||event;if(g.button>=2){return}if(!this._pressed){return}var f=this.parentNode;if(!f._enabled){return}f._busy=false;this.className="dhxform_btn"+(this._isOver?" dhxform_btn_over":"");if(this._pressed&&this._allowClick){f.callEvent("_onButtonClick",[f._name,f._cmd])}this._allowClick=false;this._pressed=false;f=null};c._doOnFocus=function(f){f.getForm().callEvent("onFocus",[f._idd])};c._doOnBlur=function(f){f.getForm().callEvent("onBlur",[f._idd])};return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._type=null;a._enabled=null;a._cmd=null;a._name=null;a._doOnFocus=null;a._doOnBlur=null;a._doOnKeyUpDown=null;a.onselectstart=null;a.firstChild.onselectstart=null;a.firstChild.onkeypress=null;a.firstChild.ontouchstart=null;a.firstChild.onfocus=null;a.firstChild.onblur=null;a.firstChild.onkeyup=null;a.firstChild.onkeydown=null;a.firstChild.onmouseover=null;a.firstChild.onmouseout=null;a.firstChild.onmousedown=null;a.firstChild.onmouseup=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[0].removeAttribute("disabled");a.childNodes[0].setAttribute("role","link");a.childNodes[0].setAttribute("tabIndex","0")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[0].setAttribute("disabled","true");a.childNodes[0].removeAttribute("role");a.childNodes[0].removeAttribute("tabIndex")},setText:function(a,b){a.childNodes[0].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},setFocus:function(a){a.childNodes[0].focus()}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.button[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.hidden={_index:false,render:function(b,c){b.style.display="none";b._name=c.name;b._type="hd";b._enabled=true;var a=document.createElement("INPUT");a.type="HIDDEN";a.name=c.name;a.value=(c.value||"");b.appendChild(a);return this},destruct:function(a){this.doUnloadNestedLists(a);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a._autoCheck=null;a._name=null;a._type=null;a._enabled=null;a.onselectstart=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.parentNode.removeChild(a);a=null},enable:function(a){a._enabled=true;a.childNodes[0].setAttribute("name",a._name)},disable:function(a){a._enabled=false;a.childNodes[0].removeAttribute("name")},show:function(){},hide:function(){},isHidden:function(){return true},setValue:function(a,b){a.childNodes[0].value=b},getValue:function(a){return a.childNodes[0].value},getInput:function(a){return a.childNodes[0]}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.hidden[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.list={_index:false,render:function(a,b){a._type="list";a._enabled=true;a._isNestedForm=true;a.style.paddingLeft=a._ofsNested+"px";a.className="dhxform_base_nested"+(a._custom_css||"");return[this,new dhtmlXForm(a,null,b)]},destruct:function(a){}};dhtmlXForm.prototype.items.fieldset={_index:false,render:function(b,d){b._type="fs";if(typeof(parseInt(d.inputWidth))=="number"){}b._width=d.width;b._enabled=true;b._checked=true;b.className="fs_"+d.position+(typeof(d.className)=="string"?" "+d.className:"");var c=document.createElement("FIELDSET");c.className="dhxform_fs";var g=String(d.labelAlign).replace("align_","");c.innerHTML="<legend class='fs_legend' align='"+g+"' style='text-align:"+g+"'>"+d.label+"</legend>";b.appendChild(c);if(!isNaN(d.inputLeft)){c.style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){c.style.top=parseInt(d.inputTop)+"px"}if(d.inputWidth!="auto"){if(!isNaN(d.inputWidth)){c.style.width=parseInt(d.inputWidth)+"px";var a=parseInt(c.style.width);if(c.offsetWidth>a){c.style.width=a+(a-c.offsetWidth)+"px"}}}b._addSubListNode=function(){var f=document.createElement("DIV");f._custom_css=" dhxform_fs_nested";this.childNodes[0].appendChild(f);return f};if(d.hidden==true){this.hide(b)}if(d.disabled==true){this.userDisable(b)}return this},destruct:function(a){this.doUnloadNestedLists(a);a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._width=null;a.onselectstart=null;a._addSubListNode=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,b){a.childNodes[0].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}},setWidth:function(b,a){b.childNodes[0].style.width=a+"px";b._width=a},getWidth:function(a){return a._width}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.fieldset[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.block={_index:false,render:function(c,d){c._type="bl";c._width=d.width;c._enabled=true;c._checked=true;c.className="block_"+d.position+(typeof(d.className)=="string"?" "+d.className:"");var a=document.createElement("DIV");a.className="dhxform_obj_"+c.getForm().skin+" dhxform_block";a.style.fontSize=c.getForm().cont.style.fontSize;if(d.style){a.style.cssText=d.style}if(typeof(d.id)!="undefined"){a.id=d.id}c.appendChild(a);if(!isNaN(d.inputLeft)){a.style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){a.style.top=parseInt(d.inputTop)+"px"}if(d.inputWidth!="auto"){if(!isNaN(d.inputWidth)){a.style.width=parseInt(d.inputWidth)+"px"}}if(!isNaN(d.blockOffset)){c._ofsNested=d.blockOffset}c._addSubListNode=function(){var b=document.createElement("DIV");b._inBlcok=true;if(typeof(this._ofsNested)!="undefined"){b._ofsNested=this._ofsNested}this.childNodes[0].appendChild(b);return b};if(d.hidden==true){this.hide(c)}if(d.disabled==true){this.userDisable(c)}return this},_setCss:function(a,c,b){a.firstChild.className="dhxform_obj_"+c+" dhxform_block";a.firstChild.style.fontSize=b}};(function(){for(var b in {enable:1,disable:1,isEnabled:1,setWidth:1,getWidth:1,doUnloadNestedLists:1,destruct:1}){dhtmlXForm.prototype.items.block[b]=dhtmlXForm.prototype.items.fieldset[b]}})();dhtmlXForm.prototype.items.newcolumn={_index:false};dhtmlXForm.prototype.items.template={render:function(b,c){var a=(!isNaN(c.rows));b._type="tp";b._enabled=true;if(c.format){if(typeof(c.format)=="function"){b.format=c.format}if(typeof(window[c.format])=="function"){b.format=window[c.format]}}if(!b.format){b.format=function(d,f){return f}}this.doAddLabel(b,c);this.doAddInput(b,c,"DIV",null,true,true,"dhxform_item_template");b._value=(c.value||"");b.childNodes[1].childNodes[0].innerHTML=b.format(b._idd,b._value);return this},setValue:function(a,b){a._value=b;a.childNodes[1].childNodes[0].innerHTML=a.format(a._idd,a._value)},getValue:function(a){return a._value},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false}};(function(){for(var b in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.template[b]=dhtmlXForm.prototype.items.select[b]}})();dhtmlXForm.prototype._ulToObject=function(f,i){var g=[];for(var b=0;b<f.childNodes.length;b++){if(String(f.childNodes[b].tagName||"").toLowerCase()=="li"){var c={};var l=f.childNodes[b];for(var j=0;j<i.length;j++){if(l.getAttribute(i[j])!=null){c[String(i[j]).replace("ftype","type")]=l.getAttribute(i[j])}}if(!c.label){try{c.label=l.firstChild.nodeValue}catch(h){}}var d=l.getElementsByTagName("UL");if(d[0]!=null){c[(c.type=="select"?"options":"list")]=dhtmlXForm.prototype._ulToObject(d[0],i)}for(var j=0;j<l.childNodes.length;j++){if(String(l.childNodes[j].tagName||"").toLowerCase()=="userdata"){if(!c.userdata){c.userdata={}}c.userdata[l.childNodes[j].getAttribute("name")]=l.childNodes[j].firstChild.nodeValue}}g[g.length]=c}if(String(f.childNodes[b].tagName||"").toLowerCase()=="div"){var c={};c.type="label";try{c.label=f.childNodes[b].firstChild.nodeValue}catch(h){}g[g.length]=c}}return g};dhtmlXForm.prototype.setUserData=function(f,c,d,a){if(typeof(a)!="undefined"){var b=this.doWithItem([f,c],"_getId");if(b!=null){f=b;c=d;d=a}}if(!this._userdata){this._userdata={}}this._userdata[f]=(this._userdata[f]||{});this._userdata[f][c]=d};dhtmlXForm.prototype.getUserData=function(d,c,a){if(typeof(a)!="undefined"){var b=this.doWithItem([d,c],"_getId");if(b!=null){d=b;c=a}}if(this._userdata!=null&&typeof(this._userdata[d])!="undefined"&&typeof(this._userdata[d][c])!="undefined"){return this._userdata[d][c]}return""};dhtmlXForm.prototype.setRTL=function(a){this._rtl=(a===true?true:false);if(this._rtl){if(String(this.cont).search(/dhxform_rtl/gi)<0){this.cont.className+=" dhxform_rtl"}}else{if(String(this.cont).search(/dhxform_rtl/gi)>=0){this.cont.className=String(this.cont.className).replace(/dhxform_rtl/gi,"")}}};_dhxForm_doClick=function(d,b){if(typeof(b)=="object"){var a=b[1];b=b[0]}if(document.createEvent){var c=document.createEvent("MouseEvents");c.initEvent(b,true,false);d.dispatchEvent(c)}else{if(document.createEventObject){var c=document.createEventObject();c.button=1;d.fireEvent("on"+b,c)}}if(a){window.setTimeout(function(){_dhxForm_doClick(d,a)},100)}};dhtmlXForm.prototype.setFormData=function(c){for(var b in c){var d=this.getItemType(b);switch(d){case"checkbox":this[c[b]==true||parseInt(c[b])==1||c[b]=="true"||c[b]==this.getItemValue(b,"realvalue")?"checkItem":"uncheckItem"](b);break;case"radio":this.checkItem(b,c[b]);break;case"input":case"textarea":case"password":case"select":case"multiselect":case"hidden":case"template":case"combo":case"calendar":case"colorpicker":case"editor":this.setItemValue(b,c[b]);break;default:if(this["setFormData_"+d]){this["setFormData_"+d](b,c[b])}else{if(!this.hId){this.hId=this._genStr(12)}this.setUserData(this.hId,b,c[b])}break}}};dhtmlXForm.prototype.getFormData=function(p,h){var c={};var m=this;for(var o in this.itemPull){var l=this.itemPull[o]._idd;var s=this.itemPull[o]._type;if(s=="ch"){c[l]=(this.isItemChecked(l)?this.getItemValue(l):0)}if(s=="ra"&&!c[this.itemPull[o]._group]){c[this.itemPull[o]._group]=this.getCheckedValue(this.itemPull[o]._group)}if(s in {se:1,ta:1,pw:1,hd:1,tp:1,fl:1,calendar:1,combo:1,editor:1,colorpicker:1}){c[l]=this.getItemValue(l,p)}if(this["getFormData_"+s]){c[l]=this["getFormData_"+s](l)}if(s=="up"){var g=this.getItemValue(l);for(var f in g){c[f]=g[f]}}if(this.itemPull[o]._list){for(var d=0;d<this.itemPull[o]._list.length;d++){var j=this.itemPull[o]._list[d].getFormData(p,h);for(var n in j){c[n]=j[n]}}}}if(!h&&this.hId&&this._userdata[this.hId]){for(var o in this._userdata[this.hId]){if(!c[o]){c[o]=this._userdata[this.hId][o]}}}return c};dhtmlXForm.prototype.adjustParentSize=function(){var f=0;var d=-1;for(var g=0;g<this.base.length;g++){f+=this.base[g].firstChild.offsetWidth;if(this.base[g].offsetHeight>d){d=this.base[g].offsetHeight}}var c=false;try{c=(this.cont.parentNode.parentNode.parentNode.parentNode._isCell==true);if(c){var a=this.cont.parentNode.parentNode.parentNode.parentNode}}catch(h){}if(c&&typeof(a)!="undefined"){if(f>0){a.setWidth(f+10)}if(d>0){a.setHeight(d+a.firstChild.firstChild.offsetHeight+5)}c=a=null;return}var b=false;try{b=(this.cont.parentNode.parentNode.parentNode._isWindow==true);if(b){var i=this.cont.parentNode.parentNode;if(typeof(i.callEvent)=="function"){this.cont.style.display="none";i.callEvent("_setCellSize",[f+15,d+15]);this.cont.style.display=""}}}catch(h){}};dhtmlXForm.prototype.reset=function(){if(this.callEvent("onBeforeReset",[this.formId,this.getFormData()])){if(this._last_load_data){this.setFormData(this._last_load_data)}this.callEvent("onAfterReset",[this.formId])}};dhtmlXForm.prototype.send=function(b,h,i,d){if(typeof h=="function"){i=h;h="post"}else{h=(h=="get"?"get":"post")}if(d!==true&&!this.validate()){return}var g=this.getFormData(true);var f=[];for(var c in g){f.push(c+"="+encodeURIComponent(g[c]))}var a=function(j){if(i){i.call(this,j,j.xmlDoc.responseText)}};if(h=="get"){window.dhx4.ajax.get(b+(b.indexOf("?")==-1?"?":"&")+f.join("&"),a)}else{window.dhx4.ajax.post(b,f.join("&"),a)}};dhtmlXForm.prototype.save=function(a,b){};dhtmlXForm.prototype.dummy=function(){};dhtmlXForm.prototype._changeFormId=function(b,a){this.formId=a};dhtmlXForm.prototype._dp_init=function(a){a._methods=["dummy","dummy","_changeFormId","dummy"];a._getRowData=function(d,b){var c=this.obj.getFormData(true);c[this.action_param]=this.obj.getUserData(d,this.action_param);return c};a._clearUpdateFlag=function(){};a.attachEvent("onAfterUpdate",function(c,d,f,b){if(d=="inserted"||d=="updated"){this.obj.resetDataProcessor("updated");this.obj._last_load_data=this.obj.getFormData(true)}this.obj.callEvent("onAfterSave",[this.obj.formId,b]);return true});a.autoUpdate=false;a.setTransactionMode("POST",true);this.dp=a;this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");this.save=function(){if(!this.callEvent("onBeforeSave",[this.formId,this.getFormData()])){return}if(!this.validate()){return}a.sendData()}};dhtmlXForm.prototype.resetDataProcessor=function(a){if(!this.dp){return}this.dp.updatedRows=[];this.dp._in_progress=[];this.dp.setUpdated(this.formId,true,a)};dhtmlXForm.prototype._ccActivate=function(c,a,b){if(!this._formLS){this._formLS={}}if(!this._formLS[c]){this._formLS[c]={input:a,value:b}}if(!this._ccActive){this._ccActive=true;this._ccDo()}a=null};dhtmlXForm.prototype._ccDeactivate=function(a){if(this._ccTm){window.clearTimeout(this._ccTm)}this._ccActive=false;if(this._formLS!=null&&this._formLS[a]!=null){this._formLS[a].input=null;this._formLS[a]=null;delete this._formLS[a]}};dhtmlXForm.prototype._ccDo=function(){if(this._ccTm){window.clearTimeout(this._ccTm)}for(var b in this._formLS){var f=this._formLS[b].input;if(String(f.tagName).toLowerCase()=="select"){var c="";if(f.selectedIndex>=0&&f.selectedIndex<f.options.length){c=f.options[f.selectedIndex].value}}else{var c=f.value}if(c!=this._formLS[b].value){this._formLS[b].value=c;this.callEvent("onInputChange",[f._idd,c,this])}f=null}if(this._ccActive){var d=this;this._ccTm=window.setTimeout(function(){d._ccDo();d=null},100)}};dhtmlXForm.prototype._ccReload=function(b,a){if(this._formLS&&this._formLS[b]){this._formLS[b].value=a}};dhtmlXForm.prototype._autoload=function(){var b=["ftype","name","value","label","check","checked","disabled","text","rows","select","selected","width","style","className","labelWidth","labelHeight","labelLeft","labelTop","inputWidth","inputHeight","inputLeft","inputTop","position","size"];var c=document.getElementsByTagName("UL");var d=[];for(var h=0;h<c.length;h++){if(c[h].className=="dhtmlxForm"){var g=document.createElement("DIV");d[d.length]={nodeUL:c[h],nodeForm:g,data:dhtmlXForm.prototype._ulToObject(c[h],b),name:(c[h].getAttribute("name")||null)}}}for(var h=0;h<d.length;h++){d[h].nodeUL.parentNode.insertBefore(d[h].nodeForm,d[h].nodeUL);var i=new dhtmlXForm(d[h].nodeForm,d[h].data);if(d[h].name!==null){window[d[h].name]=i}var f=(d[h].nodeUL.getAttribute("oninit")||null);d[h].nodeUL.parentNode.removeChild(d[h].nodeUL);d[h].nodeUL=null;d[h].nodeForm=null;d[h].data=null;d[h]=null;if(f){if(typeof(f)=="function"){f()}else{if(typeof(window[f])=="function"){window[f]()}}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.detachEvent("onload",dhtmlXForm.prototype._autoload)}};if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.attachEvent("onload",dhtmlXForm.prototype._autoload)}if(!window.dhtmlxValidation){dhtmlxValidation=function(){};dhtmlxValidation.prototype={isEmpty:function(a){return a==""},isNotEmpty:function(a){return(a instanceof Array?a.length>0:!a=="")},isValidBoolean:function(a){return !!a.toString().match(/^(0|1|true|false)$/)},isValidEmail:function(a){return !!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,4})$)/i)},isValidInteger:function(a){return !!a.toString().match(/(^-?\d+$)/)},isValidNumeric:function(a){return !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},isValidAplhaNumeric:function(a){return !!a.toString().match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(b){var a=b.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return a&&!!(a[1]<=9999&&a[2]<=12&&a[3]<=31&&a[4]<=59&&a[5]<=59&&a[6]<=59)||false},isValidDate:function(a){var b=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31)||false},isValidTime:function(b){var a=b.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return a&&!!(a[1]<=24&&a[2]<=59&&a[3]<=59)||false},isValidIPv4:function(a){var b=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return b&&!!(b[1]<=255&&b[2]<=255&&b[3]<=255&&b[4]<=255)||false},isValidCurrency:function(a){return a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/)&&true||false},isValidSSN:function(a){return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&true||false},isValidSIN:function(a){return a.toString().match(/^\d{9}$/)&&true||false}};dhtmlxValidation=new dhtmlxValidation()}dhtmlXForm.prototype.addItem=function(c,a,h,d){var b=null;if(c instanceof Array){b=c[1];c=c[0]}var g=null;if(c!=null){var g=this._getParentForm(c,b);if(g!=null){if(g.item._list==null){if(!a.listParent){a.listParent=g.item._idd}g.form._addItem("list",g.item._idd,[a],null,g.item._idd,h,d)}else{g.item._list[0].addItem(null,a,h,d)}g.form=g.item=null;g=null;this._autoCheck();return}}this._prepareItem(a,h,d);this._autoCheck()};dhtmlXForm.prototype.removeItem=function(b,a){this._removeItem(b,a)};dhtmlXForm.prototype.removeColumn=function(i,h,d,c){var l=null;if(i instanceof Array){l=i[1];i=i[0]}if(i!=null){var g=this._getParentForm(i,l);if(g!=null){if(g.item._list!=null&&g.item._list[0]!=null){g.item._list[0].removeColumn(null,h,d,c)}g.form=g.item=null;g=null}return}h=Math.min(Math.max(h,0),this.cont.childNodes.length-1);if(this.cont.childNodes.length==1){if(d==true){this._removeItemsInColumn(this.cont.childNodes[h])}}else{if(d==true){this._removeItemsInColumn(this.cont.childNodes[h])}else{if(!c){var a=h-1;if(a<0){a=h+1}}else{var a=h+1;if(a>this.cont.childNodes.length-1){a=h-1}}while(this.cont.childNodes[h].childNodes.length>0){this.cont.childNodes[a].appendChild(this.cont.childNodes[h].childNodes[0])}}var j=[];for(var b=0;b<this.base.length;b++){if(this.cont.childNodes[h]!=this.base[b]){j.push(this.base[b])}}this.base=j;this.cont.removeChild(this.cont.childNodes[h]);this.b_index--;j=null}};dhtmlXForm.prototype.getColumnNode=function(c,b){var d=null;var a=null;if(c instanceof Array){a=c[1];c=c[0]}if(c!=null){var g=this._getParentForm(c,a);if(g!=null){if(g.item._list!=null&&g.item._list[0]!=null&&d==null){d=g.item._list[0].getColumnNode(null,b)}g.form=g.item=null;g=null}return d}if(b<0||b>this.cont.childNodes.length-1){return null}return this.cont.childNodes[b]};dhtmlXForm.prototype._removeItemsInColumn=function(d){var a=[];for(var c=0;c<d.childNodes.length;c++){var b=d.childNodes[c];if(b._idd!=null&&b._type!=null){a.push([b._idd,(b._type=="ra"?b._value:null)])}b=null}for(var c=0;c<a.length;c++){this.removeItem(a[c][0],a[c][1])}};dhtmlXForm.prototype._getParentForm=function(h,g){if(this.itemPull[this.idPrefix+h]!=null){return{form:this,item:this.itemPull[this.idPrefix+h]}}for(var b in this.itemPull){if(this.itemPull[b]._type=="ra"&&this.itemPull[b]._group==h&&this.itemPull[b]._value==g){return{form:this,item:this.itemPull[b]}}}var d=null;for(var b in this.itemPull){if(!d&&this.itemPull[b]._list!=null){for(var c=0;c<this.itemPull[b]._list.length;c++){if(!d){d=this.itemPull[b]._list[c]._getParentForm(h,g)}}}}return d};(function(){for(var b in dhtmlXForm.prototype.items){if(!dhtmlXForm.prototype.items[b]._getItemNode){dhtmlXForm.prototype.items[b]._getItemNode=function(a){return a}}}})();dhtmlXForm.prototype._getItemNode=function(b,a){if(a!=null){b=[b,a]}return this.doWithItem(b,"_getItemNode")};dhtmlXForm.prototype.setRequired=function(i,g,f){if(typeof(f)=="undefined"){f=g}else{i=[i,g]}var c=this._getItemNode(i);if(!c){return}f=window.dhx4.s2b(f);c._required=(f==true);if(c._required){if(!c._validate){c._validate=[]}var b=false;for(var d=0;d<c._validate.length;d++){b=(c._validate[d]=="NotEmpty"||b)}if(!b){c._validate.push("NotEmpty")}var h=c.childNodes[c._ll?0:1].childNodes[0];if(!(h.lastChild&&h.lastChild.className&&h.lastChild.className.search(/required/)>=0)){var a=document.createElement("SPAN");a.className="dhxform_item_required";a.innerHTML="*";h.appendChild(a);a=h=null}}else{if(c._validate!=null){var b=c._validate;c._validate=[];for(var d=0;d<b.length;d++){if(b[d]!="NotEmpty"){c._validate.push(b[d])}}if(c._validate.length==0){c._validate=null}}var h=c.childNodes[c._ll?0:1].childNodes[0];if(h.lastChild&&h.lastChild.className&&h.lastChild.className.search(/required/)>=0){h.removeChild(h.lastChild);h=null}}this._resetValidateCss(c);c=null};dhtmlXForm.prototype.setNote=function(f,c,a){if(typeof(a)=="undefined"){a=c}else{f=[f,c]}var b=this._getItemNode(f);if(!b){return}var d=this._getNoteNode(b);if(!d){if(!a.width){a.width=b.childNodes[b._ll?1:0].childNodes[0].offsetWidth}d=document.createElement("DIV");d.className="dhxform_note";if({ch:1,ra:1}[b._type]){b.childNodes[b._ll?1:0].insertBefore(d,b.childNodes[b._ll?1:0].lastChild)}else{b.childNodes[b._ll?1:0].appendChild(d)}}d.innerHTML=a.text;if(a.width!=null){d.style.width=a.width+"px";d._w=a.width}d=null};dhtmlXForm.prototype.clearNote=function(d,b){if(typeof(b)!="undefined"){d=[d,b]}var a=this._getItemNode(d);if(!a){return}var c=this._getNoteNode(a);if(c!=null){c.parentNode.removeChild(c);c=null}};dhtmlXForm.prototype._getNoteNode=function(a){var c=null;for(var b=0;b<a.childNodes[a._ll?1:0].childNodes.length;b++){if(String(a.childNodes[a._ll?1:0].childNodes[b].className).search(/dhxform_note/)>=0){c=a.childNodes[a._ll?1:0].childNodes[b]}}a=null;return c};dhtmlXForm.prototype.setValidation=function(g,d,f){if(typeof(note)=="undefined"){f=d}else{g=[g,d]}var b=this._getItemNode(g);if(!b){return}if(b._validate!=null){for(var c=0;c<b._validate.length;c++){b._validate[c]=null}}b._validate=[];if(typeof(f)=="function"||typeof(window[f])=="function"){b._validate=[f]}else{b._validate=String(f).split(this.separator)}if(b._required){var a=false;for(var c=0;c<b._validate.length;c++){a=(b._validate[c]=="NotEmpty"||a)}if(!a){b._validate.push("NotEmpty")}}b=null};dhtmlXForm.prototype.clearValidation=function(d,c){if(typeof(c)!="undefined"){d=[d,c]}var a=this._getItemNode(d);if(!a){return}if(a._validate!=null){for(var b=0;b<a._validate.length;b++){a._validate[b]=null}}a._validate=a._required?["NotEmpty"]:null;a=null};dhtmlXForm.prototype.reloadOptions=function(a,g){var b=this.getItemType(a);if(!{select:1,multiselect:1,combo:1}[b]){return}if(b=="select"||b=="multiselect"){var d=this.getOptions(a);while(d.length>0){d.remove(0)}d.length=0;d=null;if(typeof(g)=="string"){this.doWithItem(a,"doLoadOptsConnector",g)}else{if(g instanceof Array){this.doWithItem(a,"doLoadOpts",{options:g})}}}if(b=="combo"){var h=this.getCombo(a);h.clearAll();h.setComboValue("");if(typeof(g)=="string"){this.doWithItem(a,"doLoadOptsConnector",g)}else{if(g instanceof Array){var c=null;for(var f=0;f<g.length;f++){if(window.dhx4.s2b(g[f].selected)){c=g[f].value}}h.addOption(g);if(c!=null){this.setItemValue(a,c)}h=null}}}};dhtmlXForm.prototype.setTooltip=function(g,f,d){if(typeof(d)=="undefined"){d=f}else{g=[g,f]}var b=this._getItemNode(g);if(!b){return}var a=null;if(b.childNodes.length==1){a=b.childNodes[0]}else{for(var c=0;c<b.childNodes.length;c++){if(b.childNodes[c].className!=null&&b.childNodes[c].className.search("dhxform_label")>=0){a=b.childNodes[c]}}}if(a!=null){if(d==null||d.length==0){a.removeAttribute("title")}else{a.title=d}}a=null};dhtmlXForm.prototype.saveBackup=function(){if(!this._backup){this._backup={};this._backupId=new Date().getTime()}this._backup[++this._backupId]=this.getFormData();return this._backupId};dhtmlXForm.prototype.restoreBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this.setFormData(this._backup[a])}};dhtmlXForm.prototype.clearBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this._backup[a]=null;delete this._backup[a]}};dhtmlXForm.prototype.items.combo={render:function(b,c){b._type="combo";b._enabled=true;b._value=null;b._newValue=null;this.doAddLabel(b,c);this.doAddInput(b,c,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(b);this.doLoadOpts(b,c);b.onselectstart=function(d){return true};b.childNodes[b._ll?1:0].childNodes[0].setAttribute("mode",c.comboType||"");if(c.comboImagePath){b.childNodes[b._ll?1:0].childNodes[0].setAttribute("imagePath",c.comboImagePath)}if(c.comboDefaultImage){b.childNodes[b._ll?1:0].childNodes[0].setAttribute("defaultImage",c.comboDefaultImage)}if(c.comboDefaultImageDis){b.childNodes[b._ll?1:0].childNodes[0].setAttribute("defaultImageDis",c.comboDefaultImageDis)}b._combo=new dhtmlXComboFromSelect(b.childNodes[b._ll?1:0].childNodes[0]);b._combo.setSkin(b.getForm().skin);b._combo._currentComboValue=b._combo.getSelectedValue();b._combo.getInput().id=c.uid;var a=this;b._combo.attachEvent("onChange",function(){a.doOnChange(this)});if(c.connector){this.doLoadOptsConnector(b,c.connector)}if(c.filtering){b._combo.enableFilteringMode(true)}else{if(c.serverFiltering){b._combo.enableFilteringMode(true,c.serverFiltering,c.filterCache,c.filterSubLoad)}}if(c.readonly==true){this.setReadonly(b,true)}if(c.style){b._combo.DOMelem_input.style.cssText+=c.style}b._combo.attachEvent("onFocus",function(){var d=this.cont.parentNode.parentNode;var g=d.getForm();if(g.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)<0){this.cont.className+=" combo_in_focus"}g.callEvent("onFocus",[d._idd]);g=d=null});b._combo.attachEvent("onBlur",function(){var d=this.cont.parentNode.parentNode;var g=d.getForm();if(g.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)>=0){this.cont.className=this.cont.className.replace(/\s{0,}combo_in_focus/gi,"")}g.callEvent("onBlur",[d._idd]);g=d=null});return this},destruct:function(a){a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a._combo._currentComboValue=null;a._combo.unload();a._combo=null;a._apiChange=null;this.d2(a);a=null},doAttachEvents:function(b){var a=this;b.childNodes[b._ll?1:0].childNodes[0].onchange=function(){a.doOnChange(this);a.doValidate(this.DOMParent.parentNode.parentNode)}},doValidate:function(a){if(a.getForm().hot_validate){this._validate(a)}},doOnChange:function(b){var a=b.base.parentNode.parentNode.parentNode;if(a._apiChange){return}b._newComboValue=b.getSelectedValue();if(b._newComboValue!=b._currentComboValue){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,b._currentComboValue,b._newComboValue])!==true){window.setTimeout(function(){b.setComboValue(b._currentComboValue)},1);return false}}b._currentComboValue=b._newComboValue;a.callEvent("onChange",[a._idd,b._currentComboValue])}a._autoCheck(a._enabled)},doLoadOptsConnector:function(d,a){var c=this;var b=d;d._connector_working=true;d._apiChange=true;d._combo.load(a,function(){b.callEvent("onOptionsLoaded",[b._idd]);b._connector_working=false;if(b._connector_value!=null){c.setValue(b,b._connector_value);b._connector_value=null}b._apiChange=false;c=b=null})},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a._combo.enable()},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a._combo.disable()},getCombo:function(a){return a._combo},setValue:function(a,b){if(a._connector_working){a._connector_value=b;return}a._apiChange=true;a._combo.setComboValue(b);a._combo._currentComboValue=a._combo.getActualValue();a._apiChange=false},getValue:function(a){return a._combo.getActualValue()},setWidth:function(b,a){b.childNodes[b._ll?1:0].childNodes[0].style.width=a+"px"},setReadonly:function(a,b){if(!a._combo){return}a._combo_ro=b;a._combo.readonly(a._combo_ro)},isReadonly:function(a,b){return a._combo_ro||false},setFocus:function(a){if(a._enabled){a._combo.setFocus()}},_setCss:function(a,c,b){a._combo.setFontSize(b,b)}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,_checkNoteWidth:1}){dhtmlXForm.prototype.items.combo[b]=dhtmlXForm.prototype.items.select[b]}})();dhtmlXForm.prototype.items.combo.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.getCombo=function(a){return this.doWithItem(a,"getCombo")};dhtmlXForm.prototype.items.calendar={render:function(c,g){var b=this;c._type="calendar";c._enabled=true;var h=navigator.userAgent;var a=(h.indexOf("MSIE 6.0")>=0||h.indexOf("MSIE 7.0")>=0||h.indexOf("MSIE 8.0")>=0);this.doAddLabel(c,g);this.doAddInput(c,g,"INPUT","TEXT",true,true,"dhxform_textarea calendar");this.doAttachChangeLS(c);if(a){c.childNodes[c._ll?1:0].childNodes[0].onfocus2=c.childNodes[c._ll?1:0].childNodes[0].onfocus;c.childNodes[c._ll?1:0].childNodes[0].onfocus=function(){if(this._skipOnFocus==true){this._skipOnFocus=false;return}this.onfocus2.apply(this,arguments)}}c.childNodes[c._ll?1:0].childNodes[0]._idd=c._idd;c.childNodes[c._ll?1:0].childNodes[0].onblur=function(){var j=this.parentNode.parentNode;if(j._c.base._formMouseDown){j._c.base._formMouseDown=false;this._skipOnFocus=true;this.focus();this.value=this.value;j=null;return true}var l=j.getForm();l._ccDeactivate(j._idd);b.checkEnteredValue(this.parentNode.parentNode);if(l.live_validate){b._validate(j)}l.callEvent("onBlur",[j._idd]);l=j=null};c._f=(g.dateFormat||null);c._f0=(g.serverDateFormat||c._f);var d=c.getForm();c._c=new dhtmlXCalendarObject(c.childNodes[c._ll?1:0].childNodes[0],g.skin||d.skin||"dhx_skyblue");c._c._nullInInput=true;c._c.enableListener(c.childNodes[c._ll?1:0].childNodes[0]);if(c._f!=null){c._c.setDateFormat(c._f)}if(!window.dhx4.s2b(g.enableTime)){c._c.hideTime()}if(window.dhx4.s2b(g.showWeekNumbers)){c._c.showWeekNumbers()}if(!isNaN(g.weekStart)){c._c.setWeekStartDay(g.weekStart)}if(typeof(g.calendarPosition)!="undefined"){c._c.setPosition(g.calendarPosition)}if(g.minutesInterval!=null){c._c.setMinutesInterval(g.minutesInterval)}c._c._itemIdd=c._idd;c._c.attachEvent("onBeforeChange",function(f){if(c._value!=f){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,f])!==true){return false}}c._tempValue=c._value=f;b.setValue(c,f,false);c.callEvent("onChange",[this._itemIdd,c._value])}return true});c._c.attachEvent("onClick",function(){c._tempValue=null});if(a){c._c.base.onmousedown=function(){this._formMouseDown=true;return false}}this.setValue(c,g.value);d=null;return this},getCalendar:function(a){return a._c},setSkin:function(a,b){a._c.setSkin(b)},setValue:function(b,c,a){if(!c||c==null||typeof(c)=="undefined"||c==""){b._value=null;b.childNodes[b._ll?1:0].childNodes[0].value=""}else{b._value=(c instanceof Date?c:b._c._strToDate(c,b._f0||b._c._dateFormat));b.childNodes[b._ll?1:0].childNodes[0].value=b._c._dateToStr(b._value,b._f||b._c._dateFormat)}if(a!==false){b._c.setDate(b._value)}},getValue:function(b,a){var c=b._tempValue||b._c.getDate();if(a===true&&c==null){return""}return(a===true?b._c._dateToStr(c,b._f0||b._c._dateFormat):c)},setDateFormat:function(b,a,c){b._f=a;b._f0=(c||b._f);b._c.setDateFormat(b._f);this.setValue(b,this.getValue(b))},destruct:function(a){a._c.disableListener(a.childNodes[a._ll?1:0].childNodes[0]);a._c.unload();a._c=null;try{delete a._c}catch(b){}a._f=null;try{delete a._f}catch(b){}a._f0=null;try{delete a._f0}catch(b){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;this.d2(a);a=null},checkEnteredValue:function(a){this.setValue(a,a._c.getDate())}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.calendar[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.calendar.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};dhtmlXForm.prototype.setCalendarDateFormat=function(b,a,c){this.doWithItem(b,"setDateFormat",a,c)};dhtmlXForm.prototype.items.btn2state={setChecked:function(a,b){a._checked=(b===true?true:false);a.childNodes[a._ll?1:0].lastChild.className="dhxform_img "+a._cssName+"_"+(a._checked?"1":"0");this.doCheckValue(a)}};(function(){for(var b in dhtmlXForm.prototype.items.checkbox){if(!dhtmlXForm.prototype.items.btn2state[b]){dhtmlXForm.prototype.items.btn2state[b]=dhtmlXForm.prototype.items.checkbox[b]}}})();dhtmlXForm.prototype.items.btn2state.render2=dhtmlXForm.prototype.items.btn2state.render;dhtmlXForm.prototype.items.btn2state.render=function(a,b){b._autoInputWidth=false;this.render2(a,b);a._type="btn2state";a._cssName=(typeof(b.cssName)=="undefined"?"btn2state":b.cssName);a._updateImgNode=function(){};a._doOnFocus=function(){a.getForm().callEvent("onFocus",[a._idd])};a._doOnBlur=function(){a.getForm().callEvent("onBlur",[a._idd])};a._doOnKeyUpDown=function(d,c,f){this.callEvent(d,[this.childNodes[this._ll?0:1].childNodes[0],c,this._idd])};this.setChecked(a,a._checked);return this};dhtmlXForm.prototype.setFormData_btn2state=function(a,b){this[b==true||parseInt(b)==1||b=="true"||b==this.getItemValue(a)?"checkItem":"uncheckItem"](a)};dhtmlXForm.prototype.getFormData_btn2state=function(a){return(this.isItemChecked(a)?this.getItemValue(a):0)};dhtmlXForm.prototype.items.colorpicker={colorpicker:{},render:function(c,d){var b=this;c._type="colorpicker";c._enabled=true;this.doAddLabel(c,d);this.doAddInput(c,d,"INPUT","TEXT",true,true,"dhxform_textarea");c._value=(d.value||"");c.childNodes[c._ll?1:0].childNodes[0].value=c._value;var a={input:c.childNodes[c._ll?1:0].childNodes[0],custom_colors:(window.dhx4.s2b(d.enableCustomColors)==true),skin:c.getForm().skin};this.colorpicker[c._idd]=new dhtmlXColorPicker(a);this.colorpicker[c._idd]._nodes[0].valueColor=null;this.colorpicker[c._idd].base.className+=" dhtmlxcp_in_form";if(typeof(d.customColors)!="undefined"){this.colorpicker[c._idd].setCustomColors(d.customColors)}this.colorpicker[c._idd].attachEvent("onSelect",function(f){if(c._value!=f){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,f])!==true){c.childNodes[c._ll?1:0].childNodes[0].value=c._value;return}}c._value=f;b.setValue(c,f);c.callEvent("onChange",[c._idd,c._value])}});this.colorpicker[c._idd].attachEvent("onHide",function(f){var g=c.childNodes[c._ll?1:0].childNodes[0];if(g.value!=c._value){g.value=c._value}g=null});c.childNodes[c._ll?1:0].childNodes[0]._idd=c._idd;return this},getColorPicker:function(a){return this.colorpicker[a._idd]},destruct:function(a){if(this.colorpicker[a._idd].unload){this.colorpicker[a._idd].unload()}this.colorpicker[a._idd]=null;try{delete this.colorpicker[a._idd]}catch(b){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null},setSkin:function(a,b){this.colorpicker[a._idd].setSkin(b)}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setValue:1,getValue:1,updateValue:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.colorpicker[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.colorpicker.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getColorPicker=function(a){return this.doWithItem(a,"getColorPicker")};dhtmlXForm.prototype.items.container={render:function(a,b){a._type="container";a._enabled=true;this.doAddLabel(a,b);this.doAddInput(a,b,"DIV",null,true,true,"dhxform_container");return this},getContainer:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a.callEvent("onEnable",[a._idd])},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a.callEvent("onDisable",[a._idd])},doAttachEvents:function(){},setValue:function(){},getValue:function(){return null}};dhtmlXForm.prototype.getContainer=function(a){return this.doWithItem(a,"getContainer")};(function(){for(var b in dhtmlXForm.prototype.items.input){if(!dhtmlXForm.prototype.items.container[b]){dhtmlXForm.prototype.items.container[b]=dhtmlXForm.prototype.items.input[b]}}})();dhtmlXForm.prototype.items.editor={editor:{},render:function(c,d){var a=(!isNaN(d.rows));c._type="editor";c._enabled=true;this.doAddLabel(c,d);this.doAddInput(c,d,"DIV",null,true,true,"dhxform_item_template");c._value=(d.value||"");var b=this;this.editor[c._idd]=new dhtmlXEditor({parent:c.childNodes[c._ll?1:0].childNodes[0],content:c._value});this.editor[c._idd].attachEvent("onAccess",function(g,h){c.callEvent("_onBeforeEditorAccess",[]);_dhxForm_doClick(document.body,"click");if(g=="blur"){b.doOnBlur(c,this);c.callEvent("onBlur",[c._idd]);if(c.getForm().skin=="dhx_terrace"){var f=c.childNodes[c._ll?1:0].className;if(f.indexOf("dhxeditor_focus")>=0){c.childNodes[c._ll?1:0].className=(f).replace(/\s{0,}dhxeditor_focus/gi,"")}}}else{c.callEvent("onEditorAccess",[c._idd,g,h,this,c.getForm()]);c.callEvent("onFocus",[c._idd]);if(c.getForm().skin=="dhx_terrace"){var f=c.childNodes[c._ll?1:0].className;if(f.indexOf("dhxeditor_focus")==-1){c.childNodes[c._ll?1:0].className+=" dhxeditor_focus"}}}});this.editor[c._idd].attachEvent("onToolbarClick",function(f){c.callEvent("onEditorToolbarClick",[c._idd,f,this,c.getForm()])});if(d.readonly){this.setReadonly(c,true)}c.childNodes[c._ll?0:1].childNodes[0].removeAttribute("for");c.childNodes[c._ll?0:1].childNodes[0].onclick=function(){b.editor[c._idd]._focus()};return this},doOnBlur:function(c,b){var a=b.getContent();if(c._value!=a){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,a])!==true){b.setContent(c._value);return}}c._value=a;c.callEvent("onChange",[c._idd,a])}},setValue:function(a,b){if(a._value==b){return}a._value=b;this.editor[a._idd].setContent(a._value)},getValue:function(a){a._value=this.editor[a._idd].getContent();return a._value},enable:function(a){this.editor[a._idd].setReadonly(false);this.doEn(a)},disable:function(a){this.editor[a._idd].setReadonly(true);this.doDis(a)},setReadonly:function(a,b){this.editor[a._idd].setReadonly(b)},getEditor:function(a){return(this.editor[a._idd]||null)},destruct:function(a){a.childNodes[a._ll?0:1].childNodes[0].onclick=null;this.editor[a._idd].unload();this.editor[a._idd]=null;this.d2(a);a=null},setFocus:function(a){this.editor[a._idd]._focus()}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,setWidth:1,isEnabled:1}){dhtmlXForm.prototype.items.editor[b]=dhtmlXForm.prototype.items.template[b]}})();dhtmlXForm.prototype.items.editor.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.items.editor.doEn=dhtmlXForm.prototype.items.select.enable;dhtmlXForm.prototype.items.editor.doDis=dhtmlXForm.prototype.items.select.disable;dhtmlXForm.prototype.getEditor=function(a){return this.doWithItem(a,"getEditor")};dhtmlXForm.prototype.items.upload={render:function(b,c){b._type="up";b._enabled=true;b._checked=true;b.className=c.position+(typeof(c.className)=="string"?" "+c.className:"");var a=document.createElement("DIV");b.appendChild(a);if(!isNaN(c.inputLeft)){b.style.left=parseInt(c.inputLeft)+"px"}if(!isNaN(c.inputTop)){b.style.top=parseInt(c.inputTop)+"px"}if(c.inputWidth!="auto"){if(!isNaN(c.inputWidth)){a.style.width=parseInt(c.inputWidth)+"px"}}b._uploader=new dhtmlXFileUploader(a,c.swfPath||"",c.swfUrl||"",c.mode||null,c.swfLogs,c.slXap||"",c.slUrl||"",c.slLogs||"",c.multiple);b._uploader.setURL(c.url||"");b._uploader.callEvent=b.callEvent;if(typeof(c.autoStart)!="undefined"){b._uploader.setAutoStart(c.autoStart)}if(typeof(c.autoRemove)!="undefined"){b._uploader.setAutoRemove(c.autoRemove)}if(typeof(c.titleScreen)!="undefined"){b._uploader.enableTitleScreen(c.titleScreen)}if(typeof(c.titleText)!="undefined"){b._uploader.setTitleText(c.titleText)}if(c.hidden==true){this.hide(b)}if(c.disabled==true){this.userDisable(b)}if(!(c.inputHeight=="auto"||parseInt(c.inputHeight)==NaN)){b._uploader.p_files.style.height=parseInt(c.inputHeight)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._uploader.callEvent=null;a._uploader.unload();a._uploader=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a.onselectstart=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,b){},getText:function(a){},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._uploader.enable()},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._uploader.disable()},setWidth:function(b,a){b.childNodes[0].style.width=a+"px";b._width=a},getWidth:function(a){return a._width||parseInt(a.childNodes[0].style.width)},setValue:function(a){a._uploader.clear()},getValue:function(g){var d=g._uploader.getData();var f={};var c=0;for(var b in d){f[g._idd+"_r_"+c]=d[b].realName;f[g._idd+"_s_"+c]=d[b].serverName;c++}f[g._idd+"_count"]=c;return f},getUploader:function(a){return a._uploader},getStatus:function(a){return a._uploader.getStatus()}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.upload[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.setFormData_upload=function(a){this.doWithItem(a,"setValue")};dhtmlXForm.prototype.getUploader=function(a){return this.doWithItem(a,"getUploader")};dhtmlXForm.prototype.getUploaderStatus=function(a){return this.doWithItem(a,"getStatus")};function dhtmlXFileUploader(p,swfPath,swfUrl,mode,swfLogs,slXap,slUrl,slLogs,multiple){var that=this;if(typeof(mode)=="string"&&typeof(this[mode])=="function"){this.engine=mode}else{this.engine="html4";var k=null;if(typeof(window.FormData)!="undefined"&&typeof(window.XMLHttpRequest)!="undefined"){k=new XMLHttpRequest();if(typeof(k.upload)=="undefined"){k=null}}if(k!=null){this.engine="html5"}else{if(typeof(window.swfobject)!="undefined"||k===false){var k=swfobject.getFlashPlayerVersion();if(k.major>=10){this.engine="flash"}}else{this._sl_v=this.getSLVersion();if(this._sl_v){this.engine="sl"}}}k=null}if(typeof(p)=="string"){p=document.getElementById(p)}this._upload_mp=(typeof(multiple)!="undefined"?multiple==true:true);this._upload_dnd=true;this._swf_file_url=swfPath||"";this._swf_upolad_url=swfUrl||"";this._swf_logs=swfLogs;this._sl_xap=slXap;this._sl_upload_url=slUrl;this._sl_logs=slLogs;this.p=document.createElement("DIV");this.p.className+=" dhx_file_uploader";p.appendChild(this.p);this.p_files=document.createElement("DIV");this.p_files.className="dhx_upload_files";this.p.appendChild(this.p_files);this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_upload_controls";this.p.appendChild(this.p_controls);this._files={};this._items={};this._data={};this._autoStart=false;this._autoRemove=false;this._titleScreen=true;this._enabled=true;this._uploaded_count=0;this._initToolbar=function(){this.b_opts={info:{onclick:null},browse:{onclick:null,tooltip:"Browse"},upload:{onclick:function(){if(!that._enabled){return}if(!that._uploading){that._uploadStart()}},tooltip:"Upload"},cancel:{onclick:function(){if(!that._enabled){return}that._uploadStop();that._switchButton(false)},tooltip:"Stop"},clear:{onclick:function(){if(!that._enabled){return}that.clear()},tooltip:"Clear list"}};this.buttons={};for(var a in this.b_opts){var k=document.createElement("DIV");k.innerHTML="&nbsp;";k.className="dhx_file_uploader_button button_"+a;k.onclick=this.b_opts[a].onclick;if(this.b_opts[a].tooltip){k.title=this.b_opts[a].tooltip}this.p_controls.appendChild(k);this.buttons[a]=k;k=null}this.buttons.cancel.style.display="none"};this._readableSize=function(t){var i=false;var b=["b","Kb","Mb","Gb","Tb","Pb","Eb"];for(var q=0;q<b.length;q++){if(t>1024){t=t/1024}else{if(i===false){i=q}}}if(i===false){i=b.length-1}return Math.round(t*100)/100+" "+b[i]};this._beforeAddFileToList=function(name,size){return(this.callEvent("onBeforeFileAdd",[name,size])===true)};this._addFileToList=function(id,name,size,state,progress){this._checkTitleScreen();var t=document.createElement("DIV");t._idd=id;t.className="dhx_file dhx_file_"+state;t.innerHTML="<div class='dhx_file_param dhx_file_name'>&nbsp;</div><div class='dhx_file_param dhx_file_progress'>"+progress+"%</div><div class='dhx_file_param dhx_file_delete' title='Remove from list'>&nbsp;</div>";this.p_files.appendChild(t);t.childNodes[0].style.width=t.offsetWidth-127+"px";this._items[id]=t;this._updateFileNameSize(id);t.childNodes[2].onclick=function(){if(!that._enabled){return}var id=this.parentNode._idd;that._removeFileFromQueue(id)};this.callEvent("onFileAdd",[name])};this._removeFileFromList=function(id){if(!this._items[id]){return}this._items[id].childNodes[2].onclick=null;this._items[id].parentNode.removeChild(this._items[id]);this._items[id]=null;delete this._items[id];if(this._data[id]){this._data[id]=null;delete this._data[id]}this._checkTitleScreen()};this._updateFileNameSize=function(id){this._items[id].childNodes[0].innerHTML=this._files[id].name+(!isNaN(this._files[id].size)?" ("+this._readableSize(this._files[id].size)+")":"&nbsp;");this._items[id].childNodes[0].title=this._files[id].name+(!isNaN(this._files[id].size)?" ("+this._readableSize(this._files[id].size)+")":"")};this._updateFileInList=function(id,state,progress){if(!this._items[id]){return}this._items[id].className="dhx_file dhx_file_"+state;this._updateProgress(id,state,progress);this._updateFileNameSize(id)};this._updateProgress=function(id,state,progress){if(state=="uploading"&&progress<100&&this._progress_type=="loader"){this._items[id].childNodes[1].className="dhx_file_param dhx_file_uploading";this._items[id].childNodes[1].innerHTML="&nbsp;"}else{this._items[id].childNodes[1].className="dhx_file_param dhx_file_progress";this._items[id].childNodes[1].innerHTML=progress+"%"}this._updateFileNameSize(id)};this._removeFilesByState=function(state){for(var a in this._files){if(state===true||this._files[a].state==state){this._removeFileFromQueue(a)}}};this._switchButton=function(state){if(state==true){this.buttons.upload.style.display="none";this.buttons.cancel.style.display=""}else{var t=this._uploaded_count;this.buttons.upload.style.display="";this.buttons.cancel.style.display="none";this._uploaded_count=0;if(t>0){this.callEvent("onUploadComplete",[t])}}};this._uploadStart=function(){this._switchButton(true);if(!this._uploading){for(var a in this._files){if(this._files[a].state=="fail"){this._files[a].state="added";this._updateFileInList(a,"added",0)}}}this._uploading=true;var t=false;for(var a in this._files){if(!t&&[this._files[a].state]=="added"){t=true;this._files[a].state="uploading";this._updateFileInList(a,"uploading",0);this._doUploadFile(a)}}if(!t){this._uploading=false;this._switchButton(false)}};this._onUploadSuccess=function(id,serverName,r,extra){if(typeof(r)!="undefined"&&this.engine=="flash"){dhx4.temp=null;try{eval("dhx4.temp="+r.data)}catch(e){dhx4.temp=null}var t=dhx4.temp;dhx4.temp=null;if(t!=null&&t.state==true&&t.name!=null){serverName=t.name;if(t.extra!=null){extra=t.extra}}else{this._onUploadFail(id,(t!=null&&t.extra!=null?t.extra:null));return}}this._uploaded_count++;this._data[id]={realName:this._files[id].name,serverName:serverName};this._files[id].state="uploaded";this._updateFileInList(id,"uploaded",100);this.callEvent("onUploadFile",[this._files[id].name,serverName,extra]);if(this._autoRemove){this._removeFileFromQueue(id)}if(this._uploading){this._uploadStart()}};this._onUploadFail=function(id,extra){this._files[id].state="fail";this._updateFileInList(id,"fail",0);this.callEvent("onUploadFail",[this._files[id].name,extra]);if(this._uploading){this._uploadStart()}};this._onUploadAbort=function(id){this._uploading=false;this._files[id].state="added";this._updateFileInList(id,"added",0);this.callEvent("onUploadCancel",[this._files[id].name])};this._checkTitleScreen=function(){var k=0;for(var a in this._files){k++}if(k==0&&this.p.className.search("dhx_file_uploader_title")<0&&this._titleScreen){this.p.className+=" dhx_file_uploader_title";this.buttons.info.innerHTML=this._titleText;this.buttons.info.style.width=Math.max(this.p_controls.offsetWidth-134,0)+"px"}if((k>0||!this._titleScreen)&&this.p.className.search("dhx_file_uploader_title")>=0){this.p.className=this.p.className.replace(/dhx_file_uploader_title/g,"");this.buttons.info.innerHTML=""}};this.callEvent=function(){};this.upload=function(){if(!this._uploading){this._uploadStart()}};this.setAutoStart=function(state){this._autoStart=(state==true)};this.setAutoRemove=function(state){this._autoRemove=(state==true)};this.enableTitleScreen=function(state){this._titleScreen=(state==true);this._checkTitleScreen()};this.setTitleText=function(text){this._titleText=text;if(this.p.className.search("dhx_file_uploader_title")>=0){this.buttons.info.innerHTML=this._titleText}};this.setURL=function(url){this._url=url};this.setSWFURL=function(url){this._swf_upolad_url=url};this.enable=function(){this._enabled=true;this.p_files.className="dhx_upload_files";this.p_controls.className="dhx_upload_controls"};this.disable=function(){this._enabled=false;this.p_files.className="dhx_upload_files dhx_uploader_dis";this.p_controls.className="dhx_upload_controls dhx_uploader_dis"};this.getStatus=function(){var t=0;for(var a in this._files){if(this._files[a].state!="uploaded"){return -1}t=1}return t};this.getData=function(){return this._data};this.clear=function(){if(this.callEvent("onBeforeClear",[])!==true){return}if(this._uploading){that._uploadStop()}that._switchButton(false);that._removeFilesByState(true);this.callEvent("onClear",[])};this.unload=function(){this._removeFilesByState(true);this._data=null;this._files=null;this._items=null;this._unloadEngine();for(var a in this.buttons){this.buttons[a].onclick=null;this.buttons[a].parentNode.removeChild(this.buttons[a]);this.buttons[a]=null;delete this.buttons[a]}this.buttons=null;for(var a in this.b_opts){this.b_opts[a].onclick=null;this.b_opts[a]=null;delete this.b_opts[a]}this.b_opts=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_files.parentNode.removeChild(this.p_files);this.p.className=this.p.className.replace(/dhx_file_uploader_title/gi,"").replace(/dhx_file_uploader/gi,"");for(var a in this){this[a]=null}that=a=null};var e=new this[this.engine]();for(var a in e){this[a]=e[a];e[a]=null}a=e=p=null;this._initToolbar();this._initEngine();this._checkTitleScreen();return this}dhtmlXFileUploader.prototype.html5=function(){};dhtmlXFileUploader.prototype.html5.prototype={_initEngine:function(){var b=this;this.buttons.browse.onclick=function(){if(b._enabled){b.f.click()}};this._progress_type="percentage";var a=window.navigator.userAgent;if(a.match(/Windows/gi)!=null&&a.match(/AppleWebKit/gi)!=null&&a.match(/Safari/gi)!=null){if(a.match(/Version\/5\.1\.5/gi)){this._upload_mp=false}if(a.match(/Version\/5\.1[^\.\d{1,}]/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.1/gi)){this._upload_mp=false;this._upload_dnd=false}if(a.match(/Version\/5\.1\.2/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.7/gi)){this._upload_mp=false}}this._addFileInput();if(this._upload_dnd){this.p.ondragenter=function(c){if(!c.dataTransfer){return}c.stopPropagation();c.preventDefault()};this.p.ondragover=function(c){if(!c.dataTransfer){return}c.stopPropagation();c.preventDefault()};this.p.ondrop=function(c){if(!c.dataTransfer){return}c.stopPropagation();c.preventDefault();if(b._enabled){b._parseFilesInInput(c.dataTransfer.files)}};this._titleText="Drag-n-Drop files here or<br>click to select files for upload."}else{this._titleText="Click to select files for upload."}},_addFileInput:function(){if(this.f!=null){this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null}var a=this;this.f=document.createElement("INPUT");this.f.type="file";if(this._upload_mp){this.f.multiple="1"}this.f.className="dhx_uploader_input";this.p_controls.appendChild(this.f);this.f.onchange=function(){a._parseFilesInInput(this.files);if(window.dhx4.isOpera){a._addFileInput()}else{this.value=""}}},_doUploadFile:function(id){var that=this;if(!this._loader){this._loader=new XMLHttpRequest();this._loader.upload.onprogress=function(e){if(that._files[this._idd].state=="uploading"){that._updateFileInList(this._idd,"uploading",Math.round(e.loaded*100/e.total))}};this._loader.onload=function(e){dhx4.temp=null;try{eval("dhx4.temp="+this.responseText)}catch(e){}var r=dhx4.temp;dhx4.temp=null;if(typeof(r)=="object"&&r!=null&&typeof(r.state)!="undefined"&&r.state==true){that._onUploadSuccess(this.upload._idd,r.name,null,r.extra);r=null}else{that._onUploadFail(this.upload._idd,(r!=null&&r.extra!=null?r.extra:null))}};this._loader.onerror=function(e){that._onUploadFail(this.upload._idd)};this._loader.onabort=function(e){that._onUploadAbort(this.upload._idd)}}this._loader.upload._idd=id;var form=new FormData();form.append("file",this._files[id].file);this._loader.open("POST",this._url+(String(this._url).indexOf("?")<0?"?":"&")+"mode=html5&dhxr"+new Date().getTime(),true);this._loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this._loader.send(form)},_uploadStop:function(){if(!this._uploading||!this._loader){return}this._loader.abort()},_parseFilesInInput:function(b){for(var a=0;a<b.length;a++){this._addFileToQueue(b[a])}},_addFileToQueue:function(a){if(!this._beforeAddFileToList(a.name,a.size)){return}var b=(a._idd||window.dhx4.newId());this._files[b]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(b,a.name,a.size,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(d){if(!this._files[d]){return}var b=this._files[d].name;var c=(this._data!=null&&this._data[d]!=null?this._data[d].serverName:null);if(this.callEvent("onBeforeFileRemove",[b,c])!==true){return}var a=false;if(this._uploading&&d==this._loader.upload._idd&&this._files[d].state=="uploading"){this._uploadStop();a=true}this._files[d].file=null;this._files[d].name=null;this._files[d].size=null;this._files[d].state=null;this._files[d]=null;delete this._files[d];this._removeFileFromList(d);this.callEvent("onFileRemove",[b,c]);if(a){this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=null;this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;this.p.ondragenter=null;this.p.ondragover=null;this.p.ondrop=null;if(this._loader){this._loader.upload.onprogress=null;this._loader.onload=null;this._loader.onerror=null;this._loader.onabort=null;this._loader.upload._idd=null;this._loader=null}this._initEngine=null;this._doUploadFile=null;this._uploadStop=null;this._parseFilesInInput=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.html4=function(){};dhtmlXFileUploader.prototype.html4.prototype={_initEngine:function(){this._addForm();this._progress_type="loader";this._titleText="Click button<br>to select files for upload."},_addForm:function(){var a=this;var c=window.dhx4.newId();if(!this.k){this.k=document.createElement("DIV");this.k.className="dhx_file_form_cont";this.buttons.browse.appendChild(this.k);this.fr_name="dhx_file_"+window.dhx4.newId();this.k.innerHTML='<iframe name="'+this.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>';this.fr=this.k.firstChild;if(window.navigator.userAgent.indexOf("MSIE")>=0){this.fr.onreadystatechange=function(){if(this.readyState=="complete"){a._onLoad()}}}else{this.fr.onload=function(){a._onLoad()}}}var b=document.createElement("DIV");b.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.fr_name+"' class='dhx_file_form' name='dhx_file_form_"+window.dhx4.newId()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value='"+c+"'><input type='file' name='file' class='dhx_file_input'></form>";this.k.appendChild(b);b.firstChild.lastChild._idd=c;b.firstChild.lastChild.onchange=function(){if(!a._beforeAddFileToList(this.value,null)){return}a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};b=null},_onLoad:function(){if(this._uploading){dhx4.temp=null;try{eval("dhx4.temp="+this.fr.contentWindow.document.body.innerHTML)}catch(e){}var r=dhx4.temp;dhx4.temp=null;if(typeof(r)=="object"&&r!=null){if(typeof(r.state)!="undefined"){if(r.state=="cancelled"){this._onUploadAbort(this.fr._idd);r=null;return}else{if(r.state==true){if(typeof(r.size)!="undefined"&&!isNaN(r.size)){this._files[this.fr._idd].size=r.size}this._onUploadSuccess(this.fr._idd,r.name,null,r.extra);r=null;return}}}}this._onUploadFail(this.fr._idd,(r!=null&&r.extra!=null?r.extra:null))}},_addFileToQueue:function(b){var a=b.value.match(/[^\\\/]*$/g);if(a[0]!=null){a=a[0]}else{a=b.value}this._files[b._idd]={name:a,form:b.parentNode,node:b.parentNode.parentNode,input:b,state:"added"};this._addFileToList(b._idd,b.value,false,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(c){var a=this._files[c].name;var b=(this._data!=null&&this._data[c]!=null?this._data[c].serverName:null);if(this.callEvent("onBeforeFileRemove",[a,b])!==true){return}this._files[c].input.onchange=null;this._files[c].form.removeChild(this._files[c].input);this._files[c].node.removeChild(this._files[c].form);this._files[c].node.parentNode.removeChild(this._files[c].node);this._files[c].input=null;this._files[c].name=null;this._files[c].form=null;this._files[c].node=null;this._files[c].size=null;this._files[c].state=null;this._files[c]=null;delete this._files[c];this._removeFileFromList(c);this.callEvent("onFileRemove",[a,b])},_doUploadFile:function(a){this.fr._idd=a;this._files[a].form.action=this._url;this._files[a].form.submit()},_uploadStop:function(){if(!this._uploading){return}this.fr.contentWindow.location.href=(this._url)+(this._url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&dhxr"+new Date().getTime()},_unloadEngine:function(){if(this.k){this.fr_name=null;this.fr.onreadystatechange=null;this.fr.onload=null;this.fr.parentNode.removeChild(this.fr);this.fr=null;this.k.firstChild.firstChild.lastChild.onchange=null;this.k.parentNode.removeChild(this.k);this.k=null}this._initEngine=null;this._addForm=null;this._onLoad=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.flash=function(){};dhtmlXFileUploader.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXFileUploaderSWFObjects){window.dhtmlXFileUploaderSWFObjects={items:{},callEvent:function(f,c,d){return window.dhtmlXFileUploaderSWFObjects.items[f].uploader[c].apply(window.dhtmlXFileUploaderSWFObjects.items[f].uploader,d)}}}var b=this;this._swf_obj_id="dhtmlXFileUploaderSWFObject_"+window.dhx4.newId();this._swf_file_url=this._swf_file_url+(this._swf_file_url.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime();this.buttons.browse.innerHTML="<div id='"+this._swf_obj_id+"' style='width:100%;height:100%;'></div>";swfobject.embedSWF(this._swf_file_url,this._swf_obj_id,"100%","100%","9",null,{ID:this._swf_obj_id,enableLogs:this._swf_logs},{wmode:"transparent"});var a=swfobject.getFlashPlayerVersion();this._titleText="Engine successfuly inited<br>Flash Player: "+a.major+"."+a.minor+"."+a.release;this._progress_type="percentage";window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]={id:this._swf_obj_id,uploader:this}},_beforeAddFileToQueue:function(a,b){return(this.callEvent("onBeforeFileAdd",[a,b])===true)},_addFileToQueue:function(d,b,c){if(window.dhx4.isIE){var a=document.createElement("INPUT");a.type="TEXT";a.style.position="absolute";a.style.left="0px";a.style.top=window.dhx4.absTop(this.buttons.browse)+"px";a.style.width="10px";document.body.appendChild(a);a.focus();document.body.removeChild(a);a=null}this._files[d]={name:b,size:c,state:"added"};this._addFileToList(d,b,c,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(d){if(!this._files[d]){return}var b=this._files[d].name;var c=(this._data!=null&&this._data[d]!=null?this._data[d].serverName:null);if(this.callEvent("onBeforeFileRemove",[b,c])!==true){return}var a=false;if(this._uploading&&this._files[d].state=="uploading"){this._uploadStop();a=true}swfobject.getObjectById(this._swf_obj_id).removeFileById(d);this._files[d].name=null;this._files[d].size=null;this._files[d].state=null;this._files[d]=null;delete this._files[d];this._removeFileFromList(d);this.callEvent("onFileRemove",[b,c]);if(a){this._uploadStart()}},_doUploadFile:function(a){swfobject.getObjectById(this._swf_obj_id).upload(a,this._swf_upolad_url)},_uploadStop:function(c){for(var b in this._files){if(this._files[b].state=="uploading"){swfobject.getObjectById(this._swf_obj_id).uploadStop(b)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]){window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].id=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].uploader=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]=null;delete window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]}this._swf_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.sl=function(){};dhtmlXFileUploader.prototype.sl.prototype={_initEngine:function(){if(typeof(this._sl_v)=="undefined"){this._sl_v=this.getSLVersion()}if(!window.dhtmlXFileUploaderSLObjects){window.dhtmlXFileUploaderSLObjects={items:{},callEvent:function(c,a,b){window.dhtmlXFileUploaderSLObjects.items[c].uploader[a].apply(window.dhtmlXFileUploaderSLObjects.items[c].uploader,b)}}}this._sl_obj_id="dhtmlXFileUploaderSLObject_"+window.dhx4.newId();if(this._sl_v!=false){this._titleText="Engine successfuly inited<br>Silverlight version: "+this._sl_v[0]+"."+this._sl_v[1];this.buttons.browse.innerHTML='<div style="width:100%;height:100%;"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" id="'+this._sl_obj_id+'"><param name="source" value="'+this._sl_xap+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="SLID='+this._sl_obj_id+",LOGS="+this._sl_logs+'"/><param name="minRuntimeVersion" value="5.0"/></object></div>'}else{this._titleText="Silverlight plugin not found<br>or version less than 4.0";this.buttons.browse.style.cursor="wait";this.buttons.browse.title=""}this._progress_type="percentage";window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]={id:this._sl_obj_id,uploader:this}},_addFileToQueue:function(c,a,b){this._files[c]={name:a,size:b,state:"added"};this._addFileToList(c,a,b,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(b){if(!this._files[b]){return}var a=false;if(this._uploading&&this._files[b].state=="uploading"){this._uploadStop();a=true}document.getElementById([this._sl_obj_id]).Content.a.removeFileById(b);this._files[b].name=null;this._files[b].size=null;this._files[b].state=null;this._files[b]=null;delete this._files[b];this._removeFileFromList(b);if(a){this._uploadStart()}},_doUploadFile:function(a){document.getElementById(this._sl_obj_id).Content.a.upload(a,this._sl_upload_url,"&mode=sl&dhxr"+new Date().getTime())},_uploadStop:function(c){this._uploading=false;for(var b in this._files){if(this._files[b].state=="uploading"){document.getElementById(this._sl_obj_id).Content.a.uploadStop(b)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]){window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].id=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].uploader=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]=null;delete window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]}this._sl_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.setSLURL=function(a){this._sl_upload_url=a};dhtmlXFileUploader.prototype.getSLVersion=function(){var a=false;if(window.dhx4.isIE){try{var b=new ActiveXObject("AgControl.AgControl");if(b!=null){var f=4,d=0;while(b.isVersionSupported([f,d].join("."))){a=[f,d];if(++d>9){f++;d=0}}}b=null}catch(c){}}else{if(navigator.plugins["Silverlight Plug-In"]!=null){a=navigator.plugins["Silverlight Plug-In"].description.split(".")}}return a};
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/ext/dhxupload.xap b/portal/static/unbound_reservation_static/lib/ext/dhxupload.xap
new file mode 100644 (file)
index 0000000..f2deecd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/ext/dhxupload.xap differ
diff --git a/portal/static/unbound_reservation_static/lib/ext/swfobject.js b/portal/static/unbound_reservation_static/lib/ext/swfobject.js
new file mode 100644 (file)
index 0000000..bf35c07
--- /dev/null
@@ -0,0 +1,777 @@
+/*!    SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+       
+       var UNDEF = "undefined",
+               OBJECT = "object",
+               SHOCKWAVE_FLASH = "Shockwave Flash",
+               SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+               FLASH_MIME_TYPE = "application/x-shockwave-flash",
+               EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+               ON_READY_STATE_CHANGE = "onreadystatechange",
+               
+               win = window,
+               doc = document,
+               nav = navigator,
+               
+               plugin = false,
+               domLoadFnArr = [main],
+               regObjArr = [],
+               objIdArr = [],
+               listenersArr = [],
+               storedAltContent,
+               storedAltContentId,
+               storedCallbackFn,
+               storedCallbackObj,
+               isDomLoaded = false,
+               isExpressInstallActive = false,
+               dynamicStylesheet,
+               dynamicStylesheetMedia,
+               autoHideShow = true,
+       
+       /* Centralized function for browser feature detection
+               - User agent string detection is only used when no good alternative is possible
+               - Is executed directly for optimal performance
+       */      
+       ua = function() {
+               var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+                       u = nav.userAgent.toLowerCase(),
+                       p = nav.platform.toLowerCase(),
+                       windows = p ? /win/.test(p) : /win/.test(u),
+                       mac = p ? /mac/.test(p) : /mac/.test(u),
+                       webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+                       ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+                       playerVersion = [0,0,0],
+                       d = null;
+               if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+                       d = nav.plugins[SHOCKWAVE_FLASH].description;
+                       if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+                               plugin = true;
+                               ie = false; // cascaded feature detection for Internet Explorer
+                               d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+                               playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+                               playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+                               playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+                       }
+               }
+               else if (typeof win.ActiveXObject != UNDEF) {
+                       try {
+                               var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+                               if (a) { // a will return null when ActiveX is disabled
+                                       d = a.GetVariable("$version");
+                                       if (d) {
+                                               ie = true; // cascaded feature detection for Internet Explorer
+                                               d = d.split(" ")[1].split(",");
+                                               playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                                       }
+                               }
+                       }
+                       catch(e) {}
+               }
+               return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+       }(),
+       
+       /* Cross-browser onDomLoad
+               - Will fire an event as soon as the DOM of a web page is loaded
+               - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+               - Regular onload serves as fallback
+       */ 
+       onDomLoad = function() {
+               if (!ua.w3) { return; }
+               if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+                       callDomLoadFunctions();
+               }
+               if (!isDomLoaded) {
+                       if (typeof doc.addEventListener != UNDEF) {
+                               doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+                       }               
+                       if (ua.ie && ua.win) {
+                               doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+                                       if (doc.readyState == "complete") {
+                                               doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+                                               callDomLoadFunctions();
+                                       }
+                               });
+                               if (win == top) { // if not inside an iframe
+                                       (function(){
+                                               if (isDomLoaded) { return; }
+                                               try {
+                                                       doc.documentElement.doScroll("left");
+                                               }
+                                               catch(e) {
+                                                       setTimeout(arguments.callee, 0);
+                                                       return;
+                                               }
+                                               callDomLoadFunctions();
+                                       })();
+                               }
+                       }
+                       if (ua.wk) {
+                               (function(){
+                                       if (isDomLoaded) { return; }
+                                       if (!/loaded|complete/.test(doc.readyState)) {
+                                               setTimeout(arguments.callee, 0);
+                                               return;
+                                       }
+                                       callDomLoadFunctions();
+                               })();
+                       }
+                       addLoadEvent(callDomLoadFunctions);
+               }
+       }();
+       
+       function callDomLoadFunctions() {
+               if (isDomLoaded) { return; }
+               try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+                       var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+                       t.parentNode.removeChild(t);
+               }
+               catch (e) { return; }
+               isDomLoaded = true;
+               var dl = domLoadFnArr.length;
+               for (var i = 0; i < dl; i++) {
+                       domLoadFnArr[i]();
+               }
+       }
+       
+       function addDomLoadEvent(fn) {
+               if (isDomLoaded) {
+                       fn();
+               }
+               else { 
+                       domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+               }
+       }
+       
+       /* Cross-browser onload
+               - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+               - Will fire an event as soon as a web page including all of its assets are loaded 
+        */
+       function addLoadEvent(fn) {
+               if (typeof win.addEventListener != UNDEF) {
+                       win.addEventListener("load", fn, false);
+               }
+               else if (typeof doc.addEventListener != UNDEF) {
+                       doc.addEventListener("load", fn, false);
+               }
+               else if (typeof win.attachEvent != UNDEF) {
+                       addListener(win, "onload", fn);
+               }
+               else if (typeof win.onload == "function") {
+                       var fnOld = win.onload;
+                       win.onload = function() {
+                               fnOld();
+                               fn();
+                       };
+               }
+               else {
+                       win.onload = fn;
+               }
+       }
+       
+       /* Main function
+               - Will preferably execute onDomLoad, otherwise onload (as a fallback)
+       */
+       function main() { 
+               if (plugin) {
+                       testPlayerVersion();
+               }
+               else {
+                       matchVersions();
+               }
+       }
+       
+       /* Detect the Flash Player version for non-Internet Explorer browsers
+               - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+                 a. Both release and build numbers can be detected
+                 b. Avoid wrong descriptions by corrupt installers provided by Adobe
+                 c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+               - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+       */
+       function testPlayerVersion() {
+               var b = doc.getElementsByTagName("body")[0];
+               var o = createElement(OBJECT);
+               o.setAttribute("type", FLASH_MIME_TYPE);
+               var t = b.appendChild(o);
+               if (t) {
+                       var counter = 0;
+                       (function(){
+                               if (typeof t.GetVariable != UNDEF) {
+                                       var d = t.GetVariable("$version");
+                                       if (d) {
+                                               d = d.split(" ")[1].split(",");
+                                               ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                                       }
+                               }
+                               else if (counter < 10) {
+                                       counter++;
+                                       setTimeout(arguments.callee, 10);
+                                       return;
+                               }
+                               b.removeChild(o);
+                               t = null;
+                               matchVersions();
+                       })();
+               }
+               else {
+                       matchVersions();
+               }
+       }
+       
+       /* Perform Flash Player and SWF version matching; static publishing only
+       */
+       function matchVersions() {
+               var rl = regObjArr.length;
+               if (rl > 0) {
+                       for (var i = 0; i < rl; i++) { // for each registered object element
+                               var id = regObjArr[i].id;
+                               var cb = regObjArr[i].callbackFn;
+                               var cbObj = {success:false, id:id};
+                               if (ua.pv[0] > 0) {
+                                       var obj = getElementById(id);
+                                       if (obj) {
+                                               if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+                                                       setVisibility(id, true);
+                                                       if (cb) {
+                                                               cbObj.success = true;
+                                                               cbObj.ref = getObjectById(id);
+                                                               cb(cbObj);
+                                                       }
+                                               }
+                                               else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+                                                       var att = {};
+                                                       att.data = regObjArr[i].expressInstall;
+                                                       att.width = obj.getAttribute("width") || "0";
+                                                       att.height = obj.getAttribute("height") || "0";
+                                                       if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+                                                       if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+                                                       // parse HTML object param element's name-value pairs
+                                                       var par = {};
+                                                       var p = obj.getElementsByTagName("param");
+                                                       var pl = p.length;
+                                                       for (var j = 0; j < pl; j++) {
+                                                               if (p[j].getAttribute("name").toLowerCase() != "movie") {
+                                                                       par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+                                                               }
+                                                       }
+                                                       showExpressInstall(att, par, id, cb);
+                                               }
+                                               else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+                                                       displayAltContent(obj);
+                                                       if (cb) { cb(cbObj); }
+                                               }
+                                       }
+                               }
+                               else {  // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+                                       setVisibility(id, true);
+                                       if (cb) {
+                                               var o = getObjectById(id); // test whether there is an HTML object element or not
+                                               if (o && typeof o.SetVariable != UNDEF) { 
+                                                       cbObj.success = true;
+                                                       cbObj.ref = o;
+                                               }
+                                               cb(cbObj);
+                                       }
+                               }
+                       }
+               }
+       }
+       
+       function getObjectById(objectIdStr) {
+               var r = null;
+               var o = getElementById(objectIdStr);
+               if (o && o.nodeName == "OBJECT") {
+                       if (typeof o.SetVariable != UNDEF) {
+                               r = o;
+                       }
+                       else {
+                               var n = o.getElementsByTagName(OBJECT)[0];
+                               if (n) {
+                                       r = n;
+                               }
+                       }
+               }
+               return r;
+       }
+       
+       /* Requirements for Adobe Express Install
+               - only one instance can be active at a time
+               - fp 6.0.65 or higher
+               - Win/Mac OS only
+               - no Webkit engines older than version 312
+       */
+       function canExpressInstall() {
+               return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+       }
+       
+       /* Show the Adobe Express Install dialog
+               - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+       */
+       function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+               isExpressInstallActive = true;
+               storedCallbackFn = callbackFn || null;
+               storedCallbackObj = {success:false, id:replaceElemIdStr};
+               var obj = getElementById(replaceElemIdStr);
+               if (obj) {
+                       if (obj.nodeName == "OBJECT") { // static publishing
+                               storedAltContent = abstractAltContent(obj);
+                               storedAltContentId = null;
+                       }
+                       else { // dynamic publishing
+                               storedAltContent = obj;
+                               storedAltContentId = replaceElemIdStr;
+                       }
+                       att.id = EXPRESS_INSTALL_ID;
+                       if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+                       if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+                       doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+                       var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+                               fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+                       if (typeof par.flashvars != UNDEF) {
+                               par.flashvars += "&" + fv;
+                       }
+                       else {
+                               par.flashvars = fv;
+                       }
+                       // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+                       // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+                       if (ua.ie && ua.win && obj.readyState != 4) {
+                               var newObj = createElement("div");
+                               replaceElemIdStr += "SWFObjectNew";
+                               newObj.setAttribute("id", replaceElemIdStr);
+                               obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+                               obj.style.display = "none";
+                               (function(){
+                                       if (obj.readyState == 4) {
+                                               obj.parentNode.removeChild(obj);
+                                       }
+                                       else {
+                                               setTimeout(arguments.callee, 10);
+                                       }
+                               })();
+                       }
+                       createSWF(att, par, replaceElemIdStr);
+               }
+       }
+       
+       /* Functions to abstract and display alternative content
+       */
+       function displayAltContent(obj) {
+               if (ua.ie && ua.win && obj.readyState != 4) {
+                       // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+                       // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+                       var el = createElement("div");
+                       obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+                       el.parentNode.replaceChild(abstractAltContent(obj), el);
+                       obj.style.display = "none";
+                       (function(){
+                               if (obj.readyState == 4) {
+                                       obj.parentNode.removeChild(obj);
+                               }
+                               else {
+                                       setTimeout(arguments.callee, 10);
+                               }
+                       })();
+               }
+               else {
+                       obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+               }
+       } 
+
+       function abstractAltContent(obj) {
+               var ac = createElement("div");
+               if (ua.win && ua.ie) {
+                       ac.innerHTML = obj.innerHTML;
+               }
+               else {
+                       var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+                       if (nestedObj) {
+                               var c = nestedObj.childNodes;
+                               if (c) {
+                                       var cl = c.length;
+                                       for (var i = 0; i < cl; i++) {
+                                               if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+                                                       ac.appendChild(c[i].cloneNode(true));
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return ac;
+       }
+       
+       /* Cross-browser dynamic SWF creation
+       */
+       function createSWF(attObj, parObj, id) {
+               var r, el = getElementById(id);
+               if (ua.wk && ua.wk < 312) { return r; }
+               if (el) {
+                       if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+                               attObj.id = id;
+                       }
+                       if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+                               var att = "";
+                               for (var i in attObj) {
+                                       if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+                                               if (i.toLowerCase() == "data") {
+                                                       parObj.movie = attObj[i];
+                                               }
+                                               else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                                       att += ' class="' + attObj[i] + '"';
+                                               }
+                                               else if (i.toLowerCase() != "classid") {
+                                                       att += ' ' + i + '="' + attObj[i] + '"';
+                                               }
+                                       }
+                               }
+                               var par = "";
+                               for (var j in parObj) {
+                                       if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+                                               par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+                                       }
+                               }
+                               el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+                               objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+                               r = getElementById(attObj.id);  
+                       }
+                       else { // well-behaving browsers
+                               var o = createElement(OBJECT);
+                               o.setAttribute("type", FLASH_MIME_TYPE);
+                               for (var m in attObj) {
+                                       if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+                                               if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                                       o.setAttribute("class", attObj[m]);
+                                               }
+                                               else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+                                                       o.setAttribute(m, attObj[m]);
+                                               }
+                                       }
+                               }
+                               for (var n in parObj) {
+                                       if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+                                               createObjParam(o, n, parObj[n]);
+                                       }
+                               }
+                               el.parentNode.replaceChild(o, el);
+                               r = o;
+                       }
+               }
+               return r;
+       }
+       
+       function createObjParam(el, pName, pValue) {
+               var p = createElement("param");
+               p.setAttribute("name", pName);  
+               p.setAttribute("value", pValue);
+               el.appendChild(p);
+       }
+       
+       /* Cross-browser SWF removal
+               - Especially needed to safely and completely remove a SWF in Internet Explorer
+       */
+       function removeSWF(id) {
+               var obj = getElementById(id);
+               if (obj && obj.nodeName == "OBJECT") {
+                       if (ua.ie && ua.win) {
+                               obj.style.display = "none";
+                               (function(){
+                                       if (obj.readyState == 4) {
+                                               removeObjectInIE(id);
+                                       }
+                                       else {
+                                               setTimeout(arguments.callee, 10);
+                                       }
+                               })();
+                       }
+                       else {
+                               obj.parentNode.removeChild(obj);
+                       }
+               }
+       }
+       
+       function removeObjectInIE(id) {
+               var obj = getElementById(id);
+               if (obj) {
+                       for (var i in obj) {
+                               if (typeof obj[i] == "function") {
+                                       obj[i] = null;
+                               }
+                       }
+                       obj.parentNode.removeChild(obj);
+               }
+       }
+       
+       /* Functions to optimize JavaScript compression
+       */
+       function getElementById(id) {
+               var el = null;
+               try {
+                       el = doc.getElementById(id);
+               }
+               catch (e) {}
+               return el;
+       }
+       
+       function createElement(el) {
+               return doc.createElement(el);
+       }
+       
+       /* Updated attachEvent function for Internet Explorer
+               - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+       */      
+       function addListener(target, eventType, fn) {
+               target.attachEvent(eventType, fn);
+               listenersArr[listenersArr.length] = [target, eventType, fn];
+       }
+       
+       /* Flash Player and SWF content version matching
+       */
+       function hasPlayerVersion(rv) {
+               var pv = ua.pv, v = rv.split(".");
+               v[0] = parseInt(v[0], 10);
+               v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+               v[2] = parseInt(v[2], 10) || 0;
+               return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+       }
+       
+       /* Cross-browser dynamic CSS creation
+               - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+       */      
+       function createCSS(sel, decl, media, newStyle) {
+               if (ua.ie && ua.mac) { return; }
+               var h = doc.getElementsByTagName("head")[0];
+               if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+               var m = (media && typeof media == "string") ? media : "screen";
+               if (newStyle) {
+                       dynamicStylesheet = null;
+                       dynamicStylesheetMedia = null;
+               }
+               if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+                       // create dynamic stylesheet + get a global reference to it
+                       var s = createElement("style");
+                       s.setAttribute("type", "text/css");
+                       s.setAttribute("media", m);
+                       dynamicStylesheet = h.appendChild(s);
+                       if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+                               dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+                       }
+                       dynamicStylesheetMedia = m;
+               }
+               // add style rule
+               if (ua.ie && ua.win) {
+                       if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+                               dynamicStylesheet.addRule(sel, decl);
+                       }
+               }
+               else {
+                       if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+                               dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+                       }
+               }
+       }
+       
+       function setVisibility(id, isVisible) {
+               if (!autoHideShow) { return; }
+               var v = isVisible ? "visible" : "hidden";
+               if (isDomLoaded && getElementById(id)) {
+                       getElementById(id).style.visibility = v;
+               }
+               else {
+                       createCSS("#" + id, "visibility:" + v);
+               }
+       }
+
+       /* Filter to avoid XSS attacks
+       */
+       function urlEncodeIfNecessary(s) {
+               var regex = /[\\\"<>\.;]/;
+               var hasBadChars = regex.exec(s) != null;
+               return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+       }
+       
+       /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+       */
+       var cleanup = function() {
+               if (ua.ie && ua.win) {
+                       window.attachEvent("onunload", function() {
+                               // remove listeners to avoid memory leaks
+                               var ll = listenersArr.length;
+                               for (var i = 0; i < ll; i++) {
+                                       listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+                               }
+                               // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+                               var il = objIdArr.length;
+                               for (var j = 0; j < il; j++) {
+                                       removeSWF(objIdArr[j]);
+                               }
+                               // cleanup library's main closures to avoid memory leaks
+                               for (var k in ua) {
+                                       ua[k] = null;
+                               }
+                               ua = null;
+                               for (var l in swfobject) {
+                                       swfobject[l] = null;
+                               }
+                               swfobject = null;
+                       });
+               }
+       }();
+       
+       return {
+               /* Public API
+                       - Reference: http://code.google.com/p/swfobject/wiki/documentation
+               */ 
+               registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+                       if (ua.w3 && objectIdStr && swfVersionStr) {
+                               var regObj = {};
+                               regObj.id = objectIdStr;
+                               regObj.swfVersion = swfVersionStr;
+                               regObj.expressInstall = xiSwfUrlStr;
+                               regObj.callbackFn = callbackFn;
+                               regObjArr[regObjArr.length] = regObj;
+                               setVisibility(objectIdStr, false);
+                       }
+                       else if (callbackFn) {
+                               callbackFn({success:false, id:objectIdStr});
+                       }
+               },
+               
+               getObjectById: function(objectIdStr) {
+                       if (ua.w3) {
+                               return getObjectById(objectIdStr);
+                       }
+               },
+               
+               embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+                       var callbackObj = {success:false, id:replaceElemIdStr};
+                       if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+                               setVisibility(replaceElemIdStr, false);
+                               addDomLoadEvent(function() {
+                                       widthStr += ""; // auto-convert to string
+                                       heightStr += "";
+                                       var att = {};
+                                       if (attObj && typeof attObj === OBJECT) {
+                                               for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+                                                       att[i] = attObj[i];
+                                               }
+                                       }
+                                       att.data = swfUrlStr;
+                                       att.width = widthStr;
+                                       att.height = heightStr;
+                                       var par = {}; 
+                                       if (parObj && typeof parObj === OBJECT) {
+                                               for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+                                                       par[j] = parObj[j];
+                                               }
+                                       }
+                                       if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+                                               for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+                                                       if (typeof par.flashvars != UNDEF) {
+                                                               par.flashvars += "&" + k + "=" + flashvarsObj[k];
+                                                       }
+                                                       else {
+                                                               par.flashvars = k + "=" + flashvarsObj[k];
+                                                       }
+                                               }
+                                       }
+                                       if (hasPlayerVersion(swfVersionStr)) { // create SWF
+                                               var obj = createSWF(att, par, replaceElemIdStr);
+                                               if (att.id == replaceElemIdStr) {
+                                                       setVisibility(replaceElemIdStr, true);
+                                               }
+                                               callbackObj.success = true;
+                                               callbackObj.ref = obj;
+                                       }
+                                       else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+                                               att.data = xiSwfUrlStr;
+                                               showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+                                               return;
+                                       }
+                                       else { // show alternative content
+                                               setVisibility(replaceElemIdStr, true);
+                                       }
+                                       if (callbackFn) { callbackFn(callbackObj); }
+                               });
+                       }
+                       else if (callbackFn) { callbackFn(callbackObj); }
+               },
+               
+               switchOffAutoHideShow: function() {
+                       autoHideShow = false;
+               },
+               
+               ua: ua,
+               
+               getFlashPlayerVersion: function() {
+                       return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+               },
+               
+               hasFlashPlayerVersion: hasPlayerVersion,
+               
+               createSWF: function(attObj, parObj, replaceElemIdStr) {
+                       if (ua.w3) {
+                               return createSWF(attObj, parObj, replaceElemIdStr);
+                       }
+                       else {
+                               return undefined;
+                       }
+               },
+               
+               showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+                       if (ua.w3 && canExpressInstall()) {
+                               showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+                       }
+               },
+               
+               removeSWF: function(objElemIdStr) {
+                       if (ua.w3) {
+                               removeSWF(objElemIdStr);
+                       }
+               },
+               
+               createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+                       if (ua.w3) {
+                               createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+                       }
+               },
+               
+               addDomLoadEvent: addDomLoadEvent,
+               
+               addLoadEvent: addLoadEvent,
+               
+               getQueryParamValue: function(param) {
+                       var q = doc.location.search || doc.location.hash;
+                       if (q) {
+                               if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+                               if (param == null) {
+                                       return urlEncodeIfNecessary(q);
+                               }
+                               var pairs = q.split("&");
+                               for (var i = 0; i < pairs.length; i++) {
+                                       if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+                                               return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+                                       }
+                               }
+                       }
+                       return "";
+               },
+               
+               // For internal usage only
+               expressInstallCallback: function() {
+                       if (isExpressInstallActive) {
+                               var obj = getElementById(EXPRESS_INSTALL_ID);
+                               if (obj && storedAltContent) {
+                                       obj.parentNode.replaceChild(storedAltContent, obj);
+                                       if (storedAltContentId) {
+                                               setVisibility(storedAltContentId, true);
+                                               if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+                                       }
+                                       if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+                               }
+                               isExpressInstallActive = false;
+                       } 
+               }
+       };
+}();
diff --git a/portal/static/unbound_reservation_static/lib/ext/uploader.swf b/portal/static/unbound_reservation_static/lib/ext/uploader.swf
new file mode 100644 (file)
index 0000000..b64e142
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/ext/uploader.swf differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_btns.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_btns.gif
new file mode 100644 (file)
index 0000000..7de4aab
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_btns.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_cell_progress.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_cell_progress.gif
new file mode 100644 (file)
index 0000000..1df5c43
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxacc_skyblue/dhxacc_cell_progress.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif
new file mode 100644 (file)
index 0000000..f927e47
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_left.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif
new file mode 100644 (file)
index 0000000..c2a4835
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_arrow_right.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif
new file mode 100644 (file)
index 0000000..c3f7391
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_clock.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif
new file mode 100644 (file)
index 0000000..7390c60
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_mark.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif
new file mode 100644 (file)
index 0000000..b6f2c4b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_bottom.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif
new file mode 100644 (file)
index 0000000..090b597
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcalendar_skyblue/dhxcalendar_selector_top.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif
new file mode 100644 (file)
index 0000000..7fdb358
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif
new file mode 100644 (file)
index 0000000..c256a28
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_arrow_down_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif
new file mode 100644 (file)
index 0000000..60d880e
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcombo_skyblue/dhxcombo_chbx.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_colors.png b/portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_colors.png
new file mode 100644 (file)
index 0000000..ede480c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_colors.png differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_icon_save.png b/portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_icon_save.png
new file mode 100644 (file)
index 0000000..d56e0b1
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxcp_skyblue/dhxcp_icon_save.png differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector.png b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector.png
new file mode 100644 (file)
index 0000000..5d8e9b4
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector.png differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_cells.png b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_cells.png
new file mode 100644 (file)
index 0000000..63da638
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_cells.png differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_lines.png b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_lines.png
new file mode 100644 (file)
index 0000000..576ecfd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/dnd_selector_lines.png differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/marker.png b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/marker.png
new file mode 100644 (file)
index 0000000..ceec125
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxdataview_skyblue/marker.png differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_center.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_center.gif
new file mode 100644 (file)
index 0000000..bc3f7ce
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_center.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_justify.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_justify.gif
new file mode 100644 (file)
index 0000000..6efd2ce
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_justify.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_left.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_left.gif
new file mode 100644 (file)
index 0000000..2acb732
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_left.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_right.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_right.gif
new file mode 100644 (file)
index 0000000..35c828b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/align_right.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/bold.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/bold.gif
new file mode 100644 (file)
index 0000000..32416d4
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/bold.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/buttons.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/buttons.gif
new file mode 100644 (file)
index 0000000..5170c32
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/buttons.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/clear.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/clear.gif
new file mode 100644 (file)
index 0000000..51f1aee
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/clear.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h1.gif
new file mode 100644 (file)
index 0000000..6b13a66
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h2.gif
new file mode 100644 (file)
index 0000000..b83cf54
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h3.gif
new file mode 100644 (file)
index 0000000..b5647b8
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h4.gif
new file mode 100644 (file)
index 0000000..b5c1dc2
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/h4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_dec.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_dec.gif
new file mode 100644 (file)
index 0000000..b16fbb5
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_dec.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_inc.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_inc.gif
new file mode 100644 (file)
index 0000000..a4567b1
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/indent_inc.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/italic.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/italic.gif
new file mode 100644 (file)
index 0000000..8dc358c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/italic.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_bullet.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_bullet.gif
new file mode 100644 (file)
index 0000000..dc64941
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_bullet.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_number.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_number.gif
new file mode 100644 (file)
index 0000000..eea183d
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/list_number.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_sub.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_sub.gif
new file mode 100644 (file)
index 0000000..02d1cb6
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_sub.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_super.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_super.gif
new file mode 100644 (file)
index 0000000..945ae76
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/script_super.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/strike.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/strike.gif
new file mode 100644 (file)
index 0000000..0324297
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/strike.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/underline.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/underline.gif
new file mode 100644 (file)
index 0000000..16aa16d
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxeditor_skyblue/underline.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_chbxrd.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_chbxrd.gif
new file mode 100644 (file)
index 0000000..d176df1
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_chbxrd.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_buttons.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_buttons.gif
new file mode 100644 (file)
index 0000000..96a9b8a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_buttons.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_uploading.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_uploading.gif
new file mode 100644 (file)
index 0000000..fbdfbdd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxform_skyblue/dhxform_upload_uploading.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left.gif
new file mode 100644 (file)
index 0000000..07ef2fc
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs.gif
new file mode 100644 (file)
index 0000000..2d32720
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs_dis.gif
new file mode 100644 (file)
index 0000000..35050e8
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_abs_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_dis.gif
new file mode 100644 (file)
index 0000000..2ac953e
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_left_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right.gif
new file mode 100644 (file)
index 0000000..cf326d3
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs.gif
new file mode 100644 (file)
index 0000000..0736a5f
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs_dis.gif
new file mode 100644 (file)
index 0000000..f454ee7
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_abs_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_dis.gif
new file mode 100644 (file)
index 0000000..2cf6399
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/ar_right_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/blank.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/blank.gif
new file mode 100644 (file)
index 0000000..d7ae406
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/blank.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/combo_select_dhx_skyblue.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/combo_select_dhx_skyblue.gif
new file mode 100644 (file)
index 0000000..03f4e9a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/combo_select_dhx_skyblue.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_.gif
new file mode 100644 (file)
index 0000000..361094a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_down.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_down.gif
new file mode 100644 (file)
index 0000000..b73c84e
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_down.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_up.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_up.gif
new file mode 100644 (file)
index 0000000..556a9fb
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/dyn_up.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/imageloaderror.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/imageloaderror.gif
new file mode 100644 (file)
index 0000000..d7ae406
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/imageloaderror.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0.gif
new file mode 100644 (file)
index 0000000..a98e298
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0_dis.gif
new file mode 100644 (file)
index 0000000..2082b54
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk0_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1.gif
new file mode 100644 (file)
index 0000000..2ebae89
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1_dis.gif
new file mode 100644 (file)
index 0000000..17a0b16
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/item_chk1_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/minus.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/minus.gif
new file mode 100644 (file)
index 0000000..ef04a54
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/minus.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_page.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_page.gif
new file mode 100644 (file)
index 0000000..efda03a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_page.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_pages.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_pages.gif
new file mode 100644 (file)
index 0000000..5c17308
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_pages.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_rows.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_rows.gif
new file mode 100644 (file)
index 0000000..217fb96
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/paging_rows.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/plus.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/plus.gif
new file mode 100644 (file)
index 0000000..abb84bd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/plus.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0.gif
new file mode 100644 (file)
index 0000000..f2ee489
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0_dis.gif
new file mode 100644 (file)
index 0000000..ada7848
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk0_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1.gif
new file mode 100644 (file)
index 0000000..54af4c8
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1_dis.gif
new file mode 100644 (file)
index 0000000..af5d41f
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/radio_chk1_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_asc.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_asc.gif
new file mode 100644 (file)
index 0000000..c3c0983
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_asc.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_desc.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_desc.gif
new file mode 100644 (file)
index 0000000..e080183
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/sort_desc.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/blank.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/blank.gif
new file mode 100644 (file)
index 0000000..d7ae406
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/blank.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/folder.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/folder.gif
new file mode 100644 (file)
index 0000000..e0a88ce
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/folder.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/leaf.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/leaf.gif
new file mode 100644 (file)
index 0000000..9c3e531
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/leaf.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line.gif
new file mode 100644 (file)
index 0000000..b4f560c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line1.gif
new file mode 100644 (file)
index 0000000..b4f560c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line2.gif
new file mode 100644 (file)
index 0000000..23b2ce3
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line3.gif
new file mode 100644 (file)
index 0000000..43152c5
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line4.gif
new file mode 100644 (file)
index 0000000..907fe7a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/line4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus.gif
new file mode 100644 (file)
index 0000000..ea11fd9
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus1.gif
new file mode 100644 (file)
index 0000000..d6a8b2b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus2.gif
new file mode 100644 (file)
index 0000000..a3fad45
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus3.gif
new file mode 100644 (file)
index 0000000..dbc1292
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus4.gif
new file mode 100644 (file)
index 0000000..1c2fccf
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus5.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus5.gif
new file mode 100644 (file)
index 0000000..031c160
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/minus5.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus.gif
new file mode 100644 (file)
index 0000000..2d50cd2
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus1.gif
new file mode 100644 (file)
index 0000000..cb8add4
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus2.gif
new file mode 100644 (file)
index 0000000..d57afa9
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus3.gif
new file mode 100644 (file)
index 0000000..2b6546b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus4.gif
new file mode 100644 (file)
index 0000000..a4fe8c0
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus5.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus5.gif
new file mode 100644 (file)
index 0000000..88c35a4
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxgrid_skyblue/tree/plus5.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_btns.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_btns.gif
new file mode 100644 (file)
index 0000000..f23cd77
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_btns.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_progress.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_progress.gif
new file mode 100644 (file)
index 0000000..1df5c43
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_cell_progress.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_h.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_h.gif
new file mode 100644 (file)
index 0000000..3996e4f
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_h.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_v.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_v.gif
new file mode 100644 (file)
index 0000000..5f4391d
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxlayout_skyblue/dhxlayout_sep_v.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down.gif
new file mode 100644 (file)
index 0000000..60be3f7
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down_dis.gif
new file mode 100644 (file)
index 0000000..d849732
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_down_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up.gif
new file mode 100644 (file)
index 0000000..c23a23a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up_dis.gif
new file mode 100644 (file)
index 0000000..a43cfe3
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_arrow_up_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_chrd.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_chrd.gif
new file mode 100644 (file)
index 0000000..235caaf
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_chrd.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_loader.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_loader.gif
new file mode 100644 (file)
index 0000000..21cc17e
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_loader.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_subar.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_subar.gif
new file mode 100644 (file)
index 0000000..4603471
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxmenu_skyblue/dhxmenu_subar.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_bottom.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_bottom.gif
new file mode 100644 (file)
index 0000000..e20fd4c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_bottom.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_left.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_left.gif
new file mode 100644 (file)
index 0000000..e337c53
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_left.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_right.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_right.gif
new file mode 100644 (file)
index 0000000..f0c7c59
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_right.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_top.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_top.gif
new file mode 100644 (file)
index 0000000..bec146f
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxpopup_skyblue/dhxpopup_arrow_top.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_arrow.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_arrow.gif
new file mode 100644 (file)
index 0000000..f64e20b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_arrow.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked.gif
new file mode 100644 (file)
index 0000000..9858188
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked_dis.gif
new file mode 100644 (file)
index 0000000..2aa750b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxribbon_skyblue/dhxribbon_checked_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_down.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_down.gif
new file mode 100644 (file)
index 0000000..b44180f
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_down.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_up.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_up.gif
new file mode 100644 (file)
index 0000000..560cbcf
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_arrow_up.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_cell_progress.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_cell_progress.gif
new file mode 100644 (file)
index 0000000..1df5c43
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxsidebar_skyblue/dhxsidebar_cell_progress.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_arrows.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_arrows.gif
new file mode 100644 (file)
index 0000000..56490ce
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_arrows.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_button_close.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_button_close.gif
new file mode 100644 (file)
index 0000000..1445534
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_button_close.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_cell_progress.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_cell_progress.gif
new file mode 100644 (file)
index 0000000..1df5c43
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtabbar_skyblue/dhxtabbar_cell_progress.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow.gif
new file mode 100644 (file)
index 0000000..8e805d8
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow_dis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow_dis.gif
new file mode 100644 (file)
index 0000000..3eddbbd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtoolbar_skyblue/dhxtoolbar_arrow_dis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/blank.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/blank.gif
new file mode 100644 (file)
index 0000000..d7ae406
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/blank.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/but_cut.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/but_cut.gif
new file mode 100644 (file)
index 0000000..942bd18
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/but_cut.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderClosed.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderClosed.gif
new file mode 100644 (file)
index 0000000..e0a88ce
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderClosed.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderOpen.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderOpen.gif
new file mode 100644 (file)
index 0000000..1680dbc
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/folderOpen.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckAll.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckAll.gif
new file mode 100644 (file)
index 0000000..a61302a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckAll.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckDis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckDis.gif
new file mode 100644 (file)
index 0000000..42447b8
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckDis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckGray.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckGray.gif
new file mode 100644 (file)
index 0000000..0350b2a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconCheckGray.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckAll.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckAll.gif
new file mode 100644 (file)
index 0000000..9f3fe50
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckAll.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckDis.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckDis.gif
new file mode 100644 (file)
index 0000000..f15d9f7
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/iconUncheckDis.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/leaf.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/leaf.gif
new file mode 100644 (file)
index 0000000..9c3e531
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/leaf.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line.gif
new file mode 100644 (file)
index 0000000..b4f560c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1.gif
new file mode 100644 (file)
index 0000000..b4f560c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1_rtl.gif
new file mode 100644 (file)
index 0000000..bf32db2
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line1_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2.gif
new file mode 100644 (file)
index 0000000..23b2ce3
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2_rtl.gif
new file mode 100644 (file)
index 0000000..6ec17b5
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line2_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3.gif
new file mode 100644 (file)
index 0000000..43152c5
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3_rtl.gif
new file mode 100644 (file)
index 0000000..74a874c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line3_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4.gif
new file mode 100644 (file)
index 0000000..907fe7a
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4_rtl.gif
new file mode 100644 (file)
index 0000000..5c7e162
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/line4_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/lock.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/lock.gif
new file mode 100644 (file)
index 0000000..67456b1
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/lock.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus.gif
new file mode 100644 (file)
index 0000000..caa3f57
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus1.gif
new file mode 100644 (file)
index 0000000..2ab1070
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2.gif
new file mode 100644 (file)
index 0000000..036e5b3
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2_rtl.gif
new file mode 100644 (file)
index 0000000..b4672bf
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus2_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3.gif
new file mode 100644 (file)
index 0000000..3242cca
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3_rtl.gif
new file mode 100644 (file)
index 0000000..8c279e0
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus3_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4.gif
new file mode 100644 (file)
index 0000000..1c7c0a7
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4_rtl.gif
new file mode 100644 (file)
index 0000000..70992fe
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus4_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5.gif
new file mode 100644 (file)
index 0000000..031c160
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5_rtl.gif
new file mode 100644 (file)
index 0000000..47e25cd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/minus5_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus.gif
new file mode 100644 (file)
index 0000000..019cfbd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus1.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus1.gif
new file mode 100644 (file)
index 0000000..34dee94
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus1.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2.gif
new file mode 100644 (file)
index 0000000..d57afa9
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2_rtl.gif
new file mode 100644 (file)
index 0000000..fde3a58
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus2_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3.gif
new file mode 100644 (file)
index 0000000..2b6546b
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3_rtl.gif
new file mode 100644 (file)
index 0000000..863d34c
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus3_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4.gif
new file mode 100644 (file)
index 0000000..a4fe8c0
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4_rtl.gif
new file mode 100644 (file)
index 0000000..635e6f6
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus4_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5.gif
new file mode 100644 (file)
index 0000000..88c35a4
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5_rtl.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5_rtl.gif
new file mode 100644 (file)
index 0000000..2ae5444
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/plus5_rtl.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_off.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_off.gif
new file mode 100644 (file)
index 0000000..a050afd
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_off.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_on.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_on.gif
new file mode 100644 (file)
index 0000000..4d594b5
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxtree_skyblue/radio_on.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_buttons.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_buttons.gif
new file mode 100644 (file)
index 0000000..625a0e7
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_buttons.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_icon.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_icon.gif
new file mode 100644 (file)
index 0000000..e9427ac
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_icon.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_progress.gif b/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_progress.gif
new file mode 100644 (file)
index 0000000..1df5c43
Binary files /dev/null and b/portal/static/unbound_reservation_static/lib/imgs/dhxwins_skyblue/dhxwins_progress.gif differ
diff --git a/portal/static/unbound_reservation_static/lib/jquery-1.9.0-min.js b/portal/static/unbound_reservation_static/lib/jquery-1.9.0-min.js
new file mode 100644 (file)
index 0000000..50d1b22
--- /dev/null
@@ -0,0 +1,4 @@
+/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},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(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t
+},set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.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(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")
+},nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
+//@ sourceMappingURL=jquery.min.map
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/jquery-1.9.0.js b/portal/static/unbound_reservation_static/lib/jquery-1.9.0.js
new file mode 100644 (file)
index 0000000..67e3160
--- /dev/null
@@ -0,0 +1,9555 @@
+/*!
+ * jQuery JavaScript Library v1.9.0
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-1-14
+ */
+(function( window, undefined ) {
+"use strict";
+var
+       // A central reference to the root jQuery(document)
+       rootjQuery,
+
+       // The deferred used on DOM ready
+       readyList,
+
+       // Use the correct document accordingly with window argument (sandbox)
+       document = window.document,
+       location = window.location,
+
+       // Map over jQuery in case of overwrite
+       _jQuery = window.jQuery,
+
+       // Map over the $ in case of overwrite
+       _$ = window.$,
+
+       // [[Class]] -> type pairs
+       class2type = {},
+
+       // List of deleted data cache ids, so we can reuse them
+       core_deletedIds = [],
+
+       core_version = "1.9.0",
+
+       // Save a reference to some core methods
+       core_concat = core_deletedIds.concat,
+       core_push = core_deletedIds.push,
+       core_slice = core_deletedIds.slice,
+       core_indexOf = core_deletedIds.indexOf,
+       core_toString = class2type.toString,
+       core_hasOwn = class2type.hasOwnProperty,
+       core_trim = core_version.trim,
+
+       // Define a local copy of jQuery
+       jQuery = function( selector, context ) {
+               // The jQuery object is actually just the init constructor 'enhanced'
+               return new jQuery.fn.init( selector, context, rootjQuery );
+       },
+
+       // Used for matching numbers
+       core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
+
+       // Used for splitting on whitespace
+       core_rnotwhite = /\S+/g,
+
+       // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+       rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+       // A simple way to check for HTML strings
+       // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+       // Strict HTML recognition (#11290: must start with <)
+       rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+       // Match a standalone tag
+       rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+       // JSON RegExp
+       rvalidchars = /^[\],:{}\s]*$/,
+       rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+       rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+       rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
+
+       // Matches dashed string for camelizing
+       rmsPrefix = /^-ms-/,
+       rdashAlpha = /-([\da-z])/gi,
+
+       // Used by jQuery.camelCase as callback to replace()
+       fcamelCase = function( all, letter ) {
+               return letter.toUpperCase();
+       },
+
+       // The ready event handler and self cleanup method
+       DOMContentLoaded = function() {
+               if ( document.addEventListener ) {
+                       document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+                       jQuery.ready();
+               } else if ( document.readyState === "complete" ) {
+                       // we're here because readyState === "complete" in oldIE
+                       // which is good enough for us to call the dom ready!
+                       document.detachEvent( "onreadystatechange", DOMContentLoaded );
+                       jQuery.ready();
+               }
+       };
+
+jQuery.fn = jQuery.prototype = {
+       // The current version of jQuery being used
+       jquery: core_version,
+
+       constructor: jQuery,
+       init: function( selector, context, rootjQuery ) {
+               var match, elem;
+
+               // HANDLE: $(""), $(null), $(undefined), $(false)
+               if ( !selector ) {
+                       return this;
+               }
+
+               // Handle HTML strings
+               if ( typeof selector === "string" ) {
+                       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 = rquickExpr.exec( selector );
+                       }
+
+                       // Match html or make sure no context is specified for #id
+                       if ( match && (match[1] || !context) ) {
+
+                               // HANDLE: $(html) -> $(array)
+                               if ( match[1] ) {
+                                       context = context instanceof jQuery ? context[0] : context;
+
+                                       // scripts is true for back-compat
+                                       jQuery.merge( this, jQuery.parseHTML(
+                                               match[1],
+                                               context && context.nodeType ? context.ownerDocument || context : document,
+                                               true
+                                       ) );
+
+                                       // HANDLE: $(html, props)
+                                       if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+                                               for ( match in context ) {
+                                                       // Properties of context are called as methods if possible
+                                                       if ( jQuery.isFunction( this[ match ] ) ) {
+                                                               this[ match ]( context[ match ] );
+
+                                                       // ...and otherwise set as attributes
+                                                       } else {
+                                                               this.attr( match, context[ match ] );
+                                                       }
+                                               }
+                                       }
+
+                                       return this;
+
+                               // 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: $(DOMElement)
+               } else if ( selector.nodeType ) {
+                       this.context = this[0] = selector;
+                       this.length = 1;
+                       return this;
+
+               // 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 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 core_slice.call( this );
+       },
+
+       // 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 ) {
+
+               // Build a new jQuery matched element set
+               var ret = jQuery.merge( this.constructor(), elems );
+
+               // Add the old object onto the stack (as a reference)
+               ret.prevObject = this;
+               ret.context = this.context;
+
+               // 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 ) {
+               // Add the callback
+               jQuery.ready.promise().done( fn );
+
+               return this;
+       },
+
+       slice: function() {
+               return this.pushStack( core_slice.apply( this, arguments ) );
+       },
+
+       first: function() {
+               return this.eq( 0 );
+       },
+
+       last: function() {
+               return this.eq( -1 );
+       },
+
+       eq: function( i ) {
+               var len = this.length,
+                       j = +i + ( i < 0 ? len : 0 );
+               return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+       },
+
+       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: core_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 ) {
+
+               // Abort if there are pending holds or we're already ready
+               if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+                       return;
+               }
+
+               // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+               if ( !document.body ) {
+                       return setTimeout( jQuery.ready );
+               }
+
+               // 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").off("ready");
+               }
+       },
+
+       // 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";
+       },
+
+       isWindow: function( obj ) {
+               return obj != null && obj == obj.window;
+       },
+
+       isNumeric: function( obj ) {
+               return !isNaN( parseFloat(obj) ) && isFinite( obj );
+       },
+
+       type: function( obj ) {
+               if ( obj == null ) {
+                       return String( obj );
+               }
+               return typeof obj === "object" || typeof obj === "function" ?
+                       class2type[ core_toString.call(obj) ] || "object" :
+                       typeof obj;
+       },
+
+       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 &&
+                               !core_hasOwn.call(obj, "constructor") &&
+                               !core_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 || core_hasOwn.call( obj, key );
+       },
+
+       isEmptyObject: function( obj ) {
+               var name;
+               for ( name in obj ) {
+                       return false;
+               }
+               return true;
+       },
+
+       error: function( msg ) {
+               throw new Error( msg );
+       },
+
+       // data: string of html
+       // context (optional): If specified, the fragment will be created in this context, defaults to document
+       // keepScripts (optional): If true, will include scripts passed in the html string
+       parseHTML: function( data, context, keepScripts ) {
+               if ( !data || typeof data !== "string" ) {
+                       return null;
+               }
+               if ( typeof context === "boolean" ) {
+                       keepScripts = context;
+                       context = false;
+               }
+               context = context || document;
+
+               var parsed = rsingleTag.exec( data ),
+                       scripts = !keepScripts && [];
+
+               // Single tag
+               if ( parsed ) {
+                       return [ context.createElement( parsed[1] ) ];
+               }
+
+               parsed = jQuery.buildFragment( [ data ], context, scripts );
+               if ( scripts ) {
+                       jQuery( scripts ).remove();
+               }
+               return jQuery.merge( [], parsed.childNodes );
+       },
+
+       parseJSON: function( data ) {
+               // Attempt to parse using the native JSON parser first
+               if ( window.JSON && window.JSON.parse ) {
+                       return window.JSON.parse( data );
+               }
+
+               if ( data === null ) {
+                       return data;
+               }
+
+               if ( typeof data === "string" ) {
+
+                       // Make sure leading/trailing whitespace is removed (IE can't handle it)
+                       data = jQuery.trim( data );
+
+                       if ( 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;
+               if ( !data || typeof data !== "string" ) {
+                       return null;
+               }
+               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 && jQuery.trim( 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.toLowerCase() === name.toLowerCase();
+       },
+
+       // args is for internal usage only
+       each: function( obj, callback, args ) {
+               var value,
+                       i = 0,
+                       length = obj.length,
+                       isArray = isArraylike( obj );
+
+               if ( args ) {
+                       if ( isArray ) {
+                               for ( ; i < length; i++ ) {
+                                       value = callback.apply( obj[ i ], args );
+
+                                       if ( value === false ) {
+                                               break;
+                                       }
+                               }
+                       } else {
+                               for ( i in obj ) {
+                                       value = callback.apply( obj[ i ], args );
+
+                                       if ( value === false ) {
+                                               break;
+                                       }
+                               }
+                       }
+
+               // A special, fast, case for the most common use of each
+               } else {
+                       if ( isArray ) {
+                               for ( ; i < length; i++ ) {
+                                       value = callback.call( obj[ i ], i, obj[ i ] );
+
+                                       if ( value === false ) {
+                                               break;
+                                       }
+                               }
+                       } else {
+                               for ( i in obj ) {
+                                       value = callback.call( obj[ i ], i, obj[ i ] );
+
+                                       if ( value === false ) {
+                                               break;
+                                       }
+                               }
+                       }
+               }
+
+               return obj;
+       },
+
+       // Use native String.trim function wherever possible
+       trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
+               function( text ) {
+                       return text == null ?
+                               "" :
+                               core_trim.call( text );
+               } :
+
+               // Otherwise use our own trimming functionality
+               function( text ) {
+                       return text == null ?
+                               "" :
+                               ( text + "" ).replace( rtrim, "" );
+               },
+
+       // results is for internal usage only
+       makeArray: function( arr, results ) {
+               var ret = results || [];
+
+               if ( arr != null ) {
+                       if ( isArraylike( Object(arr) ) ) {
+                               jQuery.merge( ret,
+                                       typeof arr === "string" ?
+                                       [ arr ] : arr
+                               );
+                       } else {
+                               core_push.call( ret, arr );
+                       }
+               }
+
+               return ret;
+       },
+
+       inArray: function( elem, arr, i ) {
+               var len;
+
+               if ( arr ) {
+                       if ( core_indexOf ) {
+                               return core_indexOf.call( arr, elem, i );
+                       }
+
+                       len = arr.length;
+                       i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+                       for ( ; i < len; i++ ) {
+                               // Skip accessing in sparse arrays
+                               if ( i in arr && arr[ i ] === elem ) {
+                                       return i;
+                               }
+                       }
+               }
+
+               return -1;
+       },
+
+       merge: function( first, second ) {
+               var l = second.length,
+                       i = first.length,
+                       j = 0;
+
+               if ( typeof l === "number" ) {
+                       for ( ; 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 retVal,
+                       ret = [],
+                       i = 0,
+                       length = elems.length;
+               inv = !!inv;
+
+               // Go through the array, only saving the items
+               // that pass the validator function
+               for ( ; 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,
+                       i = 0,
+                       length = elems.length,
+                       isArray = isArraylike( elems ),
+                       ret = [];
+
+               // 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 ( i in elems ) {
+                               value = callback( elems[ i ], i, arg );
+
+                               if ( value != null ) {
+                                       ret[ ret.length ] = value;
+                               }
+                       }
+               }
+
+               // Flatten any nested arrays
+               return core_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 ) {
+               var tmp, args, proxy;
+
+               if ( typeof context === "string" ) {
+                       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
+               args = core_slice.call( arguments, 2 );
+               proxy = function() {
+                       return fn.apply( context || this, args.concat( core_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 || jQuery.guid++;
+
+               return proxy;
+       },
+
+       // Multifunctional method to get and set values of a collection
+       // The value/s can optionally be executed if it's a function
+       access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
+               var i = 0,
+                       length = elems.length,
+                       bulk = key == null;
+
+               // Sets many values
+               if ( jQuery.type( key ) === "object" ) {
+                       chainable = true;
+                       for ( i in key ) {
+                               jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+                       }
+
+               // Sets one value
+               } else if ( value !== undefined ) {
+                       chainable = true;
+
+                       if ( !jQuery.isFunction( value ) ) {
+                               raw = true;
+                       }
+
+                       if ( bulk ) {
+                               // Bulk operations run against the entire set
+                               if ( raw ) {
+                                       fn.call( elems, value );
+                                       fn = null;
+
+                               // ...except when executing function values
+                               } else {
+                                       bulk = fn;
+                                       fn = function( elem, key, value ) {
+                                               return bulk.call( jQuery( elem ), value );
+                                       };
+                               }
+                       }
+
+                       if ( fn ) {
+                               for ( ; i < length; i++ ) {
+                                       fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+                               }
+                       }
+               }
+
+               return chainable ?
+                       elems :
+
+                       // Gets
+                       bulk ?
+                               fn.call( elems ) :
+                               length ? fn( elems[0], key ) : emptyGet;
+       },
+
+       now: function() {
+               return ( new Date() ).getTime();
+       }
+});
+
+jQuery.ready.promise = function( obj ) {
+       if ( !readyList ) {
+
+               readyList = jQuery.Deferred();
+
+               // Catch cases where $(document).ready() is called after the browser event has already occurred.
+               // we once tried to use readyState "interactive" here, but it caused issues like the one
+               // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+               if ( document.readyState === "complete" ) {
+                       // Handle it asynchronously to allow scripts the opportunity to delay ready
+                       setTimeout( jQuery.ready );
+
+               // Standards-based browsers support DOMContentLoaded
+               } else 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 {
+                       // 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 top = false;
+
+                       try {
+                               top = window.frameElement == null && document.documentElement;
+                       } catch(e) {}
+
+                       if ( top && top.doScroll ) {
+                               (function doScrollCheck() {
+                                       if ( !jQuery.isReady ) {
+
+                                               try {
+                                                       // Use the trick by Diego Perini
+                                                       // http://javascript.nwbox.com/IEContentLoaded/
+                                                       top.doScroll("left");
+                                               } catch(e) {
+                                                       return setTimeout( doScrollCheck, 50 );
+                                               }
+
+                                               // and execute any waiting functions
+                                               jQuery.ready();
+                                       }
+                               })();
+                       }
+               }
+       }
+       return readyList.promise( obj );
+};
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+       class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+       var length = obj.length,
+               type = jQuery.type( obj );
+
+       if ( jQuery.isWindow( obj ) ) {
+               return false;
+       }
+
+       if ( obj.nodeType === 1 && length ) {
+               return true;
+       }
+
+       return type === "array" || type !== "function" &&
+               ( length === 0 ||
+               typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+       var object = optionsCache[ options ] = {};
+       jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
+               object[ flag ] = true;
+       });
+       return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ *     options: an optional list of space-separated options that will change how
+ *                     the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ *     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( options ) {
+
+       // Convert options from String-formatted to Object-formatted if needed
+       // (we check in cache first)
+       options = typeof options === "string" ?
+               ( optionsCache[ options ] || createOptions( options ) ) :
+               jQuery.extend( {}, options );
+
+       var // Last fire value (for non-forgettable lists)
+               memory,
+               // Flag to know if list was already fired
+               fired,
+               // 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,
+               // Actual callback list
+               list = [],
+               // Stack of fire calls for repeatable lists
+               stack = !options.once && [],
+               // Fire callbacks
+               fire = function( data ) {
+                       memory = options.memory && data;
+                       fired = true;
+                       firingIndex = firingStart || 0;
+                       firingStart = 0;
+                       firingLength = list.length;
+                       firing = true;
+                       for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+                               if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+                                       memory = false; // To prevent further calls using add
+                                       break;
+                               }
+                       }
+                       firing = false;
+                       if ( list ) {
+                               if ( stack ) {
+                                       if ( stack.length ) {
+                                               fire( stack.shift() );
+                                       }
+                               } else if ( memory ) {
+                                       list = [];
+                               } else {
+                                       self.disable();
+                               }
+                       }
+               },
+               // Actual Callbacks object
+               self = {
+                       // Add a callback or a collection of callbacks to the list
+                       add: function() {
+                               if ( list ) {
+                                       // First, we save the current length
+                                       var start = list.length;
+                                       (function add( args ) {
+                                               jQuery.each( args, function( _, arg ) {
+                                                       var type = jQuery.type( arg );
+                                                       if ( type === "function" ) {
+                                                               if ( !options.unique || !self.has( arg ) ) {
+                                                                       list.push( arg );
+                                                               }
+                                                       } else if ( arg && arg.length && type !== "string" ) {
+                                                               // Inspect recursively
+                                                               add( arg );
+                                                       }
+                                               });
+                                       })( 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
+                                       } else if ( memory ) {
+                                               firingStart = start;
+                                               fire( memory );
+                                       }
+                               }
+                               return this;
+                       },
+                       // Remove a callback from the list
+                       remove: function() {
+                               if ( list ) {
+                                       jQuery.each( arguments, function( _, arg ) {
+                                               var index;
+                                               while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+                                                       list.splice( index, 1 );
+                                                       // Handle firing indexes
+                                                       if ( firing ) {
+                                                               if ( index <= firingLength ) {
+                                                                       firingLength--;
+                                                               }
+                                                               if ( index <= firingIndex ) {
+                                                                       firingIndex--;
+                                                               }
+                                                       }
+                                               }
+                                       });
+                               }
+                               return this;
+                       },
+                       // Control if a given callback is in the list
+                       has: function( fn ) {
+                               return jQuery.inArray( fn, list ) > -1;
+                       },
+                       // 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 ) {
+                                       self.disable();
+                               }
+                               return this;
+                       },
+                       // Is it locked?
+                       locked: function() {
+                               return !stack;
+                       },
+                       // Call all callbacks with the given context and arguments
+                       fireWith: function( context, args ) {
+                               args = args || [];
+                               args = [ context, args.slice ? args.slice() : args ];
+                               if ( list && ( !fired || stack ) ) {
+                                       if ( firing ) {
+                                               stack.push( args );
+                                       } else {
+                                               fire( 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 !!fired;
+                       }
+               };
+
+       return self;
+};
+jQuery.extend({
+
+       Deferred: function( func ) {
+               var tuples = [
+                               // action, add listener, listener list, final state
+                               [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+                               [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+                               [ "notify", "progress", jQuery.Callbacks("memory") ]
+                       ],
+                       state = "pending",
+                       promise = {
+                               state: function() {
+                                       return state;
+                               },
+                               always: function() {
+                                       deferred.done( arguments ).fail( arguments );
+                                       return this;
+                               },
+                               then: function( /* fnDone, fnFail, fnProgress */ ) {
+                                       var fns = arguments;
+                                       return jQuery.Deferred(function( newDefer ) {
+                                               jQuery.each( tuples, function( i, tuple ) {
+                                                       var action = tuple[ 0 ],
+                                                               fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+                                                       // deferred[ done | fail | progress ] for forwarding actions to newDefer
+                                                       deferred[ tuple[1] ](function() {
+                                                               var returned = fn && fn.apply( this, arguments );
+                                                               if ( returned && jQuery.isFunction( returned.promise ) ) {
+                                                                       returned.promise()
+                                                                               .done( newDefer.resolve )
+                                                                               .fail( newDefer.reject )
+                                                                               .progress( newDefer.notify );
+                                                               } else {
+                                                                       newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+                                                               }
+                                                       });
+                                               });
+                                               fns = null;
+                                       }).promise();
+                               },
+                               // Get a promise for this deferred
+                               // If obj is provided, the promise aspect is added to the object
+                               promise: function( obj ) {
+                                       return obj != null ? jQuery.extend( obj, promise ) : promise;
+                               }
+                       },
+                       deferred = {};
+
+               // Keep pipe for back-compat
+               promise.pipe = promise.then;
+
+               // Add list-specific methods
+               jQuery.each( tuples, function( i, tuple ) {
+                       var list = tuple[ 2 ],
+                               stateString = tuple[ 3 ];
+
+                       // promise[ done | fail | progress ] = list.add
+                       promise[ tuple[1] ] = list.add;
+
+                       // Handle state
+                       if ( stateString ) {
+                               list.add(function() {
+                                       // state = [ resolved | rejected ]
+                                       state = stateString;
+
+                               // [ reject_list | resolve_list ].disable; progress_list.lock
+                               }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+                       }
+
+                       // deferred[ resolve | reject | notify ]
+                       deferred[ tuple[0] ] = function() {
+                               deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+                               return this;
+                       };
+                       deferred[ tuple[0] + "With" ] = list.fireWith;
+               });
+
+               // Make the deferred a promise
+               promise.promise( deferred );
+
+               // Call given func if any
+               if ( func ) {
+                       func.call( deferred, deferred );
+               }
+
+               // All done!
+               return deferred;
+       },
+
+       // Deferred helper
+       when: function( subordinate /* , ..., subordinateN */ ) {
+               var i = 0,
+                       resolveValues = core_slice.call( arguments ),
+                       length = resolveValues.length,
+
+                       // the count of uncompleted subordinates
+                       remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+                       // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+                       deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+                       // Update function for both resolve and progress values
+                       updateFunc = function( i, contexts, values ) {
+                               return function( value ) {
+                                       contexts[ i ] = this;
+                                       values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+                                       if( values === progressValues ) {
+                                               deferred.notifyWith( contexts, values );
+                                       } else if ( !( --remaining ) ) {
+                                               deferred.resolveWith( contexts, values );
+                                       }
+                               };
+                       },
+
+                       progressValues, progressContexts, resolveContexts;
+
+               // add listeners to Deferred subordinates; treat others as resolved
+               if ( length > 1 ) {
+                       progressValues = new Array( length );
+                       progressContexts = new Array( length );
+                       resolveContexts = new Array( length );
+                       for ( ; i < length; i++ ) {
+                               if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+                                       resolveValues[ i ].promise()
+                                               .done( updateFunc( i, resolveContexts, resolveValues ) )
+                                               .fail( deferred.reject )
+                                               .progress( updateFunc( i, progressContexts, progressValues ) );
+                               } else {
+                                       --remaining;
+                               }
+                       }
+               }
+
+               // if we're not waiting on anything, resolve the master
+               if ( !remaining ) {
+                       deferred.resolveWith( resolveContexts, resolveValues );
+               }
+
+               return deferred.promise();
+       }
+});
+jQuery.support = (function() {
+
+       var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
+               div = document.createElement("div");
+
+       // Setup
+       div.setAttribute( "className", "t" );
+       div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+       // Support tests won't run in some limited or non-browser environments
+       all = div.getElementsByTagName("*");
+       a = div.getElementsByTagName("a")[ 0 ];
+       if ( !all || !a || !all.length ) {
+               return {};
+       }
+
+       // First batch of tests
+       select = document.createElement("select");
+       opt = select.appendChild( document.createElement("option") );
+       input = div.getElementsByTagName("input")[ 0 ];
+
+       a.style.cssText = "top:1px;float:left;opacity:.5";
+       support = {
+               // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+               getSetAttribute: div.className !== "t",
+
+               // 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.5/.test( a.style.opacity ),
+
+               // Verify style float existence
+               // (IE uses styleFloat instead of cssFloat)
+               cssFloat: !!a.style.cssFloat,
+
+               // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+               checkOn: !!input.value,
+
+               // 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,
+
+               // 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>",
+
+               // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
+               boxModel: document.compatMode === "CSS1Compat",
+
+               // Will be defined later
+               deleteExpando: true,
+               noCloneEvent: true,
+               inlineBlockNeedsLayout: false,
+               shrinkWrapBlocks: false,
+               reliableMarginRight: true,
+               boxSizingReliable: true,
+               pixelPosition: false
+       };
+
+       // 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;
+
+       // Support: IE<9
+       try {
+               delete div.test;
+       } catch( e ) {
+               support.deleteExpando = false;
+       }
+
+       // Check if we can trust getAttribute("value")
+       input = document.createElement("input");
+       input.setAttribute( "value", "" );
+       support.input = input.getAttribute( "value" ) === "";
+
+       // Check if an input maintains its value after becoming a radio
+       input.value = "t";
+       input.setAttribute( "type", "radio" );
+       support.radioValue = input.value === "t";
+
+       // #11217 - WebKit loses check when the name is after the checked attribute
+       input.setAttribute( "checked", "t" );
+       input.setAttribute( "name", "t" );
+
+       fragment = document.createDocumentFragment();
+       fragment.appendChild( input );
+
+       // Check if a disconnected checkbox will retain its checked
+       // value of true after appended to the DOM (IE6/7)
+       support.appendChecked = input.checked;
+
+       // WebKit doesn't clone checked state correctly in fragments
+       support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+       // Support: IE<9
+       // Opera does not clone events (and typeof div.attachEvent === undefined).
+       // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+       if ( div.attachEvent ) {
+               div.attachEvent( "onclick", function() {
+                       support.noCloneEvent = false;
+               });
+
+               div.cloneNode( true ).click();
+       }
+
+       // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+       // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
+       for ( i in { submit: true, change: true, focusin: true }) {
+               div.setAttribute( eventName = "on" + i, "t" );
+
+               support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
+       }
+
+       div.style.backgroundClip = "content-box";
+       div.cloneNode( true ).style.backgroundClip = "";
+       support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+       // Run tests that need a body at doc ready
+       jQuery(function() {
+               var container, marginDiv, tds,
+                       divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+                       body = document.getElementsByTagName("body")[0];
+
+               if ( !body ) {
+                       // Return for frameset docs that don't have a body
+                       return;
+               }
+
+               container = document.createElement("div");
+               container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+               body.appendChild( container ).appendChild( div );
+
+               // Support: IE8
+               // 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).
+               div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+               tds = div.getElementsByTagName("td");
+               tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+               isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+               tds[ 0 ].style.display = "";
+               tds[ 1 ].style.display = "none";
+
+               // Support: IE8
+               // Check if empty table cells still have offsetWidth/Height
+               support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+               // Check box-sizing and margin behavior
+               div.innerHTML = "";
+               div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+               support.boxSizing = ( div.offsetWidth === 4 );
+               support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
+
+               // Use window.getComputedStyle because jsdom on node.js will break without it.
+               if ( window.getComputedStyle ) {
+                       support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+                       support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+                       // Check if div with explicit width and no margin-right incorrectly
+                       // gets computed margin-right based on width of container. (#3333)
+                       // Fails in WebKit before Feb 2011 nightlies
+                       // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+                       marginDiv = div.appendChild( document.createElement("div") );
+                       marginDiv.style.cssText = div.style.cssText = divReset;
+                       marginDiv.style.marginRight = marginDiv.style.width = "0";
+                       div.style.width = "1px";
+
+                       support.reliableMarginRight =
+                               !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+               }
+
+               if ( typeof div.style.zoom !== "undefined" ) {
+                       // Support: IE<8
+                       // Check if natively block-level elements act like inline-block
+                       // elements when setting their display to 'inline' and giving
+                       // them layout
+                       div.innerHTML = "";
+                       div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+                       support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+                       // Support: IE6
+                       // Check if elements with layout shrink-wrap their children
+                       div.style.display = "block";
+                       div.innerHTML = "<div></div>";
+                       div.firstChild.style.width = "5px";
+                       support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+                       // Prevent IE 6 from affecting layout for positioned elements #11048
+                       // Prevent IE from shrinking the body in IE 7 mode #12869
+                       body.style.zoom = 1;
+               }
+
+               body.removeChild( container );
+
+               // Null elements to avoid leaks in IE
+               container = div = tds = marginDiv = null;
+       });
+
+       // Null elements to avoid leaks in IE
+       all = select = fragment = opt = a = input = null;
+
+       return support;
+})();
+
+var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+       rmultiDash = /([A-Z])/g;
+       
+function internalData( 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[ internalKey ] : elem[ internalKey ] && internalKey;
+
+       // 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] || (!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 = core_deletedIds.pop() || jQuery.guid++;
+               } 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 );
+               }
+       }
+
+       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;
+       }
+
+       // 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;
+}
+
+function internalRemoveData( elem, name, pvt /* For internal use only */ ){
+       if ( !jQuery.acceptData( elem ) ) {
+               return;
+       }
+
+       var thisCache, i, l,
+
+               isNode = elem.nodeType,
+
+               // See jQuery.data for more information
+               cache = isNode ? jQuery.cache : elem,
+               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 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(" ");
+                                       }
+                               }
+                       } else {
+                               // If "name" is an array of keys...
+                               // When data is initially created, via ("key", "val") signature,
+                               // keys will be converted to camelCase.
+                               // Since there is no way to tell _how_ a key was added, remove
+                               // both plain key and camelCase key. #12786
+                               // This will only penalize the array argument path.
+                               name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+                       }
+
+                       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;
+               }
+       }
+
+       // Destroy the cache
+       if ( isNode ) {
+               jQuery.cleanData( [ elem ], true );
+
+       // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+       } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+               delete cache[ id ];
+
+       // When all else fails, null
+       } else {
+               cache[ id ] = null;
+       }
+}
+
+jQuery.extend({
+       cache: {},
+
+       // Unique for each copy of jQuery on the page
+       // Non-digits removed to match rinlinejQuery
+       expando: "jQuery" + ( core_version + 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 ) {
+               return internalData( elem, name, data, false );
+       },
+
+       removeData: function( elem, name ) {
+               return internalRemoveData( elem, name, false );
+       },
+
+       // For internal use only.
+       _data: function( elem, name, data ) {
+               return internalData( elem, name, data, true );
+       },
+       
+       _removeData: function( elem, name ) {
+               return internalRemoveData( elem, name, true );
+       },
+
+       // A method for determining if a DOM node can handle the data expando
+       acceptData: function( elem ) {
+               var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+               // nodes accept data unless otherwise specified; rejection can be conditional
+               return !noData || noData !== true && elem.getAttribute("classid") === noData;
+       }
+});
+
+jQuery.fn.extend({
+       data: function( key, value ) {
+               var attrs, name,
+                       elem = this[0],
+                       i = 0,
+                       data = null;
+
+               // Gets all values
+               if ( key === undefined ) {
+                       if ( this.length ) {
+                               data = jQuery.data( elem );
+
+                               if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+                                       attrs = elem.attributes;
+                                       for ( ; i < attrs.length; i++ ) {
+                                               name = attrs[i].name;
+
+                                               if ( !name.indexOf( "data-" ) ) {
+                                                       name = jQuery.camelCase( name.substring(5) );
+
+                                                       dataAttr( elem, name, data[ name ] );
+                                               }
+                                       }
+                                       jQuery._data( elem, "parsedAttrs", true );
+                               }
+                       }
+
+                       return data;
+               }
+
+               // Sets multiple values
+               if ( typeof key === "object" ) {
+                       return this.each(function() {
+                               jQuery.data( this, key );
+                       });
+               }
+
+               return jQuery.access( this, function( value ) {
+
+                       if ( value === undefined ) {
+                               // Try to fetch any internally stored data first
+                               return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
+                       }
+
+                       this.each(function() {
+                               jQuery.data( this, key, value );
+                       });
+               }, null, value, arguments.length > 1, null, true );
+       },
+
+       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 :
+                               // Only convert to a number if it doesn't change the string
+                               +data + "" === data ? +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 ) {
+       var name;
+       for ( 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;
+}
+jQuery.extend({
+       queue: function( elem, type, data ) {
+               var queue;
+
+               if ( elem ) {
+                       type = ( type || "fx" ) + "queue";
+                       queue = jQuery._data( elem, type );
+
+                       // Speed up dequeue by getting out quickly if this is just a lookup
+                       if ( data ) {
+                               if ( !queue || jQuery.isArray(data) ) {
+                                       queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+                               } else {
+                                       queue.push( data );
+                               }
+                       }
+                       return queue || [];
+               }
+       },
+
+       dequeue: function( elem, type ) {
+               type = type || "fx";
+
+               var queue = jQuery.queue( elem, type ),
+                       startLength = queue.length,
+                       fn = queue.shift(),
+                       hooks = jQuery._queueHooks( elem, type ),
+                       next = function() {
+                               jQuery.dequeue( elem, type );
+                       };
+
+               // If the fx queue is dequeued, always remove the progress sentinel
+               if ( fn === "inprogress" ) {
+                       fn = queue.shift();
+                       startLength--;
+               }
+
+               hooks.cur = fn;
+               if ( fn ) {
+
+                       // Add a progress sentinel to prevent the fx queue from being
+                       // automatically dequeued
+                       if ( type === "fx" ) {
+                               queue.unshift( "inprogress" );
+                       }
+
+                       // clear up the last queue stop function
+                       delete hooks.stop;
+                       fn.call( elem, next, hooks );
+               }
+
+               if ( !startLength && hooks ) {
+                       hooks.empty.fire();
+               }
+       },
+
+       // not intended for public consumption - generates a queueHooks object, or returns the current one
+       _queueHooks: function( elem, type ) {
+               var key = type + "queueHooks";
+               return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+                       empty: jQuery.Callbacks("once memory").add(function() {
+                               jQuery._removeData( elem, type + "queue" );
+                               jQuery._removeData( elem, key );
+                       })
+               });
+       }
+});
+
+jQuery.fn.extend({
+       queue: function( type, data ) {
+               var setter = 2;
+
+               if ( typeof type !== "string" ) {
+                       data = type;
+                       type = "fx";
+                       setter--;
+               }
+
+               if ( arguments.length < setter ) {
+                       return jQuery.queue( this[0], type );
+               }
+
+               return data === undefined ?
+                       this :
+                       this.each(function() {
+                               var queue = jQuery.queue( this, type, data );
+
+                               // ensure a hooks for this queue
+                               jQuery._queueHooks( this, type );
+
+                               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, obj ) {
+               var tmp,
+                       count = 1,
+                       defer = jQuery.Deferred(),
+                       elements = this,
+                       i = this.length,
+                       resolve = function() {
+                               if ( !( --count ) ) {
+                                       defer.resolveWith( elements, [ elements ] );
+                               }
+                       };
+
+               if ( typeof type !== "string" ) {
+                       obj = type;
+                       type = undefined;
+               }
+               type = type || "fx";
+
+               while( i-- ) {
+                       tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+                       if ( tmp && tmp.empty ) {
+                               count++;
+                               tmp.empty.add( resolve );
+                       }
+               }
+               resolve();
+               return defer.promise( obj );
+       }
+});
+var nodeHook, boolHook,
+       rclass = /[\t\r\n]/g,
+       rreturn = /\r/g,
+       rfocusable = /^(?:input|select|textarea|button|object)$/i,
+       rclickable = /^(?:a|area)$/i,
+       rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
+       ruseDefault = /^(?:checked|selected)$/i,
+       getSetAttribute = jQuery.support.getSetAttribute,
+       getSetInput = jQuery.support.input;
+
+jQuery.fn.extend({
+       attr: function( name, value ) {
+               return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+       },
+
+       removeAttr: function( name ) {
+               return this.each(function() {
+                       jQuery.removeAttr( this, name );
+               });
+       },
+
+       prop: function( name, value ) {
+               return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+       },
+
+       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 classes, elem, cur, clazz, j,
+                       i = 0,
+                       len = this.length,
+                       proceed = typeof value === "string" && value;
+
+               if ( jQuery.isFunction( value ) ) {
+                       return this.each(function( j ) {
+                               jQuery( this ).addClass( value.call( this, j, this.className ) );
+                       });
+               }
+
+               if ( proceed ) {
+                       // The disjunction here is for better compressibility (see removeClass)
+                       classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+                       for ( ; i < len; i++ ) {
+                               elem = this[ i ];
+                               cur = elem.nodeType === 1 && ( elem.className ?
+                                       ( " " + elem.className + " " ).replace( rclass, " " ) :
+                                       " "
+                               );
+
+                               if ( cur ) {
+                                       j = 0;
+                                       while ( (clazz = classes[j++]) ) {
+                                               if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+                                                       cur += clazz + " ";
+                                               }
+                                       }
+                                       elem.className = jQuery.trim( cur );
+
+                               }
+                       }
+               }
+
+               return this;
+       },
+
+       removeClass: function( value ) {
+               var classes, elem, cur, clazz, j,
+                       i = 0,
+                       len = this.length,
+                       proceed = arguments.length === 0 || typeof value === "string" && value;
+
+               if ( jQuery.isFunction( value ) ) {
+                       return this.each(function( j ) {
+                               jQuery( this ).removeClass( value.call( this, j, this.className ) );
+                       });
+               }
+               if ( proceed ) {
+                       classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+                       for ( ; i < len; i++ ) {
+                               elem = this[ i ];
+                               // This expression is here for better compressibility (see addClass)
+                               cur = elem.nodeType === 1 && ( elem.className ?
+                                       ( " " + elem.className + " " ).replace( rclass, " " ) :
+                                       ""
+                               );
+
+                               if ( cur ) {
+                                       j = 0;
+                                       while ( (clazz = classes[j++]) ) {
+                                               // Remove *all* instances
+                                               while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+                                                       cur = cur.replace( " " + clazz + " ", " " );
+                                               }
+                                       }
+                                       elem.className = value ? jQuery.trim( cur ) : "";
+                               }
+                       }
+               }
+
+               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.match( core_rnotwhite ) || [];
+
+                               while ( (className = classNames[ i++ ]) ) {
+                                       // check each className given, space separated list
+                                       state = isBool ? state : !self.hasClass( className );
+                                       self[ state ? "addClass" : "removeClass" ]( className );
+                               }
+
+                       // Toggle whole class name
+                       } else if ( type === "undefined" || type === "boolean" ) {
+                               if ( this.className ) {
+                                       // store className if set
+                                       jQuery._data( this, "__className__", this.className );
+                               }
+
+                               // If the element has a class name or if we're passed "false",
+                               // then remove the whole classname (if there was one, the above saved it).
+                               // Otherwise bring back whatever was previously saved (if anything),
+                               // falling back to the empty string if nothing was stored.
+                               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 ) >= 0 ) {
+                               return true;
+                       }
+               }
+
+               return false;
+       },
+
+       val: function( value ) {
+               var hooks, ret, isFunction,
+                       elem = this[0];
+
+               if ( !arguments.length ) {
+                       if ( elem ) {
+                               hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+                               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 val,
+                               self = jQuery(this);
+
+                       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.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+                       // 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, option,
+                                       options = elem.options,
+                                       index = elem.selectedIndex,
+                                       one = elem.type === "select-one" || index < 0,
+                                       values = one ? null : [],
+                                       max = one ? index + 1 : options.length,
+                                       i = index < 0 ?
+                                               max :
+                                               one ? index : 0;
+
+                               // Loop through all the selected options
+                               for ( ; i < max; i++ ) {
+                                       option = options[ i ];
+
+                                       // oldIE doesn't update selected after form reset (#2551)
+                                       if ( ( option.selected || i === index ) &&
+                                                       // Don't return options that are disabled or in a disabled optgroup
+                                                       ( 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 );
+                                       }
+                               }
+
+                               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;
+                       }
+               }
+       },
+
+       attr: function( elem, name, value ) {
+               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;
+               }
+
+               // 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 );
+
+                       } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+                               return ret;
+
+                       } else {
+                               elem.setAttribute( name, value + "" );
+                               return value;
+                       }
+
+               } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+                       return ret;
+
+               } else {
+
+                       // In IE9+, Flash objects don't have .getAttribute (#12945)
+                       // Support: IE9+
+                       if ( typeof elem.getAttribute !== "undefined" ) {
+                               ret =  elem.getAttribute( name );
+                       }
+
+                       // Non-existent attributes return null, we normalize to undefined
+                       return ret == null ?
+                               undefined :
+                               ret;
+               }
+       },
+
+       removeAttr: function( elem, value ) {
+               var name, propName,
+                       i = 0,
+                       attrNames = value && value.match( core_rnotwhite );
+
+               if ( attrNames && elem.nodeType === 1 ) {
+                       while ( (name = attrNames[i++]) ) {
+                               propName = jQuery.propFix[ name ] || name;
+
+                               // Boolean attributes get special treatment (#10870)
+                               if ( rboolean.test( name ) ) {
+                                       // Set corresponding property to false for boolean attributes
+                                       // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
+                                       if ( !getSetAttribute && ruseDefault.test( name ) ) {
+                                               elem[ jQuery.camelCase( "default-" + name ) ] =
+                                                       elem[ propName ] = false;
+                                       } else {
+                                               elem[ propName ] = false;
+                                       }
+
+                               // See #9699 for explanation of this approach (setting first, then removal)
+                               } else {
+                                       jQuery.attr( elem, name, "" );
+                               }
+
+                               elem.removeAttribute( getSetAttribute ? name : propName );
+                       }
+               }
+       },
+
+       attrHooks: {
+               type: {
+                       set: function( elem, value ) {
+                               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 default in case type is set after value during creation
+                                       var val = elem.value;
+                                       elem.setAttribute( "type", value );
+                                       if ( val ) {
+                                               elem.value = val;
+                                       }
+                                       return 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;
+                       }
+               }
+       }
+});
+
+// Hook for boolean attributes
+boolHook = {
+       get: function( elem, name ) {
+               var
+                       // Use .prop to determine if this attribute is understood as boolean
+                       prop = jQuery.prop( elem, name ),
+
+                       // Fetch it accordingly
+                       attr = typeof prop === "boolean" && elem.getAttribute( name ),
+                       detail = typeof prop === "boolean" ?
+
+                               getSetInput && getSetAttribute ?
+                                       attr != null :
+                                       // oldIE fabricates an empty string for missing boolean attributes
+                                       // and conflates checked/selected into attroperties
+                                       ruseDefault.test( name ) ?
+                                               elem[ jQuery.camelCase( "default-" + name ) ] :
+                                               !!attr :
+
+                               // fetch an attribute node for properties not recognized as boolean
+                               elem.getAttributeNode( name );
+
+               return detail && detail.value !== false ?
+                       name.toLowerCase() :
+                       undefined;
+       },
+       set: function( elem, value, name ) {
+               if ( value === false ) {
+                       // Remove boolean attributes when set to false
+                       jQuery.removeAttr( elem, name );
+               } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+                       // IE<8 needs the *property* name
+                       elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+               // Use defaultChecked and defaultSelected for oldIE
+               } else {
+                       elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+               }
+
+               return name;
+       }
+};
+
+// fix oldIE value attroperty
+if ( !getSetInput || !getSetAttribute ) {
+       jQuery.attrHooks.value = {
+               get: function( elem, name ) {
+                       var ret = elem.getAttributeNode( name );
+                       return jQuery.nodeName( elem, "input" ) ?
+
+                               // Ignore the value *property* by using defaultValue
+                               elem.defaultValue :
+
+                               ret && ret.specified ? ret.value : undefined;
+               },
+               set: function( elem, value, name ) {
+                       if ( jQuery.nodeName( elem, "input" ) ) {
+                               // Does not return so that setAttribute is also used
+                               elem.defaultValue = value;
+                       } else {
+                               // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+                               return nodeHook && nodeHook.set( elem, value, name );
+                       }
+               }
+       };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !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 = elem.getAttributeNode( name );
+                       return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
+                               ret.value :
+                               undefined;
+               },
+               set: function( elem, value, name ) {
+                       // Set the existing or create a new attribute node
+                       var ret = elem.getAttributeNode( name );
+                       if ( !ret ) {
+                               elem.setAttributeNode(
+                                       (ret = elem.ownerDocument.createAttribute( name ))
+                               );
+                       }
+
+                       ret.value = value += "";
+
+                       // Break association with cloned elements by also using setAttribute (#9646)
+                       return name === "value" || value === elem.getAttribute( name ) ?
+                               value :
+                               undefined;
+               }
+       };
+
+       // 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 ) {
+                       nodeHook.set( elem, value === "" ? false : value, name );
+               }
+       };
+
+       // 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
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+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;
+                       }
+               });
+       });
+
+       // href/src property should get the full normalized URL (#10299/#12915)
+       jQuery.each([ "href", "src" ], function( i, name ) {
+               jQuery.propHooks[ name ] = {
+                       get: function( elem ) {
+                               return elem.getAttribute( name, 4 );
+                       }
+               };
+       });
+}
+
+if ( !jQuery.support.style ) {
+       jQuery.attrHooks.style = {
+               get: function( elem ) {
+                       // Return undefined in the case of empty string
+                       // Note: IE uppercases css property names, but if we were to .toLowerCase()
+                       // .cssText, that would destroy case senstitivity in URL's, like in "background"
+                       return elem.style.cssText || 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 = /^(?:input|select|textarea)$/i,
+       rkeyEvent = /^key/,
+       rmouseEvent = /^(?:mouse|contextmenu)|click/,
+       rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+       rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+       return true;
+}
+
+function returnFalse() {
+       return false;
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+       global: {},
+
+       add: function( elem, types, handler, data, selector ) {
+
+               var handleObjIn, eventHandle, tmp,
+                       events, t, handleObj,
+                       special, handlers, type, namespaces, origType,
+                       // Don't attach events to noData or text/comment nodes (but allow plain objects)
+                       elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem );
+
+               if ( !elemData ) {
+                       return;
+               }
+
+               // Caller can pass in an object of custom data in lieu of the handler
+               if ( handler.handler ) {
+                       handleObjIn = handler;
+                       handler = handleObjIn.handler;
+                       selector = handleObjIn.selector;
+               }
+
+               // 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
+               if ( !(events = elemData.events) ) {
+                       events = elemData.events = {};
+               }
+               if ( !(eventHandle = elemData.handle) ) {
+                       eventHandle = elemData.handle = 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 = ( types || "" ).match( core_rnotwhite ) || [""];
+               t = types.length;
+               while ( t-- ) {
+                       tmp = rtypenamespace.exec( types[t] ) || [];
+                       type = origType = tmp[1];
+                       namespaces = ( tmp[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: origType,
+                               data: data,
+                               handler: handler,
+                               guid: handler.guid,
+                               selector: selector,
+                               needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+                               namespace: namespaces.join(".")
+                       }, handleObjIn );
+
+                       // Init the event handler queue if we're the first
+                       if ( !(handlers = events[ type ]) ) {
+                               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;
+       },
+
+       // Detach an event or set of events from an element
+       remove: function( elem, types, handler, selector, mappedTypes ) {
+
+               var j, origCount, tmp,
+                       events, t, handleObj,
+                       special, handlers, type, namespaces, origType,
+                       elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+               if ( !elemData || !(events = elemData.events) ) {
+                       return;
+               }
+
+               // Once for each type.namespace in types; type may be omitted
+               types = ( types || "" ).match( core_rnotwhite ) || [""];
+               t = types.length;
+               while ( t-- ) {
+                       tmp = rtypenamespace.exec( types[t] ) || [];
+                       type = origType = tmp[1];
+                       namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+                       // 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;
+                       handlers = events[ type ] || [];
+                       tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+                       // Remove matching events
+                       origCount = j = handlers.length;
+                       while ( j-- ) {
+                               handleObj = handlers[ j ];
+
+                               if ( ( mappedTypes || origType === handleObj.origType ) &&
+                                       ( !handler || handler.guid === handleObj.guid ) &&
+                                       ( !tmp || tmp.test( handleObj.namespace ) ) &&
+                                       ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+                                       handlers.splice( j, 1 );
+
+                                       if ( handleObj.selector ) {
+                                               handlers.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 ( origCount && !handlers.length ) {
+                               if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+                                       jQuery.removeEvent( elem, type, elemData.handle );
+                               }
+
+                               delete events[ type ];
+                       }
+               }
+
+               // Remove the expando if it's no longer used
+               if ( jQuery.isEmptyObject( events ) ) {
+                       delete elemData.handle;
+
+                       // removeData also checks for emptiness and clears the expando if empty
+                       // so use it instead of delete
+                       jQuery._removeData( elem, "events" );
+               }
+       },
+
+       trigger: function( event, data, elem, onlyHandlers ) {
+
+               var i, cur, tmp, bubbleType, ontype, handle, special,
+                       eventPath = [ elem || document ],
+                       type = event.type || event,
+                       namespaces = event.namespace ? event.namespace.split(".") : [];
+
+               cur = tmp = elem = elem || document;
+
+               // Don't do events on text and comment nodes
+               if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+                       return;
+               }
+
+               // 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 ) {
+                       // Namespaced trigger; create a regexp to match event type in handle()
+                       namespaces = type.split(".");
+                       type = namespaces.shift();
+                       namespaces.sort();
+               }
+               ontype = type.indexOf(":") < 0 && "on" + type;
+
+               // Caller can pass in a jQuery.Event object, Object, or just an event type string
+               event = event[ jQuery.expando ] ?
+                       event :
+                       new jQuery.Event( type, typeof event === "object" && event );
+
+               event.isTrigger = true;
+               event.namespace = namespaces.join(".");
+               event.namespace_re = event.namespace ?
+                       new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+                       null;
+
+               // 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 ?
+                       [ event ] :
+                       jQuery.makeArray( data, [ event ] );
+
+               // Allow special events to draw outside the lines
+               special = jQuery.event.special[ type ] || {};
+               if ( !onlyHandlers && 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)
+               if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+                       bubbleType = special.delegateType || type;
+                       if ( !rfocusMorph.test( bubbleType + type ) ) {
+                               cur = cur.parentNode;
+                       }
+                       for ( ; cur; cur = cur.parentNode ) {
+                               eventPath.push( cur );
+                               tmp = cur;
+                       }
+
+                       // Only add window if we got to document (e.g., not plain obj or detached DOM)
+                       if ( tmp === (elem.ownerDocument || document) ) {
+                               eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+                       }
+               }
+
+               // Fire handlers on the event path
+               i = 0;
+               while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+                       event.type = i > 1 ?
+                               bubbleType :
+                               special.bindType || type;
+
+                       // jQuery handler
+                       handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+                       if ( handle ) {
+                               handle.apply( cur, data );
+                       }
+
+                       // Native handler
+                       handle = ontype && cur[ ontype ];
+                       if ( handle && jQuery.acceptData( cur ) && handle.apply && 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)
+                               if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+                                       // Don't re-trigger an onFOO event when we call its FOO() method
+                                       tmp = elem[ ontype ];
+
+                                       if ( tmp ) {
+                                               elem[ ontype ] = null;
+                                       }
+
+                                       // Prevent re-triggering of the same event, since we already bubbled it above
+                                       jQuery.event.triggered = type;
+                                       try {
+                                               elem[ type ]();
+                                       } catch ( e ) {
+                                               // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+                                               // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+                                       }
+                                       jQuery.event.triggered = undefined;
+
+                                       if ( tmp ) {
+                                               elem[ ontype ] = tmp;
+                                       }
+                               }
+                       }
+               }
+
+               return event.result;
+       },
+
+       dispatch: function( event ) {
+
+               // Make a writable jQuery.Event from the native event object
+               event = jQuery.event.fix( event );
+
+               var i, j, ret, matched, handleObj,
+                       handlerQueue = [],
+                       args = core_slice.call( arguments ),
+                       handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+                       special = jQuery.event.special[ event.type ] || {};
+
+               // Use the fix-ed jQuery.Event rather than the (read-only) native event
+               args[0] = event;
+               event.delegateTarget = this;
+
+               // Call the preDispatch hook for the mapped type, and let it bail if desired
+               if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+                       return;
+               }
+
+               // Determine handlers
+               handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+               // Run delegates first; they may want to stop propagation beneath us
+               i = 0;
+               while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+                       event.currentTarget = matched.elem;
+
+                       j = 0;
+                       while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+                               // Triggered event must either 1) have no namespace, or
+                               // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+                               if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+                                       event.handleObj = handleObj;
+                                       event.data = handleObj.data;
+
+                                       ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+                                                       .apply( matched.elem, args );
+
+                                       if ( ret !== undefined ) {
+                                               if ( (event.result = ret) === false ) {
+                                                       event.preventDefault();
+                                                       event.stopPropagation();
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               // Call the postDispatch hook for the mapped type
+               if ( special.postDispatch ) {
+                       special.postDispatch.call( this, event );
+               }
+
+               return event.result;
+       },
+
+       handlers: function( event, handlers ) {
+               var i, matches, sel, handleObj,
+                       handlerQueue = [],
+                       delegateCount = handlers.delegateCount,
+                       cur = event.target;
+
+               // Find delegate handlers
+               // Black-hole SVG <use> instance trees (#13180)
+               // Avoid non-left-click bubbling in Firefox (#3861)
+               if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+                       for ( ; cur != this; cur = cur.parentNode || this ) {
+
+                               // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+                               if ( cur.disabled !== true || event.type !== "click" ) {
+                                       matches = [];
+                                       for ( i = 0; i < delegateCount; i++ ) {
+                                               handleObj = handlers[ i ];
+
+                                               // Don't conflict with Object.prototype properties (#13203)
+                                               sel = handleObj.selector + " ";
+
+                                               if ( matches[ sel ] === undefined ) {
+                                                       matches[ sel ] = handleObj.needsContext ?
+                                                               jQuery( sel, this ).index( cur ) >= 0 :
+                                                               jQuery.find( sel, this, null, [ cur ] ).length;
+                                               }
+                                               if ( matches[ sel ] ) {
+                                                       matches.push( handleObj );
+                                               }
+                                       }
+                                       if ( matches.length ) {
+                                               handlerQueue.push({ elem: cur, handlers: matches });
+                                       }
+                               }
+                       }
+               }
+
+               // Add the remaining (directly-bound) handlers
+               if ( delegateCount < handlers.length ) {
+                       handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+               }
+
+               return handlerQueue;
+       },
+
+       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 = new jQuery.Event( originalEvent );
+
+               i = copy.length;
+               while ( i-- ) {
+                       prop = copy[ i ];
+                       event[ prop ] = originalEvent[ prop ];
+               }
+
+               // Support: IE<9
+               // Fix target property (#1925)
+               if ( !event.target ) {
+                       event.target = originalEvent.srcElement || document;
+               }
+
+               // Support: Chrome 23+, Safari?
+               // Target should not be a text node (#504, #13143)
+               if ( event.target.nodeType === 3 ) {
+                       event.target = event.target.parentNode;
+               }
+
+               // Support: IE<9
+               // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+               event.metaKey = !!event.metaKey;
+
+               return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+       },
+
+       // Includes some event props shared by KeyEvent and MouseEvent
+       props: "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;
+               }
+       },
+
+       special: {
+               load: {
+                       // Prevent triggered image.load events from bubbling to window.load
+                       noBubble: true
+               },
+               click: {
+                       // For checkbox, fire native event so checked state will be right
+                       trigger: function() {
+                               if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+                                       this.click();
+                                       return false;
+                               }
+                       }
+               },
+               focus: {
+                       // Fire native event if possible so blur/focus sequence is correct
+                       trigger: function() {
+                               if ( this !== document.activeElement && this.focus ) {
+                                       try {
+                                               this.focus();
+                                               return false;
+                                       } catch ( e ) {
+                                               // Support: IE<9
+                                               // If we error on focus to hidden element (#1486, #12518),
+                                               // let .trigger() run the handlers
+                                       }
+                               }
+                       },
+                       delegateType: "focusin"
+               },
+               blur: {
+                       trigger: function() {
+                               if ( this === document.activeElement && this.blur ) {
+                                       this.blur();
+                                       return false;
+                               }
+                       },
+                       delegateType: "focusout"
+               },
+
+               beforeunload: {
+                       postDispatch: function( event ) {
+
+                               // Even when returnValue equals to undefined Firefox will still show alert
+                               if ( event.result !== undefined ) {
+                                       event.originalEvent.returnValue = event.result;
+                               }
+                       }
+               }
+       },
+
+       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();
+               }
+       }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+       function( elem, type, handle ) {
+               if ( elem.removeEventListener ) {
+                       elem.removeEventListener( type, handle, false );
+               }
+       } :
+       function( elem, type, handle ) {
+               var name = "on" + type;
+
+               if ( elem.detachEvent ) {
+
+                       // #8545, #7054, preventing memory leaks for custom events in IE6-8
+                       // detachEvent needed property on element, by name of that event, to properly expose it to GC
+                       if ( typeof elem[ name ] === "undefined" ) {
+                               elem[ name ] = null;
+                       }
+
+                       elem.detachEvent( name, 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;
+};
+
+// 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 = {
+       isDefaultPrevented: returnFalse,
+       isPropagationStopped: returnFalse,
+       isImmediatePropagationStopped: returnFalse,
+
+       preventDefault: function() {
+               var e = this.originalEvent;
+
+               this.isDefaultPrevented = returnTrue;
+               if ( !e ) {
+                       return;
+               }
+
+               // If preventDefault exists, run it on the original event
+               if ( e.preventDefault ) {
+                       e.preventDefault();
+
+               // Support: IE
+               // Otherwise set the returnValue property of the original event to false
+               } else {
+                       e.returnValue = false;
+               }
+       },
+       stopPropagation: function() {
+               var e = this.originalEvent;
+
+               this.isPropagationStopped = returnTrue;
+               if ( !e ) {
+                       return;
+               }
+               // If stopPropagation exists, run it on the original event
+               if ( e.stopPropagation ) {
+                       e.stopPropagation();
+               }
+
+               // Support: IE
+               // Set the cancelBubble property of the original event to true
+               e.cancelBubble = true;
+       },
+       stopImmediatePropagation: function() {
+               this.isImmediatePropagationStopped = returnTrue;
+               this.stopPropagation();
+       }
+};
+
+// 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 ret,
+                               target = this,
+                               related = event.relatedTarget,
+                               handleObj = event.handleObj;
+
+                       // 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 && !jQuery._data( form, "submitBubbles" ) ) {
+                                       jQuery.event.add( form, "submit._submit", function( event ) {
+                                               event._submit_bubble = true;
+                                       });
+                                       jQuery._data( form, "submitBubbles", true );
+                               }
+                       });
+                       // return undefined since we don't need an event listener
+               },
+
+               postDispatch: function( event ) {
+                       // If form was submitted by the user, bubble the event up the tree
+                       if ( event._submit_bubble ) {
+                               delete event._submit_bubble;
+                               if ( this.parentNode && !event.isTrigger ) {
+                                       jQuery.event.simulate( "submit", this.parentNode, event, true );
+                               }
+                       }
+               },
+
+               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;
+                                               }
+                                               // Allow triggered, simulated change events (#11500)
+                                               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 ) && !jQuery._data( elem, "changeBubbles" ) ) {
+                                       jQuery.event.add( elem, "change._change", function( event ) {
+                                               if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+                                                       jQuery.event.simulate( "change", this.parentNode, event, true );
+                                               }
+                                       });
+                                       jQuery._data( elem, "changeBubbles", 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 = 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( types, selector, data, fn, 1 );
+       },
+       off: function( types, selector, fn ) {
+               var handleObj, type;
+               if ( types && types.preventDefault && types.handleObj ) {
+                       // ( event )  dispatched jQuery.Event
+                       handleObj = types.handleObj;
+                       jQuery( types.delegateTarget ).off(
+                               handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+                               handleObj.selector,
+                               handleObj.handler
+                       );
+                       return this;
+               }
+               if ( typeof types === "object" ) {
+                       // ( types-object [, selector] )
+                       for ( 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 );
+       },
+
+       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 ) {
+               var elem = this[0];
+               if ( elem ) {
+                       return jQuery.event.trigger( type, data, elem, true );
+               }
+       },
+
+       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 ) {
+               return arguments.length > 0 ?
+                       this.on( name, null, data, fn ) :
+                       this.trigger( name );
+       };
+
+       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 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://sizzlejs.com/
+ */
+(function( window, undefined ) {
+
+var i,
+       cachedruns,
+       Expr,
+       getText,
+       isXML,
+       compile,
+       hasDuplicate,
+       outermostContext,
+
+       // Local document vars
+       setDocument,
+       document,
+       docElem,
+       documentIsXML,
+       rbuggyQSA,
+       rbuggyMatches,
+       matches,
+       contains,
+       sortOrder,
+
+       // Instance-specific data
+       expando = "sizzle" + -(new Date()),
+       preferredDoc = window.document,
+       support = {},
+       dirruns = 0,
+       done = 0,
+       classCache = createCache(),
+       tokenCache = createCache(),
+       compilerCache = createCache(),
+
+       // General-purpose constants
+       strundefined = typeof undefined,
+       MAX_NEGATIVE = 1 << 31,
+
+       // Array methods
+       arr = [],
+       pop = arr.pop,
+       push = arr.push,
+       slice = arr.slice,
+       // Use a stripped-down indexOf if we can't use a native one
+       indexOf = arr.indexOf || function( elem ) {
+               var i = 0,
+                       len = this.length;
+               for ( ; i < len; i++ ) {
+                       if ( this[i] === elem ) {
+                               return i;
+                       }
+               }
+               return -1;
+       },
+
+
+       // Regular expressions
+
+       // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+       whitespace = "[\\x20\\t\\r\\n\\f]",
+       // http://www.w3.org/TR/css3-syntax/#characters
+       characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+       // Loosely modeled on CSS identifier characters
+       // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+       // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+       identifier = characterEncoding.replace( "w", "w#" ),
+
+       // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+       operators = "([*^$|!~]?=)",
+       attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+               "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+       // Prefer arguments quoted,
+       //   then not containing pseudos/brackets,
+       //   then attribute selectors/non-parenthetical expressions,
+       //   then anything else
+       // These preferences are here to reduce the number of selectors
+       //   needing tokenize in the PSEUDO preFilter
+       pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+       // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+       rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+       rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+       rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
+       rpseudo = new RegExp( pseudos ),
+       ridentifier = new RegExp( "^" + identifier + "$" ),
+
+       matchExpr = {
+               "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+               "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+               "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
+               "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+               "ATTR": new RegExp( "^" + attributes ),
+               "PSEUDO": new RegExp( "^" + pseudos ),
+               "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+                       "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+                       "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+               // For use in libraries implementing .is()
+               // We use this for POS matching in `select`
+               "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+                       whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+       },
+
+       rsibling = /[\x20\t\r\n\f]*[+~]/,
+
+       rnative = /\{\s*\[native code\]\s*\}/,
+
+       // Easily-parseable/retrievable ID or TAG or CLASS selectors
+       rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+       rinputs = /^(?:input|select|textarea|button)$/i,
+       rheader = /^h\d$/i,
+
+       rescape = /'|\\/g,
+       rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
+
+       // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+       runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
+       funescape = function( _, escaped ) {
+               var high = "0x" + escaped - 0x10000;
+               // NaN means non-codepoint
+               return high !== high ?
+                       escaped :
+                       // BMP codepoint
+                       high < 0 ?
+                               String.fromCharCode( high + 0x10000 ) :
+                               // Supplemental Plane codepoint (surrogate pair)
+                               String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+       };
+
+// Use a stripped-down slice if we can't use a native one
+try {
+       slice.call( docElem.childNodes, 0 )[0].nodeType;
+} catch ( e ) {
+       slice = function( i ) {
+               var elem,
+                       results = [];
+               for ( ; (elem = this[i]); i++ ) {
+                       results.push( elem );
+               }
+               return results;
+       };
+}
+
+/**
+ * For feature detection
+ * @param {Function} fn The function to test for native support
+ */
+function isNative( fn ) {
+       return rnative.test( fn + "" );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ *     property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ *     deleting the oldest entry
+ */
+function createCache() {
+       var cache,
+               keys = [];
+
+       return (cache = function( key, value ) {
+               // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+               if ( keys.push( key += " " ) > Expr.cacheLength ) {
+                       // Only keep the most recent entries
+                       delete cache[ keys.shift() ];
+               }
+               return (cache[ key ] = value);
+       });
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+       fn[ expando ] = true;
+       return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+       var div = document.createElement("div");
+
+       try {
+               return fn( div );
+       } catch (e) {
+               return false;
+       } finally {
+               // release memory in IE
+               div = null;
+       }
+}
+
+function Sizzle( selector, context, results, seed ) {
+       var match, elem, m, nodeType,
+               // QSA vars
+               i, groups, old, nid, newContext, newSelector;
+
+       if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+               setDocument( context );
+       }
+
+       context = context || document;
+       results = results || [];
+
+       if ( !selector || typeof selector !== "string" ) {
+               return results;
+       }
+
+       if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+               return [];
+       }
+
+       if ( !documentIsXML && !seed ) {
+
+               // Shortcuts
+               if ( (match = rquickExpr.exec( selector )) ) {
+                       // Speed-up: Sizzle("#ID")
+                       if ( (m = match[1]) ) {
+                               if ( nodeType === 9 ) {
+                                       elem = context.getElementById( m );
+                                       // 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, Opera, and Webkit return items
+                                               // by name instead of ID
+                                               if ( elem.id === m ) {
+                                                       results.push( elem );
+                                                       return results;
+                                               }
+                                       } else {
+                                               return results;
+                                       }
+                               } else {
+                                       // Context is not a document
+                                       if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+                                               contains( context, elem ) && elem.id === m ) {
+                                               results.push( elem );
+                                               return results;
+                                       }
+                               }
+
+                       // Speed-up: Sizzle("TAG")
+                       } else if ( match[2] ) {
+                               push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
+                               return results;
+
+                       // Speed-up: Sizzle(".CLASS")
+                       } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
+                               push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
+                               return results;
+                       }
+               }
+
+               // QSA path
+               if ( support.qsa && !rbuggyQSA.test(selector) ) {
+                       old = true;
+                       nid = expando;
+                       newContext = context;
+                       newSelector = nodeType === 9 && selector;
+
+                       // 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
+                       if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+                               groups = tokenize( selector );
+
+                               if ( (old = context.getAttribute("id")) ) {
+                                       nid = old.replace( rescape, "\\$&" );
+                               } else {
+                                       context.setAttribute( "id", nid );
+                               }
+                               nid = "[id='" + nid + "'] ";
+
+                               i = groups.length;
+                               while ( i-- ) {
+                                       groups[i] = nid + toSelector( groups[i] );
+                               }
+                               newContext = rsibling.test( selector ) && context.parentNode || context;
+                               newSelector = groups.join(",");
+                       }
+
+                       if ( newSelector ) {
+                               try {
+                                       push.apply( results, slice.call( newContext.querySelectorAll(
+                                               newSelector
+                                       ), 0 ) );
+                                       return results;
+                               } catch(qsaError) {
+                               } finally {
+                                       if ( !old ) {
+                                               context.removeAttribute("id");
+                                       }
+                               }
+                       }
+               }
+       }
+
+       // All others
+       return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = 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).documentElement;
+       return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+       var doc = node ? node.ownerDocument || node : preferredDoc;
+
+       // If no document and documentElement is available, return
+       if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+               return document;
+       }
+
+       // Set our document
+       document = doc;
+       docElem = doc.documentElement;
+
+       // Support tests
+       documentIsXML = isXML( doc );
+
+       // Check if getElementsByTagName("*") returns only elements
+       support.tagNameNoComments = assert(function( div ) {
+               div.appendChild( doc.createComment("") );
+               return !div.getElementsByTagName("*").length;
+       });
+
+       // Check if attributes should be retrieved by attribute nodes
+       support.attributes = assert(function( div ) {
+               div.innerHTML = "<select></select>";
+               var type = typeof div.lastChild.getAttribute("multiple");
+               // IE8 returns a string for some attributes even when not present
+               return type !== "boolean" && type !== "string";
+       });
+
+       // Check if getElementsByClassName can be trusted
+       support.getByClassName = assert(function( div ) {
+               // Opera can't find a second classname (in 9.6)
+               div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
+               if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
+                       return false;
+               }
+
+               // Safari 3.2 caches class attributes and doesn't catch changes
+               div.lastChild.className = "e";
+               return div.getElementsByClassName("e").length === 2;
+       });
+
+       // Check if getElementById returns elements by name
+       // Check if getElementsByName privileges form controls or returns elements by ID
+       support.getByName = assert(function( div ) {
+               // Inject content
+               div.id = expando + 0;
+               div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
+               docElem.insertBefore( div, docElem.firstChild );
+
+               // Test
+               var pass = doc.getElementsByName &&
+                       // buggy browsers will return fewer than the correct 2
+                       doc.getElementsByName( expando ).length === 2 +
+                       // buggy browsers will return more than the correct 0
+                       doc.getElementsByName( expando + 0 ).length;
+               support.getIdNotName = !doc.getElementById( expando );
+
+               // Cleanup
+               docElem.removeChild( div );
+
+               return pass;
+       });
+
+       // IE6/7 return modified attributes
+       Expr.attrHandle = assert(function( div ) {
+               div.innerHTML = "<a href='#'></a>";
+               return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
+                       div.firstChild.getAttribute("href") === "#";
+       }) ?
+               {} :
+               {
+                       "href": function( elem ) {
+                               return elem.getAttribute( "href", 2 );
+                       },
+                       "type": function( elem ) {
+                               return elem.getAttribute("type");
+                       }
+               };
+
+       // ID find and filter
+       if ( support.getIdNotName ) {
+               Expr.find["ID"] = function( id, context ) {
+                       if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
+                               var m = context.getElementById( id );
+                               // Check parentNode to catch when Blackberry 4.6 returns
+                               // nodes that are no longer in the document #6963
+                               return m && m.parentNode ? [m] : [];
+                       }
+               };
+               Expr.filter["ID"] = function( id ) {
+                       var attrId = id.replace( runescape, funescape );
+                       return function( elem ) {
+                               return elem.getAttribute("id") === attrId;
+                       };
+               };
+       } else {
+               Expr.find["ID"] = function( id, context ) {
+                       if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
+                               var m = context.getElementById( id );
+
+                               return m ?
+                                       m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
+                                               [m] :
+                                               undefined :
+                                       [];
+                       }
+               };
+               Expr.filter["ID"] =  function( id ) {
+                       var attrId = id.replace( runescape, funescape );
+                       return function( elem ) {
+                               var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+                               return node && node.value === attrId;
+                       };
+               };
+       }
+
+       // Tag
+       Expr.find["TAG"] = support.tagNameNoComments ?
+               function( tag, context ) {
+                       if ( typeof context.getElementsByTagName !== strundefined ) {
+                               return context.getElementsByTagName( tag );
+                       }
+               } :
+               function( tag, context ) {
+                       var elem,
+                               tmp = [],
+                               i = 0,
+                               results = context.getElementsByTagName( tag );
+
+                       // Filter out possible comments
+                       if ( tag === "*" ) {
+                               for ( ; (elem = results[i]); i++ ) {
+                                       if ( elem.nodeType === 1 ) {
+                                               tmp.push( elem );
+                                       }
+                               }
+
+                               return tmp;
+                       }
+                       return results;
+               };
+
+       // Name
+       Expr.find["NAME"] = support.getByName && function( tag, context ) {
+               if ( typeof context.getElementsByName !== strundefined ) {
+                       return context.getElementsByName( name );
+               }
+       };
+
+       // Class
+       Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
+               if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
+                       return context.getElementsByClassName( className );
+               }
+       };
+
+       // QSA and matchesSelector support
+
+       // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+       rbuggyMatches = [];
+
+       // qSa(:focus) reports false when true (Chrome 21),
+       // no need to also add to buggyMatches since matches checks buggyQSA
+       // A support test would require too much code (would include document ready)
+       rbuggyQSA = [ ":focus" ];
+
+       if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
+               // Build QSA regex
+               // Regex strategy adopted from Diego Perini
+               assert(function( div ) {
+                       // Select is set to empty string on purpose
+                       // This is to test IE's treatment of not explictly
+                       // setting a boolean content attribute,
+                       // since its presence should be enough
+                       // http://bugs.jquery.com/ticket/12359
+                       div.innerHTML = "<select><option selected=''></option></select>";
+
+                       // IE8 - Some boolean attributes are not treated correctly
+                       if ( !div.querySelectorAll("[selected]").length ) {
+                               rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
+                       }
+
+                       // Webkit/Opera - :checked should return selected option elements
+                       // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+                       // IE8 throws error here and will not see later tests
+                       if ( !div.querySelectorAll(":checked").length ) {
+                               rbuggyQSA.push(":checked");
+                       }
+               });
+
+               assert(function( div ) {
+
+                       // Opera 10-12/IE8 - ^= $= *= and empty values
+                       // Should not select anything
+                       div.innerHTML = "<input type='hidden' i=''/>";
+                       if ( div.querySelectorAll("[i^='']").length ) {
+                               rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
+                       }
+
+                       // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+                       // IE8 throws error here and will not see later tests
+                       if ( !div.querySelectorAll(":enabled").length ) {
+                               rbuggyQSA.push( ":enabled", ":disabled" );
+                       }
+
+                       // Opera 10-11 does not throw on post-comma invalid pseudos
+                       div.querySelectorAll("*,:x");
+                       rbuggyQSA.push(",.*:");
+               });
+       }
+
+       if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
+               docElem.mozMatchesSelector ||
+               docElem.webkitMatchesSelector ||
+               docElem.oMatchesSelector ||
+               docElem.msMatchesSelector) )) ) {
+
+               assert(function( div ) {
+                       // Check to see if it's possible to do matchesSelector
+                       // on a disconnected node (IE 9)
+                       support.disconnectedMatch = matches.call( div, "div" );
+
+                       // This should fail with an exception
+                       // Gecko does not error, returns false instead
+                       matches.call( div, "[s!='']:x" );
+                       rbuggyMatches.push( "!=", pseudos );
+               });
+       }
+
+       rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
+       rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
+
+       // Element contains another
+       // Purposefully does not implement inclusive descendent
+       // As in, an element does not contain itself
+       contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
+               function( a, b ) {
+                       var adown = a.nodeType === 9 ? a.documentElement : a,
+                               bup = b && b.parentNode;
+                       return a === bup || !!( bup && bup.nodeType === 1 && (
+                               adown.contains ?
+                                       adown.contains( bup ) :
+                                       a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+                       ));
+               } :
+               function( a, b ) {
+                       if ( b ) {
+                               while ( (b = b.parentNode) ) {
+                                       if ( b === a ) {
+                                               return true;
+                                       }
+                               }
+                       }
+                       return false;
+               };
+
+       // Document order sorting
+       sortOrder = docElem.compareDocumentPosition ?
+       function( a, b ) {
+               var compare;
+
+               if ( a === b ) {
+                       hasDuplicate = true;
+                       return 0;
+               }
+
+               if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
+                       if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
+                               if ( a === doc || contains( preferredDoc, a ) ) {
+                                       return -1;
+                               }
+                               if ( b === doc || contains( preferredDoc, b ) ) {
+                                       return 1;
+                               }
+                               return 0;
+                       }
+                       return compare & 4 ? -1 : 1;
+               }
+
+               return a.compareDocumentPosition ? -1 : 1;
+       } :
+       function( a, b ) {
+               var cur,
+                       i = 0,
+                       aup = a.parentNode,
+                       bup = b.parentNode,
+                       ap = [ a ],
+                       bp = [ 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 ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE );
+
+               // Parentless nodes are either documents or disconnected
+               } else if ( !aup || !bup ) {
+                       return a === doc ? -1 :
+                               b === doc ? 1 :
+                               aup ? -1 :
+                               bup ? 1 :
+                               0;
+
+               // If the nodes are siblings, we can do a quick check
+               } else if ( aup === bup ) {
+                       return siblingCheck( a, b );
+               }
+
+               // Otherwise we need full lists of their ancestors for comparison
+               cur = a;
+               while ( (cur = cur.parentNode) ) {
+                       ap.unshift( cur );
+               }
+               cur = b;
+               while ( (cur = cur.parentNode) ) {
+                       bp.unshift( cur );
+               }
+
+               // Walk down the tree looking for a discrepancy
+               while ( ap[i] === bp[i] ) {
+                       i++;
+               }
+
+               return i ?
+                       // Do a sibling check if the nodes have a common ancestor
+                       siblingCheck( ap[i], bp[i] ) :
+
+                       // Otherwise nodes in our document sort first
+                       ap[i] === preferredDoc ? -1 :
+                       bp[i] === preferredDoc ? 1 :
+                       0;
+       };
+
+       // Always assume the presence of duplicates if sort doesn't
+       // pass them to our comparison function (as in Google Chrome).
+       hasDuplicate = false;
+       [0, 0].sort( sortOrder );
+       support.detectDuplicates = hasDuplicate;
+
+       return document;
+};
+
+Sizzle.matches = function( expr, elements ) {
+       return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+       // Set document vars if needed
+       if ( ( elem.ownerDocument || elem ) !== document ) {
+               setDocument( elem );
+       }
+
+       // Make sure that attribute selectors are quoted
+       expr = expr.replace( rattributeQuotes, "='$1']" );
+
+       // rbuggyQSA always contains :focus, so no need for an existence check
+       if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
+               try {
+                       var ret = matches.call( elem, expr );
+
+                       // IE 9's matchesSelector returns false on disconnected nodes
+                       if ( ret || support.disconnectedMatch ||
+                                       // As well, disconnected nodes are said to be in a document
+                                       // fragment in IE 9
+                                       elem.document && elem.document.nodeType !== 11 ) {
+                               return ret;
+                       }
+               } catch(e) {}
+       }
+
+       return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+       // Set document vars if needed
+       if ( ( context.ownerDocument || context ) !== document ) {
+               setDocument( context );
+       }
+       return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+       var val;
+
+       // Set document vars if needed
+       if ( ( elem.ownerDocument || elem ) !== document ) {
+               setDocument( elem );
+       }
+
+       if ( !documentIsXML ) {
+               name = name.toLowerCase();
+       }
+       if ( (val = Expr.attrHandle[ name ]) ) {
+               return val( elem );
+       }
+       if ( documentIsXML || support.attributes ) {
+               return elem.getAttribute( name );
+       }
+       return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
+               name :
+               val && val.specified ? val.value : null;
+};
+
+Sizzle.error = function( msg ) {
+       throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+// Document sorting and removing duplicates
+Sizzle.uniqueSort = function( results ) {
+       var elem,
+               duplicates = [],
+               i = 1,
+               j = 0;
+
+       // Unless we *know* we can detect duplicates, assume their presence
+       hasDuplicate = !support.detectDuplicates;
+       results.sort( sortOrder );
+
+       if ( hasDuplicate ) {
+               for ( ; (elem = results[i]); i++ ) {
+                       if ( elem === results[ i - 1 ] ) {
+                               j = duplicates.push( i );
+                       }
+               }
+               while ( j-- ) {
+                       results.splice( duplicates[ j ], 1 );
+               }
+       }
+
+       return results;
+};
+
+function siblingCheck( a, b ) {
+       var cur = a && b && a.nextSibling;
+
+       for ( ; cur; cur = cur.nextSibling ) {
+               if ( cur === b ) {
+                       return -1;
+               }
+       }
+
+       return a ? 1 : -1;
+}
+
+// Returns a function to use in pseudos for input types
+function createInputPseudo( type ) {
+       return function( elem ) {
+               var name = elem.nodeName.toLowerCase();
+               return name === "input" && elem.type === type;
+       };
+}
+
+// Returns a function to use in pseudos for buttons
+function createButtonPseudo( type ) {
+       return function( elem ) {
+               var name = elem.nodeName.toLowerCase();
+               return (name === "input" || name === "button") && elem.type === type;
+       };
+}
+
+// Returns a function to use in pseudos for positionals
+function createPositionalPseudo( fn ) {
+       return markFunction(function( argument ) {
+               argument = +argument;
+               return markFunction(function( seed, matches ) {
+                       var j,
+                               matchIndexes = fn( [], seed.length, argument ),
+                               i = matchIndexes.length;
+
+                       // Match elements found at the specified indexes
+                       while ( i-- ) {
+                               if ( seed[ (j = matchIndexes[i]) ] ) {
+                                       seed[j] = !(matches[j] = seed[j]);
+                               }
+                       }
+               });
+       });
+}
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+       var node,
+               ret = "",
+               i = 0,
+               nodeType = elem.nodeType;
+
+       if ( !nodeType ) {
+               // If no nodeType, this is expected to be an array
+               for ( ; (node = elem[i]); i++ ) {
+                       // Do not traverse comment nodes
+                       ret += getText( node );
+               }
+       } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+               // Use textContent for elements
+               // innerText usage removed for consistency of new lines (see #11153)
+               if ( typeof elem.textContent === "string" ) {
+                       return elem.textContent;
+               } else {
+                       // Traverse its children
+                       for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+                               ret += getText( elem );
+                       }
+               }
+       } else if ( nodeType === 3 || nodeType === 4 ) {
+               return elem.nodeValue;
+       }
+       // Do not include comment or processing instruction nodes
+
+       return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+       // Can be adjusted by the user
+       cacheLength: 50,
+
+       createPseudo: markFunction,
+
+       match: matchExpr,
+
+       find: {},
+
+       relative: {
+               ">": { dir: "parentNode", first: true },
+               " ": { dir: "parentNode" },
+               "+": { dir: "previousSibling", first: true },
+               "~": { dir: "previousSibling" }
+       },
+
+       preFilter: {
+               "ATTR": function( match ) {
+                       match[1] = match[1].replace( runescape, funescape );
+
+                       // Move the given value to match[3] whether quoted or unquoted
+                       match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+                       if ( match[2] === "~=" ) {
+                               match[3] = " " + match[3] + " ";
+                       }
+
+                       return match.slice( 0, 4 );
+               },
+
+               "CHILD": function( match ) {
+                       /* matches from matchExpr["CHILD"]
+                               1 type (only|nth|...)
+                               2 what (child|of-type)
+                               3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+                               4 xn-component of xn+y argument ([+-]?\d*n|)
+                               5 sign of xn-component
+                               6 x of xn-component
+                               7 sign of y-component
+                               8 y of y-component
+                       */
+                       match[1] = match[1].toLowerCase();
+
+                       if ( match[1].slice( 0, 3 ) === "nth" ) {
+                               // nth-* requires argument
+                               if ( !match[3] ) {
+                                       Sizzle.error( match[0] );
+                               }
+
+                               // numeric x and y parameters for Expr.filter.CHILD
+                               // remember that false/true cast respectively to 0/1
+                               match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+                               match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+                       // other types prohibit arguments
+                       } else if ( match[3] ) {
+                               Sizzle.error( match[0] );
+                       }
+
+                       return match;
+               },
+
+               "PSEUDO": function( match ) {
+                       var excess,
+                               unquoted = !match[5] && match[2];
+
+                       if ( matchExpr["CHILD"].test( match[0] ) ) {
+                               return null;
+                       }
+
+                       // Accept quoted arguments as-is
+                       if ( match[4] ) {
+                               match[2] = match[4];
+
+                       // Strip excess characters from unquoted arguments
+                       } else if ( unquoted && rpseudo.test( unquoted ) &&
+                               // Get excess from tokenize (recursively)
+                               (excess = tokenize( unquoted, true )) &&
+                               // advance to the next closing parenthesis
+                               (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+                               // excess is a negative index
+                               match[0] = match[0].slice( 0, excess );
+                               match[2] = unquoted.slice( 0, excess );
+                       }
+
+                       // Return only captures needed by the pseudo filter method (type and argument)
+                       return match.slice( 0, 3 );
+               }
+       },
+
+       filter: {
+
+               "TAG": function( nodeName ) {
+                       if ( nodeName === "*" ) {
+                               return function() { return true; };
+                       }
+
+                       nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
+                       return function( elem ) {
+                               return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+                       };
+               },
+
+               "CLASS": function( className ) {
+                       var pattern = classCache[ className + " " ];
+
+                       return pattern ||
+                               (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+                               classCache( className, function( elem ) {
+                                       return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
+                               });
+               },
+
+               "ATTR": function( name, operator, check ) {
+                       return function( elem ) {
+                               var result = Sizzle.attr( elem, name );
+
+                               if ( result == null ) {
+                                       return operator === "!=";
+                               }
+                               if ( !operator ) {
+                                       return true;
+                               }
+
+                               result += "";
+
+                               return operator === "=" ? result === check :
+                                       operator === "!=" ? result !== check :
+                                       operator === "^=" ? check && result.indexOf( check ) === 0 :
+                                       operator === "*=" ? check && result.indexOf( check ) > -1 :
+                                       operator === "$=" ? check && result.substr( result.length - check.length ) === check :
+                                       operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+                                       operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
+                                       false;
+                       };
+               },
+
+               "CHILD": function( type, what, argument, first, last ) {
+                       var simple = type.slice( 0, 3 ) !== "nth",
+                               forward = type.slice( -4 ) !== "last",
+                               ofType = what === "of-type";
+
+                       return first === 1 && last === 0 ?
+
+                               // Shortcut for :nth-*(n)
+                               function( elem ) {
+                                       return !!elem.parentNode;
+                               } :
+
+                               function( elem, context, xml ) {
+                                       var cache, outerCache, node, diff, nodeIndex, start,
+                                               dir = simple !== forward ? "nextSibling" : "previousSibling",
+                                               parent = elem.parentNode,
+                                               name = ofType && elem.nodeName.toLowerCase(),
+                                               useCache = !xml && !ofType;
+
+                                       if ( parent ) {
+
+                                               // :(first|last|only)-(child|of-type)
+                                               if ( simple ) {
+                                                       while ( dir ) {
+                                                               node = elem;
+                                                               while ( (node = node[ dir ]) ) {
+                                                                       if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+                                                                               return false;
+                                                                       }
+                                                               }
+                                                               // Reverse direction for :only-* (if we haven't yet done so)
+                                                               start = dir = type === "only" && !start && "nextSibling";
+                                                       }
+                                                       return true;
+                                               }
+
+                                               start = [ forward ? parent.firstChild : parent.lastChild ];
+
+                                               // non-xml :nth-child(...) stores cache data on `parent`
+                                               if ( forward && useCache ) {
+                                                       // Seek `elem` from a previously-cached index
+                                                       outerCache = parent[ expando ] || (parent[ expando ] = {});
+                                                       cache = outerCache[ type ] || [];
+                                                       nodeIndex = cache[0] === dirruns && cache[1];
+                                                       diff = cache[0] === dirruns && cache[2];
+                                                       node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+                                                       while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+                                                               // Fallback to seeking `elem` from the start
+                                                               (diff = nodeIndex = 0) || start.pop()) ) {
+
+                                                               // When found, cache indexes on `parent` and break
+                                                               if ( node.nodeType === 1 && ++diff && node === elem ) {
+                                                                       outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+                                                                       break;
+                                                               }
+                                                       }
+
+                                               // Use previously-cached element index if available
+                                               } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+                                                       diff = cache[1];
+
+                                               // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+                                               } else {
+                                                       // Use the same loop as above to seek `elem` from the start
+                                                       while ( (node = ++nodeIndex && node && node[ dir ] ||
+                                                               (diff = nodeIndex = 0) || start.pop()) ) {
+
+                                                               if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+                                                                       // Cache the index of each encountered element
+                                                                       if ( useCache ) {
+                                                                               (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+                                                                       }
+
+                                                                       if ( node === elem ) {
+                                                                               break;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+
+                                               // Incorporate the offset, then check against cycle size
+                                               diff -= last;
+                                               return diff === first || ( diff % first === 0 && diff / first >= 0 );
+                                       }
+                               };
+               },
+
+               "PSEUDO": function( pseudo, argument ) {
+                       // pseudo-class names are case-insensitive
+                       // http://www.w3.org/TR/selectors/#pseudo-classes
+                       // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+                       // Remember that setFilters inherits from pseudos
+                       var args,
+                               fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+                                       Sizzle.error( "unsupported pseudo: " + pseudo );
+
+                       // The user may use createPseudo to indicate that
+                       // arguments are needed to create the filter function
+                       // just as Sizzle does
+                       if ( fn[ expando ] ) {
+                               return fn( argument );
+                       }
+
+                       // But maintain support for old signatures
+                       if ( fn.length > 1 ) {
+                               args = [ pseudo, pseudo, "", argument ];
+                               return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+                                       markFunction(function( seed, matches ) {
+                                               var idx,
+                                                       matched = fn( seed, argument ),
+                                                       i = matched.length;
+                                               while ( i-- ) {
+                                                       idx = indexOf.call( seed, matched[i] );
+                                                       seed[ idx ] = !( matches[ idx ] = matched[i] );
+                                               }
+                                       }) :
+                                       function( elem ) {
+                                               return fn( elem, 0, args );
+                                       };
+                       }
+
+                       return fn;
+               }
+       },
+
+       pseudos: {
+               // Potentially complex pseudos
+               "not": markFunction(function( selector ) {
+                       // Trim the selector passed to compile
+                       // to avoid treating leading and trailing
+                       // spaces as combinators
+                       var input = [],
+                               results = [],
+                               matcher = compile( selector.replace( rtrim, "$1" ) );
+
+                       return matcher[ expando ] ?
+                               markFunction(function( seed, matches, context, xml ) {
+                                       var elem,
+                                               unmatched = matcher( seed, null, xml, [] ),
+                                               i = seed.length;
+
+                                       // Match elements unmatched by `matcher`
+                                       while ( i-- ) {
+                                               if ( (elem = unmatched[i]) ) {
+                                                       seed[i] = !(matches[i] = elem);
+                                               }
+                                       }
+                               }) :
+                               function( elem, context, xml ) {
+                                       input[0] = elem;
+                                       matcher( input, null, xml, results );
+                                       return !results.pop();
+                               };
+               }),
+
+               "has": markFunction(function( selector ) {
+                       return function( elem ) {
+                               return Sizzle( selector, elem ).length > 0;
+                       };
+               }),
+
+               "contains": markFunction(function( text ) {
+                       return function( elem ) {
+                               return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+                       };
+               }),
+
+               // "Whether an element is represented by a :lang() selector
+               // is based solely on the element's language value
+               // being equal to the identifier C,
+               // or beginning with the identifier C immediately followed by "-".
+               // The matching of C against the element's language value is performed case-insensitively.
+               // The identifier C does not have to be a valid language name."
+               // http://www.w3.org/TR/selectors/#lang-pseudo
+               "lang": markFunction( function( lang ) {
+                       // lang value must be a valid identifider
+                       if ( !ridentifier.test(lang || "") ) {
+                               Sizzle.error( "unsupported lang: " + lang );
+                       }
+                       lang = lang.replace( runescape, funescape ).toLowerCase();
+                       return function( elem ) {
+                               var elemLang;
+                               do {
+                                       if ( (elemLang = documentIsXML ?
+                                               elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
+                                               elem.lang) ) {
+
+                                               elemLang = elemLang.toLowerCase();
+                                               return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+                                       }
+                               } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+                               return false;
+                       };
+               }),
+
+               // Miscellaneous
+               "target": function( elem ) {
+                       var hash = window.location && window.location.hash;
+                       return hash && hash.slice( 1 ) === elem.id;
+               },
+
+               "root": function( elem ) {
+                       return elem === docElem;
+               },
+
+               "focus": function( elem ) {
+                       return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+               },
+
+               // Boolean properties
+               "enabled": function( elem ) {
+                       return elem.disabled === false;
+               },
+
+               "disabled": function( elem ) {
+                       return elem.disabled === true;
+               },
+
+               "checked": function( elem ) {
+                       // In CSS3, :checked should return both checked and selected elements
+                       // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+                       var nodeName = elem.nodeName.toLowerCase();
+                       return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+               },
+
+               "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;
+               },
+
+               // Contents
+               "empty": function( elem ) {
+                       // http://www.w3.org/TR/selectors/#empty-pseudo
+                       // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+                       //   not comment, processing instructions, or others
+                       // Thanks to Diego Perini for the nodeName shortcut
+                       //   Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+                       for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+                               if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+                                       return false;
+                               }
+                       }
+                       return true;
+               },
+
+               "parent": function( elem ) {
+                       return !Expr.pseudos["empty"]( elem );
+               },
+
+               // Element/input types
+               "header": function( elem ) {
+                       return rheader.test( elem.nodeName );
+               },
+
+               "input": function( elem ) {
+                       return rinputs.test( elem.nodeName );
+               },
+
+               "button": function( elem ) {
+                       var name = elem.nodeName.toLowerCase();
+                       return name === "input" && elem.type === "button" || name === "button";
+               },
+
+               "text": function( elem ) {
+                       var attr;
+                       // 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" &&
+                               elem.type === "text" &&
+                               ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+               },
+
+               // Position-in-collection
+               "first": createPositionalPseudo(function() {
+                       return [ 0 ];
+               }),
+
+               "last": createPositionalPseudo(function( matchIndexes, length ) {
+                       return [ length - 1 ];
+               }),
+
+               "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+                       return [ argument < 0 ? argument + length : argument ];
+               }),
+
+               "even": createPositionalPseudo(function( matchIndexes, length ) {
+                       var i = 0;
+                       for ( ; i < length; i += 2 ) {
+                               matchIndexes.push( i );
+                       }
+                       return matchIndexes;
+               }),
+
+               "odd": createPositionalPseudo(function( matchIndexes, length ) {
+                       var i = 1;
+                       for ( ; i < length; i += 2 ) {
+                               matchIndexes.push( i );
+                       }
+                       return matchIndexes;
+               }),
+
+               "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+                       var i = argument < 0 ? argument + length : argument;
+                       for ( ; --i >= 0; ) {
+                               matchIndexes.push( i );
+                       }
+                       return matchIndexes;
+               }),
+
+               "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+                       var i = argument < 0 ? argument + length : argument;
+                       for ( ; ++i < length; ) {
+                               matchIndexes.push( i );
+                       }
+                       return matchIndexes;
+               })
+       }
+};
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+       Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+       Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+function tokenize( selector, parseOnly ) {
+       var matched, match, tokens, type,
+               soFar, groups, preFilters,
+               cached = tokenCache[ selector + " " ];
+
+       if ( cached ) {
+               return parseOnly ? 0 : cached.slice( 0 );
+       }
+
+       soFar = selector;
+       groups = [];
+       preFilters = Expr.preFilter;
+
+       while ( soFar ) {
+
+               // Comma and first run
+               if ( !matched || (match = rcomma.exec( soFar )) ) {
+                       if ( match ) {
+                               // Don't consume trailing commas as valid
+                               soFar = soFar.slice( match[0].length ) || soFar;
+                       }
+                       groups.push( tokens = [] );
+               }
+
+               matched = false;
+
+               // Combinators
+               if ( (match = rcombinators.exec( soFar )) ) {
+                       matched = match.shift();
+                       tokens.push( {
+                               value: matched,
+                               // Cast descendant combinators to space
+                               type: match[0].replace( rtrim, " " )
+                       } );
+                       soFar = soFar.slice( matched.length );
+               }
+
+               // Filters
+               for ( type in Expr.filter ) {
+                       if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+                               (match = preFilters[ type ]( match ))) ) {
+                               matched = match.shift();
+                               tokens.push( {
+                                       value: matched,
+                                       type: type,
+                                       matches: match
+                               } );
+                               soFar = soFar.slice( matched.length );
+                       }
+               }
+
+               if ( !matched ) {
+                       break;
+               }
+       }
+
+       // Return the length of the invalid excess
+       // if we're just parsing
+       // Otherwise, throw an error or return tokens
+       return parseOnly ?
+               soFar.length :
+               soFar ?
+                       Sizzle.error( selector ) :
+                       // Cache the tokens
+                       tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+       var i = 0,
+               len = tokens.length,
+               selector = "";
+       for ( ; i < len; i++ ) {
+               selector += tokens[i].value;
+       }
+       return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+       var dir = combinator.dir,
+               checkNonElements = base && combinator.dir === "parentNode",
+               doneName = done++;
+
+       return combinator.first ?
+               // Check against closest ancestor/preceding element
+               function( elem, context, xml ) {
+                       while ( (elem = elem[ dir ]) ) {
+                               if ( elem.nodeType === 1 || checkNonElements ) {
+                                       return matcher( elem, context, xml );
+                               }
+                       }
+               } :
+
+               // Check against all ancestor/preceding elements
+               function( elem, context, xml ) {
+                       var data, cache, outerCache,
+                               dirkey = dirruns + " " + doneName;
+
+                       // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+                       if ( xml ) {
+                               while ( (elem = elem[ dir ]) ) {
+                                       if ( elem.nodeType === 1 || checkNonElements ) {
+                                               if ( matcher( elem, context, xml ) ) {
+                                                       return true;
+                                               }
+                                       }
+                               }
+                       } else {
+                               while ( (elem = elem[ dir ]) ) {
+                                       if ( elem.nodeType === 1 || checkNonElements ) {
+                                               outerCache = elem[ expando ] || (elem[ expando ] = {});
+                                               if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
+                                                       if ( (data = cache[1]) === true || data === cachedruns ) {
+                                                               return data === true;
+                                                       }
+                                               } else {
+                                                       cache = outerCache[ dir ] = [ dirkey ];
+                                                       cache[1] = matcher( elem, context, xml ) || cachedruns;
+                                                       if ( cache[1] === true ) {
+                                                               return true;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               };
+}
+
+function elementMatcher( matchers ) {
+       return matchers.length > 1 ?
+               function( elem, context, xml ) {
+                       var i = matchers.length;
+                       while ( i-- ) {
+                               if ( !matchers[i]( elem, context, xml ) ) {
+                                       return false;
+                               }
+                       }
+                       return true;
+               } :
+               matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+       var elem,
+               newUnmatched = [],
+               i = 0,
+               len = unmatched.length,
+               mapped = map != null;
+
+       for ( ; i < len; i++ ) {
+               if ( (elem = unmatched[i]) ) {
+                       if ( !filter || filter( elem, context, xml ) ) {
+                               newUnmatched.push( elem );
+                               if ( mapped ) {
+                                       map.push( i );
+                               }
+                       }
+               }
+       }
+
+       return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+       if ( postFilter && !postFilter[ expando ] ) {
+               postFilter = setMatcher( postFilter );
+       }
+       if ( postFinder && !postFinder[ expando ] ) {
+               postFinder = setMatcher( postFinder, postSelector );
+       }
+       return markFunction(function( seed, results, context, xml ) {
+               var temp, i, elem,
+                       preMap = [],
+                       postMap = [],
+                       preexisting = results.length,
+
+                       // Get initial elements from seed or context
+                       elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+                       // Prefilter to get matcher input, preserving a map for seed-results synchronization
+                       matcherIn = preFilter && ( seed || !selector ) ?
+                               condense( elems, preMap, preFilter, context, xml ) :
+                               elems,
+
+                       matcherOut = matcher ?
+                               // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+                               postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+                                       // ...intermediate processing is necessary
+                                       [] :
+
+                                       // ...otherwise use results directly
+                                       results :
+                               matcherIn;
+
+               // Find primary matches
+               if ( matcher ) {
+                       matcher( matcherIn, matcherOut, context, xml );
+               }
+
+               // Apply postFilter
+               if ( postFilter ) {
+                       temp = condense( matcherOut, postMap );
+                       postFilter( temp, [], context, xml );
+
+                       // Un-match failing elements by moving them back to matcherIn
+                       i = temp.length;
+                       while ( i-- ) {
+                               if ( (elem = temp[i]) ) {
+                                       matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+                               }
+                       }
+               }
+
+               if ( seed ) {
+                       if ( postFinder || preFilter ) {
+                               if ( postFinder ) {
+                                       // Get the final matcherOut by condensing this intermediate into postFinder contexts
+                                       temp = [];
+                                       i = matcherOut.length;
+                                       while ( i-- ) {
+                                               if ( (elem = matcherOut[i]) ) {
+                                                       // Restore matcherIn since elem is not yet a final match
+                                                       temp.push( (matcherIn[i] = elem) );
+                                               }
+                                       }
+                                       postFinder( null, (matcherOut = []), temp, xml );
+                               }
+
+                               // Move matched elements from seed to results to keep them synchronized
+                               i = matcherOut.length;
+                               while ( i-- ) {
+                                       if ( (elem = matcherOut[i]) &&
+                                               (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+                                               seed[temp] = !(results[temp] = elem);
+                                       }
+                               }
+                       }
+
+               // Add elements to results, through postFinder if defined
+               } else {
+                       matcherOut = condense(
+                               matcherOut === results ?
+                                       matcherOut.splice( preexisting, matcherOut.length ) :
+                                       matcherOut
+                       );
+                       if ( postFinder ) {
+                               postFinder( null, results, matcherOut, xml );
+                       } else {
+                               push.apply( results, matcherOut );
+                       }
+               }
+       });
+}
+
+function matcherFromTokens( tokens ) {
+       var checkContext, matcher, j,
+               len = tokens.length,
+               leadingRelative = Expr.relative[ tokens[0].type ],
+               implicitRelative = leadingRelative || Expr.relative[" "],
+               i = leadingRelative ? 1 : 0,
+
+               // The foundational matcher ensures that elements are reachable from top-level context(s)
+               matchContext = addCombinator( function( elem ) {
+                       return elem === checkContext;
+               }, implicitRelative, true ),
+               matchAnyContext = addCombinator( function( elem ) {
+                       return indexOf.call( checkContext, elem ) > -1;
+               }, implicitRelative, true ),
+               matchers = [ function( elem, context, xml ) {
+                       return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+                               (checkContext = context).nodeType ?
+                                       matchContext( elem, context, xml ) :
+                                       matchAnyContext( elem, context, xml ) );
+               } ];
+
+       for ( ; i < len; i++ ) {
+               if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+                       matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+               } else {
+                       matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+                       // Return special upon seeing a positional matcher
+                       if ( matcher[ expando ] ) {
+                               // Find the next relative operator (if any) for proper handling
+                               j = ++i;
+                               for ( ; j < len; j++ ) {
+                                       if ( Expr.relative[ tokens[j].type ] ) {
+                                               break;
+                                       }
+                               }
+                               return setMatcher(
+                                       i > 1 && elementMatcher( matchers ),
+                                       i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
+                                       matcher,
+                                       i < j && matcherFromTokens( tokens.slice( i, j ) ),
+                                       j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+                                       j < len && toSelector( tokens )
+                               );
+                       }
+                       matchers.push( matcher );
+               }
+       }
+
+       return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+       // A counter to specify which element is currently being matched
+       var matcherCachedRuns = 0,
+               bySet = setMatchers.length > 0,
+               byElement = elementMatchers.length > 0,
+               superMatcher = function( seed, context, xml, results, expandContext ) {
+                       var elem, j, matcher,
+                               setMatched = [],
+                               matchedCount = 0,
+                               i = "0",
+                               unmatched = seed && [],
+                               outermost = expandContext != null,
+                               contextBackup = outermostContext,
+                               // We must always have either seed elements or context
+                               elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+                               // Nested matchers should use non-integer dirruns
+                               dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
+
+                       if ( outermost ) {
+                               outermostContext = context !== document && context;
+                               cachedruns = matcherCachedRuns;
+                       }
+
+                       // Add elements passing elementMatchers directly to results
+                       for ( ; (elem = elems[i]) != null; i++ ) {
+                               if ( byElement && elem ) {
+                                       for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
+                                               if ( matcher( elem, context, xml ) ) {
+                                                       results.push( elem );
+                                                       break;
+                                               }
+                                       }
+                                       if ( outermost ) {
+                                               dirruns = dirrunsUnique;
+                                               cachedruns = ++matcherCachedRuns;
+                                       }
+                               }
+
+                               // Track unmatched elements for set filters
+                               if ( bySet ) {
+                                       // They will have gone through all possible matchers
+                                       if ( (elem = !matcher && elem) ) {
+                                               matchedCount--;
+                                       }
+
+                                       // Lengthen the array for every element, matched or not
+                                       if ( seed ) {
+                                               unmatched.push( elem );
+                                       }
+                               }
+                       }
+
+                       // Apply set filters to unmatched elements
+                       // `i` starts as a string, so matchedCount would equal "00" if there are no elements
+                       matchedCount += i;
+                       if ( bySet && i !== matchedCount ) {
+                               for ( j = 0; (matcher = setMatchers[j]); j++ ) {
+                                       matcher( unmatched, setMatched, context, xml );
+                               }
+
+                               if ( seed ) {
+                                       // Reintegrate element matches to eliminate the need for sorting
+                                       if ( matchedCount > 0 ) {
+                                               while ( i-- ) {
+                                                       if ( !(unmatched[i] || setMatched[i]) ) {
+                                                               setMatched[i] = pop.call( results );
+                                                       }
+                                               }
+                                       }
+
+                                       // Discard index placeholder values to get only actual matches
+                                       setMatched = condense( setMatched );
+                               }
+
+                               // Add matches to results
+                               push.apply( results, setMatched );
+
+                               // Seedless set matches succeeding multiple successful matchers stipulate sorting
+                               if ( outermost && !seed && setMatched.length > 0 &&
+                                       ( matchedCount + setMatchers.length ) > 1 ) {
+
+                                       Sizzle.uniqueSort( results );
+                               }
+                       }
+
+                       // Override manipulation of globals by nested matchers
+                       if ( outermost ) {
+                               dirruns = dirrunsUnique;
+                               outermostContext = contextBackup;
+                       }
+
+                       return unmatched;
+               };
+
+       return bySet ?
+               markFunction( superMatcher ) :
+               superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+       var i,
+               setMatchers = [],
+               elementMatchers = [],
+               cached = compilerCache[ selector + " " ];
+
+       if ( !cached ) {
+               // Generate a function of recursive functions that can be used to check each element
+               if ( !group ) {
+                       group = tokenize( selector );
+               }
+               i = group.length;
+               while ( i-- ) {
+                       cached = matcherFromTokens( group[i] );
+                       if ( cached[ expando ] ) {
+                               setMatchers.push( cached );
+                       } else {
+                               elementMatchers.push( cached );
+                       }
+               }
+
+               // Cache the compiled function
+               cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+       }
+       return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+       var i = 0,
+               len = contexts.length;
+       for ( ; i < len; i++ ) {
+               Sizzle( selector, contexts[i], results );
+       }
+       return results;
+}
+
+function select( selector, context, results, seed ) {
+       var i, tokens, token, type, find,
+               match = tokenize( selector );
+
+       if ( !seed ) {
+               // Try to minimize operations if there is only one group
+               if ( match.length === 1 ) {
+
+                       // Take a shortcut and set the context if the root selector is an ID
+                       tokens = match[0] = match[0].slice( 0 );
+                       if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+                                       context.nodeType === 9 && !documentIsXML &&
+                                       Expr.relative[ tokens[1].type ] ) {
+
+                               context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
+                               if ( !context ) {
+                                       return results;
+                               }
+
+                               selector = selector.slice( tokens.shift().value.length );
+                       }
+
+                       // Fetch a seed set for right-to-left matching
+                       for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
+                               token = tokens[i];
+
+                               // Abort if we hit a combinator
+                               if ( Expr.relative[ (type = token.type) ] ) {
+                                       break;
+                               }
+                               if ( (find = Expr.find[ type ]) ) {
+                                       // Search, expanding context for leading sibling combinators
+                                       if ( (seed = find(
+                                               token.matches[0].replace( runescape, funescape ),
+                                               rsibling.test( tokens[0].type ) && context.parentNode || context
+                                       )) ) {
+
+                                               // If seed is empty or no tokens remain, we can return early
+                                               tokens.splice( i, 1 );
+                                               selector = seed.length && toSelector( tokens );
+                                               if ( !selector ) {
+                                                       push.apply( results, slice.call( seed, 0 ) );
+                                                       return results;
+                                               }
+
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       // Compile and execute a filtering function
+       // Provide `match` to avoid retokenization if we modified the selector above
+       compile( selector, match )(
+               seed,
+               context,
+               documentIsXML,
+               results,
+               rsibling.test( selector )
+       );
+       return results;
+}
+
+// Deprecated
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Easy API for creating new setFilters
+function setFilters() {}
+Expr.filters = setFilters.prototype = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+// Initialize with the default document
+setDocument();
+
+// Override sizzle attribute retrieval
+Sizzle.attr = jQuery.attr;
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})( window );
+var runtil = /Until$/,
+       rparentsprev = /^(?:parents|prev(?:Until|All))/,
+       isSimple = /^.[^:#\[\.,]*$/,
+       rneedsContext = jQuery.expr.match.needsContext,
+       // 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 i, ret, self;
+
+               if ( typeof selector !== "string" ) {
+                       self = this;
+                       return this.pushStack( jQuery( selector ).filter(function() {
+                               for ( i = 0; i < self.length; i++ ) {
+                                       if ( jQuery.contains( self[ i ], this ) ) {
+                                               return true;
+                                       }
+                               }
+                       }) );
+               }
+
+               ret = [];
+               for ( i = 0; i < this.length; i++ ) {
+                       jQuery.find( selector, this[ i ], ret );
+               }
+
+               // Needed because $( selector, context ) becomes $( context ).find( selector )
+               ret = this.pushStack( jQuery.unique( ret ) );
+               ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
+               return ret;
+       },
+
+       has: function( target ) {
+               var i,
+                       targets = jQuery( target, this ),
+                       len = targets.length;
+
+               return this.filter(function() {
+                       for ( i = 0; i < len; i++ ) {
+                               if ( jQuery.contains( this, targets[i] ) ) {
+                                       return true;
+                               }
+                       }
+               });
+       },
+
+       not: function( selector ) {
+               return this.pushStack( winnow(this, selector, false) );
+       },
+
+       filter: function( selector ) {
+               return this.pushStack( winnow(this, selector, true) );
+       },
+
+       is: function( selector ) {
+               return !!selector && (
+                       typeof selector === "string" ?
+                               // If this is a positional/relative selector, check membership in the returned set
+                               // so $("p:first").is("p:last") won't return true for a doc with two "p".
+                               rneedsContext.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 cur,
+                       i = 0,
+                       l = this.length,
+                       ret = [],
+                       pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+                               jQuery( selectors, context || this.context ) :
+                               0;
+
+               for ( ; i < l; i++ ) {
+                       cur = this[i];
+
+                       while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
+                               if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+                                       ret.push( cur );
+                                       break;
+                               }
+                               cur = cur.parentNode;
+                       }
+               }
+
+               return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
+       },
+
+       // 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.first().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( jQuery.unique(all) );
+       },
+
+       addBack: function( selector ) {
+               return this.add( selector == null ?
+                       this.prevObject : this.prevObject.filter(selector)
+               );
+       }
+});
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+function sibling( cur, dir ) {
+       do {
+               cur = cur[ dir ];
+       } while ( cur && cur.nodeType !== 1 );
+
+       return cur;
+}
+
+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 sibling( elem, "nextSibling" );
+       },
+       prev: function( elem ) {
+               return sibling( elem, "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.merge( [], 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 && rparentsprev.test( name ) ) {
+                       ret = ret.reverse();
+               }
+
+               return this.pushStack( ret );
+       };
+});
+
+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;
+       },
+
+       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 ) {
+                       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 ) {
+               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|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+               "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+       rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+       rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+       rleadingWhitespace = /^\s+/,
+       rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+       rtagName = /<([\w:]+)/,
+       rtbody = /<tbody/i,
+       rhtml = /<|&#?\w+;/,
+       rnoInnerhtml = /<(?:script|style|link)/i,
+       manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
+       // checked="checked" or checked
+       rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+       rscriptType = /^$|\/(?:java|ecma)script/i,
+       rscriptTypeMasked = /^true\/(.*)/,
+       rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+       // We have to close these tags to support XHTML (#13200)
+       wrapMap = {
+               option: [ 1, "<select multiple='multiple'>", "</select>" ],
+               legend: [ 1, "<fieldset>", "</fieldset>" ],
+               area: [ 1, "<map>", "</map>" ],
+               param: [ 1, "<object>", "</object>" ],
+               thead: [ 1, "<table>", "</table>" ],
+               tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+               col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+               td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+               // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+               // unless wrapped in a div with non-breaking characters in front of it.
+               _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
+       },
+       safeFragment = createSafeFragment( document ),
+       fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+jQuery.fn.extend({
+       text: function( value ) {
+               return jQuery.access( this, function( value ) {
+                       return value === undefined ?
+                               jQuery.text( this ) :
+                               this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+               }, null, value, arguments.length );
+       },
+
+       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.nodeType === 11 || this.nodeType === 9 ) {
+                               this.appendChild( elem );
+                       }
+               });
+       },
+
+       prepend: function() {
+               return this.domManip(arguments, true, function( elem ) {
+                       if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+                               this.insertBefore( elem, this.firstChild );
+                       }
+               });
+       },
+
+       before: function() {
+               return this.domManip( arguments, false, function( elem ) {
+                       if ( this.parentNode ) {
+                               this.parentNode.insertBefore( elem, this );
+                       }
+               });
+       },
+
+       after: function() {
+               return this.domManip( arguments, false, function( elem ) {
+                       if ( this.parentNode ) {
+                               this.parentNode.insertBefore( elem, this.nextSibling );
+                       }
+               });
+       },
+
+       // keepData is for internal use only--do not document
+       remove: function( selector, keepData ) {
+               var elem,
+                       i = 0;
+
+               for ( ; (elem = this[i]) != null; i++ ) {
+                       if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
+                               if ( !keepData && elem.nodeType === 1 ) {
+                                       jQuery.cleanData( getAll( elem ) );
+                               }
+
+                               if ( elem.parentNode ) {
+                                       if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+                                               setGlobalEval( getAll( elem, "script" ) );
+                                       }
+                                       elem.parentNode.removeChild( elem );
+                               }
+                       }
+               }
+
+               return this;
+       },
+
+       empty: function() {
+               var elem,
+                       i = 0;
+
+               for ( ; (elem = this[i]) != null; i++ ) {
+                       // Remove element nodes and prevent memory leaks
+                       if ( elem.nodeType === 1 ) {
+                               jQuery.cleanData( getAll( elem, false ) );
+                       }
+
+                       // Remove any remaining nodes
+                       while ( elem.firstChild ) {
+                               elem.removeChild( elem.firstChild );
+                       }
+
+                       // If this is a select, ensure that it displays empty (#12336)
+                       // Support: IE<9
+                       if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+                               elem.options.length = 0;
+                       }
+               }
+
+               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 ) {
+               return jQuery.access( this, function( value ) {
+                       var elem = this[0] || {},
+                               i = 0,
+                               l = this.length;
+
+                       if ( value === undefined ) {
+                               return elem.nodeType === 1 ?
+                                       elem.innerHTML.replace( rinlinejQuery, "" ) :
+                                       undefined;
+                       }
+
+                       // See if we can take a shortcut and just use innerHTML
+                       if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+                               ( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
+                               ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+                               !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
+
+                               value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+                               try {
+                                       for (; i < l; i++ ) {
+                                               // Remove element nodes and prevent memory leaks
+                                               elem = this[i] || {};
+                                               if ( elem.nodeType === 1 ) {
+                                                       jQuery.cleanData( getAll( elem, false ) );
+                                                       elem.innerHTML = value;
+                                               }
+                                       }
+
+                                       elem = 0;
+
+                               // If using innerHTML throws an exception, use the fallback method
+                               } catch(e) {}
+                       }
+
+                       if ( elem ) {
+                               this.empty().append( value );
+                       }
+               }, null, value, arguments.length );
+       },
+
+       replaceWith: function( value ) {
+               var isFunc = jQuery.isFunction( value );
+
+               // 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 ( !isFunc && typeof value !== "string" ) {
+                       value = jQuery( value ).not( this ).detach();
+               }
+
+               return this.domManip( [ value ], true, function( elem ) {
+                       var next = this.nextSibling,
+                               parent = this.parentNode;
+
+                       if ( parent && this.nodeType === 1 || this.nodeType === 11 ) {
+
+                               jQuery( this ).remove();
+
+                               if ( next ) {
+                                       next.parentNode.insertBefore( elem, next );
+                               } else {
+                                       parent.appendChild( elem );
+                               }
+                       }
+               });
+       },
+
+       detach: function( selector ) {
+               return this.remove( selector, true );
+       },
+
+       domManip: function( args, table, callback ) {
+
+               // Flatten any nested arrays
+               args = core_concat.apply( [], args );
+
+               var fragment, first, scripts, hasScripts, node, doc,
+                       i = 0,
+                       l = this.length,
+                       set = this,
+                       iNoClone = l - 1,
+                       value = args[0],
+                       isFunction = jQuery.isFunction( value );
+
+               // We can't cloneNode fragments that contain checked, in WebKit
+               if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
+                       return this.each(function( index ) {
+                               var self = set.eq( index );
+                               if ( isFunction ) {
+                                       args[0] = value.call( this, index, table ? self.html() : undefined );
+                               }
+                               self.domManip( args, table, callback );
+                       });
+               }
+
+               if ( l ) {
+                       fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
+                       first = fragment.firstChild;
+
+                       if ( fragment.childNodes.length === 1 ) {
+                               fragment = first;
+                       }
+
+                       if ( first ) {
+                               table = table && jQuery.nodeName( first, "tr" );
+                               scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+                               hasScripts = scripts.length;
+
+                               // Use the original fragment for the last item instead of the first because it can end up
+                               // being emptied incorrectly in certain situations (#8070).
+                               for ( ; i < l; i++ ) {
+                                       node = fragment;
+
+                                       if ( i !== iNoClone ) {
+                                               node = jQuery.clone( node, true, true );
+
+                                               // Keep references to cloned scripts for later restoration
+                                               if ( hasScripts ) {
+                                                       jQuery.merge( scripts, getAll( node, "script" ) );
+                                               }
+                                       }
+
+                                       callback.call(
+                                               table && jQuery.nodeName( this[i], "table" ) ?
+                                                       findOrAppend( this[i], "tbody" ) :
+                                                       this[i],
+                                               node,
+                                               i
+                                       );
+                               }
+
+                               if ( hasScripts ) {
+                                       doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+                                       // Reenable scripts
+                                       jQuery.map( scripts, restoreScript );
+
+                                       // Evaluate executable scripts on first document insertion
+                                       for ( i = 0; i < hasScripts; i++ ) {
+                                               node = scripts[ i ];
+                                               if ( rscriptType.test( node.type || "" ) &&
+                                                       !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+                                                       if ( node.src ) {
+                                                               // Hope ajax is available...
+                                                               jQuery.ajax({
+                                                                       url: node.src,
+                                                                       type: "GET",
+                                                                       dataType: "script",
+                                                                       async: false,
+                                                                       global: false,
+                                                                       "throws": true
+                                                               });
+                                                       } else {
+                                                               jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
+                                                       }
+                                               }
+                                       }
+                               }
+
+                               // Fix #11809: Avoid leaking memory
+                               fragment = first = null;
+                       }
+               }
+
+               return this;
+       }
+});
+
+function findOrAppend( elem, tag ) {
+       return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+       var attr = elem.getAttributeNode("type");
+       elem.type = ( attr && attr.specified ) + "/" + elem.type;
+       return elem;
+}
+function restoreScript( elem ) {
+       var match = rscriptTypeMasked.exec( elem.type );
+       if ( match ) {
+               elem.type = match[1];
+       } else {
+               elem.removeAttribute("type");
+       }
+       return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+       var elem,
+               i = 0;
+       for ( ; (elem = elems[i]) != null; i++ ) {
+               jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
+       }
+}
+
+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 ] );
+                       }
+               }
+       }
+
+       // make the cloned public data object a copy from the original
+       if ( curData.data ) {
+               curData.data = jQuery.extend( {}, curData.data );
+       }
+}
+
+function fixCloneNodeIssues( src, dest ) {
+       var nodeName, data, e;
+
+       // We do not need to do anything for non-Elements
+       if ( dest.nodeType !== 1 ) {
+               return;
+       }
+
+       nodeName = dest.nodeName.toLowerCase();
+
+       // IE6-8 copies events bound via attachEvent when using cloneNode.
+       if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
+               data = jQuery._data( dest );
+
+               for ( e in data.events ) {
+                       jQuery.removeEvent( dest, e, data.handle );
+               }
+
+               // Event data gets referenced instead of copied if the expando gets copied too
+               dest.removeAttribute( jQuery.expando );
+       }
+
+       // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+       if ( nodeName === "script" && dest.text !== src.text ) {
+               disableScript( dest ).text = src.text;
+               restoreScript( dest );
+
+       // IE6-10 improperly clones children of object elements using classid.
+       // IE10 throws NoModificationAllowedError if parent is null, #12132.
+       } else if ( nodeName === "object" ) {
+               if ( dest.parentNode ) {
+                       dest.outerHTML = src.outerHTML;
+               }
+
+               // This path appears unavoidable for IE9. When cloning an object
+               // element in IE9, the outerHTML strategy above is not sufficient.
+               // If the src has innerHTML and the destination does not,
+               // copy the src.innerHTML into the dest.innerHTML. #10324
+               if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
+                       dest.innerHTML = src.innerHTML;
+               }
+
+       } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
+               // 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
+
+               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.defaultSelected = 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;
+       }
+}
+
+jQuery.each({
+       appendTo: "append",
+       prependTo: "prepend",
+       insertBefore: "before",
+       insertAfter: "after",
+       replaceAll: "replaceWith"
+}, function( name, original ) {
+       jQuery.fn[ name ] = function( selector ) {
+               var elems,
+                       i = 0,
+                       ret = [],
+                       insert = jQuery( selector ),
+                       last = insert.length - 1;
+
+               for ( ; i <= last; i++ ) {
+                       elems = i === last ? this : this.clone(true);
+                       jQuery( insert[i] )[ original ]( elems );
+
+                       // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+                       core_push.apply( ret, elems.get() );
+               }
+
+               return this.pushStack( ret );
+       };
+});
+
+function getAll( context, tag ) {
+       var elems, elem,
+               i = 0,
+               found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) :
+                       typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) :
+                       undefined;
+
+       if ( !found ) {
+               for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
+                       if ( !tag || jQuery.nodeName( elem, tag ) ) {
+                               found.push( elem );
+                       } else {
+                               jQuery.merge( found, getAll( elem, tag ) );
+                       }
+               }
+       }
+
+       return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+               jQuery.merge( [ context ], found ) :
+               found;
+}
+
+// Used in buildFragment, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+       if ( manipulation_rcheckableType.test( elem.type ) ) {
+               elem.defaultChecked = elem.checked;
+       }
+}
+
+jQuery.extend({
+       clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+               var destElements, srcElements, node, i, clone,
+                       inPage = jQuery.contains( elem.ownerDocument, elem );
+
+               if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+                       clone = elem.cloneNode( true );
+
+               // IE<=8 does not properly clone detached, unknown element nodes
+               } else {
+                       fragmentDiv.innerHTML = elem.outerHTML;
+                       fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+               }
+
+               if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+                               (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+
+                       // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+                       destElements = getAll( clone );
+                       srcElements = getAll( elem );
+
+                       // Fix all IE cloning issues
+                       for ( i = 0; (node = srcElements[i]) != null; ++i ) {
+                               // Ensure that the destination node is not null; Fixes #9587
+                               if ( destElements[i] ) {
+                                       fixCloneNodeIssues( node, destElements[i] );
+                               }
+                       }
+               }
+
+               // Copy the events from the original to the clone
+               if ( dataAndEvents ) {
+                       if ( deepDataAndEvents ) {
+                               srcElements = srcElements || getAll( elem );
+                               destElements = destElements || getAll( clone );
+
+                               for ( i = 0; (node = srcElements[i]) != null; i++ ) {
+                                       cloneCopyEvent( node, destElements[i] );
+                               }
+                       } else {
+                               cloneCopyEvent( elem, clone );
+                       }
+               }
+
+               // Preserve script evaluation history
+               destElements = getAll( clone, "script" );
+               if ( destElements.length > 0 ) {
+                       setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+               }
+
+               destElements = srcElements = node = null;
+
+               // Return the cloned set
+               return clone;
+       },
+
+       buildFragment: function( elems, context, scripts, selection ) {
+               var contains, elem, tag, tmp, wrap, tbody, j,
+                       l = elems.length,
+
+                       // Ensure a safe fragment
+                       safe = createSafeFragment( context ),
+
+                       nodes = [],
+                       i = 0;
+
+               for ( ; i < l; i++ ) {
+                       elem = elems[ i ];
+
+                       if ( elem || elem === 0 ) {
+
+                               // Add nodes directly
+                               if ( jQuery.type( elem ) === "object" ) {
+                                       jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+                               // Convert non-html into a text node
+                               } else if ( !rhtml.test( elem ) ) {
+                                       nodes.push( context.createTextNode( elem ) );
+
+                               // Convert html into DOM nodes
+                               } else {
+                                       tmp = tmp || safe.appendChild( context.createElement("div") );
+
+                                       // Deserialize a standard representation
+                                       tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
+                                       wrap = wrapMap[ tag ] || wrapMap._default;
+
+                                       tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
+
+                                       // Descend through wrappers to the right content
+                                       j = wrap[0];
+                                       while ( j-- ) {
+                                               tmp = tmp.lastChild;
+                                       }
+
+                                       // Manually add leading whitespace removed by IE
+                                       if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+                                               nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
+                                       }
+
+                                       // Remove IE's autoinserted <tbody> from table fragments
+                                       if ( !jQuery.support.tbody ) {
+
+                                               // String was a <table>, *may* have spurious <tbody>
+                                               elem = tag === "table" && !rtbody.test( elem ) ?
+                                                       tmp.firstChild :
+
+                                                       // String was a bare <thead> or <tfoot>
+                                                       wrap[1] === "<table>" && !rtbody.test( elem ) ?
+                                                               tmp :
+                                                               0;
+
+                                               j = elem && elem.childNodes.length;
+                                               while ( j-- ) {
+                                                       if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
+                                                               elem.removeChild( tbody );
+                                                       }
+                                               }
+                                       }
+
+                                       jQuery.merge( nodes, tmp.childNodes );
+
+                                       // Fix #12392 for WebKit and IE > 9
+                                       tmp.textContent = "";
+
+                                       // Fix #12392 for oldIE
+                                       while ( tmp.firstChild ) {
+                                               tmp.removeChild( tmp.firstChild );
+                                       }
+
+                                       // Remember the top-level container for proper cleanup
+                                       tmp = safe.lastChild;
+                               }
+                       }
+               }
+
+               // Fix #11356: Clear elements from fragment
+               if ( tmp ) {
+                       safe.removeChild( tmp );
+               }
+
+               // Reset defaultChecked for any radios and checkboxes
+               // about to be appended to the DOM in IE 6/7 (#8060)
+               if ( !jQuery.support.appendChecked ) {
+                       jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+               }
+
+               i = 0;
+               while ( (elem = nodes[ i++ ]) ) {
+
+                       // #4087 - If origin and destination elements are the same, and this is
+                       // that element, do not do anything
+                       if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+                               continue;
+                       }
+
+                       contains = jQuery.contains( elem.ownerDocument, elem );
+
+                       // Append to fragment
+                       tmp = getAll( safe.appendChild( elem ), "script" );
+
+                       // Preserve script evaluation history
+                       if ( contains ) {
+                               setGlobalEval( tmp );
+                       }
+
+                       // Capture executables
+                       if ( scripts ) {
+                               j = 0;
+                               while ( (elem = tmp[ j++ ]) ) {
+                                       if ( rscriptType.test( elem.type || "" ) ) {
+                                               scripts.push( elem );
+                                       }
+                               }
+                       }
+               }
+
+               tmp = null;
+
+               return safe;
+       },
+
+       cleanData: function( elems, /* internal */ acceptData ) {
+               var data, id, elem, type,
+                       i = 0,
+                       internalKey = jQuery.expando,
+                       cache = jQuery.cache,
+                       deleteExpando = jQuery.support.deleteExpando,
+                       special = jQuery.event.special;
+
+               for ( ; (elem = elems[i]) != null; i++ ) {
+
+                       if ( acceptData || jQuery.acceptData( elem ) ) {
+
+                               id = elem[ internalKey ];
+                               data = id && cache[ id ];
+
+                               if ( data ) {
+                                       if ( data.events ) {
+                                               for ( 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 );
+                                                       }
+                                               }
+                                       }
+
+                                       // Remove cache only if it was not already removed by jQuery.event.remove
+                                       if ( cache[ id ] ) {
+
+                                               delete cache[ id ];
+
+                                               // 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 ( deleteExpando ) {
+                                                       delete elem[ internalKey ];
+
+                                               } else if ( typeof elem.removeAttribute !== "undefined" ) {
+                                                       elem.removeAttribute( internalKey );
+
+                                               } else {
+                                                       elem[ internalKey ] = null;
+                                               }
+
+                                               core_deletedIds.push( id );
+                                       }
+                               }
+                       }
+               }
+       }
+});
+var curCSS, getStyles, iframe,
+       ralpha = /alpha\([^)]*\)/i,
+       ropacity = /opacity\s*=\s*([^)]*)/,
+       rposition = /^(top|right|bottom|left)$/,
+       // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+       // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+       rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+       rmargin = /^margin/,
+       rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
+       rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
+       rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
+       elemdisplay = { BODY: "block" },
+
+       cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+       cssNormalTransform = {
+               letterSpacing: 0,
+               fontWeight: 400
+       },
+
+       cssExpand = [ "Top", "Right", "Bottom", "Left" ],
+       cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+       // shortcut for names that are not vendor prefixed
+       if ( name in style ) {
+               return name;
+       }
+
+       // check for vendor prefixed names
+       var capName = name.charAt(0).toUpperCase() + name.slice(1),
+               origName = name,
+               i = cssPrefixes.length;
+
+       while ( i-- ) {
+               name = cssPrefixes[ i ] + capName;
+               if ( name in style ) {
+                       return name;
+               }
+       }
+
+       return origName;
+}
+
+function isHidden( elem, el ) {
+       // isHidden might be called from jQuery#filter function;
+       // in that case, element will be second argument
+       elem = el || elem;
+       return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+}
+
+function showHide( elements, show ) {
+       var elem,
+               values = [],
+               index = 0,
+               length = elements.length;
+
+       for ( ; index < length; index++ ) {
+               elem = elements[ index ];
+               if ( !elem.style ) {
+                       continue;
+               }
+               values[ index ] = jQuery._data( elem, "olddisplay" );
+               if ( show ) {
+                       // Reset the inline display of this element to learn if it is
+                       // being hidden by cascaded rules or not
+                       if ( !values[ index ] && elem.style.display === "none" ) {
+                               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 ( elem.style.display === "" && isHidden( elem ) ) {
+                               values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
+                       }
+               } else if ( !values[ index ] && !isHidden( elem ) ) {
+                       jQuery._data( elem, "olddisplay", jQuery.css( elem, "display" ) );
+               }
+       }
+
+       // Set the display of most of the elements in a second loop
+       // to avoid the constant reflow
+       for ( index = 0; index < length; index++ ) {
+               elem = elements[ index ];
+               if ( !elem.style ) {
+                       continue;
+               }
+               if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+                       elem.style.display = show ? values[ index ] || "" : "none";
+               }
+       }
+
+       return elements;
+}
+
+jQuery.fn.extend({
+       css: function( name, value ) {
+               return jQuery.access( this, function( elem, name, value ) {
+                       var styles, len,
+                               map = {},
+                               i = 0;
+
+                       if ( jQuery.isArray( name ) ) {
+                               styles = getStyles( elem );
+                               len = name.length;
+
+                               for ( ; i < len; i++ ) {
+                                       map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+                               }
+
+                               return map;
+                       }
+
+                       return value !== undefined ?
+                               jQuery.style( elem, name, value ) :
+                               jQuery.css( elem, name );
+               }, name, value, arguments.length > 1 );
+       },
+       show: function() {
+               return showHide( this, true );
+       },
+       hide: function() {
+               return showHide( this );
+       },
+       toggle: function( state ) {
+               var bool = typeof state === "boolean";
+
+               return this.each(function() {
+                       if ( bool ? state : isHidden( this ) ) {
+                               jQuery( this ).show();
+                       } else {
+                               jQuery( this ).hide();
+                       }
+               });
+       }
+});
+
+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" );
+                                       return ret === "" ? "1" : ret;
+                               }
+                       }
+               }
+       },
+
+       // Exclude the following css properties to add px
+       cssNumber: {
+               "columnCount": true,
+               "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, hooks,
+                       origName = jQuery.camelCase( name ),
+                       style = elem.style;
+
+               name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+               // gets hook for the prefixed version
+               // followed by the unprefixed version
+               hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ 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";
+                       }
+
+                       // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+                       // but it would mean to define eight (for every problematic property) identical functions
+                       if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+                               style[ name ] = "inherit";
+                       }
+
+                       // If a hook was provided, use that value, otherwise just set the specified value
+                       if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== 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, styles ) {
+               var val, num, hooks,
+                       origName = jQuery.camelCase( name );
+
+               // Make sure that we're working with the right name
+               name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+               // gets hook for the prefixed version
+               // followed by the unprefixed version
+               hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+               // If a hook was provided get the computed value from there
+               if ( hooks && "get" in hooks ) {
+                       val = hooks.get( elem, true, extra );
+               }
+
+               // Otherwise, if a way to get the computed value exists, use that
+               if ( val === undefined ) {
+                       val = curCSS( elem, name, styles );
+               }
+
+               //convert "normal" to computed value
+               if ( val === "normal" && name in cssNormalTransform ) {
+                       val = cssNormalTransform[ name ];
+               }
+
+               // Return, converting to number if forced or a qualifier was provided and val looks numeric
+               if ( extra ) {
+                       num = parseFloat( val );
+                       return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+               }
+               return val;
+       },
+
+       // A method for quickly swapping in/out CSS properties to get correct calculations
+       swap: function( elem, options, callback, args ) {
+               var ret, name,
+                       old = {};
+
+               // Remember the old values, and insert the new ones
+               for ( name in options ) {
+                       old[ name ] = elem.style[ name ];
+                       elem.style[ name ] = options[ name ];
+               }
+
+               ret = callback.apply( elem, args || [] );
+
+               // Revert the old values
+               for ( name in options ) {
+                       elem.style[ name ] = old[ name ];
+               }
+
+               return ret;
+       }
+});
+
+// NOTE: we've included the "window" in window.getComputedStyle
+// because jsdom on node.js will break without it.
+if ( window.getComputedStyle ) {
+       getStyles = function( elem ) {
+               return window.getComputedStyle( elem, null );
+       };
+
+       curCSS = function( elem, name, _computed ) {
+               var width, minWidth, maxWidth,
+                       computed = _computed || getStyles( elem ),
+
+                       // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+                       ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
+                       style = elem.style;
+
+               if ( computed ) {
+
+                       if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+                               ret = jQuery.style( elem, name );
+                       }
+
+                       // A tribute to the "awesome hack by Dean Edwards"
+                       // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+                       // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+                       // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+                       if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+                               // Remember the original values
+                               width = style.width;
+                               minWidth = style.minWidth;
+                               maxWidth = style.maxWidth;
+
+                               // Put in the new values to get a computed value out
+                               style.minWidth = style.maxWidth = style.width = ret;
+                               ret = computed.width;
+
+                               // Revert the changed values
+                               style.width = width;
+                               style.minWidth = minWidth;
+                               style.maxWidth = maxWidth;
+                       }
+               }
+
+               return ret;
+       };
+} else if ( document.documentElement.currentStyle ) {
+       getStyles = function( elem ) {
+               return elem.currentStyle;
+       };
+
+       curCSS = function( elem, name, _computed ) {
+               var left, rs, rsLeft,
+                       computed = _computed || getStyles( elem ),
+                       ret = computed ? computed[ name ] : undefined,
+                       style = elem.style;
+
+               // Avoid setting ret to empty string here
+               // so we don't default to auto
+               if ( ret == null && style && style[ name ] ) {
+                       ret = style[ name ];
+               }
+
+               // 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
+               // but not position css attributes, as those are proportional to the parent element instead
+               // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+               if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+                       // Remember the original values
+                       left = style.left;
+                       rs = elem.runtimeStyle;
+                       rsLeft = rs && rs.left;
+
+                       // Put in the new values to get a computed value out
+                       if ( rsLeft ) {
+                               rs.left = elem.currentStyle.left;
+                       }
+                       style.left = name === "fontSize" ? "1em" : ret;
+                       ret = style.pixelLeft + "px";
+
+                       // Revert the changed values
+                       style.left = left;
+                       if ( rsLeft ) {
+                               rs.left = rsLeft;
+                       }
+               }
+
+               return ret === "" ? "auto" : ret;
+       };
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+       var matches = rnumsplit.exec( value );
+       return matches ?
+               // Guard against undefined "subtract", e.g., when used as in cssHooks
+               Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+               value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+       var i = extra === ( isBorderBox ? "border" : "content" ) ?
+               // If we already have the right measurement, avoid augmentation
+               4 :
+               // Otherwise initialize for horizontal or vertical properties
+               name === "width" ? 1 : 0,
+
+               val = 0;
+
+       for ( ; i < 4; i += 2 ) {
+               // both box models exclude margin, so add it if we want it
+               if ( extra === "margin" ) {
+                       val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+               }
+
+               if ( isBorderBox ) {
+                       // border-box includes padding, so remove it if we want content
+                       if ( extra === "content" ) {
+                               val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+                       }
+
+                       // at this point, extra isn't border nor margin, so remove border
+                       if ( extra !== "margin" ) {
+                               val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+                       }
+               } else {
+                       // at this point, extra isn't content, so add padding
+                       val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+                       // at this point, extra isn't content nor padding, so add border
+                       if ( extra !== "padding" ) {
+                               val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+                       }
+               }
+       }
+
+       return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+       // Start with offset property, which is equivalent to the border-box value
+       var valueIsBorderBox = true,
+               val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+               styles = getStyles( elem ),
+               isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+       // some non-html elements return undefined for offsetWidth, so check for null/undefined
+       // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+       // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+       if ( val <= 0 || val == null ) {
+               // Fall back to computed then uncomputed css if necessary
+               val = curCSS( elem, name, styles );
+               if ( val < 0 || val == null ) {
+                       val = elem.style[ name ];
+               }
+
+               // Computed unit is not pixels. Stop here and return.
+               if ( rnumnonpx.test(val) ) {
+                       return val;
+               }
+
+               // we need the check for style in case a browser which returns unreliable values
+               // for getComputedStyle silently falls back to the reliable elem.style
+               valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
+
+               // Normalize "", auto, and prepare for extra
+               val = parseFloat( val ) || 0;
+       }
+
+       // use the active box-sizing model to add/subtract irrelevant styles
+       return ( val +
+               augmentWidthOrHeight(
+                       elem,
+                       name,
+                       extra || ( isBorderBox ? "border" : "content" ),
+                       valueIsBorderBox,
+                       styles
+               )
+       ) + "px";
+}
+
+// Try to determine the default display value of an element
+function css_defaultDisplay( nodeName ) {
+       var doc = document,
+               display = elemdisplay[ nodeName ];
+
+       if ( !display ) {
+               display = actualDisplay( nodeName, doc );
+
+               // If the simple way fails, read from inside an iframe
+               if ( display === "none" || !display ) {
+                       // Use the already-created iframe if possible
+                       iframe = ( iframe ||
+                               jQuery("<iframe frameborder='0' width='0' height='0'/>")
+                               .css( "cssText", "display:block !important" )
+                       ).appendTo( doc.documentElement );
+
+                       // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+                       doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
+                       doc.write("<!doctype html><html><body>");
+                       doc.close();
+
+                       display = actualDisplay( nodeName, doc );
+                       iframe.detach();
+               }
+
+               // Store the correct default display
+               elemdisplay[ nodeName ] = display;
+       }
+
+       return display;
+}
+
+// Called ONLY from within css_defaultDisplay
+function actualDisplay( name, doc ) {
+       var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+               display = jQuery.css( elem[0], "display" );
+       elem.remove();
+       return display;
+}
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+       jQuery.cssHooks[ name ] = {
+               get: function( elem, computed, extra ) {
+                       if ( computed ) {
+                               // certain elements can have dimension info if we invisibly show them
+                               // however, it must have a current display style that would benefit from this
+                               return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
+                                       jQuery.swap( elem, cssShow, function() {
+                                               return getWidthOrHeight( elem, name, extra );
+                                       }) :
+                                       getWidthOrHeight( elem, name, extra );
+                       }
+               },
+
+               set: function( elem, value, extra ) {
+                       var styles = extra && getStyles( elem );
+                       return setPositiveNumber( elem, value, extra ?
+                               augmentWidthOrHeight(
+                                       elem,
+                                       name,
+                                       extra,
+                                       jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+                                       styles
+                               ) : 0
+                       );
+               }
+       };
+});
+
+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) || "" ) ?
+                               ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+                               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 === "", then remove inline opacity #12685
+                       if ( ( value >= 1 || value === "" ) &&
+                                       jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+                                       style.removeAttribute ) {
+
+                               // 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 is no filter style applied in a css rule or unset inline opacity, we are done
+                               if ( value === "" || currentStyle && !currentStyle.filter ) {
+                                       return;
+                               }
+                       }
+
+                       // otherwise, set new filter values
+                       style.filter = ralpha.test( filter ) ?
+                               filter.replace( ralpha, opacity ) :
+                               filter + " " + opacity;
+               }
+       };
+}
+
+// These hooks cannot be added until DOM ready because the support test
+// for it is not run until after DOM ready
+jQuery(function() {
+       if ( !jQuery.support.reliableMarginRight ) {
+               jQuery.cssHooks.marginRight = {
+                       get: function( elem, computed ) {
+                               if ( computed ) {
+                                       // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+                                       // Work around by temporarily setting element display to inline-block
+                                       return jQuery.swap( elem, { "display": "inline-block" },
+                                               curCSS, [ elem, "marginRight" ] );
+                               }
+                       }
+               };
+       }
+
+       // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+       // getComputedStyle returns percent when specified for top/left/bottom/right
+       // rather than make the css module depend on the offset module, we just check for it here
+       if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
+               jQuery.each( [ "top", "left" ], function( i, prop ) {
+                       jQuery.cssHooks[ prop ] = {
+                               get: function( elem, computed ) {
+                                       if ( computed ) {
+                                               computed = curCSS( elem, prop );
+                                               // if curCSS returns percentage, fallback to offset
+                                               return rnumnonpx.test( computed ) ?
+                                                       jQuery( elem ).position()[ prop ] + "px" :
+                                                       computed;
+                                       }
+                               }
+                       };
+               });
+       }
+
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+       jQuery.expr.filters.hidden = function( elem ) {
+               return ( elem.offsetWidth === 0 && elem.offsetHeight === 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 );
+       };
+}
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+       margin: "",
+       padding: "",
+       border: "Width"
+}, function( prefix, suffix ) {
+       jQuery.cssHooks[ prefix + suffix ] = {
+               expand: function( value ) {
+                       var i = 0,
+                               expanded = {},
+
+                               // assumes a single number if not a string
+                               parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+                       for ( ; i < 4; i++ ) {
+                               expanded[ prefix + cssExpand[ i ] + suffix ] =
+                                       parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+                       }
+
+                       return expanded;
+               }
+       };
+
+       if ( !rmargin.test( prefix ) ) {
+               jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+       }
+});
+var r20 = /%20/g,
+       rbracket = /\[\]$/,
+       rCRLF = /\r?\n/g,
+       rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
+       rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+jQuery.fn.extend({
+       serialize: function() {
+               return jQuery.param( this.serializeArray() );
+       },
+       serializeArray: function() {
+               return this.map(function(){
+                       // Can add propHook for "elements" to filter or add form elements
+                       var elements = jQuery.prop( this, "elements" );
+                       return elements ? jQuery.makeArray( elements ) : this;
+               })
+               .filter(function(){
+                       var type = this.type;
+                       // Use .is(":disabled") so that fieldset[disabled] works
+                       return this.name && !jQuery( this ).is( ":disabled" ) &&
+                               rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+                               ( this.checked || !manipulation_rcheckableType.test( type ) );
+               })
+               .map(function( i, elem ){
+                       var val = jQuery( this ).val();
+
+                       return val == null ?
+                               null :
+                               jQuery.isArray( val ) ?
+                                       jQuery.map( val, function( val ){
+                                               return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+                                       }) :
+                                       { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+               }).get();
+       }
+});
+
+//Serialize an array of form elements or a set of
+//key/values into a query string
+jQuery.param = function( a, traditional ) {
+       var prefix,
+               s = [],
+               add = function( key, value ) {
+                       // If value is a function, invoke it and return its value
+                       value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+                       s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+               };
+
+       // Set traditional to true for jQuery <= 1.3.2 behavior.
+       if ( traditional === undefined ) {
+               traditional = jQuery.ajaxSettings && 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 ( prefix in a ) {
+                       buildParams( prefix, a[ prefix ], traditional, add );
+               }
+       }
+
+       // Return the resulting serialization
+       return s.join( "&" ).replace( r20, "+" );
+};
+
+function buildParams( prefix, obj, traditional, add ) {
+       var name;
+
+       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 {
+                               // Item is non-scalar (array or object), encode its numeric index.
+                               buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+                       }
+               });
+
+       } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+               // Serialize object item.
+               for ( name in obj ) {
+                       buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+               }
+
+       } else {
+               // Serialize scalar item.
+               add( prefix, obj );
+       }
+}
+var
+       // Document location
+       ajaxLocParts,
+       ajaxLocation,
+       
+       ajax_nonce = jQuery.now(),
+
+       ajax_rquery = /\?/,
+       rhash = /#.*$/,
+       rts = /([?&])_=[^&]*/,
+       rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+       // #7653, #8125, #8152: local protocol detection
+       rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+       rnoContent = /^(?:GET|HEAD)$/,
+       rprotocol = /^\/\//,
+       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 = {},
+
+       // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+       allTypes = "*/".concat("*");
+
+// #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 = "*";
+               }
+
+               var dataType,
+                       i = 0,
+                       dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
+
+               if ( jQuery.isFunction( func ) ) {
+                       // For each dataType in the dataTypeExpression
+                       while ( (dataType = dataTypes[i++]) ) {
+                               // Prepend if requested
+                               if ( dataType[0] === "+" ) {
+                                       dataType = dataType.slice( 1 ) || "*";
+                                       (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+                               // Otherwise append
+                               } else {
+                                       (structure[ dataType ] = structure[ dataType ] || []).push( func );
+                               }
+                       }
+               }
+       };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+       var inspected = {},
+               seekingTransport = ( structure === transports );
+
+       function inspect( dataType ) {
+               var selected;
+               inspected[ dataType ] = true;
+               jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+                       var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+                       if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+                               options.dataTypes.unshift( dataTypeOrTransport );
+                               inspect( dataTypeOrTransport );
+                               return false;
+                       } else if ( seekingTransport ) {
+                               return !( selected = dataTypeOrTransport );
+                       }
+               });
+               return selected;
+       }
+
+       return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// 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 );
+       }
+
+       return target;
+}
+
+jQuery.fn.load = function( url, params, callback ) {
+       if ( typeof url !== "string" && _load ) {
+               return _load.apply( this, arguments );
+       }
+
+       var selector, type, response,
+               self = this,
+               off = url.indexOf(" ");
+
+       if ( off >= 0 ) {
+               selector = url.slice( off, url.length );
+               url = url.slice( 0, off );
+       }
+
+       // 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 ( params && typeof params === "object" ) {
+               type = "POST";
+       }
+
+       // If we have elements to modify, make the request
+       if ( self.length > 0 ) {
+               jQuery.ajax({
+                       url: url,
+
+                       // if "type" variable is undefined, then "GET" method will be used
+                       type: type,
+                       dataType: "html",
+                       data: params
+               }).done(function( responseText ) {
+
+                       // Save response for use in complete callback
+                       response = arguments;
+
+                       self.html( selector ?
+
+                               // If a selector was specified, locate the right elements in a dummy div
+                               // Exclude scripts to avoid IE 'Permission Denied' errors
+                               jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+                               // Otherwise use the full result
+                               responseText );
+
+               }).complete( callback && function( jqXHR, status ) {
+                       self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+               });
+       }
+
+       return this;
+};
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
+       jQuery.fn[ type ] = function( fn ){
+               return this.on( type, fn );
+       };
+});
+
+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({
+                       url: url,
+                       type: method,
+                       dataType: type,
+                       data: data,
+                       success: callback
+               });
+       };
+});
+
+jQuery.extend({
+
+       // Counter for holding the number of active queries
+       active: 0,
+
+       // Last-Modified header cache for next request
+       lastModified: {},
+       etag: {},
+
+       ajaxSettings: {
+               url: ajaxLocation,
+               type: "GET",
+               isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+               global: true,
+               processData: true,
+               async: true,
+               contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+               /*
+               timeout: 0,
+               data: null,
+               dataType: null,
+               username: null,
+               password: null,
+               cache: null,
+               throws: false,
+               traditional: false,
+               headers: {},
+               */
+
+               accepts: {
+                       "*": allTypes,
+                       text: "text/plain",
+                       html: "text/html",
+                       xml: "application/xml, text/xml",
+                       json: "application/json, text/javascript"
+               },
+
+               contents: {
+                       xml: /xml/,
+                       html: /html/,
+                       json: /json/
+               },
+
+               responseFields: {
+                       xml: "responseXML",
+                       text: "responseText"
+               },
+
+               // Data converters
+               // Keys separate source (or catchall "*") and destination types with a single space
+               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: {
+                       url: true,
+                       context: true
+               }
+       },
+
+       // 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 ) {
+               return settings ?
+
+                       // Building a settings object
+                       ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+                       // Extending ajaxSettings
+                       ajaxExtend( jQuery.ajaxSettings, target );
+       },
+
+       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 transport,
+                       // URL without anti-cache param
+                       cacheURL,
+                       // Response headers
+                       responseHeadersString,
+                       responseHeaders,
+                       // timeout handle
+                       timeoutTimer,
+                       // Cross-domain detection vars
+                       parts,
+                       // To know if global events are to be dispatched
+                       fireGlobals,
+                       // Loop variable
+                       i,
+                       // Create the final options object
+                       s = jQuery.ajaxSetup( {}, options ),
+                       // Callbacks context
+                       callbackContext = s.context || s,
+                       // Context for global events is callbackContext if it is a DOM node or jQuery collection
+                       globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+                               jQuery( callbackContext ) :
+                               jQuery.event,
+                       // Deferreds
+                       deferred = jQuery.Deferred(),
+                       completeDeferred = jQuery.Callbacks("once memory"),
+                       // Status-dependent callbacks
+                       statusCode = s.statusCode || {},
+                       // Headers (they are sent all at once)
+                       requestHeaders = {},
+                       requestHeadersNames = {},
+                       // The jqXHR state
+                       state = 0,
+                       // Default abort message
+                       strAbort = "canceled",
+                       // Fake xhr
+                       jqXHR = {
+                               readyState: 0,
+
+                               // 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 == null ? null : match;
+                               },
+
+                               // Raw string
+                               getAllResponseHeaders: function() {
+                                       return state === 2 ? responseHeadersString : null;
+                               },
+
+                               // Caches the header
+                               setRequestHeader: function( name, value ) {
+                                       var lname = name.toLowerCase();
+                                       if ( !state ) {
+                                               name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+                                               requestHeaders[ name ] = value;
+                                       }
+                                       return this;
+                               },
+
+                               // Overrides response content-type header
+                               overrideMimeType: function( type ) {
+                                       if ( !state ) {
+                                               s.mimeType = type;
+                                       }
+                                       return this;
+                               },
+
+                               // Status-dependent callbacks
+                               statusCode: function( map ) {
+                                       var code;
+                                       if ( map ) {
+                                               if ( state < 2 ) {
+                                                       for ( code in map ) {
+                                                               // Lazy-add the new callback in a way that preserves old ones
+                                                               statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+                                                       }
+                                               } else {
+                                                       // Execute the appropriate callbacks
+                                                       jqXHR.always( map[ jqXHR.status ] );
+                                               }
+                                       }
+                                       return this;
+                               },
+
+                               // Cancel the request
+                               abort: function( statusText ) {
+                                       var finalText = statusText || strAbort;
+                                       if ( transport ) {
+                                               transport.abort( finalText );
+                                       }
+                                       done( 0, finalText );
+                                       return this;
+                               }
+                       };
+
+               // Attach deferreds
+               deferred.promise( jqXHR ).complete = completeDeferred.add;
+               jqXHR.success = jqXHR.done;
+               jqXHR.error = jqXHR.fail;
+
+               // Remove hash character (#7531: and string promotion)
+               // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+               // Handle falsy url in the settings object (#10093: consistency with old signature)
+               // We also use the url parameter if available
+               s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+               // Alias method option to type as per ticket #12004
+               s.type = options.method || options.type || s.method || s.type;
+
+               // Extract dataTypes list
+               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
+
+               // A cross-domain request is in order when we have a protocol:host:port mismatch
+               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 prefilter, stop there
+               if ( state === 2 ) {
+                       return jqXHR;
+               }
+
+               // We can fire global events as of now if asked to
+               fireGlobals = s.global;
+
+               // Watch for a new set of requests
+               if ( fireGlobals && jQuery.active++ === 0 ) {
+                       jQuery.event.trigger("ajaxStart");
+               }
+
+               // Uppercase the type
+               s.type = s.type.toUpperCase();
+
+               // Determine if request has content
+               s.hasContent = !rnoContent.test( s.type );
+
+               // Save the URL in case we're toying with the If-Modified-Since
+               // and/or If-None-Match header later on
+               cacheURL = s.url;
+
+               // More options handling for requests with no content
+               if ( !s.hasContent ) {
+
+                       // If data is available, append data to url
+                       if ( s.data ) {
+                               cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+                               // #9682: remove data so that it's not used in an eventual retry
+                               delete s.data;
+                       }
+
+                       // Add anti-cache in url if needed
+                       if ( s.cache === false ) {
+                               s.url = rts.test( cacheURL ) ?
+
+                                       // If there is already a '_' parameter, set its value
+                                       cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
+
+                                       // Otherwise add one to the end
+                                       cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
+                       }
+               }
+
+               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+               if ( s.ifModified ) {
+                       if ( jQuery.lastModified[ cacheURL ] ) {
+                               jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+                       }
+                       if ( jQuery.etag[ cacheURL ] ) {
+                               jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+                       }
+               }
+
+               // 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 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 and return
+                       return jqXHR.abort();
+               }
+
+               // aborting is no longer a cancellation
+               strAbort = "abort";
+
+               // 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;
+                               }
+                       }
+               }
+
+               // Callback for when everything is done
+               function done( status, nativeStatusText, responses, headers ) {
+                       var isSuccess, success, error, response, modified,
+                               statusText = nativeStatusText;
+
+                       // 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;
+
+                       // Get response data
+                       if ( responses ) {
+                               response = ajaxHandleResponses( s, jqXHR, responses );
+                       }
+
+                       // 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 ) {
+                                       modified = jqXHR.getResponseHeader("Last-Modified");
+                                       if ( modified ) {
+                                               jQuery.lastModified[ cacheURL ] = modified;
+                                       }
+                                       modified = jqXHR.getResponseHeader("etag");
+                                       if ( modified ) {
+                                               jQuery.etag[ cacheURL ] = modified;
+                                       }
+                               }
+
+                               // If not modified
+                               if ( status === 304 ) {
+                                       isSuccess = true;
+                                       statusText = "notmodified";
+
+                               // If we have data
+                               } else {
+                                       isSuccess = ajaxConvert( s, response );
+                                       statusText = isSuccess.state;
+                                       success = isSuccess.data;
+                                       error = isSuccess.error;
+                                       isSuccess = !error;
+                               }
+                       } else {
+                               // We extract error from statusText
+                               // then normalize statusText and status for non-aborts
+                               error = statusText;
+                               if ( status || !statusText ) {
+                                       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( isSuccess ? "ajaxSuccess" : "ajaxError",
+                                       [ 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");
+                               }
+                       }
+               }
+
+               return jqXHR;
+       },
+
+       getScript: function( url, callback ) {
+               return jQuery.get( url, undefined, callback, "script" );
+       },
+
+       getJSON: function( url, data, callback ) {
+               return jQuery.get( url, data, callback, "json" );
+       }
+});
+
+/* 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 ct, type, finalDataType, firstDataType,
+               contents = s.contents,
+               dataTypes = s.dataTypes,
+               responseFields = s.responseFields;
+
+       // 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 ) {
+
+       var conv, conv2, current, tmp,
+               converters = {},
+               i = 0,
+               // Work with a copy of dataTypes in case we need to modify it for conversion
+               dataTypes = s.dataTypes.slice(),
+               prev = dataTypes[ 0 ];
+
+       // Apply the dataFilter if provided
+       if ( s.dataFilter ) {
+               response = s.dataFilter( response, s.dataType );
+       }
+
+       // Create converters map with lowercased keys
+       if ( dataTypes[ 1 ] ) {
+               for ( conv in s.converters ) {
+                       converters[ conv.toLowerCase() ] = s.converters[ conv ];
+               }
+       }
+
+       // Convert to each sequential dataType, tolerating list modification
+       for ( ; (current = dataTypes[++i]); ) {
+
+               // There's only work to do if current dataType is non-auto
+               if ( current !== "*" ) {
+
+                       // Convert response if prev dataType is non-auto and differs from current
+                       if ( prev !== "*" && prev !== current ) {
+
+                               // Seek a direct converter
+                               conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+                               // If none found, seek a pair
+                               if ( !conv ) {
+                                       for ( conv2 in converters ) {
+
+                                               // If conv2 outputs current
+                                               tmp = conv2.split(" ");
+                                               if ( tmp[ 1 ] === current ) {
+
+                                                       // If prev can be converted to accepted input
+                                                       conv = converters[ prev + " " + tmp[ 0 ] ] ||
+                                                               converters[ "* " + tmp[ 0 ] ];
+                                                       if ( conv ) {
+                                                               // Condense equivalence converters
+                                                               if ( conv === true ) {
+                                                                       conv = converters[ conv2 ];
+
+                                                               // Otherwise, insert the intermediate dataType
+                                                               } else if ( converters[ conv2 ] !== true ) {
+                                                                       current = tmp[ 0 ];
+                                                                       dataTypes.splice( i--, 0, current );
+                                                               }
+
+                                                               break;
+                                                       }
+                                               }
+                                       }
+                               }
+
+                               // Apply converter (if not an equivalence)
+                               if ( conv !== true ) {
+
+                                       // Unless errors are allowed to bubble, catch and return them
+                                       if ( conv && s["throws"] ) {
+                                               response = conv( response );
+                                       } else {
+                                               try {
+                                                       response = conv( response );
+                                               } catch ( e ) {
+                                                       return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+                                               }
+                                       }
+                               }
+                       }
+
+                       // Update prev for next iteration
+                       prev = current;
+               }
+       }
+
+       return { state: "success", data: response };
+}
+// Install script dataType
+jQuery.ajaxSetup({
+       accepts: {
+               script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+       },
+       contents: {
+               script: /(?:java|ecma)script/
+       },
+       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 || jQuery("head")[0] || document.documentElement;
+
+               return {
+
+                       send: function( _, callback ) {
+
+                               script = document.createElement("script");
+
+                               script.async = true;
+
+                               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 ( script.parentNode ) {
+                                                       script.parentNode.removeChild( script );
+                                               }
+
+                                               // Dereference the script
+                                               script = null;
+
+                                               // Callback if not abort
+                                               if ( !isAbort ) {
+                                                       callback( 200, "success" );
+                                               }
+                                       }
+                               };
+
+                               // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+                               // Use native DOM manipulation to avoid our domManip AJAX trickery
+                               head.insertBefore( script, head.firstChild );
+                       },
+
+                       abort: function() {
+                               if ( script ) {
+                                       script.onload( undefined, true );
+                               }
+                       }
+               };
+       }
+});
+var oldCallbacks = [],
+       rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+       jsonp: "callback",
+       jsonpCallback: function() {
+               var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
+               this[ callback ] = true;
+               return callback;
+       }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+       var callbackName, overwritten, responseContainer,
+               jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+                       "url" :
+                       typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+               );
+
+       // Handle iff the expected data type is "jsonp" or we have a parameter to set
+       if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+               // Get callback name, remembering preexisting value associated with it
+               callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+                       s.jsonpCallback() :
+                       s.jsonpCallback;
+
+               // Insert callback into url or form data
+               if ( jsonProp ) {
+                       s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+               } else if ( s.jsonp !== false ) {
+                       s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+               }
+
+               // Use data converter to retrieve json after script execution
+               s.converters["script json"] = function() {
+                       if ( !responseContainer ) {
+                               jQuery.error( callbackName + " was not called" );
+                       }
+                       return responseContainer[ 0 ];
+               };
+
+               // force json dataType
+               s.dataTypes[ 0 ] = "json";
+
+               // Install callback
+               overwritten = window[ callbackName ];
+               window[ callbackName ] = function() {
+                       responseContainer = arguments;
+               };
+
+               // Clean-up function (fires after converters)
+               jqXHR.always(function() {
+                       // Restore preexisting value
+                       window[ callbackName ] = overwritten;
+
+                       // Save back as free
+                       if ( s[ callbackName ] ) {
+                               // make sure that re-using the options doesn't screw things around
+                               s.jsonpCallback = originalSettings.jsonpCallback;
+
+                               // save the callback name for future use
+                               oldCallbacks.push( callbackName );
+                       }
+
+                       // Call if it was a function and we have a response
+                       if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+                               overwritten( responseContainer[ 0 ] );
+                       }
+
+                       responseContainer = overwritten = undefined;
+               });
+
+               // Delegate to script
+               return "script";
+       }
+});
+var xhrCallbacks, xhrSupported,
+       xhrId = 0,
+       // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+       xhrOnUnloadAbort = window.ActiveXObject && function() {
+               // Abort all pending requests
+               var key;
+               for ( key in xhrCallbacks ) {
+                       xhrCallbacks[ key ]( undefined, true );
+               }
+       };
+
+// 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
+xhrSupported = jQuery.ajaxSettings.xhr();
+jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = jQuery.support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+       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 handle, i,
+                                               xhr = s.xhr();
+
+                                       // 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( err ) {}
+
+                                       // 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 occurred
+                                               // 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 {
+                                                                       responses = {};
+                                                                       status = xhr.status;
+                                                                       xml = xhr.responseXML;
+                                                                       responseHeaders = xhr.getAllResponseHeaders();
+
+                                                                       // Construct response list
+                                                                       if ( xml && xml.documentElement /* #4958 */ ) {
+                                                                               responses.xml = xml;
+                                                                       }
+
+                                                                       // When requesting binary data, IE6-9 will throw an exception
+                                                                       // on any attempt to access responseText (#11426)
+                                                                       if ( typeof xhr.responseText === "string" ) {
+                                                                               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 ( !s.async ) {
+                                               // if we're in sync mode we fire the callback
+                                               callback();
+                                       } else if ( xhr.readyState === 4 ) {
+                                               // (IE6 & IE7) if it's in cache and has been
+                                               // retrieved directly we need to fire the callback
+                                               setTimeout( 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( undefined, true );
+                                       }
+                               }
+                       };
+               }
+       });
+}
+var fxNow, timerId,
+       rfxtypes = /^(?:toggle|show|hide)$/,
+       rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+       rrun = /queueHooks$/,
+       animationPrefilters = [ defaultPrefilter ],
+       tweeners = {
+               "*": [function( prop, value ) {
+                       var end, unit,
+                               tween = this.createTween( prop, value ),
+                               parts = rfxnum.exec( value ),
+                               target = tween.cur(),
+                               start = +target || 0,
+                               scale = 1,
+                               maxIterations = 20;
+
+                       if ( parts ) {
+                               end = +parts[2];
+                               unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+
+                               // We need to compute starting value
+                               if ( unit !== "px" && start ) {
+                                       // Iteratively approximate from a nonzero starting point
+                                       // Prefer the current property, because this process will be trivial if it uses the same units
+                                       // Fallback to end or a simple constant
+                                       start = jQuery.css( tween.elem, prop, true ) || end || 1;
+
+                                       do {
+                                               // If previous iteration zeroed out, double until we get *something*
+                                               // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+                                               scale = scale || ".5";
+
+                                               // Adjust and apply
+                                               start = start / scale;
+                                               jQuery.style( tween.elem, prop, start + unit );
+
+                                       // Update scale, tolerating zero or NaN from tween.cur()
+                                       // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+                                       } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+                               }
+
+                               tween.unit = unit;
+                               tween.start = start;
+                               // If a +=/-= token was provided, we're doing a relative animation
+                               tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
+                       }
+                       return tween;
+               }]
+       };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+       setTimeout(function() {
+               fxNow = undefined;
+       });
+       return ( fxNow = jQuery.now() );
+}
+
+function createTweens( animation, props ) {
+       jQuery.each( props, function( prop, value ) {
+               var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+                       index = 0,
+                       length = collection.length;
+               for ( ; index < length; index++ ) {
+                       if ( collection[ index ].call( animation, prop, value ) ) {
+
+                               // we're done with this property
+                               return;
+                       }
+               }
+       });
+}
+
+function Animation( elem, properties, options ) {
+       var result,
+               stopped,
+               index = 0,
+               length = animationPrefilters.length,
+               deferred = jQuery.Deferred().always( function() {
+                       // don't match elem in the :animated selector
+                       delete tick.elem;
+               }),
+               tick = function() {
+                       if ( stopped ) {
+                               return false;
+                       }
+                       var currentTime = fxNow || createFxNow(),
+                               remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+                               // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+                               temp = remaining / animation.duration || 0,
+                               percent = 1 - temp,
+                               index = 0,
+                               length = animation.tweens.length;
+
+                       for ( ; index < length ; index++ ) {
+                               animation.tweens[ index ].run( percent );
+                       }
+
+                       deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+                       if ( percent < 1 && length ) {
+                               return remaining;
+                       } else {
+                               deferred.resolveWith( elem, [ animation ] );
+                               return false;
+                       }
+               },
+               animation = deferred.promise({
+                       elem: elem,
+                       props: jQuery.extend( {}, properties ),
+                       opts: jQuery.extend( true, { specialEasing: {} }, options ),
+                       originalProperties: properties,
+                       originalOptions: options,
+                       startTime: fxNow || createFxNow(),
+                       duration: options.duration,
+                       tweens: [],
+                       createTween: function( prop, end ) {
+                               var tween = jQuery.Tween( elem, animation.opts, prop, end,
+                                               animation.opts.specialEasing[ prop ] || animation.opts.easing );
+                               animation.tweens.push( tween );
+                               return tween;
+                       },
+                       stop: function( gotoEnd ) {
+                               var index = 0,
+                                       // if we are going to the end, we want to run all the tweens
+                                       // otherwise we skip this part
+                                       length = gotoEnd ? animation.tweens.length : 0;
+                               if ( stopped ) {
+                                       return this;
+                               }
+                               stopped = true;
+                               for ( ; index < length ; index++ ) {
+                                       animation.tweens[ index ].run( 1 );
+                               }
+
+                               // resolve when we played the last frame
+                               // otherwise, reject
+                               if ( gotoEnd ) {
+                                       deferred.resolveWith( elem, [ animation, gotoEnd ] );
+                               } else {
+                                       deferred.rejectWith( elem, [ animation, gotoEnd ] );
+                               }
+                               return this;
+                       }
+               }),
+               props = animation.props;
+
+       propFilter( props, animation.opts.specialEasing );
+
+       for ( ; index < length ; index++ ) {
+               result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+               if ( result ) {
+                       return result;
+               }
+       }
+
+       createTweens( animation, props );
+
+       if ( jQuery.isFunction( animation.opts.start ) ) {
+               animation.opts.start.call( elem, animation );
+       }
+
+       jQuery.fx.timer(
+               jQuery.extend( tick, {
+                       elem: elem,
+                       anim: animation,
+                       queue: animation.opts.queue
+               })
+       );
+
+       // attach callbacks from options
+       return animation.progress( animation.opts.progress )
+               .done( animation.opts.done, animation.opts.complete )
+               .fail( animation.opts.fail )
+               .always( animation.opts.always );
+}
+
+function propFilter( props, specialEasing ) {
+       var index, name, easing, value, hooks;
+
+       // camelCase, specialEasing and expand cssHook pass
+       for ( index in props ) {
+               name = jQuery.camelCase( index );
+               easing = specialEasing[ name ];
+               value = props[ index ];
+               if ( jQuery.isArray( value ) ) {
+                       easing = value[ 1 ];
+                       value = props[ index ] = value[ 0 ];
+               }
+
+               if ( index !== name ) {
+                       props[ name ] = value;
+                       delete props[ index ];
+               }
+
+               hooks = jQuery.cssHooks[ name ];
+               if ( hooks && "expand" in hooks ) {
+                       value = hooks.expand( value );
+                       delete props[ name ];
+
+                       // not quite $.extend, this wont overwrite keys already present.
+                       // also - reusing 'index' from above because we have the correct "name"
+                       for ( index in value ) {
+                               if ( !( index in props ) ) {
+                                       props[ index ] = value[ index ];
+                                       specialEasing[ index ] = easing;
+                               }
+                       }
+               } else {
+                       specialEasing[ name ] = easing;
+               }
+       }
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+       tweener: function( props, callback ) {
+               if ( jQuery.isFunction( props ) ) {
+                       callback = props;
+                       props = [ "*" ];
+               } else {
+                       props = props.split(" ");
+               }
+
+               var prop,
+                       index = 0,
+                       length = props.length;
+
+               for ( ; index < length ; index++ ) {
+                       prop = props[ index ];
+                       tweeners[ prop ] = tweeners[ prop ] || [];
+                       tweeners[ prop ].unshift( callback );
+               }
+       },
+
+       prefilter: function( callback, prepend ) {
+               if ( prepend ) {
+                       animationPrefilters.unshift( callback );
+               } else {
+                       animationPrefilters.push( callback );
+               }
+       }
+});
+
+function defaultPrefilter( elem, props, opts ) {
+       /*jshint validthis:true */
+       var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
+               anim = this,
+               style = elem.style,
+               orig = {},
+               handled = [],
+               hidden = elem.nodeType && isHidden( elem );
+
+       // handle queue: false promises
+       if ( !opts.queue ) {
+               hooks = jQuery._queueHooks( elem, "fx" );
+               if ( hooks.unqueued == null ) {
+                       hooks.unqueued = 0;
+                       oldfire = hooks.empty.fire;
+                       hooks.empty.fire = function() {
+                               if ( !hooks.unqueued ) {
+                                       oldfire();
+                               }
+                       };
+               }
+               hooks.unqueued++;
+
+               anim.always(function() {
+                       // doing this makes sure that the complete handler will be called
+                       // before this completes
+                       anim.always(function() {
+                               hooks.unqueued--;
+                               if ( !jQuery.queue( elem, "fx" ).length ) {
+                                       hooks.empty.fire();
+                               }
+                       });
+               });
+       }
+
+       // height/width overflow pass
+       if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+               // 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
+               opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+               // Set display property to inline-block for height/width
+               // animations on inline elements that are having width/height animated
+               if ( jQuery.css( elem, "display" ) === "inline" &&
+                               jQuery.css( elem, "float" ) === "none" ) {
+
+                       // inline-level elements accept inline-block;
+                       // block-level elements need to be inline with layout
+                       if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
+                               style.display = "inline-block";
+
+                       } else {
+                               style.zoom = 1;
+                       }
+               }
+       }
+
+       if ( opts.overflow ) {
+               style.overflow = "hidden";
+               if ( !jQuery.support.shrinkWrapBlocks ) {
+                       anim.done(function() {
+                               style.overflow = opts.overflow[ 0 ];
+                               style.overflowX = opts.overflow[ 1 ];
+                               style.overflowY = opts.overflow[ 2 ];
+                       });
+               }
+       }
+
+
+       // show/hide pass
+       for ( index in props ) {
+               value = props[ index ];
+               if ( rfxtypes.exec( value ) ) {
+                       delete props[ index ];
+                       toggle = toggle || value === "toggle";
+                       if ( value === ( hidden ? "hide" : "show" ) ) {
+                               continue;
+                       }
+                       handled.push( index );
+               }
+       }
+
+       length = handled.length;
+       if ( length ) {
+               dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
+               if ( "hidden" in dataShow ) {
+                       hidden = dataShow.hidden;
+               }
+
+               // store state if its toggle - enables .stop().toggle() to "reverse"
+               if ( toggle ) {
+                       dataShow.hidden = !hidden;
+               }
+               if ( hidden ) {
+                       jQuery( elem ).show();
+               } else {
+                       anim.done(function() {
+                               jQuery( elem ).hide();
+                       });
+               }
+               anim.done(function() {
+                       var prop;
+                       jQuery._removeData( elem, "fxshow" );
+                       for ( prop in orig ) {
+                               jQuery.style( elem, prop, orig[ prop ] );
+                       }
+               });
+               for ( index = 0 ; index < length ; index++ ) {
+                       prop = handled[ index ];
+                       tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
+                       orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
+
+                       if ( !( prop in dataShow ) ) {
+                               dataShow[ prop ] = tween.start;
+                               if ( hidden ) {
+                                       tween.end = tween.start;
+                                       tween.start = prop === "width" || prop === "height" ? 1 : 0;
+                               }
+                       }
+               }
+       }
+}
+
+function Tween( elem, options, prop, end, easing ) {
+       return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+       constructor: Tween,
+       init: function( elem, options, prop, end, easing, unit ) {
+               this.elem = elem;
+               this.prop = prop;
+               this.easing = easing || "swing";
+               this.options = options;
+               this.start = this.now = this.cur();
+               this.end = end;
+               this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+       },
+       cur: function() {
+               var hooks = Tween.propHooks[ this.prop ];
+
+               return hooks && hooks.get ?
+                       hooks.get( this ) :
+                       Tween.propHooks._default.get( this );
+       },
+       run: function( percent ) {
+               var eased,
+                       hooks = Tween.propHooks[ this.prop ];
+
+               if ( this.options.duration ) {
+                       this.pos = eased = jQuery.easing[ this.easing ](
+                               percent, this.options.duration * percent, 0, 1, this.options.duration
+                       );
+               } else {
+                       this.pos = eased = percent;
+               }
+               this.now = ( this.end - this.start ) * eased + this.start;
+
+               if ( this.options.step ) {
+                       this.options.step.call( this.elem, this.now, this );
+               }
+
+               if ( hooks && hooks.set ) {
+                       hooks.set( this );
+               } else {
+                       Tween.propHooks._default.set( this );
+               }
+               return this;
+       }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+       _default: {
+               get: function( tween ) {
+                       var result;
+
+                       if ( tween.elem[ tween.prop ] != null &&
+                               (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+                               return tween.elem[ tween.prop ];
+                       }
+
+                       // passing a non empty string as a 3rd parameter to .css will automatically
+                       // attempt a parseFloat and fallback to a string if the parse fails
+                       // so, simple values such as "10px" are parsed to Float.
+                       // complex values such as "rotate(1rad)" are returned as is.
+                       result = jQuery.css( tween.elem, tween.prop, "auto" );
+                       // Empty strings, null, undefined and "auto" are converted to 0.
+                       return !result || result === "auto" ? 0 : result;
+               },
+               set: function( tween ) {
+                       // use step hook for back compat - use cssHook if its there - use .style if its
+                       // available and use plain properties where available
+                       if ( jQuery.fx.step[ tween.prop ] ) {
+                               jQuery.fx.step[ tween.prop ]( tween );
+                       } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+                               jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+                       } else {
+                               tween.elem[ tween.prop ] = tween.now;
+                       }
+               }
+       }
+};
+
+// Remove in 2.0 - this supports IE8's panic based approach
+// to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+       set: function( tween ) {
+               if ( tween.elem.nodeType && tween.elem.parentNode ) {
+                       tween.elem[ tween.prop ] = tween.now;
+               }
+       }
+};
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+       var cssFn = jQuery.fn[ name ];
+       jQuery.fn[ name ] = function( speed, easing, callback ) {
+               return speed == null || typeof speed === "boolean" ?
+                       cssFn.apply( this, arguments ) :
+                       this.animate( genFx( name, true ), speed, easing, callback );
+       };
+});
+
+jQuery.fn.extend({
+       fadeTo: function( speed, to, easing, callback ) {
+
+               // show any hidden elements after setting opacity to 0
+               return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+                       // animate to the value specified
+                       .end().animate({ opacity: to }, speed, easing, callback );
+       },
+       animate: function( prop, speed, easing, callback ) {
+               var empty = jQuery.isEmptyObject( prop ),
+                       optall = jQuery.speed( speed, easing, callback ),
+                       doAnimation = function() {
+                               // Operate on a copy of prop so per-property easing won't be lost
+                               var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+                               doAnimation.finish = function() {
+                                       anim.stop( true );
+                               };
+                               // Empty animations, or finishing resolves immediately
+                               if ( empty || jQuery._data( this, "finish" ) ) {
+                                       anim.stop( true );
+                               }
+                       };
+                       doAnimation.finish = doAnimation;
+
+               return empty || optall.queue === false ?
+                       this.each( doAnimation ) :
+                       this.queue( optall.queue, doAnimation );
+       },
+       stop: function( type, clearQueue, gotoEnd ) {
+               var stopQueue = function( hooks ) {
+                       var stop = hooks.stop;
+                       delete hooks.stop;
+                       stop( gotoEnd );
+               };
+
+               if ( typeof type !== "string" ) {
+                       gotoEnd = clearQueue;
+                       clearQueue = type;
+                       type = undefined;
+               }
+               if ( clearQueue && type !== false ) {
+                       this.queue( type || "fx", [] );
+               }
+
+               return this.each(function() {
+                       var dequeue = true,
+                               index = type != null && type + "queueHooks",
+                               timers = jQuery.timers,
+                               data = jQuery._data( this );
+
+                       if ( index ) {
+                               if ( data[ index ] && data[ index ].stop ) {
+                                       stopQueue( data[ index ] );
+                               }
+                       } else {
+                               for ( index in data ) {
+                                       if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+                                               stopQueue( data[ index ] );
+                                       }
+                               }
+                       }
+
+                       for ( index = timers.length; index--; ) {
+                               if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+                                       timers[ index ].anim.stop( gotoEnd );
+                                       dequeue = false;
+                                       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 ( dequeue || !gotoEnd ) {
+                               jQuery.dequeue( this, type );
+                       }
+               });
+       },
+       finish: function( type ) {
+               if ( type !== false ) {
+                       type = type || "fx";
+               }
+               return this.each(function() {
+                       var index,
+                               data = jQuery._data( this ),
+                               queue = data[ type + "queue" ],
+                               hooks = data[ type + "queueHooks" ],
+                               timers = jQuery.timers,
+                               length = queue ? queue.length : 0;
+
+                       // enable finishing flag on private data
+                       data.finish = true;
+
+                       // empty the queue first
+                       jQuery.queue( this, type, [] );
+
+                       if ( hooks && hooks.cur && hooks.cur.finish ) {
+                               hooks.cur.finish.call( this );
+                       }
+
+                       // look for any active animations, and finish them
+                       for ( index = timers.length; index--; ) {
+                               if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+                                       timers[ index ].anim.stop( true );
+                                       timers.splice( index, 1 );
+                               }
+                       }
+
+                       // look for any animations in the old queue and finish them
+                       for ( index = 0; index < length; index++ ) {
+                               if ( queue[ index ] && queue[ index ].finish ) {
+                                       queue[ index ].finish.call( this );
+                               }
+                       }
+
+                       // turn off finishing flag
+                       delete data.finish;
+               });
+       }
+});
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+       var which,
+               attrs = { height: type },
+               i = 0;
+
+       // if we include width, step value is 1 to do all cssExpand values,
+       // if we don't include width, step value is 2 to skip over Left and Right
+       includeWidth = includeWidth? 1 : 0;
+       for( ; i < 4 ; i += 2 - includeWidth ) {
+               which = cssExpand[ i ];
+               attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+       }
+
+       if ( includeWidth ) {
+               attrs.opacity = attrs.width = type;
+       }
+
+       return attrs;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+       slideDown: genFx("show"),
+       slideUp: genFx("hide"),
+       slideToggle: genFx("toggle"),
+       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.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() {
+               if ( jQuery.isFunction( opt.old ) ) {
+                       opt.old.call( this );
+               }
+
+               if ( opt.queue ) {
+                       jQuery.dequeue( this, opt.queue );
+               }
+       };
+
+       return opt;
+};
+
+jQuery.easing = {
+       linear: function( p ) {
+               return p;
+       },
+       swing: function( p ) {
+               return 0.5 - Math.cos( p*Math.PI ) / 2;
+       }
+};
+
+jQuery.timers = [];
+jQuery.fx = Tween.prototype.init;
+jQuery.fx.tick = function() {
+       var timer,
+               timers = jQuery.timers,
+               i = 0;
+
+       fxNow = jQuery.now();
+
+       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();
+       }
+       fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+       if ( timer() && jQuery.timers.push( timer ) ) {
+               jQuery.fx.start();
+       }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+       if ( !timerId ) {
+               timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+       }
+};
+
+jQuery.fx.stop = function() {
+       clearInterval( timerId );
+       timerId = null;
+};
+
+jQuery.fx.speeds = {
+       slow: 600,
+       fast: 200,
+       // Default speed
+       _default: 400
+};
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+       jQuery.expr.filters.animated = function( elem ) {
+               return jQuery.grep(jQuery.timers, function( fn ) {
+                       return elem === fn.elem;
+               }).length;
+       };
+}
+jQuery.fn.offset = function( options ) {
+       if ( arguments.length ) {
+               return options === undefined ?
+                       this :
+                       this.each(function( i ) {
+                               jQuery.offset.setOffset( this, options, i );
+                       });
+       }
+
+       var docElem, win,
+               box = { top: 0, left: 0 },
+               elem = this[ 0 ],
+               doc = elem && elem.ownerDocument;
+
+       if ( !doc ) {
+               return;
+       }
+
+       docElem = doc.documentElement;
+
+       // Make sure it's not a disconnected DOM node
+       if ( !jQuery.contains( docElem, elem ) ) {
+               return box;
+       }
+
+       // If we don't have gBCR, just use 0,0 rather than error
+       // BlackBerry 5, iOS 3 (original iPhone)
+       if ( typeof elem.getBoundingClientRect !== "undefined" ) {
+               box = elem.getBoundingClientRect();
+       }
+       win = getWindow( doc );
+       return {
+               top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
+               left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+       };
+};
+
+jQuery.offset = {
+
+       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;
+               }
+
+               var offsetParent, offset,
+                       parentOffset = { top: 0, left: 0 },
+                       elem = this[ 0 ];
+
+               // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+               if ( jQuery.css( elem, "position" ) === "fixed" ) {
+                       // we assume that getBoundingClientRect is available when computed position is fixed
+                       offset = elem.getBoundingClientRect();
+               } else {
+                       // Get *real* offsetParent
+                       offsetParent = this.offsetParent();
+
+                       // Get correct offsets
+                       offset = this.offset();
+                       if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+                               parentOffset = offsetParent.offset();
+                       }
+
+                       // Add offsetParent borders
+                       parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+                       parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+               }
+
+               // Subtract parent offsets and 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
+               return {
+                       top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+                       left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+               };
+       },
+
+       offsetParent: function() {
+               return this.map(function() {
+                       var offsetParent = this.offsetParent || document.documentElement;
+                       while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
+                               offsetParent = offsetParent.offsetParent;
+                       }
+                       return offsetParent || document.documentElement;
+               });
+       }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+       var top = /Y/.test( prop );
+
+       jQuery.fn[ method ] = function( val ) {
+               return jQuery.access( this, function( elem, method, val ) {
+                       var win = getWindow( elem );
+
+                       if ( val === undefined ) {
+                               return win ? (prop in win) ? win[ prop ] :
+                                       win.document.documentElement[ method ] :
+                                       elem[ method ];
+                       }
+
+                       if ( win ) {
+                               win.scrollTo(
+                                       !top ? val : jQuery( win ).scrollLeft(),
+                                       top ? val : jQuery( win ).scrollTop()
+                               );
+
+                       } else {
+                               elem[ method ] = val;
+                       }
+               }, method, val, arguments.length, null );
+       };
+});
+
+function getWindow( elem ) {
+       return jQuery.isWindow( elem ) ?
+               elem :
+               elem.nodeType === 9 ?
+                       elem.defaultView || elem.parentWindow :
+                       false;
+}
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+       jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+               // margin is only for outerHeight, outerWidth
+               jQuery.fn[ funcName ] = function( margin, value ) {
+                       var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+                               extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+                       return jQuery.access( this, function( elem, type, value ) {
+                               var doc;
+
+                               if ( jQuery.isWindow( elem ) ) {
+                                       // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+                                       // isn't a whole lot we can do. See pull request at this URL for discussion:
+                                       // https://github.com/jquery/jquery/pull/764
+                                       return elem.document.documentElement[ "client" + name ];
+                               }
+
+                               // Get document width or height
+                               if ( elem.nodeType === 9 ) {
+                                       doc = elem.documentElement;
+
+                                       // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+                                       // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+                                       return Math.max(
+                                               elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+                                               elem.body[ "offset" + name ], doc[ "offset" + name ],
+                                               doc[ "client" + name ]
+                                       );
+                               }
+
+                               return value === undefined ?
+                                       // Get width or height on the element, requesting but not forcing parseFloat
+                                       jQuery.css( elem, type, extra ) :
+
+                                       // Set width or height on the element
+                                       jQuery.style( elem, type, value, extra );
+                       }, type, chainable ? margin : undefined, chainable, null );
+               };
+       });
+});
+// Limit scope pollution from any deprecated API
+// (function() {
+
+// })();
+// 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/portal/static/unbound_reservation_static/lib/jquery-ui-1.9.2-min.js b/portal/static/unbound_reservation_static/lib/jquery-ui-1.9.2-min.js
new file mode 100644 (file)
index 0000000..bc01354
--- /dev/null
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.9.2 - 2012-11-23
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
+* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
+(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery),function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})}(jQuery),function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})}(jQuery),function(e,t){e.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}}(jQuery),function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}}(jQuery),function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}(jQuery),function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})}(jQuery),jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function d(e){var n=o(),r=n._rgba=[];return e=e.toLowerCase(),h(s,function(t,i){var s,o=i.re.exec(e),a=o&&i.parse(o),f=i.space||"rgba";if(a)return s=n[f](a),n[u[f].cache]=s[u[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&t.extend(r,c.transparent),n):c[e]}function v(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],o=t.Color=function(e,n,r,i){return new t.Color.fn.parse(e,n,r,i)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},a={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},f=o.support={},l=t("<p>")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,n){var i,s;for(s=0;s<n.length;s++)n[s]!==null&&(i=e.data(r+n[s]),i===t&&(i=""),e.css(n[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery),function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype))}(jQuery),function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgiframe&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this.document.find(t||"body")[0]),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})}(jQuery),function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){$(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$('<span class="'+this._appendClass+'">'+n+"</span>"),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var r=this._getInst(e);if(arguments.length==2&&typeof t=="string")return t=="defaults"?$.extend({},$.datepicker._defaults):r?t=="all"?$.extend({},r.settings):this._get(r,t):null;var i=t||{};typeof t=="string"&&(i={},i[t]=n);if(r){this._curInst==r&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),o=this._getMinMaxDate(r,"min"),u=this._getMinMaxDate(r,"max");extendRemove(r.settings,i),o!==null&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,o)),u!==null&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,u)),this._attachments($(e),r),this._autoSize(r),this._setDate(r,s),this._updateAlternate(r),this._updateDatepicker(r)}},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),n=!0,r=t.dpDiv.is(".ui-datepicker-rtl");t._keyEvent=!0;if($.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),n=!1;break;case 13:var i=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);i[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,i[0]);var s=$.datepicker._get(t,"onSelect");if(s){var o=$.datepicker._formatDate(t);s.apply(t.input?t.input[0]:null,[o,t])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),n=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),n=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?1:-1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),n=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?-1:1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),n=e.ctrlKey||e.metaKey;break;default:n=!1}else e.keyCode==36&&e.ctrlKey?$.datepicker._showDatepicker(this):n=!1;n&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i});var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;var t=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var n=e.dpDiv.find("iframe.ui-datepicker-cover");!n.length||n.css({left:-t[0],top:-t[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),i=r[1],s=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),e.dpDiv[(r[0]!=1||r[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var o=e.yearshtml;setTimeout(function(){o===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),o=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&($.effects.effect[n]||$.effects[n])?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length){var w=t.substr(g);if(!/^\s+/.test(w))throw"Extra/unparsed characters found in date: "+w}a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var E=this._getDaysInMonth(a,f-1);if(l<=E)break;f++,l-=E}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":l+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&v<c?c:v;while(this._daylightSavingAdjust(new Date(d,p,1))>v)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>":i?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>":i?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=e.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(e,"closeText")+"</button>",x=r?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(n?S:"")+(this._isInRange(e,E)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+w+"</button>":"")+(n?"":S)+"</div>":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j<o[0];j++){var F="";this.maxRows=4;for(var I=0;I<o[1];I++){var q=this._daylightSavingAdjust(new Date(d,p,e.selectedDay)),R=" ui-corner-all",U="";if(f){U+='<div class="ui-datepicker-group';if(o[1]>1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var z=N?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="<th"+((W+T+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+C[X]+'">'+L[X]+"</span></th>"}U+=z+"</tr></thead><tbody>";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y<Q;Y++){U+="<tr>";var Z=N?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(G)+"</td>":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&G<c||h&&G>h;Z+='<td class="'+((W+T+6)%7>=5?" ui-datepicker-week-end":"")+(tt?" ui-datepicker-other-month":"")+(G.getTime()==q.getTime()&&p==e.selectedMonth&&e._keyEvent||H.getTime()==G.getTime()&&H.getTime()==q.getTime()?" "+this._dayOverClass:"")+(nt?" "+this._unselectableClass+" ui-state-disabled":"")+(tt&&!_?"":" "+et[1]+(G.getTime()==l.getTime()?" "+this._currentClass:"")+(G.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+((!tt||_)&&et[2]?' title="'+et[2]+'"':"")+(nt?"":' data-handler="selectDay" data-event="click" data-month="'+G.getMonth()+'" data-year="'+G.getFullYear()+'"')+">"+(tt&&!_?"&#xa0;":nt?'<span class="ui-state-default">'+G.getDate()+"</span>":'<a class="ui-state-default'+(G.getTime()==t.getTime()?" ui-state-highlight":"")+(G.getTime()==l.getTime()?" ui-state-active":"")+(tt?" ui-priority-secondary":"")+'" href="#">'+G.getDate()+"</a>")+"</td>",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+"</tr>"}p++,p>11&&(p=0,d++),U+="</tbody></table>"+(f?"</div>"+(o[0]>0&&I==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',h="";if(s||!a)h+='<span class="ui-datepicker-month">'+o[t]+"</span>";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var v=0;v<12;v++)(!p||v>=r.getMonth())&&(!d||v<=i.getMonth())&&(h+='<option value="'+v+'"'+(v==t?' selected="selected"':"")+">"+u[v]+"</option>");h+="</select>"}l||(c+=h+(s||!a||!f?"&#xa0;":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+='<span class="ui-datepicker-year">'+n+"</span>";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;b<=w;b++)e.yearshtml+='<option value="'+b+'"'+(b==n?' selected="selected"':"")+">"+b+"</option>";e.yearshtml+="</select>",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?"&#xa0;":"")+h),c+="</div>",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return i=r&&i>r?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||"&#160;",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar  ui-widget-header  ui-corner-all  ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close  ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("<button></button>",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||"&#160;"))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})}(jQuery),function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}}(jQuery),function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}}(jQuery),function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}}(jQuery),function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}}(jQuery),function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}}(jQuery),function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}}(jQuery),function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})}(jQuery),function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)}(jQuery),function(e,t){e.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})}(jQuery),function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})}(jQuery),function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})}(jQuery),function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))}(jQuery),function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})}(jQuery);
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/jsBezier-0.6-min.js b/portal/static/unbound_reservation_static/lib/jsBezier-0.6-min.js
new file mode 100644 (file)
index 0000000..0054c6c
--- /dev/null
@@ -0,0 +1,8 @@
+(function(){"undefined"==typeof Math.sgn&&(Math.sgn=function(a){return 0==a?0:0<a?1:-1});var q={subtract:function(a,b){return{x:a.x-b.x,y:a.y-b.y}},dotProduct:function(a,b){return a.x*b.x+a.y*b.y},square:function(a){return Math.sqrt(a.x*a.x+a.y*a.y)},scale:function(a,b){return{x:a.x*b,y:a.y*b}}},B=Math.pow(2,-65),x=function(a,b){for(var f=[],d=b.length-1,g=2*d-1,h=[],e=[],m=[],k=[],l=[[1,0.6,0.3,0.1],[0.4,0.6,0.6,0.4],[0.1,0.3,0.6,1]],c=0;c<=d;c++)h[c]=q.subtract(b[c],a);for(c=0;c<=d-1;c++)e[c]=q.subtract(b[c+
+1],b[c]),e[c]=q.scale(e[c],3);for(c=0;c<=d-1;c++)for(var n=0;n<=d;n++)m[c]||(m[c]=[]),m[c][n]=q.dotProduct(e[c],h[n]);for(c=0;c<=g;c++)k[c]||(k[c]=[]),k[c].y=0,k[c].x=parseFloat(c)/g;g=d-1;for(h=0;h<=d+g;h++){c=Math.max(0,h-g);for(e=Math.min(h,d);c<=e;c++)j=h-c,k[c+j].y+=m[j][c]*l[j][c]}d=b.length-1;k=u(k,2*d-1,f,0);g=q.subtract(a,b[0]);m=q.square(g);for(c=l=0;c<k;c++)g=q.subtract(a,v(b,d,f[c],null,null)),g=q.square(g),g<m&&(m=g,l=f[c]);g=q.subtract(a,b[d]);g=q.square(g);g<m&&(m=g,l=1);return{location:l,
+distance:m}},u=function(a,b,f,d){var g=[],h=[],e=[],m=[],k=0,l,c;c=Math.sgn(a[0].y);for(var n=1;n<=b;n++)l=Math.sgn(a[n].y),l!=c&&k++,c=l;switch(k){case 0:return 0;case 1:if(64<=d)return f[0]=(a[0].x+a[b].x)/2,1;var r,p,k=a[0].y-a[b].y;c=a[b].x-a[0].x;n=a[0].x*a[b].y-a[b].x*a[0].y;l=max_distance_below=0;for(r=1;r<b;r++)p=k*a[r].x+c*a[r].y+n,p>l?l=p:p<max_distance_below&&(max_distance_below=p);p=c;r=0*p-1*k;l=(1*(n-l)-0*p)*(1/r);p=c;c=n-max_distance_below;r=0*p-1*k;k=(1*c-0*p)*(1/r);c=Math.min(l,k);
+if(Math.max(l,k)-c<B)return e=a[b].x-a[0].x,m=a[b].y-a[0].y,f[0]=0+1*(e*(a[0].y-0)-m*(a[0].x-0))*(1/(0*e-1*m)),1}v(a,b,0.5,g,h);a=u(g,b,e,d+1);b=u(h,b,m,d+1);for(d=0;d<a;d++)f[d]=e[d];for(d=0;d<b;d++)f[d+a]=m[d];return a+b},v=function(a,b,f,d,g){for(var h=[[]],e=0;e<=b;e++)h[0][e]=a[e];for(a=1;a<=b;a++)for(e=0;e<=b-a;e++)h[a]||(h[a]=[]),h[a][e]||(h[a][e]={}),h[a][e].x=(1-f)*h[a-1][e].x+f*h[a-1][e+1].x,h[a][e].y=(1-f)*h[a-1][e].y+f*h[a-1][e+1].y;if(null!=d)for(e=0;e<=b;e++)d[e]=h[e][0];if(null!=g)for(e=
+0;e<=b;e++)g[e]=h[b-e][e];return h[b][0]},y={},s=function(a,b){var f,d=a.length-1;f=y[d];if(!f){f=[];var g=function(a){return function(){return a}},h=function(){return function(a){return a}},e=function(){return function(a){return 1-a}},m=function(a){return function(b){for(var c=1,d=0;d<a.length;d++)c*=a[d](b);return c}};f.push(new function(){return function(a){return Math.pow(a,d)}});for(var k=1;k<d;k++){for(var l=[new g(d)],c=0;c<d-k;c++)l.push(new h);for(c=0;c<k;c++)l.push(new e);f.push(new m(l))}f.push(new function(){return function(a){return Math.pow(1-
+a,d)}});y[d]=f}for(e=h=g=0;e<a.length;e++)g+=a[e].x*f[e](b),h+=a[e].y*f[e](b);return{x:g,y:h}},z=function(a,b){return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2))},A=function(a){return a[0].x==a[1].x&&a[0].y==a[1].y},t=function(a,b,f){if(A(a))return{point:a[0],location:b};for(var d=s(a,b),g=0,h=0<f?1:-1,e=null;g<Math.abs(f);)b+=0.005*h,e=s(a,b),g+=z(e,d),d=e;return{point:e,location:b}},w=function(a,b){var f=s(a,b),d=s(a.slice(0,a.length-1),b),g=d.y-f.y,f=d.x-f.x;return 0==g?Infinity:Math.atan(g/
+f)};window.jsBezier={distanceFromCurve:x,gradientAtPoint:w,gradientAtPointAlongCurveFrom:function(a,b,f){b=t(a,b,f);1<b.location&&(b.location=1);0>b.location&&(b.location=0);return w(a,b.location)},nearestPointOnCurve:function(a,b){var f=x(a,b);return{point:v(b,b.length-1,f.location,null,null),location:f.location}},pointOnCurve:s,pointAlongCurveFrom:function(a,b,f){return t(a,b,f).point},perpendicularToCurveAt:function(a,b,f,d){b=t(a,b,null==d?0:d);a=w(a,b.location);d=Math.atan(-1/a);a=f/2*Math.sin(d);
+f=f/2*Math.cos(d);return[{x:b.point.x+f,y:b.point.y+a},{x:b.point.x-f,y:b.point.y-a}]},locationAlongCurveFrom:function(a,b,f){return t(a,b,f).location},getLength:function(a){if(A(a))return 0;for(var b=s(a,0),f=0,d=0,g=null;1>d;)d+=0.005,g=s(a,d),f+=z(g,b),b=g;return f}}})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/jsBezier-0.6.js b/portal/static/unbound_reservation_static/lib/jsBezier-0.6.js
new file mode 100644 (file)
index 0000000..47ad1b1
--- /dev/null
@@ -0,0 +1,422 @@
+/**
+* jsBezier-0.6
+*
+* Copyright (c) 2010 - 2013 Simon Porritt (simon.porritt@gmail.com)
+*
+* licensed under the MIT license.
+* 
+* a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people.  These functions work with Bezier
+* curves of arbitrary degree.
+*
+* - functions are all in the 'jsBezier' namespace.  
+* 
+* - all input points should be in the format {x:.., y:..}. all output points are in this format too.
+* 
+* - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]
+* 
+* - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length
+* of the curve.  location as output has the same format and meaning.
+* 
+* 
+* Function List:
+* --------------
+* 
+* distanceFromCurve(point, curve)
+* 
+*      Calculates the distance that the given point lies from the given Bezier.  Note that it is computed relative to the center of the Bezier,
+* so if you have stroked the curve with a wide pen you may wish to take that into account!  The distance returned is relative to the values 
+* of the curve and the point - it will most likely be pixels.
+* 
+* gradientAtPoint(curve, location)
+* 
+*      Calculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.
+*
+* gradientAtPointAlongCurveFrom (curve, location)
+*
+*      Calculates the gradient at the point on the given curve that is 'distance' units from location. 
+* 
+* nearestPointOnCurve(point, curve) 
+* 
+*      Calculates the nearest point to the given point on the given curve.  The return value of this is a JS object literal, containing both the
+*point's coordinates and also the 'location' of the point (see above), for example:  { point:{x:551,y:150}, location:0.263365 }.
+* 
+* pointOnCurve(curve, location)
+* 
+*      Calculates the coordinates of the point on the given Bezier curve at the given location.  
+*              
+* pointAlongCurveFrom(curve, location, distance)
+* 
+*      Calculates the coordinates of the point on the given curve that is 'distance' units from location.  'distance' should be in the same coordinate
+* space as that used to construct the Bezier curve.  For an HTML Canvas usage, for example, distance would be a measure of pixels.
+*
+* locationAlongCurveFrom(curve, location, distance)
+* 
+*      Calculates the location on the given curve that is 'distance' units from location.  'distance' should be in the same coordinate
+* space as that used to construct the Bezier curve.  For an HTML Canvas usage, for example, distance would be a measure of pixels.
+* 
+* perpendicularToCurveAt(curve, location, length, distance)
+* 
+*      Calculates the perpendicular to the given curve at the given location.  length is the length of the line you wish for (it will be centered
+* on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of
+* the perpendicular returned.  The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].  
+*  
+* 
+*/
+
+(function() {
+       
+       if(typeof Math.sgn == "undefined") {
+               Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };
+       }
+       
+       var Vectors = {
+                       subtract        :       function(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },
+                       dotProduct      :       function(v1, v2) { return (v1.x * v2.x)  + (v1.y * v2.y); },
+                       square          :       function(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },
+                       scale           :       function(v, s) { return {x:v.x * s, y:v.y * s }; }
+               },
+               
+               maxRecursion = 64, 
+               flatnessTolerance = Math.pow(2.0,-maxRecursion-1);
+
+       /**
+        * Calculates the distance that the point lies from the curve.
+        * 
+        * @param point a point in the form {x:567, y:3342}
+        * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}].  note that this is currently
+        * hardcoded to assume cubiz beziers, but would be better off supporting any degree. 
+        * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}.  Location is analogous to the location
+        * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve.  Distance is the distance in pixels from
+        * the point to the curve. 
+        */
+       var _distanceFromCurve = function(point, curve) {
+               var candidates = [],     
+               w = _convertToBezier(point, curve),
+               degree = curve.length - 1, higherDegree = (2 * degree) - 1,
+               numSolutions = _findRoots(w, higherDegree, candidates, 0),
+                       v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;
+
+           for (var i = 0; i < numSolutions; i++) {
+                       v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));
+               var newDist = Vectors.square(v);
+               if (newDist < dist) {
+                   dist = newDist;
+                       t = candidates[i];
+                   }
+           }
+           v = Vectors.subtract(point, curve[degree]);
+               newDist = Vectors.square(v);
+           if (newDist < dist) {
+               dist = newDist;
+               t = 1.0;
+           }
+               return {location:t, distance:dist};
+       };
+       /**
+        * finds the nearest point on the curve to the given point.
+        */
+       var _nearestPointOnCurve = function(point, curve) {    
+               var td = _distanceFromCurve(point, curve);
+           return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};
+       };
+       var _convertToBezier = function(point, curve) {
+               var degree = curve.length - 1, higherDegree = (2 * degree) - 1,
+               c = [], d = [], cdTable = [], w = [],
+               z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];       
+               
+           for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);
+           for (var i = 0; i <= degree - 1; i++) { 
+                       d[i] = Vectors.subtract(curve[i+1], curve[i]);
+                       d[i] = Vectors.scale(d[i], 3.0);
+           }
+           for (var row = 0; row <= degree - 1; row++) {
+                       for (var column = 0; column <= degree; column++) {
+                               if (!cdTable[row]) cdTable[row] = [];
+                       cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);
+                       }
+           }
+           for (i = 0; i <= higherDegree; i++) {
+                       if (!w[i]) w[i] = [];
+                       w[i].y = 0.0;
+                       w[i].x = parseFloat(i) / higherDegree;
+           }
+           var n = degree, m = degree-1;
+           for (var k = 0; k <= n + m; k++) {
+                       var lb = Math.max(0, k - m),
+                               ub = Math.min(k, n);
+                       for (i = lb; i <= ub; i++) {
+                       j = k - i;
+                       w[i+j].y += cdTable[j][i] * z[j][i];
+                       }
+           }
+           return w;
+       };
+       /**
+        * counts how many roots there are.
+        */
+       var _findRoots = function(w, degree, t, depth) {  
+           var left = [], right = [],  
+               left_count, right_count,        
+               left_t = [], right_t = [];
+               
+           switch (_getCrossingCount(w, degree)) {
+               case 0 : {      
+                       return 0;       
+               }
+               case 1 : {      
+                       if (depth >= maxRecursion) {
+                               t[0] = (w[0].x + w[degree].x) / 2.0;
+                               return 1;
+                       }
+                       if (_isFlatEnough(w, degree)) {
+                               t[0] = _computeXIntercept(w, degree);
+                               return 1;
+                       }
+                       break;
+               }
+           }
+           _bezier(w, degree, 0.5, left, right);
+           left_count  = _findRoots(left,  degree, left_t, depth+1);
+           right_count = _findRoots(right, degree, right_t, depth+1);
+           for (var i = 0; i < left_count; i++) t[i] = left_t[i];
+           for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];    
+               return (left_count+right_count);
+       };
+       var _getCrossingCount = function(curve, degree) {
+           var n_crossings = 0, sign, old_sign;                        
+           sign = old_sign = Math.sgn(curve[0].y);
+           for (var i = 1; i <= degree; i++) {
+                       sign = Math.sgn(curve[i].y);
+                       if (sign != old_sign) n_crossings++;
+                       old_sign = sign;
+           }
+           return n_crossings;
+       };
+       var _isFlatEnough = function(curve, degree) {
+           var  error,
+               intercept_1, intercept_2, left_intercept, right_intercept,
+               a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;
+           a = curve[0].y - curve[degree].y;
+           b = curve[degree].x - curve[0].x;
+           c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;
+       
+           var max_distance_above = max_distance_below = 0.0;
+           
+           for (var i = 1; i < degree; i++) {
+               var value = a * curve[i].x + b * curve[i].y + c;       
+               if (value > max_distance_above)
+                   max_distance_above = value;
+               else if (value < max_distance_below)
+                       max_distance_below = value;
+           }
+           
+           a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;
+           c2 = c - max_distance_above;
+           det = a1 * b2 - a2 * b1;
+           dInv = 1.0/det;
+           intercept_1 = (b1 * c2 - b2 * c1) * dInv;
+           a2 = a; b2 = b; c2 = c - max_distance_below;
+           det = a1 * b2 - a2 * b1;
+           dInv = 1.0/det;
+           intercept_2 = (b1 * c2 - b2 * c1) * dInv;
+           left_intercept = Math.min(intercept_1, intercept_2);
+           right_intercept = Math.max(intercept_1, intercept_2);
+           error = right_intercept - left_intercept;
+           return (error < flatnessTolerance)? 1 : 0;
+       };
+       var _computeXIntercept = function(curve, degree) {
+           var XLK = 1.0, YLK = 0.0,
+               XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,
+               XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,
+               det = XNM*YLK - YNM*XLK, detInv = 1.0/det,
+               S = (XNM*YMK - YNM*XMK) * detInv; 
+           return 0.0 + XLK * S;
+       };
+       var _bezier = function(curve, degree, t, left, right) {
+           var temp = [[]];
+           for (var j =0; j <= degree; j++) temp[0][j] = curve[j];
+           for (var i = 1; i <= degree; i++) { 
+                       for (var j =0 ; j <= degree - i; j++) {
+                               if (!temp[i]) temp[i] = [];
+                               if (!temp[i][j]) temp[i][j] = {};
+                       temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;
+                       temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;
+                       }
+           }    
+           if (left != null) 
+               for (j = 0; j <= degree; j++) left[j]  = temp[j][0];
+           if (right != null)
+                       for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];
+           
+           return (temp[degree][0]);
+       };
+       
+       var _curveFunctionCache = {};
+       var _getCurveFunctions = function(order) {
+               var fns = _curveFunctionCache[order];
+               if (!fns) {
+                       fns = [];                       
+                       var f_term = function() { return function(t) { return Math.pow(t, order); }; },
+                               l_term = function() { return function(t) { return Math.pow((1-t), order); }; },
+                               c_term = function(c) { return function(t) { return c; }; },
+                               t_term = function() { return function(t) { return t; }; },
+                               one_minus_t_term = function() { return function(t) { return 1-t; }; },
+                               _termFunc = function(terms) {
+                                       return function(t) {
+                                               var p = 1;
+                                               for (var i = 0; i < terms.length; i++) p = p * terms[i](t);
+                                               return p;
+                                       };
+                               };
+                       
+                       fns.push(new f_term());  // first is t to the power of the curve order          
+                       for (var i = 1; i < order; i++) {
+                               var terms = [new c_term(order)];
+                               for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());
+                               for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());
+                               fns.push(new _termFunc(terms));
+                       }
+                       fns.push(new l_term());  // last is (1-t) to the power of the curve order
+               
+                       _curveFunctionCache[order] = fns;
+               }
+                       
+               return fns;
+       };
+       
+       
+       /**
+        * calculates a point on the curve, for a Bezier of arbitrary order.
+        * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}].  For a cubic bezier this should have four points.
+        * @param location a decimal indicating the distance along the curve the point should be located at.  this is the distance along the curve as it travels, taking the way it bends into account.  should be a number from 0 to 1, inclusive.
+        */
+       var _pointOnPath = function(curve, location) {          
+               var cc = _getCurveFunctions(curve.length - 1),
+                       _x = 0, _y = 0;
+               for (var i = 0; i < curve.length ; i++) {
+                       _x = _x + (curve[i].x * cc[i](location));
+                       _y = _y + (curve[i].y * cc[i](location));
+               }
+               
+               return {x:_x, y:_y};
+       };
+       
+       var _dist = function(p1,p2) {
+               return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
+       };
+
+       var _isPoint = function(curve) {
+               return curve[0].x == curve[1].x && curve[0].y == curve[1].y;
+       };
+       
+       /**
+        * finds the point that is 'distance' along the path from 'location'.  this method returns both the x,y location of the point and also
+        * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the
+        * point.
+        */
+       var _pointAlongPath = function(curve, location, distance) {
+
+               if (_isPoint(curve)) {
+                       return {
+                               point:curve[0],
+                               location:location
+                       };
+               }
+
+               var prev = _pointOnPath(curve, location), 
+                       tally = 0, 
+                       curLoc = location, 
+                       direction = distance > 0 ? 1 : -1, 
+                       cur = null;
+                       
+               while (tally < Math.abs(distance)) {
+                       curLoc += (0.005 * direction);
+                       cur = _pointOnPath(curve, curLoc);
+                       tally += _dist(cur, prev);      
+                       prev = cur;
+               }
+               return {point:cur, location:curLoc};            
+       };
+       
+       var _length = function(curve) {
+               if (_isPoint(curve)) return 0;
+
+               var prev = _pointOnPath(curve, 0),
+                       tally = 0,
+                       curLoc = 0,
+                       direction = 1,
+                       cur = null;
+                       
+               while (curLoc < 1) {
+                       curLoc += (0.005 * direction);
+                       cur = _pointOnPath(curve, curLoc);
+                       tally += _dist(cur, prev);      
+                       prev = cur;
+               }
+               return tally;
+       };
+       
+       /**
+        * finds the point that is 'distance' along the path from 'location'.  
+        */
+       var _pointAlongPathFrom = function(curve, location, distance) {
+               return _pointAlongPath(curve, location, distance).point;
+       };
+
+       /**
+        * finds the location that is 'distance' along the path from 'location'.  
+        */
+       var _locationAlongPathFrom = function(curve, location, distance) {
+               return _pointAlongPath(curve, location, distance).location;
+       };
+       
+       /**
+        * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.
+        * 
+        * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html
+        */
+       var _gradientAtPoint = function(curve, location) {
+               var p1 = _pointOnPath(curve, location), 
+                       p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),
+                       dy = p2.y - p1.y, dx = p2.x - p1.x;
+               return dy == 0 ? Infinity : Math.atan(dy / dx);         
+       };
+       
+       /**
+       returns the gradient of the curve at the point which is 'distance' from the given location.
+       if this point is greater than location 1, the gradient at location 1 is returned.
+       if this point is less than location 0, the gradient at location 0 is returned.
+       */
+       var _gradientAtPointAlongPathFrom = function(curve, location, distance) {
+               var p = _pointAlongPath(curve, location, distance);
+               if (p.location > 1) p.location = 1;
+               if (p.location < 0) p.location = 0;             
+               return _gradientAtPoint(curve, p.location);             
+       };
+
+       /**
+        * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.
+        * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).
+        */
+       var _perpendicularToPathAt = function(curve, location, length, distance) {
+               distance = distance == null ? 0 : distance;
+               var p = _pointAlongPath(curve, location, distance),
+                       m = _gradientAtPoint(curve, p.location),
+                       _theta2 = Math.atan(-1 / m),
+                       y =  length / 2 * Math.sin(_theta2),
+                       x =  length / 2 * Math.cos(_theta2);
+               return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];
+       };
+       
+       var jsBezier = window.jsBezier = {
+               distanceFromCurve : _distanceFromCurve,
+               gradientAtPoint : _gradientAtPoint,
+               gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,
+               nearestPointOnCurve : _nearestPointOnCurve,
+               pointOnCurve : _pointOnPath,            
+               pointAlongCurveFrom : _pointAlongPathFrom,
+               perpendicularToCurveAt : _perpendicularToPathAt,
+               locationAlongCurveFrom:_locationAlongPathFrom,
+               getLength:_length
+       };
+})();
diff --git a/portal/static/unbound_reservation_static/lib/jsplumb-geom-0.1.js b/portal/static/unbound_reservation_static/lib/jsplumb-geom-0.1.js
new file mode 100644 (file)
index 0000000..9c0e59b
--- /dev/null
@@ -0,0 +1,186 @@
+/**
+ * jsPlumbGeom v0.1
+ *
+ * Various geometry functions written as part of jsPlumb and perhaps useful for others.
+ *
+ * Copyright (c) 2013 Simon Porritt
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+;(function() {
+
+       
+       "use strict";
+
+       // Establish the root object, `window` in the browser, or `global` on the server.
+       var root = this;
+       var jsPlumbGeom;
+       if (typeof exports !== 'undefined') {
+               jsPlumbGeom = exports;
+       } else {
+               jsPlumbGeom = root.jsPlumbGeom = {};
+       }
+
+       var _isa = function(a) { return Object.prototype.toString.call(a) === "[object Array]"; },
+               _pointHelper = function(p1, p2, fn) {
+                   p1 = _isa(p1) ? p1 : [p1.x, p1.y];
+                   p2 = _isa(p2) ? p2 : [p2.x, p2.y];    
+                   return fn(p1, p2);
+               },
+               /**
+               * @name jsPlumbGeom.gradient
+               * @function
+               * @desc Calculates the gradient of a line between the two points.
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Float} The gradient of a line between the two points.
+               */
+               _gradient = jsPlumbGeom.gradient = function(p1, p2) {
+                   return _pointHelper(p1, p2, function(_p1, _p2) { 
+                       if (_p2[0] == _p1[0])
+                           return _p2[1] > _p1[1] ? Infinity : -Infinity;
+                       else if (_p2[1] == _p1[1]) 
+                           return _p2[0] > _p1[0] ? 0 : -0;
+                       else 
+                           return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]); 
+                   });         
+               },
+               /**
+               * @name jsPlumbGeom.normal
+               * @function
+               * @desc Calculates the gradient of a normal to a line between the two points.
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Float} The gradient of a normal to a line between the two points.
+               */
+               _normal = jsPlumbGeom.normal = function(p1, p2) {
+                   return -1 / _gradient(p1, p2);
+               },
+               /**
+               * @name jsPlumbGeom.lineLength
+               * @function
+               * @desc Calculates the length of a line between the two points.
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Float} The length of a line between the two points.
+               */
+               _lineLength = jsPlumbGeom.lineLength = function(p1, p2) {
+                   return _pointHelper(p1, p2, function(_p1, _p2) {
+                       return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));                  
+                   });
+               },
+               /**
+               * @name jsPlumbGeom.quadrant
+               * @function
+               * @desc Calculates the quadrant in which the angle between the two points lies. 
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.
+               */
+               _quadrant = jsPlumbGeom.quadrant = function(p1, p2) {
+                   return _pointHelper(p1, p2, function(_p1, _p2) {
+                       if (_p2[0] > _p1[0]) {
+                           return (_p2[1] > _p1[1]) ? 2 : 1;
+                       }
+                       else if (_p2[0] == _p1[0]) {
+                           return _p2[1] > _p1[1] ? 2 : 1;    
+                       }
+                       else {
+                           return (_p2[1] > _p1[1]) ? 3 : 4;
+                       }
+                   });
+               },
+               /**
+               * @name jsPlumbGeom.theta
+               * @function
+               * @desc Calculates the angle between the two points. 
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Float} The angle between the two points.
+               */
+               _theta = jsPlumbGeom.theta = function(p1, p2) {
+                   return _pointHelper(p1, p2, function(_p1, _p2) {
+                       var m = _gradient(_p1, _p2),
+                           t = Math.atan(m),
+                           s = _quadrant(_p1, _p2);
+                       if ((s == 4 || s== 3)) t += Math.PI;
+                       if (t < 0) t += (2 * Math.PI);
+                   
+                       return t;
+                   });
+               },
+               /**
+               * @name jsPlumbGeom.intersects
+               * @function
+               * @desc Calculates whether or not the two rectangles intersect.
+               * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`
+               * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`
+               * @return {Boolean} True if the rectangles intersect, false otherwise.
+               */
+               _intersects = jsPlumbGeom.intersects = function(r1, r2) {
+                   var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,
+                       a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;
+               
+                       return  ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||
+                               ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||
+                               ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||
+                               ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) || 
+                               ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||
+                               ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||
+                               ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||
+                               ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );
+               },
+               _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],
+               _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],
+               /**
+               * @name jsPlumbGeom.pointOnLine
+               * @function
+               * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Point} Point on the line, in the form `{ x:..., y:... }`.
+               */
+               _pointOnLine = jsPlumbGeom.pointOnLine = function(fromPoint, toPoint, distance) {
+                   var m = _gradient(fromPoint, toPoint),
+                       s = _quadrant(fromPoint, toPoint),
+                       segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],
+                       theta = Math.atan(m),
+                       y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],
+                       x =  Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];
+                   return { x:fromPoint.x + x, y:fromPoint.y + y };
+               },
+               /**
+               * @name jsPlumbGeom.perpendicularLineTo
+               * @function
+               * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.
+               * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.
+               * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.
+               * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.
+               */        
+               _perpendicularLineTo = jsPlumbGeom.perpendicularLineTo = function(fromPoint, toPoint, length) {
+                   var m = _gradient(fromPoint, toPoint),
+                       theta2 = Math.atan(-1 / m),
+                       y =  length / 2 * Math.sin(theta2),
+                       x =  length / 2 * Math.cos(theta2);
+                   return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];
+               };      
+}).call(this);
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/AUTHORS b/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/AUTHORS
new file mode 100644 (file)
index 0000000..90decb3
--- /dev/null
@@ -0,0 +1,10 @@
+ExplorerCanvas\r
+\r
+Google Open Source:\r
+       <http://code.google.com>\r
+       <opensource@google.com> \r
+\r
+Developers:\r
+       Emil A Eklund <emil@eae.net>\r
+       Erik Arvidsson <erik@eae.net>\r
+       Glen Murphy <glen@glenmurphy.com>
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/COPYING b/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/COPYING
new file mode 100644 (file)
index 0000000..75b5248
--- /dev/null
@@ -0,0 +1,202 @@
+\r
+                                 Apache License\r
+                           Version 2.0, January 2004\r
+                        http://www.apache.org/licenses/\r
+\r
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+   1. Definitions.\r
+\r
+      "License" shall mean the terms and conditions for use, reproduction,\r
+      and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+      "Licensor" shall mean the copyright owner or entity authorized by\r
+      the copyright owner that is granting the License.\r
+\r
+      "Legal Entity" shall mean the union of the acting entity and all\r
+      other entities that control, are controlled by, or are under common\r
+      control with that entity. For the purposes of this definition,\r
+      "control" means (i) the power, direct or indirect, to cause the\r
+      direction or management of such entity, whether by contract or\r
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+      outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+      "You" (or "Your") shall mean an individual or Legal Entity\r
+      exercising permissions granted by this License.\r
+\r
+      "Source" form shall mean the preferred form for making modifications,\r
+      including but not limited to software source code, documentation\r
+      source, and configuration files.\r
+\r
+      "Object" form shall mean any form resulting from mechanical\r
+      transformation or translation of a Source form, including but\r
+      not limited to compiled object code, generated documentation,\r
+      and conversions to other media types.\r
+\r
+      "Work" shall mean the work of authorship, whether in Source or\r
+      Object form, made available under the License, as indicated by a\r
+      copyright notice that is included in or attached to the work\r
+      (an example is provided in the Appendix below).\r
+\r
+      "Derivative Works" shall mean any work, whether in Source or Object\r
+      form, that is based on (or derived from) the Work and for which the\r
+      editorial revisions, annotations, elaborations, or other modifications\r
+      represent, as a whole, an original work of authorship. For the purposes\r
+      of this License, Derivative Works shall not include works that remain\r
+      separable from, or merely link (or bind by name) to the interfaces of,\r
+      the Work and Derivative Works thereof.\r
+\r
+      "Contribution" shall mean any work of authorship, including\r
+      the original version of the Work and any modifications or additions\r
+      to that Work or Derivative Works thereof, that is intentionally\r
+      submitted to Licensor for inclusion in the Work by the copyright owner\r
+      or by an individual or Legal Entity authorized to submit on behalf of\r
+      the copyright owner. For the purposes of this definition, "submitted"\r
+      means any form of electronic, verbal, or written communication sent\r
+      to the Licensor or its representatives, including but not limited to\r
+      communication on electronic mailing lists, source code control systems,\r
+      and issue tracking systems that are managed by, or on behalf of, the\r
+      Licensor for the purpose of discussing and improving the Work, but\r
+      excluding communication that is conspicuously marked or otherwise\r
+      designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+      "Contributor" shall mean Licensor and any individual or Legal Entity\r
+      on behalf of whom a Contribution has been received by Licensor and\r
+      subsequently incorporated within the Work.\r
+\r
+   2. Grant of Copyright License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      copyright license to reproduce, prepare Derivative Works of,\r
+      publicly display, publicly perform, sublicense, and distribute the\r
+      Work and such Derivative Works in Source or Object form.\r
+\r
+   3. Grant of Patent License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      (except as stated in this section) patent license to make, have made,\r
+      use, offer to sell, sell, import, and otherwise transfer the Work,\r
+      where such license applies only to those patent claims licensable\r
+      by such Contributor that are necessarily infringed by their\r
+      Contribution(s) alone or by combination of their Contribution(s)\r
+      with the Work to which such Contribution(s) was submitted. If You\r
+      institute patent litigation against any entity (including a\r
+      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+      or a Contribution incorporated within the Work constitutes direct\r
+      or contributory patent infringement, then any patent licenses\r
+      granted to You under this License for that Work shall terminate\r
+      as of the date such litigation is filed.\r
+\r
+   4. Redistribution. You may reproduce and distribute copies of the\r
+      Work or Derivative Works thereof in any medium, with or without\r
+      modifications, and in Source or Object form, provided that You\r
+      meet the following conditions:\r
+\r
+      (a) You must give any other recipients of the Work or\r
+          Derivative Works a copy of this License; and\r
+\r
+      (b) You must cause any modified files to carry prominent notices\r
+          stating that You changed the files; and\r
+\r
+      (c) You must retain, in the Source form of any Derivative Works\r
+          that You distribute, all copyright, patent, trademark, and\r
+          attribution notices from the Source form of the Work,\r
+          excluding those notices that do not pertain to any part of\r
+          the Derivative Works; and\r
+\r
+      (d) If the Work includes a "NOTICE" text file as part of its\r
+          distribution, then any Derivative Works that You distribute must\r
+          include a readable copy of the attribution notices contained\r
+          within such NOTICE file, excluding those notices that do not\r
+          pertain to any part of the Derivative Works, in at least one\r
+          of the following places: within a NOTICE text file distributed\r
+          as part of the Derivative Works; within the Source form or\r
+          documentation, if provided along with the Derivative Works; or,\r
+          within a display generated by the Derivative Works, if and\r
+          wherever such third-party notices normally appear. The contents\r
+          of the NOTICE file are for informational purposes only and\r
+          do not modify the License. You may add Your own attribution\r
+          notices within Derivative Works that You distribute, alongside\r
+          or as an addendum to the NOTICE text from the Work, provided\r
+          that such additional attribution notices cannot be construed\r
+          as modifying the License.\r
+\r
+      You may add Your own copyright statement to Your modifications and\r
+      may provide additional or different license terms and conditions\r
+      for use, reproduction, or distribution of Your modifications, or\r
+      for any such Derivative Works as a whole, provided Your use,\r
+      reproduction, and distribution of the Work otherwise complies with\r
+      the conditions stated in this License.\r
+\r
+   5. Submission of Contributions. Unless You explicitly state otherwise,\r
+      any Contribution intentionally submitted for inclusion in the Work\r
+      by You to the Licensor shall be under the terms and conditions of\r
+      this License, without any additional terms or conditions.\r
+      Notwithstanding the above, nothing herein shall supersede or modify\r
+      the terms of any separate license agreement you may have executed\r
+      with Licensor regarding such Contributions.\r
+\r
+   6. Trademarks. This License does not grant permission to use the trade\r
+      names, trademarks, service marks, or product names of the Licensor,\r
+      except as required for reasonable and customary use in describing the\r
+      origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+   7. Disclaimer of Warranty. Unless required by applicable law or\r
+      agreed to in writing, Licensor provides the Work (and each\r
+      Contributor provides its Contributions) on an "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+      implied, including, without limitation, any warranties or conditions\r
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+      PARTICULAR PURPOSE. You are solely responsible for determining the\r
+      appropriateness of using or redistributing the Work and assume any\r
+      risks associated with Your exercise of permissions under this License.\r
+\r
+   8. Limitation of Liability. In no event and under no legal theory,\r
+      whether in tort (including negligence), contract, or otherwise,\r
+      unless required by applicable law (such as deliberate and grossly\r
+      negligent acts) or agreed to in writing, shall any Contributor be\r
+      liable to You for damages, including any direct, indirect, special,\r
+      incidental, or consequential damages of any character arising as a\r
+      result of this License or out of the use or inability to use the\r
+      Work (including but not limited to damages for loss of goodwill,\r
+      work stoppage, computer failure or malfunction, or any and all\r
+      other commercial damages or losses), even if such Contributor\r
+      has been advised of the possibility of such damages.\r
+\r
+   9. Accepting Warranty or Additional Liability. While redistributing\r
+      the Work or Derivative Works thereof, You may choose to offer,\r
+      and charge a fee for, acceptance of support, warranty, indemnity,\r
+      or other liability obligations and/or rights consistent with this\r
+      License. However, in accepting such obligations, You may act only\r
+      on Your own behalf and on Your sole responsibility, not on behalf\r
+      of any other Contributor, and only if You agree to indemnify,\r
+      defend, and hold each Contributor harmless for any liability\r
+      incurred by, or claims asserted against, such Contributor by reason\r
+      of your accepting any such warranty or additional liability.\r
+\r
+   END OF TERMS AND CONDITIONS\r
+\r
+   APPENDIX: How to apply the Apache License to your work.\r
+\r
+      To apply the Apache License to your work, attach the following\r
+      boilerplate notice, with the fields enclosed by brackets "[]"\r
+      replaced with your own identifying information. (Don't include\r
+      the brackets!)  The text should be enclosed in the appropriate\r
+      comment syntax for the file format. We also recommend that a\r
+      file or class name and description of purpose be included on the\r
+      same "printed page" as the copyright notice for easier\r
+      identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
diff --git a/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/README b/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/README
new file mode 100644 (file)
index 0000000..eb7c42f
--- /dev/null
@@ -0,0 +1,22 @@
+ExplorerCanvas\r
+Copyright 2006 Google Inc.\r
+\r
+-------------------------------------------------------------------------------\r
+DESCRIPTION\r
+\r
+Firefox, Safari and Opera 9 support the canvas tag to allow 2D command-based \r
+drawing operations. ExplorerCanvas brings the same functionality to Internet \r
+Explorer; web developers only need to include a single script tag in their \r
+existing canvas webpages to enable this support.\r
+\r
+\r
+-------------------------------------------------------------------------------\r
+INSTALLATION\r
+\r
+Include the ExplorerCanvas tag in the same directory as your HTML files, and \r
+add the following code to your page, preferably in the <head> tag.\r
+\r
+<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->\r
+\r
+If you run into trouble, please look at the included example code to see how\r
+to best implement this
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/excanvas.js b/portal/static/unbound_reservation_static/lib/thirdparty/excanvas/excanvas.js
new file mode 100644 (file)
index 0000000..66310a8
--- /dev/null
@@ -0,0 +1,927 @@
+// Copyright 2006 Google Inc.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//   http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+\r
+\r
+// Known Issues:\r
+//\r
+// * Patterns are not implemented.\r
+// * Radial gradient are not implemented. The VML version of these look very\r
+//   different from the canvas one.\r
+// * Clipping paths are not implemented.\r
+// * Coordsize. The width and height attribute have higher priority than the\r
+//   width and height style values which isn't correct.\r
+// * Painting mode isn't implemented.\r
+// * Canvas width/height should is using content-box by default. IE in\r
+//   Quirks mode will draw the canvas using border-box. Either change your\r
+//   doctype to HTML5\r
+//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)\r
+//   or use Box Sizing Behavior from WebFX\r
+//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)\r
+// * Non uniform scaling does not correctly scale strokes.\r
+// * Optimize. There is always room for speed improvements.\r
+\r
+// Only add this code if we do not already have a canvas implementation\r
+if (!document.createElement('canvas').getContext) {\r
+\r
+(function() {\r
+\r
+  // alias some functions to make (compiled) code shorter\r
+  var m = Math;\r
+  var mr = m.round;\r
+  var ms = m.sin;\r
+  var mc = m.cos;\r
+  var abs = m.abs;\r
+  var sqrt = m.sqrt;\r
+\r
+  // this is used for sub pixel precision\r
+  var Z = 10;\r
+  var Z2 = Z / 2;\r
+\r
+  /**\r
+   * This funtion is assigned to the <canvas> elements as element.getContext().\r
+   * @this {HTMLElement}\r
+   * @return {CanvasRenderingContext2D_}\r
+   */\r
+  function getContext() {\r
+    return this.context_ ||\r
+        (this.context_ = new CanvasRenderingContext2D_(this));\r
+  }\r
+\r
+  var slice = Array.prototype.slice;\r
+\r
+  /**\r
+   * Binds a function to an object. The returned function will always use the\r
+   * passed in {@code obj} as {@code this}.\r
+   *\r
+   * Example:\r
+   *\r
+   *   g = bind(f, obj, a, b)\r
+   *   g(c, d) // will do f.call(obj, a, b, c, d)\r
+   *\r
+   * @param {Function} f The function to bind the object to\r
+   * @param {Object} obj The object that should act as this when the function\r
+   *     is called\r
+   * @param {*} var_args Rest arguments that will be used as the initial\r
+   *     arguments when the function is called\r
+   * @return {Function} A new function that has bound this\r
+   */\r
+  function bind(f, obj, var_args) {\r
+    var a = slice.call(arguments, 2);\r
+    return function() {\r
+      return f.apply(obj, a.concat(slice.call(arguments)));\r
+    };\r
+  }\r
+\r
+  var G_vmlCanvasManager_ = {\r
+    init: function(opt_doc) {\r
+      if (/MSIE/.test(navigator.userAgent) && !window.opera) {\r
+        var doc = opt_doc || document;\r
+        // Create a dummy element so that IE will allow canvas elements to be\r
+        // recognized.\r
+        doc.createElement('canvas');\r
+        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));\r
+      }\r
+    },\r
+\r
+    init_: function(doc) {\r
+      // create xmlns\r
+      if (!doc.namespaces['g_vml_']) {\r
+        doc.namespaces.add('g_vml_', 'urn:schemas-microsoft-com:vml',\r
+                           '#default#VML');\r
+\r
+      }\r
+      if (!doc.namespaces['g_o_']) {\r
+        doc.namespaces.add('g_o_', 'urn:schemas-microsoft-com:office:office',\r
+                           '#default#VML');\r
+      }\r
+\r
+      // Setup default CSS.  Only add one style sheet per document\r
+      if (!doc.styleSheets['ex_canvas_']) {\r
+        var ss = doc.createStyleSheet();\r
+        ss.owningElement.id = 'ex_canvas_';\r
+        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +\r
+            // default size is 300x150 in Gecko and Opera\r
+            'text-align:left;width:300px;height:150px}' +\r
+            'g_vml_\\:*{behavior:url(#default#VML)}' +\r
+            'g_o_\\:*{behavior:url(#default#VML)}';\r
+\r
+      }\r
+\r
+      // find all canvas elements\r
+      var els = doc.getElementsByTagName('canvas');\r
+      for (var i = 0; i < els.length; i++) {\r
+        this.initElement(els[i]);\r
+      }\r
+    },\r
+\r
+    /**\r
+     * Public initializes a canvas element so that it can be used as canvas\r
+     * element from now on. This is called automatically before the page is\r
+     * loaded but if you are creating elements using createElement you need to\r
+     * make sure this is called on the element.\r
+     * @param {HTMLElement} el The canvas element to initialize.\r
+     * @return {HTMLElement} the element that was created.\r
+     */\r
+    initElement: function(el) {\r
+      if (!el.getContext) {\r
+\r
+        el.getContext = getContext;\r
+\r
+        // Remove fallback content. There is no way to hide text nodes so we\r
+        // just remove all childNodes. We could hide all elements and remove\r
+        // text nodes but who really cares about the fallback content.\r
+        el.innerHTML = '';\r
+\r
+        // do not use inline function because that will leak memory\r
+        el.attachEvent('onpropertychange', onPropertyChange);\r
+        el.attachEvent('onresize', onResize);\r
+\r
+        var attrs = el.attributes;\r
+        if (attrs.width && attrs.width.specified) {\r
+          // TODO: use runtimeStyle and coordsize\r
+          // el.getContext().setWidth_(attrs.width.nodeValue);\r
+          el.style.width = attrs.width.nodeValue + 'px';\r
+        } else {\r
+          el.width = el.clientWidth;\r
+        }\r
+        if (attrs.height && attrs.height.specified) {\r
+          // TODO: use runtimeStyle and coordsize\r
+          // el.getContext().setHeight_(attrs.height.nodeValue);\r
+          el.style.height = attrs.height.nodeValue + 'px';\r
+        } else {\r
+          el.height = el.clientHeight;\r
+        }\r
+        //el.getContext().setCoordsize_()\r
+      }\r
+      return el;\r
+    }\r
+  };\r
+\r
+  function onPropertyChange(e) {\r
+    var el = e.srcElement;\r
+\r
+    switch (e.propertyName) {\r
+      case 'width':\r
+        el.style.width = el.attributes.width.nodeValue + 'px';\r
+        el.getContext().clearRect();\r
+        break;\r
+      case 'height':\r
+        el.style.height = el.attributes.height.nodeValue + 'px';\r
+        el.getContext().clearRect();\r
+        break;\r
+    }\r
+  }\r
+\r
+  function onResize(e) {\r
+    var el = e.srcElement;\r
+    if (el.firstChild) {\r
+      el.firstChild.style.width =  el.clientWidth + 'px';\r
+      el.firstChild.style.height = el.clientHeight + 'px';\r
+    }\r
+  }\r
+\r
+  G_vmlCanvasManager_.init();\r
+\r
+  // precompute "00" to "FF"\r
+  var dec2hex = [];\r
+  for (var i = 0; i < 16; i++) {\r
+    for (var j = 0; j < 16; j++) {\r
+      dec2hex[i * 16 + j] = i.toString(16) + j.toString(16);\r
+    }\r
+  }\r
+\r
+  function createMatrixIdentity() {\r
+    return [\r
+      [1, 0, 0],\r
+      [0, 1, 0],\r
+      [0, 0, 1]\r
+    ];\r
+  }\r
+\r
+  function matrixMultiply(m1, m2) {\r
+    var result = createMatrixIdentity();\r
+\r
+    for (var x = 0; x < 3; x++) {\r
+      for (var y = 0; y < 3; y++) {\r
+        var sum = 0;\r
+\r
+        for (var z = 0; z < 3; z++) {\r
+          sum += m1[x][z] * m2[z][y];\r
+        }\r
+\r
+        result[x][y] = sum;\r
+      }\r
+    }\r
+    return result;\r
+  }\r
+\r
+  function copyState(o1, o2) {\r
+    o2.fillStyle     = o1.fillStyle;\r
+    o2.lineCap       = o1.lineCap;\r
+    o2.lineJoin      = o1.lineJoin;\r
+    o2.lineWidth     = o1.lineWidth;\r
+    o2.miterLimit    = o1.miterLimit;\r
+    o2.shadowBlur    = o1.shadowBlur;\r
+    o2.shadowColor   = o1.shadowColor;\r
+    o2.shadowOffsetX = o1.shadowOffsetX;\r
+    o2.shadowOffsetY = o1.shadowOffsetY;\r
+    o2.strokeStyle   = o1.strokeStyle;\r
+    o2.globalAlpha   = o1.globalAlpha;\r
+    o2.arcScaleX_    = o1.arcScaleX_;\r
+    o2.arcScaleY_    = o1.arcScaleY_;\r
+    o2.lineScale_    = o1.lineScale_;\r
+  }\r
+\r
+  function processStyle(styleString) {\r
+    var str, alpha = 1;\r
+\r
+    styleString = String(styleString);\r
+    if (styleString.substring(0, 3) == 'rgb') {\r
+      var start = styleString.indexOf('(', 3);\r
+      var end = styleString.indexOf(')', start + 1);\r
+      var guts = styleString.substring(start + 1, end).split(',');\r
+\r
+      str = '#';\r
+      for (var i = 0; i < 3; i++) {\r
+        str += dec2hex[Number(guts[i])];\r
+      }\r
+\r
+      if (guts.length == 4 && styleString.substr(3, 1) == 'a') {\r
+        alpha = guts[3];\r
+      }\r
+    } else {\r
+      str = styleString;\r
+    }\r
+\r
+    return {color: str, alpha: alpha};\r
+  }\r
+\r
+  function processLineCap(lineCap) {\r
+    switch (lineCap) {\r
+      case 'butt':\r
+        return 'flat';\r
+      case 'round':\r
+        return 'round';\r
+      case 'square':\r
+      default:\r
+        return 'square';\r
+    }\r
+  }\r
+\r
+  /**\r
+   * This class implements CanvasRenderingContext2D interface as described by\r
+   * the WHATWG.\r
+   * @param {HTMLElement} surfaceElement The element that the 2D context should\r
+   * be associated with\r
+   */\r
+  function CanvasRenderingContext2D_(surfaceElement) {\r
+    this.m_ = createMatrixIdentity();\r
+\r
+    this.mStack_ = [];\r
+    this.aStack_ = [];\r
+    this.currentPath_ = [];\r
+\r
+    // Canvas context properties\r
+    this.strokeStyle = '#000';\r
+    this.fillStyle = '#000';\r
+\r
+    this.lineWidth = 1;\r
+    this.lineJoin = 'miter';\r
+    this.lineCap = 'butt';\r
+    this.miterLimit = Z * 1;\r
+    this.globalAlpha = 1;\r
+    this.canvas = surfaceElement;\r
+\r
+    var el = surfaceElement.ownerDocument.createElement('div');\r
+    el.style.width =  surfaceElement.clientWidth + 'px';\r
+    el.style.height = surfaceElement.clientHeight + 'px';\r
+    el.style.overflow = 'hidden';\r
+    el.style.position = 'absolute';\r
+    surfaceElement.appendChild(el);\r
+\r
+    this.element_ = el;\r
+    this.arcScaleX_ = 1;\r
+    this.arcScaleY_ = 1;\r
+    this.lineScale_ = 1;\r
+  }\r
+\r
+  var contextPrototype = CanvasRenderingContext2D_.prototype;\r
+  contextPrototype.clearRect = function() {\r
+    this.element_.innerHTML = '';\r
+  };\r
+\r
+  contextPrototype.beginPath = function() {\r
+    // TODO: Branch current matrix so that save/restore has no effect\r
+    //       as per safari docs.\r
+    this.currentPath_ = [];\r
+  };\r
+\r
+  contextPrototype.moveTo = function(aX, aY) {\r
+    var p = this.getCoords_(aX, aY);\r
+    this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y});\r
+    this.currentX_ = p.x;\r
+    this.currentY_ = p.y;\r
+  };\r
+\r
+  contextPrototype.lineTo = function(aX, aY) {\r
+    var p = this.getCoords_(aX, aY);\r
+    this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y});\r
+\r
+    this.currentX_ = p.x;\r
+    this.currentY_ = p.y;\r
+  };\r
+\r
+  contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,\r
+                                            aCP2x, aCP2y,\r
+                                            aX, aY) {\r
+    var p = this.getCoords_(aX, aY);\r
+    var cp1 = this.getCoords_(aCP1x, aCP1y);\r
+    var cp2 = this.getCoords_(aCP2x, aCP2y);\r
+    bezierCurveTo(this, cp1, cp2, p);\r
+  };\r
+\r
+  // Helper function that takes the already fixed cordinates.\r
+  function bezierCurveTo(self, cp1, cp2, p) {\r
+    self.currentPath_.push({\r
+      type: 'bezierCurveTo',\r
+      cp1x: cp1.x,\r
+      cp1y: cp1.y,\r
+      cp2x: cp2.x,\r
+      cp2y: cp2.y,\r
+      x: p.x,\r
+      y: p.y\r
+    });\r
+    self.currentX_ = p.x;\r
+    self.currentY_ = p.y;\r
+  }\r
+\r
+  contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {\r
+    // the following is lifted almost directly from\r
+    // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes\r
+\r
+    var cp = this.getCoords_(aCPx, aCPy);\r
+    var p = this.getCoords_(aX, aY);\r
+\r
+    var cp1 = {\r
+      x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),\r
+      y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)\r
+    };\r
+    var cp2 = {\r
+      x: cp1.x + (p.x - this.currentX_) / 3.0,\r
+      y: cp1.y + (p.y - this.currentY_) / 3.0\r
+    };\r
+\r
+    bezierCurveTo(this, cp1, cp2, p);\r
+  };\r
+\r
+  contextPrototype.arc = function(aX, aY, aRadius,\r
+                                  aStartAngle, aEndAngle, aClockwise) {\r
+    aRadius *= Z;\r
+    var arcType = aClockwise ? 'at' : 'wa';\r
+\r
+    var xStart = aX + mc(aStartAngle) * aRadius - Z2;\r
+    var yStart = aY + ms(aStartAngle) * aRadius - Z2;\r
+\r
+    var xEnd = aX + mc(aEndAngle) * aRadius - Z2;\r
+    var yEnd = aY + ms(aEndAngle) * aRadius - Z2;\r
+\r
+    // IE won't render arches drawn counter clockwise if xStart == xEnd.\r
+    if (xStart == xEnd && !aClockwise) {\r
+      xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something\r
+                       // that can be represented in binary\r
+    }\r
+\r
+    var p = this.getCoords_(aX, aY);\r
+    var pStart = this.getCoords_(xStart, yStart);\r
+    var pEnd = this.getCoords_(xEnd, yEnd);\r
+\r
+    this.currentPath_.push({type: arcType,\r
+                           x: p.x,\r
+                           y: p.y,\r
+                           radius: aRadius,\r
+                           xStart: pStart.x,\r
+                           yStart: pStart.y,\r
+                           xEnd: pEnd.x,\r
+                           yEnd: pEnd.y});\r
+\r
+  };\r
+\r
+  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {\r
+    this.moveTo(aX, aY);\r
+    this.lineTo(aX + aWidth, aY);\r
+    this.lineTo(aX + aWidth, aY + aHeight);\r
+    this.lineTo(aX, aY + aHeight);\r
+    this.closePath();\r
+  };\r
+\r
+  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {\r
+    var oldPath = this.currentPath_;\r
+    this.beginPath();\r
+\r
+    this.moveTo(aX, aY);\r
+    this.lineTo(aX + aWidth, aY);\r
+    this.lineTo(aX + aWidth, aY + aHeight);\r
+    this.lineTo(aX, aY + aHeight);\r
+    this.closePath();\r
+    this.stroke();\r
+\r
+    this.currentPath_ = oldPath;\r
+  };\r
+\r
+  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {\r
+    var oldPath = this.currentPath_;\r
+    this.beginPath();\r
+\r
+    this.moveTo(aX, aY);\r
+    this.lineTo(aX + aWidth, aY);\r
+    this.lineTo(aX + aWidth, aY + aHeight);\r
+    this.lineTo(aX, aY + aHeight);\r
+    this.closePath();\r
+    this.fill();\r
+\r
+    this.currentPath_ = oldPath;\r
+  };\r
+\r
+  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {\r
+    var gradient = new CanvasGradient_('gradient');\r
+    gradient.x0_ = aX0;\r
+    gradient.y0_ = aY0;\r
+    gradient.x1_ = aX1;\r
+    gradient.y1_ = aY1;\r
+    return gradient;\r
+  };\r
+\r
+  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,\r
+                                                   aX1, aY1, aR1) {\r
+    var gradient = new CanvasGradient_('gradientradial');\r
+    gradient.x0_ = aX0;\r
+    gradient.y0_ = aY0;\r
+    gradient.r0_ = aR0;\r
+    gradient.x1_ = aX1;\r
+    gradient.y1_ = aY1;\r
+    gradient.r1_ = aR1;\r
+    return gradient;\r
+  };\r
+\r
+  contextPrototype.drawImage = function(image, var_args) {\r
+    var dx, dy, dw, dh, sx, sy, sw, sh;\r
+\r
+    // to find the original width we overide the width and height\r
+    var oldRuntimeWidth = image.runtimeStyle.width;\r
+    var oldRuntimeHeight = image.runtimeStyle.height;\r
+    image.runtimeStyle.width = 'auto';\r
+    image.runtimeStyle.height = 'auto';\r
+\r
+    // get the original size\r
+    var w = image.width;\r
+    var h = image.height;\r
+\r
+    // and remove overides\r
+    image.runtimeStyle.width = oldRuntimeWidth;\r
+    image.runtimeStyle.height = oldRuntimeHeight;\r
+\r
+    if (arguments.length == 3) {\r
+      dx = arguments[1];\r
+      dy = arguments[2];\r
+      sx = sy = 0;\r
+      sw = dw = w;\r
+      sh = dh = h;\r
+    } else if (arguments.length == 5) {\r
+      dx = arguments[1];\r
+      dy = arguments[2];\r
+      dw = arguments[3];\r
+      dh = arguments[4];\r
+      sx = sy = 0;\r
+      sw = w;\r
+      sh = h;\r
+    } else if (arguments.length == 9) {\r
+      sx = arguments[1];\r
+      sy = arguments[2];\r
+      sw = arguments[3];\r
+      sh = arguments[4];\r
+      dx = arguments[5];\r
+      dy = arguments[6];\r
+      dw = arguments[7];\r
+      dh = arguments[8];\r
+    } else {\r
+      throw Error('Invalid number of arguments');\r
+    }\r
+\r
+    var d = this.getCoords_(dx, dy);\r
+\r
+    var w2 = sw / 2;\r
+    var h2 = sh / 2;\r
+\r
+    var vmlStr = [];\r
+\r
+    var W = 10;\r
+    var H = 10;\r
+\r
+    // For some reason that I've now forgotten, using divs didn't work\r
+    vmlStr.push(' <g_vml_:group',\r
+                ' coordsize="', Z * W, ',', Z * H, '"',\r
+                ' coordorigin="0,0"' ,\r
+                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');\r
+\r
+    // If filters are necessary (rotation exists), create them\r
+    // filters are bog-slow, so only create them if abbsolutely necessary\r
+    // The following check doesn't account for skews (which don't exist\r
+    // in the canvas spec (yet) anyway.\r
+\r
+    if (this.m_[0][0] != 1 || this.m_[0][1]) {\r
+      var filter = [];\r
+\r
+      // Note the 12/21 reversal\r
+      filter.push('M11=', this.m_[0][0], ',',\r
+                  'M12=', this.m_[1][0], ',',\r
+                  'M21=', this.m_[0][1], ',',\r
+                  'M22=', this.m_[1][1], ',',\r
+                  'Dx=', mr(d.x / Z), ',',\r
+                  'Dy=', mr(d.y / Z), '');\r
+\r
+      // Bounding box calculation (need to minimize displayed area so that\r
+      // filters don't waste time on unused pixels.\r
+      var max = d;\r
+      var c2 = this.getCoords_(dx + dw, dy);\r
+      var c3 = this.getCoords_(dx, dy + dh);\r
+      var c4 = this.getCoords_(dx + dw, dy + dh);\r
+\r
+      max.x = m.max(max.x, c2.x, c3.x, c4.x);\r
+      max.y = m.max(max.y, c2.y, c3.y, c4.y);\r
+\r
+      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),\r
+                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',\r
+                  filter.join(''), ", sizingmethod='clip');")\r
+    } else {\r
+      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');\r
+    }\r
+\r
+    vmlStr.push(' ">' ,\r
+                '<g_vml_:image src="', image.src, '"',\r
+                ' style="width:', Z * dw, 'px;',\r
+                ' height:', Z * dh, 'px;"',\r
+                ' cropleft="', sx / w, '"',\r
+                ' croptop="', sy / h, '"',\r
+                ' cropright="', (w - sx - sw) / w, '"',\r
+                ' cropbottom="', (h - sy - sh) / h, '"',\r
+                ' />',\r
+                '</g_vml_:group>');\r
+\r
+    this.element_.insertAdjacentHTML('BeforeEnd',\r
+                                    vmlStr.join(''));\r
+  };\r
+\r
+  contextPrototype.stroke = function(aFill) {\r
+    var lineStr = [];\r
+    var lineOpen = false;\r
+    var a = processStyle(aFill ? this.fillStyle : this.strokeStyle);\r
+    var color = a.color;\r
+    var opacity = a.alpha * this.globalAlpha;\r
+\r
+    var W = 10;\r
+    var H = 10;\r
+\r
+    lineStr.push('<g_vml_:shape',\r
+                 ' filled="', !!aFill, '"',\r
+                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',\r
+                 ' coordorigin="0 0" coordsize="', Z * W, ' ', Z * H, '"',\r
+                 ' stroked="', !aFill, '"',\r
+                 ' path="');\r
+\r
+    var newSeq = false;\r
+    var min = {x: null, y: null};\r
+    var max = {x: null, y: null};\r
+\r
+    for (var i = 0; i < this.currentPath_.length; i++) {\r
+      var p = this.currentPath_[i];\r
+      var c;\r
+\r
+      switch (p.type) {\r
+        case 'moveTo':\r
+          c = p;\r
+          lineStr.push(' m ', mr(p.x), ',', mr(p.y));\r
+          break;\r
+        case 'lineTo':\r
+          lineStr.push(' l ', mr(p.x), ',', mr(p.y));\r
+          break;\r
+        case 'close':\r
+          lineStr.push(' x ');\r
+          p = null;\r
+          break;\r
+        case 'bezierCurveTo':\r
+          lineStr.push(' c ',\r
+                       mr(p.cp1x), ',', mr(p.cp1y), ',',\r
+                       mr(p.cp2x), ',', mr(p.cp2y), ',',\r
+                       mr(p.x), ',', mr(p.y));\r
+          break;\r
+        case 'at':\r
+        case 'wa':\r
+          lineStr.push(' ', p.type, ' ',\r
+                       mr(p.x - this.arcScaleX_ * p.radius), ',',\r
+                       mr(p.y - this.arcScaleY_ * p.radius), ' ',\r
+                       mr(p.x + this.arcScaleX_ * p.radius), ',',\r
+                       mr(p.y + this.arcScaleY_ * p.radius), ' ',\r
+                       mr(p.xStart), ',', mr(p.yStart), ' ',\r
+                       mr(p.xEnd), ',', mr(p.yEnd));\r
+          break;\r
+      }\r
+\r
+\r
+      // TODO: Following is broken for curves due to\r
+      //       move to proper paths.\r
+\r
+      // Figure out dimensions so we can do gradient fills\r
+      // properly\r
+      if (p) {\r
+        if (min.x == null || p.x < min.x) {\r
+          min.x = p.x;\r
+        }\r
+        if (max.x == null || p.x > max.x) {\r
+          max.x = p.x;\r
+        }\r
+        if (min.y == null || p.y < min.y) {\r
+          min.y = p.y;\r
+        }\r
+        if (max.y == null || p.y > max.y) {\r
+          max.y = p.y;\r
+        }\r
+      }\r
+    }\r
+    lineStr.push(' ">');\r
+\r
+    if (!aFill) {\r
+      var lineWidth = this.lineScale_ * this.lineWidth;\r
+\r
+      // VML cannot correctly render a line if the width is less than 1px.\r
+      // In that case, we dilute the color to make the line look thinner.\r
+      if (lineWidth < 1) {\r
+        opacity *= lineWidth;\r
+      }\r
+\r
+      lineStr.push(\r
+        '<g_vml_:stroke',\r
+        ' opacity="', opacity, '"',\r
+        ' joinstyle="', this.lineJoin, '"',\r
+        ' miterlimit="', this.miterLimit, '"',\r
+        ' endcap="', processLineCap(this.lineCap), '"',\r
+        ' weight="', lineWidth, 'px"',\r
+        ' color="', color, '" />'\r
+      );\r
+    } else if (typeof this.fillStyle == 'object') {\r
+      var fillStyle = this.fillStyle;\r
+      var angle = 0;\r
+      var focus = {x: 0, y: 0};\r
+\r
+      // additional offset\r
+      var shift = 0;\r
+      // scale factor for offset\r
+      var expansion = 1;\r
+\r
+      if (fillStyle.type_ == 'gradient') {\r
+        var x0 = fillStyle.x0_ / this.arcScaleX_;\r
+        var y0 = fillStyle.y0_ / this.arcScaleY_;\r
+        var x1 = fillStyle.x1_ / this.arcScaleX_;\r
+        var y1 = fillStyle.y1_ / this.arcScaleY_;\r
+        var p0 = this.getCoords_(x0, y0);\r
+        var p1 = this.getCoords_(x1, y1);\r
+        var dx = p1.x - p0.x;\r
+        var dy = p1.y - p0.y;\r
+        angle = Math.atan2(dx, dy) * 180 / Math.PI;\r
+\r
+        // The angle should be a non-negative number.\r
+        if (angle < 0) {\r
+          angle += 360;\r
+        }\r
+\r
+        // Very small angles produce an unexpected result because they are\r
+        // converted to a scientific notation string.\r
+        if (angle < 1e-6) {\r
+          angle = 0;\r
+        }\r
+      } else {\r
+        var p0 = this.getCoords_(fillStyle.x0_, fillStyle.y0_);\r
+        var width  = max.x - min.x;\r
+        var height = max.y - min.y;\r
+        focus = {\r
+          x: (p0.x - min.x) / width,\r
+          y: (p0.y - min.y) / height\r
+        };\r
+\r
+        width  /= this.arcScaleX_ * Z;\r
+        height /= this.arcScaleY_ * Z;\r
+        var dimension = m.max(width, height);\r
+        shift = 2 * fillStyle.r0_ / dimension;\r
+        expansion = 2 * fillStyle.r1_ / dimension - shift;\r
+      }\r
+\r
+      // We need to sort the color stops in ascending order by offset,\r
+      // otherwise IE won't interpret it correctly.\r
+      var stops = fillStyle.colors_;\r
+      stops.sort(function(cs1, cs2) {\r
+        return cs1.offset - cs2.offset;\r
+      });\r
+\r
+      var length = stops.length;\r
+      var color1 = stops[0].color;\r
+      var color2 = stops[length - 1].color;\r
+      var opacity1 = stops[0].alpha * this.globalAlpha;\r
+      var opacity2 = stops[length - 1].alpha * this.globalAlpha;\r
+\r
+      var colors = [];\r
+      for (var i = 0; i < length; i++) {\r
+        var stop = stops[i];\r
+        colors.push(stop.offset * expansion + shift + ' ' + stop.color);\r
+      }\r
+\r
+      // When colors attribute is used, the meanings of opacity and o:opacity2\r
+      // are reversed.\r
+      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',\r
+                   ' method="none" focus="100%"',\r
+                   ' color="', color1, '"',\r
+                   ' color2="', color2, '"',\r
+                   ' colors="', colors.join(','), '"',\r
+                   ' opacity="', opacity2, '"',\r
+                   ' g_o_:opacity2="', opacity1, '"',\r
+                   ' angle="', angle, '"',\r
+                   ' focusposition="', focus.x, ',', focus.y, '" />');\r
+    } else {\r
+      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,\r
+                   '" />');\r
+    }\r
+\r
+    lineStr.push('</g_vml_:shape>');\r
+\r
+    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));\r
+  };\r
+\r
+  contextPrototype.fill = function() {\r
+    this.stroke(true);\r
+  }\r
+\r
+  contextPrototype.closePath = function() {\r
+    this.currentPath_.push({type: 'close'});\r
+  };\r
+\r
+  /**\r
+   * @private\r
+   */\r
+  contextPrototype.getCoords_ = function(aX, aY) {\r
+    var m = this.m_;\r
+    return {\r
+      x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,\r
+      y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2\r
+    }\r
+  };\r
+\r
+  contextPrototype.save = function() {\r
+    var o = {};\r
+    copyState(this, o);\r
+    this.aStack_.push(o);\r
+    this.mStack_.push(this.m_);\r
+    this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);\r
+  };\r
+\r
+  contextPrototype.restore = function() {\r
+    copyState(this.aStack_.pop(), this);\r
+    this.m_ = this.mStack_.pop();\r
+  };\r
+\r
+  function matrixIsFinite(m) {\r
+    for (var j = 0; j < 3; j++) {\r
+      for (var k = 0; k < 2; k++) {\r
+        if (!isFinite(m[j][k]) || isNaN(m[j][k])) {\r
+          return false;\r
+        }\r
+      }\r
+    }\r
+    return true;\r
+  }\r
+\r
+  function setM(ctx, m, updateLineScale) {\r
+    if (!matrixIsFinite(m)) {\r
+      return;\r
+    }\r
+    ctx.m_ = m;\r
+\r
+    if (updateLineScale) {\r
+      // Get the line scale.\r
+      // Determinant of this.m_ means how much the area is enlarged by the\r
+      // transformation. So its square root can be used as a scale factor\r
+      // for width.\r
+      var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];\r
+      ctx.lineScale_ = sqrt(abs(det));\r
+    }\r
+  }\r
+\r
+  contextPrototype.translate = function(aX, aY) {\r
+    var m1 = [\r
+      [1,  0,  0],\r
+      [0,  1,  0],\r
+      [aX, aY, 1]\r
+    ];\r
+\r
+    setM(this, matrixMultiply(m1, this.m_), false);\r
+  };\r
+\r
+  contextPrototype.rotate = function(aRot) {\r
+    var c = mc(aRot);\r
+    var s = ms(aRot);\r
+\r
+    var m1 = [\r
+      [c,  s, 0],\r
+      [-s, c, 0],\r
+      [0,  0, 1]\r
+    ];\r
+\r
+    setM(this, matrixMultiply(m1, this.m_), false);\r
+  };\r
+\r
+  contextPrototype.scale = function(aX, aY) {\r
+    this.arcScaleX_ *= aX;\r
+    this.arcScaleY_ *= aY;\r
+    var m1 = [\r
+      [aX, 0,  0],\r
+      [0,  aY, 0],\r
+      [0,  0,  1]\r
+    ];\r
+\r
+    setM(this, matrixMultiply(m1, this.m_), true);\r
+  };\r
+\r
+  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {\r
+    var m1 = [\r
+      [m11, m12, 0],\r
+      [m21, m22, 0],\r
+      [dx,  dy,  1]\r
+    ];\r
+\r
+    setM(this, matrixMultiply(m1, this.m_), true);\r
+  };\r
+\r
+  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {\r
+    var m = [\r
+      [m11, m12, 0],\r
+      [m21, m22, 0],\r
+      [dx,  dy,  1]\r
+    ];\r
+\r
+    setM(this, m, true);\r
+  };\r
+\r
+  /******** STUBS ********/\r
+  contextPrototype.clip = function() {\r
+    // TODO: Implement\r
+  };\r
+\r
+  contextPrototype.arcTo = function() {\r
+    // TODO: Implement\r
+  };\r
+\r
+  contextPrototype.createPattern = function() {\r
+    return new CanvasPattern_;\r
+  };\r
+\r
+  // Gradient / Pattern Stubs\r
+  function CanvasGradient_(aType) {\r
+    this.type_ = aType;\r
+    this.x0_ = 0;\r
+    this.y0_ = 0;\r
+    this.r0_ = 0;\r
+    this.x1_ = 0;\r
+    this.y1_ = 0;\r
+    this.r1_ = 0;\r
+    this.colors_ = [];\r
+  }\r
+\r
+  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {\r
+    aColor = processStyle(aColor);\r
+    this.colors_.push({offset: aOffset,\r
+                       color: aColor.color,\r
+                       alpha: aColor.alpha});\r
+  };\r
+\r
+  function CanvasPattern_() {}\r
+\r
+  // set up externs\r
+  G_vmlCanvasManager = G_vmlCanvasManager_;\r
+  CanvasRenderingContext2D = CanvasRenderingContext2D_;\r
+  CanvasGradient = CanvasGradient_;\r
+  CanvasPattern = CanvasPattern_;\r
+\r
+})();\r
+\r
+} // if\r
+\r
+if (dhtmlx && dhtmlx._modules)\r
+       dhtmlx._modules["thirdparty/excanvas/excanvas.js"] = true;
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/anchors.js b/portal/static/unbound_reservation_static/src/anchors.js
new file mode 100644 (file)
index 0000000..e6d1374
--- /dev/null
@@ -0,0 +1,1073 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the code for creating and manipulating anchors.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (simon.porritt@gmail.com)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+;(function() { 
+    
+    //
+       // manages anchors for all elements.
+       //
+       jsPlumb.AnchorManager = function(params) {
+               var _amEndpoints = {},
+            continuousAnchors = {},
+            continuousAnchorLocations = {},
+            userDefinedContinuousAnchorLocations = {},        
+            continuousAnchorOrientations = {},
+            Orientation = { HORIZONTAL : "horizontal", VERTICAL : "vertical", DIAGONAL : "diagonal", IDENTITY:"identity" },
+                       connectionsByElementId = {},
+                       self = this,
+            anchorLists = {},
+            jsPlumbInstance = params.jsPlumbInstance,
+            jpcl = jsPlumb.CurrentLibrary,
+            floatingConnections = {},
+            // TODO this functions uses a crude method of determining orientation between two elements.
+            // 'diagonal' should be chosen when the angle of the line between the two centers is around
+            // one of 45, 135, 225 and 315 degrees. maybe +- 15 degrees.
+            // used by AnchorManager.redraw
+            calculateOrientation = function(sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {
+        
+                if (sourceId === targetId) return {
+                    orientation:Orientation.IDENTITY,
+                    a:["top", "top"]
+                };
+        
+                var theta = Math.atan2((td.centery - sd.centery) , (td.centerx - sd.centerx)),
+                    theta2 = Math.atan2((sd.centery - td.centery) , (sd.centerx - td.centerx)),
+                    h = ((sd.left <= td.left && sd.right >= td.left) || (sd.left <= td.right && sd.right >= td.right) ||
+                        (sd.left <= td.left && sd.right >= td.right) || (td.left <= sd.left && td.right >= sd.right)),
+                    v = ((sd.top <= td.top && sd.bottom >= td.top) || (sd.top <= td.bottom && sd.bottom >= td.bottom) ||
+                        (sd.top <= td.top && sd.bottom >= td.bottom) || (td.top <= sd.top && td.bottom >= sd.bottom)),
+                    possiblyTranslateEdges = function(edges) {
+                        // this function checks to see if either anchor is Continuous, and if so, runs the suggested edge
+                        // through the anchor: Continuous anchors can say which faces they support, and they get to choose 
+                        // whether a certain face is honoured, or, if not, which face to replace it with. the behaviour when
+                        // choosing an alternate face is to try for the opposite face first, then the next one clockwise, and then
+                        // the opposite of that one.
+                        return [
+                            sourceAnchor.isContinuous ? sourceAnchor.verifyEdge(edges[0]) : edges[0],    
+                            targetAnchor.isContinuous ? targetAnchor.verifyEdge(edges[1]) : edges[1]
+                        ];
+                    },
+                    out = {
+                        orientation:Orientation.DIAGONAL,
+                        theta:theta,
+                        theta2:theta2
+                    };                        
+                
+                if (! (h || v)) {                    
+                    if (td.left > sd.left && td.top > sd.top)
+                        out.a = ["right", "top"];
+                    else if (td.left > sd.left && sd.top > td.top)
+                        out.a = [ "top", "left"];
+                    else if (td.left < sd.left && td.top < sd.top)
+                        out.a = [ "top", "right"];
+                    else if (td.left < sd.left && td.top > sd.top)
+                        out.a = ["left", "top" ];                            
+                }
+                else if (h) {
+                    out.orientation = Orientation.HORIZONTAL;
+                    out.a = sd.top < td.top ? ["bottom", "top"] : ["top", "bottom"];                    
+                }
+                else {
+                    out.orientation = Orientation.VERTICAL;
+                    out.a = sd.left < td.left ? ["right", "left"] : ["left", "right"];
+                }
+                
+                out.a = possiblyTranslateEdges(out.a);
+                return out;
+            },
+                // used by placeAnchors function
+            placeAnchorsOnLine = function(desc, elementDimensions, elementPosition,
+                            connections, horizontal, otherMultiplier, reverse) {
+                var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);
+        
+                for (var i = 0; i < connections.length; i++) {
+                    var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];
+                    if (reverse)
+                      val = elementDimensions[horizontal ? 0 : 1] - val;
+        
+                    var dx = (horizontal ? val : other), x = elementPosition[0] + dx,  xp = dx / elementDimensions[0],
+                        dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];
+        
+                    a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);
+                }
+        
+                return a;
+            },
+            // used by edgeSortFunctions        
+            currySort = function(reverseAngles) {
+                return function(a,b) {
+                    var r = true;
+                    if (reverseAngles) {
+                        /*if (a[0][0] < b[0][0])
+                            r = true;
+                        else
+                            r = a[0][1] > b[0][1];*/
+                        r = a[0][0] < b[0][0];
+                    }
+                    else {
+                        /*if (a[0][0] > b[0][0])
+                            r= true;
+                        else
+                            r =a[0][1] > b[0][1];
+                        */
+                        r = a[0][0] > b[0][0];
+                    }
+                    return r === false ? -1 : 1;
+                };
+            },
+                // used by edgeSortFunctions
+            leftSort = function(a,b) {
+                // first get adjusted values
+                var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],
+                p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];
+                if (p1 > p2) return 1;
+                else return a[0][1] > b[0][1] ? 1 : -1;
+            },
+                // used by placeAnchors
+            edgeSortFunctions = {
+                "top":function(a, b) { return a[0] > b[0] ? 1 : -1; },
+                "right":currySort(true),
+                "bottom":currySort(true),
+                "left":leftSort
+            },
+                // used by placeAnchors
+            _sortHelper = function(_array, _fn) { return _array.sort(_fn); },
+                // used by AnchorManager.redraw
+            placeAnchors = function(elementId, _anchorLists) {         
+                var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,
+                placeSomeAnchors = function(desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {
+                    if (unsortedConnections.length > 0) {
+                        var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen
+                            reverse = desc === "right" || desc === "top",
+                            anchors = placeAnchorsOnLine(desc, elementDimensions,
+                                                     elementPosition, sc,
+                                                     isHorizontal, otherMultiplier, reverse );
+        
+                        // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.
+                        var _setAnchorLocation = function(endpoint, anchorPos) {
+                            var a = jsPlumbInstance.adjustForParentOffsetAndScroll([anchorPos[0], anchorPos[1]], endpoint.canvas);
+                            continuousAnchorLocations[endpoint.id] = [ a[0], a[1], anchorPos[2], anchorPos[3] ];
+                            continuousAnchorOrientations[endpoint.id] = orientation;
+                        };
+        
+                        for (var i = 0; i < anchors.length; i++) {
+                            var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;
+                            if (weAreSource)
+                                _setAnchorLocation(c.endpoints[0], anchors[i]);
+                            else if (weAreTarget)
+                                _setAnchorLocation(c.endpoints[1], anchors[i]);
+                        }
+                    }
+                };
+        
+                placeSomeAnchors("bottom", sS, [sO.left,sO.top], _anchorLists.bottom, true, 1, [0,1]);
+                placeSomeAnchors("top", sS, [sO.left,sO.top], _anchorLists.top, true, 0, [0,-1]);
+                placeSomeAnchors("left", sS, [sO.left,sO.top], _anchorLists.left, false, 0, [-1,0]);
+                placeSomeAnchors("right", sS, [sO.left,sO.top], _anchorLists.right, false, 1, [1,0]);
+            };
+
+        this.reset = function() {
+            _amEndpoints = {};
+            connectionsByElementId = {};
+            anchorLists = {};
+        };                     
+        this.addFloatingConnection = function(key, conn) {
+            floatingConnections[key] = conn;
+        };
+        this.removeFloatingConnection = function(key) {
+            delete floatingConnections[key];
+        };                                                 
+        this.newConnection = function(conn) {
+                       var sourceId = conn.sourceId, targetId = conn.targetId,
+                               ep = conn.endpoints,
+                doRegisterTarget = true,
+                registerConnection = function(otherIndex, otherEndpoint, otherAnchor, elId, c) {
+                                       if ((sourceId == targetId) && otherAnchor.isContinuous){
+                       // remove the target endpoint's canvas.  we dont need it.
+                        jpcl.removeElement(ep[1].canvas);
+                        doRegisterTarget = false;
+                    }
+                                       jsPlumbUtil.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor == jsPlumb.DynamicAnchor]);
+                           };
+
+                       registerConnection(0, ep[0], ep[0].anchor, targetId, conn);
+            if (doRegisterTarget)
+               registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);
+               };
+        var removeEndpointFromAnchorLists = function(endpoint) {
+            (function(list, eId) {
+                if (list) {  // transient anchors dont get entries in this list.
+                    var f = function(e) { return e[4] == eId; };
+                    jsPlumbUtil.removeWithFunction(list.top, f);
+                    jsPlumbUtil.removeWithFunction(list.left, f);
+                    jsPlumbUtil.removeWithFunction(list.bottom, f);
+                    jsPlumbUtil.removeWithFunction(list.right, f);
+                }
+            })(anchorLists[endpoint.elementId], endpoint.id);
+        };
+               this.connectionDetached = function(connInfo) {
+            var connection = connInfo.connection || connInfo,
+                           sourceId = connInfo.sourceId,
+                targetId = connInfo.targetId,
+                               ep = connection.endpoints,
+                               removeConnection = function(otherIndex, otherEndpoint, otherAnchor, elId, c) {
+                                       if (otherAnchor != null && otherAnchor.constructor == jsPlumb.FloatingAnchor) {
+                                               // no-op
+                                       }
+                                       else {
+                                               jsPlumbUtil.removeWithFunction(connectionsByElementId[elId], function(_c) {
+                                                       return _c[0].id == c.id;
+                                               });
+                                       }
+                               };
+                               
+                       removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);
+                       removeConnection(0, ep[0], ep[0].anchor, targetId, connection);
+
+            // remove from anchorLists            
+            removeEndpointFromAnchorLists(connection.endpoints[0]);
+            removeEndpointFromAnchorLists(connection.endpoints[1]);
+
+            self.redraw(connection.sourceId);
+            self.redraw(connection.targetId);
+               };
+               this.add = function(endpoint, elementId) {
+                       jsPlumbUtil.addToList(_amEndpoints, elementId, endpoint);
+               };
+               this.changeId = function(oldId, newId) {
+                       connectionsByElementId[newId] = connectionsByElementId[oldId];
+                       _amEndpoints[newId] = _amEndpoints[oldId];
+                       delete connectionsByElementId[oldId];
+                       delete _amEndpoints[oldId];     
+               };
+               this.getConnectionsFor = function(elementId) {
+                       return connectionsByElementId[elementId] || [];
+               };
+               this.getEndpointsFor = function(elementId) {
+                       return _amEndpoints[elementId] || [];
+               };
+               this.deleteEndpoint = function(endpoint) {
+                       jsPlumbUtil.removeWithFunction(_amEndpoints[endpoint.elementId], function(e) {
+                               return e.id == endpoint.id;
+                       });
+            removeEndpointFromAnchorLists(endpoint);
+               };
+               this.clearFor = function(elementId) {
+                       delete _amEndpoints[elementId];
+                       _amEndpoints[elementId] = [];
+               };
+        // updates the given anchor list by either updating an existing anchor's info, or adding it. this function
+        // also removes the anchor from its previous list, if the edge it is on has changed.
+        // all connections found along the way (those that are connected to one of the faces this function
+        // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint
+        // them wthout having to calculate anything else about them.
+        var _updateAnchorList = function(lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {        
+            // first try to find the exact match, but keep track of the first index of a matching element id along the way.s
+            var exactIdx = -1,
+                firstMatchingElIdx = -1,
+                endpoint = conn.endpoints[idx],
+                endpointId = endpoint.id,
+                oIdx = [1,0][idx],
+                values = [ [ theta, order ], conn, aBoolean, otherElId, endpointId ],
+                listToAddTo = lists[edgeId],
+                listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null;
+
+            if (listToRemoveFrom) {
+                var rIdx = jsPlumbUtil.findWithFunction(listToRemoveFrom, function(e) { return e[4] == endpointId; });
+                if (rIdx != -1) {
+                    listToRemoveFrom.splice(rIdx, 1);
+                    // get all connections from this list
+                    for (var i = 0; i < listToRemoveFrom.length; i++) {
+                        jsPlumbUtil.addWithFunction(connsToPaint, listToRemoveFrom[i][1], function(c) { return c.id == listToRemoveFrom[i][1].id; });
+                        jsPlumbUtil.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function(e) { return e.id == listToRemoveFrom[i][1].endpoints[idx].id; });
+                        jsPlumbUtil.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function(e) { return e.id == listToRemoveFrom[i][1].endpoints[oIdx].id; });
+                    }
+                }
+            }
+
+            for (i = 0; i < listToAddTo.length; i++) {
+                if (params.idx == 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx == -1)
+                    firstMatchingElIdx = i;
+                jsPlumbUtil.addWithFunction(connsToPaint, listToAddTo[i][1], function(c) { return c.id == listToAddTo[i][1].id; });                
+                jsPlumbUtil.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function(e) { return e.id == listToAddTo[i][1].endpoints[idx].id; });
+                jsPlumbUtil.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function(e) { return e.id == listToAddTo[i][1].endpoints[oIdx].id; });
+            }
+            if (exactIdx != -1) {
+                listToAddTo[exactIdx] = values;
+            }
+            else {
+                var insertIdx = reverse ? firstMatchingElIdx != -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.
+                listToAddTo.splice(insertIdx, 0, values);
+            }
+
+            // store this for next time.
+            endpoint._continuousAnchorEdge = edgeId;
+        };
+
+        //
+        // find the entry in an endpoint's list for this connection and update its target endpoint
+        // with the current target in the connection.
+        // 
+        //
+        this.updateOtherEndpoint = function(elId, oldTargetId, newTargetId, connection) {
+            var sIndex = jsPlumbUtil.findWithFunction(connectionsByElementId[elId], function(i) {
+                    return i[0].id === connection.id;
+                }),
+                tIndex = jsPlumbUtil.findWithFunction(connectionsByElementId[oldTargetId], function(i) {
+                    return i[0].id === connection.id;
+                });
+
+            // update or add data for source
+            if (sIndex != -1) {
+                connectionsByElementId[elId][sIndex][0] = connection;
+                connectionsByElementId[elId][sIndex][1] = connection.endpoints[1];
+                connectionsByElementId[elId][sIndex][2] = connection.endpoints[1].anchor.constructor == jsPlumb.DynamicAnchor;
+            }
+
+            // remove entry for previous target (if there)
+            if (tIndex > -1) {
+
+                connectionsByElementId[oldTargetId].splice(tIndex, 1);
+                // add entry for new target
+                jsPlumbUtil.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor == jsPlumb.DynamicAnchor]);         
+            }
+        };       
+        
+        //
+        // notification that the connection given has changed source from the originalId to the newId.
+        // This involves:
+        // 1. removing the connection from the list of connections stored for the originalId
+        // 2. updating the source information for the target of the connection
+        // 3. re-registering the connection in connectionsByElementId with the newId
+        //
+        this.sourceChanged = function(originalId, newId, connection) {            
+            // remove the entry that points from the old source to the target
+            jsPlumbUtil.removeWithFunction(connectionsByElementId[originalId], function(info) {
+                return info[0].id === connection.id;
+            });
+            // find entry for target and update it
+            var tIdx = jsPlumbUtil.findWithFunction(connectionsByElementId[connection.targetId], function(i) {
+                return i[0].id === connection.id;
+            });
+            if (tIdx > -1) {
+                connectionsByElementId[connection.targetId][tIdx][0] = connection;
+                connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];
+                connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor == jsPlumb.DynamicAnchor;
+            }
+            // add entry for new source
+            jsPlumbUtil.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor == jsPlumb.DynamicAnchor]);         
+        };
+
+        //
+        // moves the given endpoint from `currentId` to `element`.
+        // This involves:
+        //
+        // 1. changing the key in _amEndpoints under which the endpoint is stored
+        // 2. changing the source or target values in all of the endpoint's connections
+        // 3. changing the array in connectionsByElementId in which the endpoint's connections
+        //    are stored (done by either sourceChanged or updateOtherEndpoint)
+        //
+        this.rehomeEndpoint = function(ep, currentId, element) {
+            var eps = _amEndpoints[currentId] || [], 
+                elementId = jsPlumbInstance.getId(element);
+                
+            if (elementId !== currentId) {
+                var idx = jsPlumbUtil.indexOf(eps, ep);
+                if (idx > -1) {
+                    var _ep = eps.splice(idx, 1)[0];
+                    self.add(_ep, elementId);
+                }
+            }
+
+            for (var i = 0; i < ep.connections.length; i++) {                
+                if (ep.connections[i].sourceId == currentId) {
+                    ep.connections[i].sourceId = ep.elementId;
+                    ep.connections[i].source = ep.element;                  
+                    self.sourceChanged(currentId, ep.elementId, ep.connections[i]);
+                }
+                else if(ep.connections[i].targetId == currentId) {
+                    ep.connections[i].targetId = ep.elementId;
+                    ep.connections[i].target = ep.element;   
+                    self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);               
+                }
+            }   
+        };
+
+               this.redraw = function(elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {
+               
+                       if (!jsPlumbInstance.isSuspendDrawing()) {
+                               // get all the endpoints for this element
+                               var ep = _amEndpoints[elementId] || [],
+                                       endpointConnections = connectionsByElementId[elementId] || [],
+                                       connectionsToPaint = [],
+                                       endpointsToPaint = [],
+                       anchorsToUpdate = [];
+                   
+                               timestamp = timestamp || jsPlumbInstance.timestamp();
+                               // offsetToUI are values that would have been calculated in the dragManager when registering
+                               // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been
+                               // registered as draggable.
+                               offsetToUI = offsetToUI || {left:0, top:0};
+                               if (ui) {
+                                       ui = {
+                                               left:ui.left + offsetToUI.left,
+                                               top:ui.top + offsetToUI.top
+                                       };
+                               }
+                                                                       
+                               // valid for one paint cycle.
+                               var myOffset = jsPlumbInstance.updateOffset( { elId : elementId, offset : ui, recalc : false, timestamp : timestamp }),
+                       orientationCache = {};
+                               
+                               // actually, first we should compute the orientation of this element to all other elements to which
+                               // this element is connected with a continuous anchor (whether both ends of the connection have
+                               // a continuous anchor or just one)
+                               
+                   for (var i = 0; i < endpointConnections.length; i++) {
+                       var conn = endpointConnections[i][0],
+                                               sourceId = conn.sourceId,
+                           targetId = conn.targetId,
+                           sourceContinuous = conn.endpoints[0].anchor.isContinuous,
+                           targetContinuous = conn.endpoints[1].anchor.isContinuous;
+       
+                       if (sourceContinuous || targetContinuous) {
+                               var oKey = sourceId + "_" + targetId,
+                                   oKey2 = targetId + "_" + sourceId,
+                                   o = orientationCache[oKey],
+                                   oIdx = conn.sourceId == elementId ? 1 : 0;
+       
+                               if (sourceContinuous && !anchorLists[sourceId]) anchorLists[sourceId] = { top:[], right:[], bottom:[], left:[] };
+                               if (targetContinuous && !anchorLists[targetId]) anchorLists[targetId] = { top:[], right:[], bottom:[], left:[] };
+       
+                               if (elementId != targetId) jsPlumbInstance.updateOffset( { elId : targetId, timestamp : timestamp }); 
+                               if (elementId != sourceId) jsPlumbInstance.updateOffset( { elId : sourceId, timestamp : timestamp }); 
+       
+                               var td = jsPlumbInstance.getCachedData(targetId),
+                                                       sd = jsPlumbInstance.getCachedData(sourceId);
+       
+                               if (targetId == sourceId && (sourceContinuous || targetContinuous)) {
+                                   // here we may want to improve this by somehow determining the face we'd like
+                                                   // to put the connector on.  ideally, when drawing, the face should be calculated
+                                                   // by determining which face is closest to the point at which the mouse button
+                                                       // was released.  for now, we're putting it on the top face.                            
+                                   _updateAnchorList(
+                                anchorLists[sourceId], 
+                                -Math.PI / 2, 
+                                0, 
+                                conn, 
+                                false, 
+                                targetId, 
+                                0, false, "top", sourceId, connectionsToPaint, endpointsToPaint);
+                                               }
+                               else {
+                                   if (!o) {
+                                       o = calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor);
+                                       orientationCache[oKey] = o;
+                                       // this would be a performance enhancement, but the computed angles need to be clamped to
+                                       //the (-PI/2 -> PI/2) range in order for the sorting to work properly.
+                                   /*  orientationCache[oKey2] = {
+                                           orientation:o.orientation,
+                                           a:[o.a[1], o.a[0]],
+                                           theta:o.theta + Math.PI,
+                                           theta2:o.theta2 + Math.PI
+                                       };*/
+                                   }
+                                   if (sourceContinuous) _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);
+                                   if (targetContinuous) _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);
+                               }
+       
+                               if (sourceContinuous) jsPlumbUtil.addWithFunction(anchorsToUpdate, sourceId, function(a) { return a === sourceId; });
+                               if (targetContinuous) jsPlumbUtil.addWithFunction(anchorsToUpdate, targetId, function(a) { return a === targetId; });
+                               jsPlumbUtil.addWithFunction(connectionsToPaint, conn, function(c) { return c.id == conn.id; });
+                               if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1))
+                                       jsPlumbUtil.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function(e) { return e.id == conn.endpoints[oIdx].id; });
+                           }
+                   }                           
+                               // place Endpoints whose anchors are continuous but have no Connections
+                               for (i = 0; i < ep.length; i++) {
+                                       if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {
+                                               if (!anchorLists[elementId]) anchorLists[elementId] = { top:[], right:[], bottom:[], left:[] };
+                                               _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints:[ep[i], ep[i]], paint:function(){}}, false, elementId, 0, false, "top", elementId, connectionsToPaint, endpointsToPaint);
+                                               jsPlumbUtil.addWithFunction(anchorsToUpdate, elementId, function(a) { return a === elementId; });
+                                       }
+                               }
+                   // now place all the continuous anchors we need to;
+                   for (i = 0; i < anchorsToUpdate.length; i++) {
+                                       placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);
+                               }
+
+                               // now that continuous anchors have been placed, paint all the endpoints for this element
+                   // TODO performance: add the endpoint ids to a temp array, and then when iterating in the next
+                   // loop, check that we didn't just paint that endpoint. we can probably shave off a few more milliseconds this way.
+                               for (i = 0; i < ep.length; i++) {                               
+                    ep[i].paint( { timestamp : timestamp, offset : myOffset, dimensions : myOffset.s, recalc:doNotRecalcEndpoint !== true });
+                               }
+                   // ... and any other endpoints we came across as a result of the continuous anchors.
+                   for (i = 0; i < endpointsToPaint.length; i++) {
+                    var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);
+                    // dont use timestamp for this endpoint, as it is not for the current element and we may 
+                    // have needed to recalculate anchor position due to the element for the endpoint moving.
+                    //endpointsToPaint[i].paint( { timestamp : null, offset : cd, dimensions : cd.s });
+
+                    endpointsToPaint[i].paint( { timestamp : timestamp, offset : cd, dimensions : cd.s });
+                               }
+
+                               // paint all the standard and "dynamic connections", which are connections whose other anchor is
+                               // static and therefore does need to be recomputed; we make sure that happens only one time.
+       
+                               // TODO we could have compiled a list of these in the first pass through connections; might save some time.
+                               for (i = 0; i < endpointConnections.length; i++) {
+                                       var otherEndpoint = endpointConnections[i][1];
+                                       if (otherEndpoint.anchor.constructor == jsPlumb.DynamicAnchor) {                                                                                
+                                               otherEndpoint.paint({ elementWithPrecedence:elementId, timestamp:timestamp });                                                          
+                           jsPlumbUtil.addWithFunction(connectionsToPaint, endpointConnections[i][0], function(c) { return c.id == endpointConnections[i][0].id; });
+                                               // all the connections for the other endpoint now need to be repainted
+                                               for (var k = 0; k < otherEndpoint.connections.length; k++) {
+                                                       if (otherEndpoint.connections[k] !== endpointConnections[i][0])                                                 
+                                   jsPlumbUtil.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function(c) { return c.id == otherEndpoint.connections[k].id; });
+                                               }
+                                       } else if (otherEndpoint.anchor.constructor == jsPlumb.Anchor) {                                        
+                           jsPlumbUtil.addWithFunction(connectionsToPaint, endpointConnections[i][0], function(c) { return c.id == endpointConnections[i][0].id; });
+                                       }
+                               }
+                               // paint current floating connection for this element, if there is one.
+                               var fc = floatingConnections[elementId];
+                               if (fc) 
+                                       fc.paint({timestamp:timestamp, recalc:false, elId:elementId});
+                                               
+                               // paint all the connections
+                               for (i = 0; i < connectionsToPaint.length; i++) {
+                                       // if not a connection between the two elements in question dont use the timestamp.
+                    var ts  =timestamp;// ((connectionsToPaint[i].sourceId == sourceId && connectionsToPaint[i].targetId == targetId) ||
+                               //(connectionsToPaint[i].sourceId == targetId && connectionsToPaint[i].targetId == sourceId)) ? timestamp : null;
+                    connectionsToPaint[i].paint({elId:elementId, timestamp:ts, recalc:false, clearEdits:clearEdits});
+                               }
+                       }
+               };        
+        
+        var ContinuousAnchor = function(anchorParams) {
+            jsPlumbUtil.EventGenerator.apply(this);
+            this.type = "Continuous";
+            this.isDynamic = true;
+            this.isContinuous = true;
+            var faces = anchorParams.faces || ["top", "right", "bottom", "left"],
+                clockwise = !(anchorParams.clockwise === false),
+                availableFaces = { },
+                opposites = { "top":"bottom", "right":"left","left":"right","bottom":"top" },
+                clockwiseOptions = { "top":"right", "right":"bottom","left":"top","bottom":"left" },
+                antiClockwiseOptions = { "top":"left", "right":"top","left":"bottom","bottom":"right" },
+                secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,
+                lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,
+                cssClass = anchorParams.cssClass || "";
+            
+            for (var i = 0; i < faces.length; i++) { availableFaces[faces[i]] = true; }
+          
+            // if the given edge is supported, returns it. otherwise looks for a substitute that _is_
+            // supported. if none supported we also return the request edge.
+            this.verifyEdge = function(edge) {
+                if (availableFaces[edge]) return edge;
+                else if (availableFaces[opposites[edge]]) return opposites[edge];
+                else if (availableFaces[secondBest[edge]]) return secondBest[edge];
+                else if (availableFaces[lastChoice[edge]]) return lastChoice[edge];
+                return edge; // we have to give them something.
+            };
+            
+            this.compute = function(params) {
+                return userDefinedContinuousAnchorLocations[params.element.id] || continuousAnchorLocations[params.element.id] || [0,0];
+            };
+            this.getCurrentLocation = function(params) {
+                return userDefinedContinuousAnchorLocations[params.element.id] || continuousAnchorLocations[params.element.id] || [0,0];
+            };
+            this.getOrientation = function(endpoint) {
+                return continuousAnchorOrientations[endpoint.id] || [0,0];
+            };
+            this.clearUserDefinedLocation = function() { 
+                delete userDefinedContinuousAnchorLocations[anchorParams.elementId]; 
+            };
+            this.setUserDefinedLocation = function(loc) { 
+                userDefinedContinuousAnchorLocations[anchorParams.elementId] = loc; 
+            };            
+            this.getCssClass = function() { return cssClass; };
+            this.setCssClass = function(c) { cssClass = c; };
+        };        
+        
+        // continuous anchors
+        jsPlumbInstance.continuousAnchorFactory = {
+            get:function(params) {
+                var existing = continuousAnchors[params.elementId];
+                if (!existing) {
+                    existing = new ContinuousAnchor(params);                    
+                    continuousAnchors[params.elementId] = existing;
+                }
+                return existing;
+            },
+            clear:function(elementId) {
+                delete continuousAnchors[elementId];
+            }
+        };
+       };
+    
+    /**
+     * Anchors model a position on some element at which an Endpoint may be located.  They began as a first class citizen of jsPlumb, ie. a user
+     * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. "TopMiddle"),
+     * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as "TopMiddle").  jsPlumb now handles all of the
+     * creation of Anchors without user intervention.
+     */
+    jsPlumb.Anchor = function(params) {       
+        this.x = params.x || 0;
+        this.y = params.y || 0;
+        this.elementId = params.elementId;  
+        this.cssClass = params.cssClass || "";      
+        this.userDefinedLocation = null;
+        this.orientation = params.orientation || [ 0, 0 ];
+
+        jsPlumbUtil.EventGenerator.apply(this);
+        
+        var jsPlumbInstance = params.jsPlumbInstance;//,
+            //lastTimestamp = null;//, lastReturnValue = null;
+        
+        this.lastReturnValue = null;
+        this.offsets = params.offsets || [ 0, 0 ];
+        this.timestamp = null;        
+        this.compute = function(params) {
+            
+            var xy = params.xy, wh = params.wh, element = params.element, timestamp = params.timestamp; 
+
+            if(params.clearUserDefinedLocation)
+                this.userDefinedLocation = null;
+            
+            if (timestamp && timestamp === self.timestamp)
+                return this.lastReturnValue;        
+            
+            if (this.userDefinedLocation != null) {
+                this.lastReturnValue = this.userDefinedLocation;
+            }
+            else {                
+                
+                this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1] ];                    
+                // adjust loc if there is an offsetParent
+                this.lastReturnValue = jsPlumbInstance.adjustForParentOffsetAndScroll(this.lastReturnValue, element.canvas);
+            }
+            
+            this.timestamp = timestamp;
+            return this.lastReturnValue;
+        };
+
+        this.getCurrentLocation = function(params) { 
+            return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp != params.timestamp)) ? this.compute(params) : this.lastReturnValue; 
+        };
+    };
+    jsPlumbUtil.extend(jsPlumb.Anchor, jsPlumbUtil.EventGenerator, {
+        equals : function(anchor) {
+            if (!anchor) return false;
+            var ao = anchor.getOrientation(),
+                o = this.getOrientation();
+            return this.x == anchor.x && this.y == anchor.y && this.offsets[0] == anchor.offsets[0] && this.offsets[1] == anchor.offsets[1] && o[0] == ao[0] && o[1] == ao[1];
+        },
+        getUserDefinedLocation : function() { 
+            return this.userDefinedLocation;
+        },        
+        setUserDefinedLocation : function(l) {
+            this.userDefinedLocation = l;
+        },
+        clearUserDefinedLocation : function() {
+            this.userDefinedLocation = null;
+        },
+        getOrientation : function(_endpoint) { return this.orientation; },
+        getCssClass : function() { return this.cssClass; }
+    });
+
+    /**
+     * An Anchor that floats. its orientation is computed dynamically from
+     * its position relative to the anchor it is floating relative to.  It is used when creating 
+     * a connection through drag and drop.
+     * 
+     * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.
+     */
+    jsPlumb.FloatingAnchor = function(params) {
+        
+        jsPlumb.Anchor.apply(this, arguments);
+
+        // this is the anchor that this floating anchor is referenced to for
+        // purposes of calculating the orientation.
+        var ref = params.reference,
+            jpcl = jsPlumb.CurrentLibrary,
+            jsPlumbInstance = params.jsPlumbInstance,
+            // the canvas this refers to.
+            refCanvas = params.referenceCanvas,
+            size = jpcl.getSize(jpcl.getElementObject(refCanvas)),
+            // these are used to store the current relative position of our
+            // anchor wrt the reference anchor. they only indicate
+            // direction, so have a value of 1 or -1 (or, very rarely, 0). these
+            // values are written by the compute method, and read
+            // by the getOrientation method.
+            xDir = 0, yDir = 0,
+            // temporary member used to store an orientation when the floating
+            // anchor is hovering over another anchor.
+            orientation = null,
+            _lastResult = null;
+
+        // clear from parent. we want floating anchor orientation to always be computed.
+        this.orientation = null;
+
+        // set these to 0 each; they are used by certain types of connectors in the loopback case,
+        // when the connector is trying to clear the element it is on. but for floating anchor it's not
+        // very important.
+        this.x = 0; this.y = 0;
+
+        this.isFloating = true;
+
+        this.compute = function(params) {
+            var xy = params.xy, element = params.element,
+            result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.
+                        
+            // adjust loc if there is an offsetParent
+            result = jsPlumbInstance.adjustForParentOffsetAndScroll(result, element.canvas);
+            
+            _lastResult = result;
+            return result;
+        };
+
+        this.getOrientation = function(_endpoint) {
+            if (orientation) return orientation;
+            else {
+                var o = ref.getOrientation(_endpoint);
+                // here we take into account the orientation of the other
+                // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come
+                // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.
+                return [ Math.abs(o[0]) * xDir * -1,
+                        Math.abs(o[1]) * yDir * -1 ];
+            }
+        };
+
+        /**
+         * notification the endpoint associated with this anchor is hovering
+         * over another anchor; we want to assume that anchor's orientation
+         * for the duration of the hover.
+         */
+        this.over = function(anchor, endpoint) { 
+            orientation = anchor.getOrientation(endpoint); 
+        };
+
+        /**
+         * notification the endpoint associated with this anchor is no
+         * longer hovering over another anchor; we should resume calculating
+         * orientation as we normally do.
+         */
+        this.out = function() { orientation = null; };
+
+        this.getCurrentLocation = function(params) { return _lastResult == null ? this.compute(params) : _lastResult; };
+    };
+    jsPlumbUtil.extend(jsPlumb.FloatingAnchor, jsPlumb.Anchor);
+
+    var _convertAnchor = function(anchor, jsPlumbInstance, elementId) { 
+        return anchor.constructor == jsPlumb.Anchor ? anchor: jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance); 
+    };
+
+    /* 
+     * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles
+     * through at compute time to find the one that is located closest to
+     * the center of the target element, and returns that Anchor's compute
+     * method result. this causes endpoints to follow each other with
+     * respect to the orientation of their target elements, which is a useful
+     * feature for some applications.
+     * 
+     */
+    jsPlumb.DynamicAnchor = function(params) {
+        jsPlumb.Anchor.apply(this, arguments);
+        
+        this.isSelective = true;
+        this.isDynamic = true;                 
+        this.anchors = [];
+        this.elementId = params.elementId;
+        this.jsPlumbInstance = params.jsPlumbInstance;
+
+        for (var i = 0; i < params.anchors.length; i++) 
+            this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);                 
+        this.addAnchor = function(anchor) { this.anchors.push(_convertAnchor(anchor, this.jsPlumbInstance, this.elementId)); };
+        this.getAnchors = function() { return this.anchors; };
+        this.locked = false;
+        var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,
+            _curIndex = this.anchors.length > 0 ? 0 : -1,
+            _lastAnchor = _curAnchor,
+            self = this,
+        
+            // helper method to calculate the distance between the centers of the two elements.
+            _distance = function(anchor, cx, cy, xy, wh) {
+                var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),                          
+                    acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);
+                return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +
+                        Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));
+            },        
+            // default method uses distance between element centers.  you can provide your own method in the dynamic anchor
+            // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays: 
+            // xy - xy loc of the anchor's element
+            // wh - anchor's element's dimensions
+            // txy - xy loc of the element of the other anchor in the connection
+            // twh - dimensions of the element of the other anchor in the connection.
+            // anchors - the list of selectable anchors
+            _anchorSelector = params.selector || function(xy, wh, txy, twh, anchors) {
+                var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);
+                var minIdx = -1, minDist = Infinity;
+                for ( var i = 0; i < anchors.length; i++) {
+                    var d = _distance(anchors[i], cx, cy, xy, wh);
+                    if (d < minDist) {
+                        minIdx = i + 0;
+                        minDist = d;
+                    }
+                }
+                return anchors[minIdx];
+            };
+        
+        this.compute = function(params) {                              
+            var xy = params.xy, wh = params.wh, timestamp = params.timestamp, txy = params.txy, twh = params.twh;                              
+            
+            if(params.clearUserDefinedLocation)
+                userDefinedLocation = null;
+
+            this.timestamp = timestamp;            
+            
+            var udl = self.getUserDefinedLocation();
+            if (udl != null) {
+                return udl;
+            }
+            
+            // if anchor is locked or an opposite element was not given, we
+            // maintain our state. anchor will be locked
+            // if it is the source of a drag and drop.
+            if (this.locked || txy == null || twh == null)
+                return _curAnchor.compute(params);                             
+            else
+                params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.
+            
+            _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);
+            this.x = _curAnchor.x;
+            this.y = _curAnchor.y;        
+
+            if (_curAnchor != _lastAnchor)
+                this.fire("anchorChanged", _curAnchor);
+
+            _lastAnchor = _curAnchor;
+            
+            return _curAnchor.compute(params);
+        };
+
+        this.getCurrentLocation = function(params) {
+            return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);
+        };
+
+        this.getOrientation = function(_endpoint) { return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ]; };
+        this.over = function(anchor, endpoint) { if (_curAnchor != null) _curAnchor.over(anchor, endpoint); };
+        this.out = function() { if (_curAnchor != null) _curAnchor.out(); };
+
+        this.getCssClass = function() { return (_curAnchor && _curAnchor.getCssClass()) || ""; };
+    };    
+    jsPlumbUtil.extend(jsPlumb.DynamicAnchor, jsPlumb.Anchor);        
+    
+// -------- basic anchors ------------------    
+    var _curryAnchor = function(x, y, ox, oy, type, fnInit) {
+        jsPlumb.Anchors[type] = function(params) {
+            var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);
+            a.type = type;
+            if (fnInit) fnInit(a, params);
+            return a;
+        };
+    };
+       
+       _curryAnchor(0.5, 0, 0,-1, "TopCenter");
+    _curryAnchor(0.5, 1, 0, 1, "BottomCenter");
+    _curryAnchor(0, 0.5, -1, 0, "LeftMiddle");
+    _curryAnchor(1, 0.5, 1, 0, "RightMiddle");
+    // from 1.4.2: Top, Right, Bottom, Left
+    _curryAnchor(0.5, 0, 0,-1, "Top");
+    _curryAnchor(0.5, 1, 0, 1, "Bottom");
+    _curryAnchor(0, 0.5, -1, 0, "Left");
+    _curryAnchor(1, 0.5, 1, 0, "Right");
+    _curryAnchor(0.5, 0.5, 0, 0, "Center");
+    _curryAnchor(1, 0, 0,-1, "TopRight");
+    _curryAnchor(1, 1, 0, 1, "BottomRight");
+    _curryAnchor(0, 0, 0, -1, "TopLeft");
+    _curryAnchor(0, 1, 0, 1, "BottomLeft");
+    
+// ------- dynamic anchors -------------------    
+                       
+    // default dynamic anchors chooses from Top, Right, Bottom, Left
+       jsPlumb.Defaults.DynamicAnchors = function(params) {
+               return params.jsPlumbInstance.makeAnchors(["TopCenter", "RightMiddle", "BottomCenter", "LeftMiddle"], params.elementId, params.jsPlumbInstance);
+       };
+    
+    // default dynamic anchors bound to name 'AutoDefault'
+       jsPlumb.Anchors.AutoDefault  = function(params) { 
+               var a = params.jsPlumbInstance.makeDynamicAnchor(jsPlumb.Defaults.DynamicAnchors(params));
+               a.type = "AutoDefault";
+               return a;
+       };      
+    
+// ------- continuous anchors -------------------    
+    
+    var _curryContinuousAnchor = function(type, faces) {
+        jsPlumb.Anchors[type] = function(params) {
+            var a = params.jsPlumbInstance.makeAnchor(["Continuous", { faces:faces }], params.elementId, params.jsPlumbInstance);
+            a.type = type;
+            return a;
+        };
+    };
+    
+    jsPlumb.Anchors.Continuous = function(params) {
+               return params.jsPlumbInstance.continuousAnchorFactory.get(params);
+       };
+                
+    _curryContinuousAnchor("ContinuousLeft", ["left"]);    
+    _curryContinuousAnchor("ContinuousTop", ["top"]);                 
+    _curryContinuousAnchor("ContinuousBottom", ["bottom"]);                 
+    _curryContinuousAnchor("ContinuousRight", ["right"]); 
+    
+// ------- position assign anchors -------------------    
+    
+    // this anchor type lets you assign the position at connection time.
+       _curryAnchor(0, 0, 0, 0, "Assign", function(anchor, params) {
+               // find what to use as the "position finder". the user may have supplied a String which represents
+               // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the
+               // position finder as a function.  we find out what to use and then set it on the anchor.
+               var pf = params.position || "Fixed";
+               anchor.positionFinder = pf.constructor == String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;
+               // always set the constructor params; the position finder might need them later (the Grid one does,
+               // for example)
+               anchor.constructorParams = params;
+       });     
+
+    // these are the default anchor positions finders, which are used by the makeTarget function.  supplying
+    // a position finder argument to that function allows you to specify where the resulting anchor will
+    // be located
+       jsPlumbInstance.prototype.AnchorPositionFinders = {
+               "Fixed": function(dp, ep, es, params) {
+                       return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];      
+               },
+               "Grid":function(dp, ep, es, params) {
+                       var dx = dp.left - ep.left, dy = dp.top - ep.top,
+                               gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),
+                               mx = Math.floor(dx / gx), my = Math.floor(dy / gy);
+                       return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];
+               }
+       };
+    
+// ------- perimeter anchors -------------------    
+               
+       jsPlumb.Anchors.Perimeter = function(params) {
+               params = params || {};
+               var anchorCount = params.anchorCount || 60,
+                       shape = params.shape;
+               
+               if (!shape) throw new Error("no shape supplied to Perimeter Anchor type");              
+               
+               var _circle = function() {
+                var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];
+                for (var i = 0; i < anchorCount; i++) {
+                    var x = r + (r * Math.sin(current)),
+                        y = r + (r * Math.cos(current));                                
+                    a.push( [ x, y, 0, 0 ] );
+                    current += step;
+                }
+                return a;      
+            },
+            _path = function(segments) {
+                var anchorsPerFace = anchorCount / segments.length, a = [],
+                    _computeFace = function(x1, y1, x2, y2, fractionalLength) {
+                        anchorsPerFace = anchorCount * fractionalLength;
+                        var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;
+                        for (var i = 0; i < anchorsPerFace; i++) {
+                            a.push( [
+                                x1 + (dx * i),
+                                y1 + (dy * i),
+                                0,
+                                0
+                            ]);
+                        }
+                    };
+                                                               
+                for (var i = 0; i < segments.length; i++)
+                    _computeFace.apply(null, segments[i]);
+                                                                                                               
+                return a;                                      
+            },
+                       _shape = function(faces) {                                                                                              
+                var s = [];
+                for (var i = 0; i < faces.length; i++) {
+                    s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);
+                }
+                return _path(s);
+                       },
+                       _rectangle = function() {
+                               return _shape([
+                                       [ 0, 0, 1, 0 ], [ 1, 0, 1, 1 ], [ 1, 1, 0, 1 ], [ 0, 1, 0, 0 ]
+                               ]);             
+                       };
+               
+               var _shapes = {
+                       "Circle":_circle,
+                       "Ellipse":_circle,
+                       "Diamond":function() {
+                               return _shape([
+                                               [ 0.5, 0, 1, 0.5 ], [ 1, 0.5, 0.5, 1 ], [ 0.5, 1, 0, 0.5 ], [ 0, 0.5, 0.5, 0 ]
+                               ]);
+                       },
+                       "Rectangle":_rectangle,
+                       "Square":_rectangle,
+                       "Triangle":function() {
+                               return _shape([
+                                               [ 0.5, 0, 1, 1 ], [ 1, 1, 0, 1 ], [ 0, 1, 0.5, 0]
+                               ]);     
+                       },
+                       "Path":function(params) {
+                var points = params.points, p = [], tl = 0;
+                               for (var i = 0; i < points.length - 1; i++) {
+                    var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));
+                    tl += l;
+                                       p.push([points[i][0], points[i][1], points[i+1][0], points[i+1][1], l]);                                                
+                               }
+                for (var j = 0; j < p.length; j++) {
+                    p[j][4] = p[j][4] / tl;
+                }
+                               return _path(p);
+                       }
+               },
+        _rotate = function(points, amountInDegrees) {
+            var o = [], theta = amountInDegrees / 180 * Math.PI ;
+            for (var i = 0; i < points.length; i++) {
+                var _x = points[i][0] - 0.5,
+                    _y = points[i][1] - 0.5;
+                    
+                o.push([
+                    0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),
+                    0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),
+                    points[i][2],
+                    points[i][3]
+                ]);
+            }
+            return o;
+        };
+               
+               if (!_shapes[shape]) throw new Error("Shape [" + shape + "] is unknown by Perimeter Anchor type");
+               
+               var da = _shapes[shape](params);
+        if (params.rotation) da = _rotate(da, params.rotation);
+        var a = params.jsPlumbInstance.makeDynamicAnchor(da);
+               a.type = "Perimeter";
+               return a;
+       };
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/connection.js b/portal/static/unbound_reservation_static/src/connection.js
new file mode 100644 (file)
index 0000000..ea8bceb
--- /dev/null
@@ -0,0 +1,504 @@
+;(function() {
+
+    var makeConnector = function(_jsPlumb, renderMode, connectorName, connectorArgs) {
+            if (!_jsPlumb.Defaults.DoNotThrowErrors && jsPlumb.Connectors[renderMode][connectorName] == null)
+                    throw { msg:"jsPlumb: unknown connector type '" + connectorName + "'" };
+
+            return new jsPlumb.Connectors[renderMode][connectorName](connectorArgs);  
+        },
+        _makeAnchor = function(anchorParams, elementId, _jsPlumb) {
+            return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;
+        },
+        prepareEndpoint = function(_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId, connectorPaintStyle, connectorHoverPaintStyle) {
+            var e;
+            if (existing) {
+                conn.endpoints[index] = existing;
+                existing.addConnection(conn);                   
+            } else {
+                if (!params.endpoints) params.endpoints = [ null, null ];
+                var ep = params.endpoints[index]  || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || jsPlumb.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || jsPlumb.Defaults.Endpoint;
+                if (!params.endpointStyles) params.endpointStyles = [ null, null ];
+                if (!params.endpointHoverStyles) params.endpointHoverStyles = [ null, null ];
+                var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || jsPlumb.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || jsPlumb.Defaults.EndpointStyle;
+                // Endpoints derive their fillStyle from the connector's strokeStyle, if no fillStyle was specified.
+                if (es.fillStyle == null && connectorPaintStyle != null)
+                    es.fillStyle = connectorPaintStyle.strokeStyle;
+                
+                // TODO: decide if the endpoint should derive the connection's outline width and color.  currently it does:
+                //*
+                if (es.outlineColor == null && connectorPaintStyle != null) 
+                    es.outlineColor = connectorPaintStyle.outlineColor;
+                if (es.outlineWidth == null && connectorPaintStyle != null) 
+                    es.outlineWidth = connectorPaintStyle.outlineWidth;
+                //*/
+                
+                var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || jsPlumb.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || jsPlumb.Defaults.EndpointHoverStyle;
+                // endpoint hover fill style is derived from connector's hover stroke style.  TODO: do we want to do this by default? for sure?
+                if (connectorHoverPaintStyle != null) {
+                    if (ehs == null) ehs = {};
+                    if (ehs.fillStyle == null) {
+                        ehs.fillStyle = connectorHoverPaintStyle.strokeStyle;
+                    }
+                }
+                var a = params.anchors ? params.anchors[index] : 
+                        params.anchor ? params.anchor :
+                        _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) || 
+                        _makeAnchor(jsPlumb.Defaults.Anchors[index], elementId,_jsPlumb) || 
+                        _makeAnchor(_jsPlumb.Defaults.Anchor, elementId,_jsPlumb) || 
+                        _makeAnchor(jsPlumb.Defaults.Anchor, elementId, _jsPlumb),                  
+                    u = params.uuids ? params.uuids[index] : null;
+                    e = _newEndpoint({ 
+                        paintStyle : es,  hoverPaintStyle:ehs,  endpoint : ep,  connections : [ conn ], 
+                        uuid : u,  anchor : a,  source : element, scope  : params.scope, container:params.container,
+                        reattach:params.reattach || _jsPlumb.Defaults.ReattachConnections,
+                        detachable:params.detachable || _jsPlumb.Defaults.ConnectionsDetachable
+                    });
+                conn.endpoints[index] = e;
+                
+                if (params.drawEndpoints === false) e.setVisible(false, true, true);
+                                    
+            }
+            return e;
+        };
+    
+    jsPlumb.Connection = function(params) {
+        var _newConnection = params.newConnection,
+            _newEndpoint = params.newEndpoint,
+            jpcl = jsPlumb.CurrentLibrary,
+            _att = jpcl.getAttribute,
+            _gel = jpcl.getElementObject,
+            _dom = jpcl.getDOMElement,
+            _ju = jsPlumbUtil,
+            _getOffset = jpcl.getOffset;
+
+        this.connector = null;                        
+        this.idPrefix = "_jsplumb_c_";
+        this.defaultLabelLocation = 0.5;
+        this.defaultOverlayKeys = ["Overlays", "ConnectionOverlays"];
+        this.parent = params.parent;
+        // if a new connection is the result of moving some existing connection, params.previousConnection
+        // will have that Connection in it. listeners for the jsPlumbConnection event can look for that
+        // member and take action if they need to.
+        this.previousConnection = params.previousConnection;
+        this.source = _dom(params.source);
+        this.target = _dom(params.target);
+        // sourceEndpoint and targetEndpoint override source/target, if they are present. but 
+        // source is not overridden if the Endpoint has declared it is not the final target of a connection;
+        // instead we use the source that the Endpoint declares will be the final source element.
+        if (params.sourceEndpoint) this.source = params.sourceEndpoint.endpointWillMoveTo || params.sourceEndpoint.getElement();            
+        if (params.targetEndpoint) this.target = params.targetEndpoint.getElement();        
+
+        OverlayCapableJsPlumbUIComponent.apply(this, arguments);
+
+        this.sourceId = this._jsPlumb.instance.getId(this.source);
+        this.targetId = this._jsPlumb.instance.getId(this.target);
+        this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints.            
+        this.endpoints = [];
+        this.endpointStyles = [];
+            
+        var _jsPlumb = this._jsPlumb.instance;    
+        this._jsPlumb.visible = true;
+        this._jsPlumb.editable = params.editable === true;    
+        this._jsPlumb.params = {
+            parent:params.parent,
+            cssClass:params.cssClass,
+            container:params.container,
+            "pointer-events":params["pointer-events"],
+            editorParams:params.editorParams
+        };   
+        this._jsPlumb.lastPaintedAt = null;              
+        this.getDefaultType = function() {
+            return {
+                parameters:{},
+                scope:null,
+                detachable:this._jsPlumb.instance.Defaults.ConnectionsDetachable,
+                rettach:this._jsPlumb.instance.Defaults.ReattachConnections,
+                paintStyle:this._jsPlumb.instance.Defaults.PaintStyle || jsPlumb.Defaults.PaintStyle,
+                connector:this._jsPlumb.instance.Defaults.Connector || jsPlumb.Defaults.Connector,
+                hoverPaintStyle:this._jsPlumb.instance.Defaults.HoverPaintStyle || jsPlumb.Defaults.HoverPaintStyle,                           
+                overlays:this._jsPlumb.instance.Defaults.ConnectorOverlays || jsPlumb.Defaults.ConnectorOverlays
+            };
+        };
+        
+// INITIALISATION CODE                 
+                            
+        // wrapped the main function to return null if no input given. this lets us cascade defaults properly.
+        
+        var eS = prepareEndpoint(_jsPlumb, _newEndpoint, this, params.sourceEndpoint, 0, params, this.source, this.sourceId, params.paintStyle, params.hoverPaintStyle);                       
+        if (eS) _ju.addToList(params.endpointsByElement, this.sourceId, eS);                                           
+        var eT = prepareEndpoint(_jsPlumb, _newEndpoint, this, params.targetEndpoint, 1, params, this.target, this.targetId, params.paintStyle, params.hoverPaintStyle);
+        if (eT) _ju.addToList(params.endpointsByElement, this.targetId, eT);
+        // if scope not set, set it to be the scope for the source endpoint.
+        if (!this.scope) this.scope = this.endpoints[0].scope;         
+                
+        // if explicitly told to (or not to) delete endpoints on detach, override endpoint's preferences
+        if (params.deleteEndpointsOnDetach != null) {
+            this.endpoints[0]._deleteOnDetach = params.deleteEndpointsOnDetach;
+            this.endpoints[1]._deleteOnDetach = params.deleteEndpointsOnDetach;
+        }
+        else {
+            // otherwise, unless the endpoints say otherwise, mark them for deletion.
+            if (!this.endpoints[0]._doNotDeleteOnDetach) this.endpoints[0]._deleteOnDetach = true;
+            if (!this.endpoints[1]._doNotDeleteOnDetach) this.endpoints[1]._deleteOnDetach = true;
+        }   
+                    
+        // TODO these could surely be refactored into some method that tries them one at a time until something exists
+        this.setConnector(this.endpoints[0].connector || 
+                          this.endpoints[1].connector || 
+                          params.connector || 
+                          _jsPlumb.Defaults.Connector || 
+                          jsPlumb.Defaults.Connector, true);
+
+        if (params.path)
+            this.connector.setPath(params.path);
+        
+        this.setPaintStyle(this.endpoints[0].connectorStyle || 
+                           this.endpoints[1].connectorStyle || 
+                           params.paintStyle || 
+                           _jsPlumb.Defaults.PaintStyle || 
+                           jsPlumb.Defaults.PaintStyle, true);
+                    
+        this.setHoverPaintStyle(this.endpoints[0].connectorHoverStyle || 
+                                this.endpoints[1].connectorHoverStyle || 
+                                params.hoverPaintStyle || 
+                                _jsPlumb.Defaults.HoverPaintStyle || 
+                                jsPlumb.Defaults.HoverPaintStyle, true);
+        
+        this._jsPlumb.paintStyleInUse = this.getPaintStyle();
+        
+        var _suspendedAt = _jsPlumb.getSuspendedAt();
+        _jsPlumb.updateOffset( { elId : this.sourceId, timestamp:_suspendedAt });
+        _jsPlumb.updateOffset( { elId : this.targetId, timestamp:_suspendedAt });
+
+//*
+        if(!_jsPlumb.isSuspendDrawing()) {                    
+            // paint the endpoints
+            var myInfo = _jsPlumb.getCachedData(this.sourceId),
+                myOffset = myInfo.o, myWH = myInfo.s,
+                otherInfo = _jsPlumb.getCachedData(this.targetId),
+                otherOffset = otherInfo.o,
+                otherWH = otherInfo.s,
+                initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),
+                anchorLoc = this.endpoints[0].anchor.compute( {
+                    xy : [ myOffset.left, myOffset.top ], wh : myWH, element : this.endpoints[0],
+                    elementId:this.endpoints[0].elementId,
+                    txy : [ otherOffset.left, otherOffset.top ], twh : otherWH, tElement : this.endpoints[1],
+                    timestamp:initialTimestamp
+                });
+
+            this.endpoints[0].paint( { anchorLoc : anchorLoc, timestamp:initialTimestamp });
+
+            anchorLoc = this.endpoints[1].anchor.compute( {
+                xy : [ otherOffset.left, otherOffset.top ], wh : otherWH, element : this.endpoints[1],
+                elementId:this.endpoints[1].elementId,                         
+                txy : [ myOffset.left, myOffset.top ], twh : myWH, tElement : this.endpoints[0],
+                timestamp:initialTimestamp                             
+            });
+            this.endpoints[1].paint({ anchorLoc : anchorLoc, timestamp:initialTimestamp });
+        }
+        //*/
+                                
+// END INITIALISATION CODE                     
+        
+// DETACHABLE                          
+        this._jsPlumb.detachable = _jsPlumb.Defaults.ConnectionsDetachable;
+        if (params.detachable === false) this._jsPlumb.detachable = false;
+        if(this.endpoints[0].connectionsDetachable === false) this._jsPlumb.detachable = false;
+        if(this.endpoints[1].connectionsDetachable === false) this._jsPlumb.detachable = false;                
+// REATTACH
+        this._jsPlumb.reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;
+// COST + DIRECTIONALITY
+        // if cost not supplied, try to inherit from source endpoint
+        this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();                             
+        this._jsPlumb.directed = params.directed;
+        // inherit directed flag if set no source endpoint
+        if (params.directed == null) this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();        
+// END COST + DIRECTIONALITY
+                    
+// PARAMETERS                                          
+        // merge all the parameters objects into the connection.  parameters set
+        // on the connection take precedence; then source endpoint params, then
+        // finally target endpoint params.
+        // TODO jsPlumb.extend could be made to take more than two args, and it would
+        // apply the second through nth args in order.
+        var _p = jsPlumb.extend({}, this.endpoints[1].getParameters());
+        jsPlumb.extend(_p, this.endpoints[0].getParameters());
+        jsPlumb.extend(_p, this.getParameters());
+        this.setParameters(_p);
+// END PARAMETERS
+
+// PAINTING
+                  
+        // the very last thing we do is apply types, if there are any.
+        var _types = [params.type, this.endpoints[0].connectionType, this.endpoints[1].connectionType ].join(" ");
+        if (/[a-zA-Z]/.test(_types))
+            this.addType(_types, params.data, true);        
+
+        
+// END PAINTING    
+    };
+
+    jsPlumbUtil.extend(jsPlumb.Connection, OverlayCapableJsPlumbUIComponent, {
+        applyType : function(t, doNotRepaint) {            
+            if (t.detachable != null) this.setDetachable(t.detachable);
+            if (t.reattach != null) this.setReattach(t.reattach);
+            if (t.scope) this.scope = t.scope;
+            //editable = t.editable;  // TODO
+            this.setConnector(t.connector, doNotRepaint);
+        },
+        getTypeDescriptor : function() { return "connection"; },
+        getAttachedElements : function() {
+            return this.endpoints;
+        },
+        addClass : function(c, informEndpoints) {        
+            if (informEndpoints) {
+                this.endpoints[0].addClass(c);
+                this.endpoints[1].addClass(c); 
+                if (this.suspendedEndpoint) this.suspendedEndpoint.addClass(c);                   
+            }
+            if (this.connector) {
+                this.connector.addClass(c);
+            }
+        },
+        removeClass : function(c, informEndpoints) {            
+            if (informEndpoints) {
+                this.endpoints[0].removeClass(c);
+                this.endpoints[1].removeClass(c);                    
+                if (this.suspendedEndpoint) this.suspendedEndpoint.removeClass(c);
+            }
+            if (this.connector) {
+                this.connector.removeClass(c);
+            }
+        },
+        isVisible : function() { return this._jsPlumb.visible; },
+        setVisible : function(v) {
+            this._jsPlumb.visible = v;
+            //this[v ? "showOverlays" : "hideOverlays"]();
+            if (this.connector) 
+                this.connector.setVisible(v);
+            this.repaint();
+        },
+
+        /* TODO move to connecto editors; it should put these on the prototype.
+
+        setEditable : function(e) {
+            if (this.connector && this.connector.isEditable())
+                this._jsPlumb.editable = e;
+            
+            return this._jsPlumb.editable;
+        },
+        isEditable : function() { return this._jsPlumb.editable; },
+        editStarted : function() {  
+            this.setSuspendEvents(true);
+            this.fire("editStarted", {
+                path:this.connector.getPath()
+            });            
+            this._jsPlumb.instance.setHoverSuspended(true);
+        },
+        editCompleted : function() {            
+            this.fire("editCompleted", {
+                path:this.connector.getPath()
+            });       
+            this.setSuspendEvents(false);
+            this.setHover(false);     
+            this._jsPlumb.instance.setHoverSuspended(false);
+        },
+        editCanceled : function() {
+            this.fire("editCanceled", {
+                path:this.connector.getPath()
+            });
+            this.setHover(false);
+            this._jsPlumb.instance.setHoverSuspended(false);
+        },
+
+*/
+
+        cleanup:function() {
+            //this.endpointsToDeleteOnDetach = null;
+            this.endpoints = null;
+            this.source = null;
+            this.target = null;                    
+            if (this.connector != null) {
+                this.connector.cleanup();            
+                this.connector.destroy();
+            }
+            this.connector = null;
+        },
+        isDetachable : function() {
+            return this._jsPlumb.detachable === true;
+        },
+        setDetachable : function(detachable) {
+          this._jsPlumb.detachable = detachable === true;
+        },
+        isReattach : function() {
+            return this._jsPlumb.reattach === true;
+        },        
+        setReattach : function(reattach) {
+          this._jsPlumb.reattach = reattach === true;
+        },
+        setHover : function(state) {
+            if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {
+                this.connector.setHover(state);
+                jsPlumb.CurrentLibrary[state ? "addClass" : "removeClass"](this.source, this._jsPlumb.instance.hoverSourceClass);
+                jsPlumb.CurrentLibrary[state ? "addClass" : "removeClass"](this.target, this._jsPlumb.instance.hoverTargetClass);
+            }
+        },
+        getCost : function() { return this._jsPlumb.cost; },
+        setCost : function(c) { this._jsPlumb.cost = c; },
+        isDirected : function() { return this._jsPlumb.directed === true; },
+        //
+        // changes the parent element of this connection to newParent.  not exposed for the public API.
+        //
+        // TODO ensure moveParent method still works (the overlay stuff in particular)
+        moveParent : function(newParent) {
+            var jpcl = jsPlumb.CurrentLibrary, curParent = jpcl.getParent(this.connector.canvas);               
+            if (this.connector.bgCanvas) {
+                jpcl.removeElement(this.connector.bgCanvas);
+                jpcl.appendElement(this.connector.bgCanvas, newParent);
+            }
+            jpcl.removeElement(this.connector.canvas);
+            jpcl.appendElement(this.connector.canvas, newParent);                
+            // this only applies for DOMOverlays
+            for (var i = 0; i < this._jsPlumb.overlays.length; i++) {
+                if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {
+                    jpcl.removeElement(this._jsPlumb.overlays[i].canvas);
+                    jpcl.appendElement(this._jsPlumb.overlays[i].canvas, newParent);
+                    if (this._jsPlumb.overlays[i].reattachListeners) 
+                        this._jsPlumb.overlays[i].reattachListeners(this.connector);
+                }
+            }
+            if (this.connector.reattachListeners)       // this is for SVG/VML; change an element's parent and you have to reinit its listeners.
+                this.connector.reattachListeners();     // the Canvas implementation doesn't have to care about this
+        },
+        getConnector : function() { return this.connector; },
+        setConnector : function(connectorSpec, doNotRepaint) {
+            var _ju = jsPlumbUtil;
+            if (this.connector != null) {
+                this.connector.cleanup();
+                this.connector.destroy();
+            }
+
+            var connectorArgs = { 
+                    _jsPlumb:this._jsPlumb.instance, 
+                    parent:this._jsPlumb.params.parent, 
+                    cssClass:this._jsPlumb.params.cssClass, 
+                    container:this._jsPlumb.params.container,                 
+                    "pointer-events":this._jsPlumb.params["pointer-events"]
+                },
+                renderMode = this._jsPlumb.instance.getRenderMode();
+            
+            if (_ju.isString(connectorSpec)) 
+                this.connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs); // lets you use a string as shorthand.
+            else if (_ju.isArray(connectorSpec)) {
+                if (connectorSpec.length == 1)
+                    this.connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs);
+                else
+                    this.connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs));
+            }
+            // binds mouse listeners to the current connector.
+            this.bindListeners(this.connector, this, function(state) {                
+                this.setHover(state, false);                
+            }.bind(this));
+            
+            this.canvas = this.connector.canvas;
+
+            if (this._jsPlumb.editable && jsPlumb.ConnectorEditors != null && jsPlumb.ConnectorEditors[this.connector.type] && this.connector.isEditable()) {
+                new jsPlumb.ConnectorEditors[this.connector.type]({
+                    connector:this.connector,
+                    connection:this,
+                    params:this._jsPlumb.params.editorParams || { }
+                });
+            }
+            else {                    
+                this._jsPlumb.editable = false;
+            }                
+                
+            if (!doNotRepaint) this.repaint();
+        },
+        paint : function(params) {
+                    
+            if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {
+                    
+                params = params || {};
+                var elId = params.elId, ui = params.ui, recalc = params.recalc, timestamp = params.timestamp,
+                    // if the moving object is not the source we must transpose the two references.
+                    swap = false,
+                    tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,                    
+                    tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;
+
+                if (timestamp == null || timestamp != this._jsPlumb.lastPaintedAt) {                        
+                    var sourceInfo = this._jsPlumb.instance.updateOffset( { elId : sId, offset : ui, recalc : recalc, timestamp : timestamp }).o,
+                        targetInfo = this._jsPlumb.instance.updateOffset( { elId : tId, timestamp : timestamp }).o, // update the target if this is a forced repaint. otherwise, only the source has been moved.
+                        sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];
+
+                    if (params.clearEdits) {
+                        this._jsPlumb.overlayPositions = null;
+                        sE.anchor.clearUserDefinedLocation();
+                        tE.anchor.clearUserDefinedLocation();
+                        this.connector.setEdited(false);
+                    }
+                    
+                    var sAnchorP = sE.anchor.getCurrentLocation({xy:[sourceInfo.left,sourceInfo.top], wh:[sourceInfo.width, sourceInfo.height], element:sE, timestamp:timestamp}),              
+                        tAnchorP = tE.anchor.getCurrentLocation({xy:[targetInfo.left,targetInfo.top], wh:[targetInfo.width, targetInfo.height], element:tE, timestamp:timestamp});                                                 
+                        
+                    this.connector.resetBounds();
+
+                    this.connector.compute({
+                        sourcePos:sAnchorP,
+                        targetPos:tAnchorP, 
+                        sourceEndpoint:this.endpoints[sIdx],
+                        targetEndpoint:this.endpoints[tIdx],
+                        lineWidth:this._jsPlumb.paintStyleInUse.lineWidth,                                          
+                        sourceInfo:sourceInfo,
+                        targetInfo:targetInfo,
+                        clearEdits:params.clearEdits === true
+                    });                                                                                        
+
+                    var overlayExtents = { minX:Infinity, minY:Infinity, maxX:-Infinity, maxY:-Infinity };
+                                        
+                    // compute overlays. we do this first so we can get their placements, and adjust the
+                    // container if needs be (if an overlay would be clipped)
+                    for ( var i = 0; i < this._jsPlumb.overlays.length; i++) {
+                        var o = this._jsPlumb.overlays[i];
+                        if (o.isVisible()) {                            
+                            this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));
+                            overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);
+                            overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);
+                            overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);
+                            overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);
+                        }
+                    }
+
+                    var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.lineWidth || 1) / 2,
+                        outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.lineWidth || 0),
+                        extents = {
+                            xmin : Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),
+                            ymin : Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),
+                            xmax : Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),
+                            ymax : Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)
+                        };
+
+                    // paint the connector.
+                    this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);  
+                    // and then the overlays
+                    for ( var j = 0; j < this._jsPlumb.overlays.length; j++) {
+                        var p = this._jsPlumb.overlays[j];
+                        if (p.isVisible()) {
+                            p.paint(this._jsPlumb.overlayPlacements[j], extents);    
+                        }
+                    }                                                                          
+                }
+                this._jsPlumb.lastPaintedAt = timestamp;                        
+            }       
+        },
+        /*
+         * Function: repaint
+         * Repaints the Connection. No parameters exposed to public API.
+         */
+        repaint : function(params) {
+            params = params || {};            
+            this.paint({ elId : this.sourceId, recalc : !(params.recalc === false), timestamp:params.timestamp, clearEdits:params.clearEdits });
+        }
+        
+    }); // END Connection class            
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/connector-editors.js b/portal/static/unbound_reservation_static/src/connector-editors.js
new file mode 100644 (file)
index 0000000..901ea4c
--- /dev/null
@@ -0,0 +1,369 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the jsPlumb connector editors.  It is not deployed wth the released versions of jsPlumb; you need to
+ * include it as an extra script.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (simon.porritt@gmail.com)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+;(function() {
+    
+    var AbstractEditor = function(params) {
+        var self = this;        
+    };
+
+    var isTouchDevice = "ontouchstart" in document.documentElement,
+        downEvent = isTouchDevice ? "touchstart" : "mousedown",
+        upEvent = isTouchDevice ? "touchend" : "mouseup",
+        moveEvent = isTouchDevice ? "touchmove" : "mousemove";
+    
+    // TODO: this is for a Straight segment.it would be better to have these all available somewjere, keyed
+    // by segment type
+    var findClosestPointOnPath = function(seg, x, y, i, bounds) {
+        var m = seg[0] == seg[2] ? Infinity : 0,
+            m2 = -1 / m,
+            out = { s:seg, m:m, i:i, x:-1, y:-1, d:Infinity };
+        
+        if (m == 0) {
+            // a horizontal line. if x is in the range of this line then distance is delta y. otherwise we consider it to be
+            // infinity.
+            if ( (seg[0] <= x && x <= seg[2]) || (seg[2] <= x && x <= seg[0])) {
+                out.x = x,
+                out.y = seg[1];
+                out.d = Math.abs(y - seg[1]);
+            }
+        }
+        else if (m == Infinity || m == -Infinity) {
+            // a vertical line. if y is in the range of this line then distance is delta x. otherwise we consider it to be
+            // infinity.
+            if ((seg[1] <= y && y <= seg[3]) || (seg[3] <= y && y <= seg[1])){
+                out.x = seg[0];
+                out.y = y;
+                out.d = Math.abs(x - seg[0]);
+            }                        
+        }
+        else {
+            // closest point lies on normal from given point to this line.  
+            var b = seg[1] - (m * seg[0]),
+                b2 = y - (m2 * x),
+            // now we know that
+            // y1 = m.x1 + b   and   y1 = m2.x1 + b2
+            // so:  m.x1 + b = m2.x1 + b2
+            //      x1(m - m2) = b2 - b
+            //      x1 = (b2 - b) / (m - m2)
+                _x1 = (b2 -b) / (m - m2),
+                _y1 = (m * _x1) + b,
+                d = jsPlumbGeom.lineLength([ x, y ], [ _x1, _y1 ]),
+                fractionInSegment = jsPlumbGeom.lineLength([ _x1, _y1 ], [ seg[0], seg[1] ]);
+            
+            out.d = d;
+            out.x = _x1;
+            out.y = _y1;
+            out.l = fractionInSegment / length;
+        }
+        return out;
+    };
+    
+    /**
+    * @namespace jsPlumb.ConnectorEditors
+    * @desc These are editors for the various connector types. They are not included in the
+    * main jsPlumb release. To use them you have to build a custom version of jsPlumb - see
+    * the Gruntfile for information on how to do that. 
+    *
+    * Currently there is only an editor for the Flowchart connector.
+    */
+    jsPlumb.ConnectorEditors = {
+        /**
+        * @name jsPlumb.ConnectorEditors.FlowchartConnectorEditor
+        * @class
+        * @classdesc Lets you drag the segments of a flowchart connection around. If you subsequently
+        * drag an element, your edits are lost.
+        */
+        "Flowchart":function(params) {
+            AbstractEditor.apply(this, arguments);            
+            
+            var jpcl = jsPlumb.CurrentLibrary,
+                clickConsumer = function(conn) {                     
+                    conn._jsPlumb.afterEditClick = function() {
+                        console.log("after edit click");
+                        conn.unbind("click", conn._jsPlumb.afterEditClick);
+                        conn._jsPlumb.afterEditClick = null;
+                        return false;
+                    }; 
+                    conn.bind("click", conn._jsPlumb.afterEditClick, true);                    
+                },
+                documentMouseUp = function(e) {       
+
+                    // an attempt at consuming the click that occurs after this mouseup
+                    // it's not reliable though, as we dont always get a click fired, for some
+                    // reason.
+                    //if (editing)
+                    //    clickConsumer(params.connection);
+
+                    jpcl.removeClass(document.body, params.connection._jsPlumb.instance.dragSelectClass);
+                    params.connection._jsPlumb.instance.setConnectionBeingDragged(false);
+                    e.stopPropagation();
+                    e.preventDefault();
+                    jpcl.unbind(document, upEvent, documentMouseUp);
+                    jpcl.unbind(document, moveEvent, documentMouseMove);                    
+                    downAt = null;
+                    currentSegments = null;
+                    selectedSegment = null; 
+                    segmentCoords = null;
+                    params.connection.setHover(false);                    
+                    params.connector.setSuspendEvents(false); 
+                    params.connection.endpoints[0].setSuspendEvents(false);                
+                    params.connection.endpoints[1].setSuspendEvents(false);
+                    params.connection.editCompleted();
+                    params.connector.justEdited = editing;
+                    editing = false;            
+                },
+                downAt = null,
+                currentSegments = null,
+                selectedSegment = null,
+                segmentCoords = null,
+                editing = false,
+                anchorsMoveable = params.params.anchorsMoveable,
+                sgn = function(p1, p2) {
+                    if (p1[0] == p2[0])
+                        return p1[1] < p2[1]  ? 1 : -1;
+                    else
+                        return p1[0] < p2[0]  ? 1 : -1;
+                },
+                // collapses currentSegments by joining subsequent segments that are in the
+                // same axis. we do this because it doesn't matter about stubs any longer once a user
+                // is editing a connector. so it is best to reduce the number of segments to the 
+                // minimum.
+                _collapseSegments = function() {                       
+                    var _last = null, _lastAxis = null, s = [];
+                    for (var i = 0; i < currentSegments.length; i++) {
+                        var seg = currentSegments[i], axis = seg[4], axisIndex = (axis == "v" ? 3 : 2);
+                        if (_last != null && _lastAxis === axis) {
+                            _last[axisIndex] = seg[axisIndex];                            
+                        }
+                        else {
+                            s.push(seg);
+                            _last = seg;
+                            _lastAxis = seg[4];
+                        }
+                    }
+                    currentSegments = s;                   
+                },
+                // attempt to shift anchor
+                _shiftAnchor = function(endpoint, horizontal, value) {                    
+                    var elementSize = jpcl.getSize(endpoint.element),
+                        sizeValue = elementSize[horizontal ? 1 : 0],
+                        ee = jpcl.getElementObject(endpoint.element),
+                        off = jpcl.getOffset(ee), 
+                        cc = jpcl.getElementObject(params.connector.canvas.parentNode),
+                        co = jpcl.getOffset(cc),
+                        offValue = off[horizontal ? "top" : "left"] - co[horizontal ? "top" : "left"], 
+                        ap = endpoint.anchor.getCurrentLocation({element:endpoint}),
+                        desiredLoc = horizontal ? params.connector.y + value : params.connector.x + value;
+                    
+                    if (anchorsMoveable) {                        
+                        
+                        if (offValue < desiredLoc && desiredLoc < offValue + sizeValue) {
+                            // if still on the element, okay to move.
+                            var udl = [ ap[0], ap[1] ];
+                            ap[horizontal ? 1 : 0] = desiredLoc;
+                            endpoint.anchor.setUserDefinedLocation(ap);
+                            return value;
+                        }
+                        else {                        
+                            // otherwise, clamp to element edge
+                            var edgeVal = desiredLoc < offValue ? offValue : offValue + sizeValue;
+                            return edgeVal - (horizontal ? params.connector.y: params.connector.x);                         
+                        }                    
+                    }
+                    else {
+                        // otherwise, return the current anchor point.
+                        return ap[horizontal ? 1 : 0] - params.connector[horizontal ? "y" : "x"];
+                    }
+                },
+                _updateSegmentOrientation = function(seg) {
+                    if (seg[0] != seg[2]) seg[5] = (seg[0] < seg[2]) ? 1 : -1;
+                    if (seg[1] != seg[3]) seg[6] = (seg[1] < seg[3]) ? 1 : -1;
+                },
+                documentMouseMove = function(e) {
+                    if (selectedSegment != null) {
+                        // suspend events on first move.
+                        if (!editing) {
+                            params.connection.setHover(true);
+                            params.connector.setSuspendEvents(true);
+                            params.connection.endpoints[0].setSuspendEvents(true);                
+                            params.connection.endpoints[1].setSuspendEvents(true);
+                        }
+                        editing = true;
+                        var m = selectedSegment.m, s = selectedSegment.s,
+                            x = (e.pageX || e.page.x), y = (e.pageY || e.page.y),
+                            dx = m == 0 ? 0 : x - downAt[0], dy = m == 0 ? y - downAt[1] : 0,
+                            newX1 = segmentCoords[0] + dx,
+                            newY1 = segmentCoords[1] + dy,
+                            newX2 = segmentCoords[2] + dx,
+                            newY2 = segmentCoords[3] + dy,
+                            horizontal = s[4] == "h";
+                        
+                        // so here we know the new x,y values we would like to set for the start
+                        // and end of this segment. but we may not be able to set these values: if this
+                        // is the first segment, for example, then we are constrained by how far the anchor
+                        // can move (before it slides off its element). same thing goes if this is the last
+                        // segment. if this is not the first or last segment then there are other considerations.
+                        // we know, from having run collapse segments, that there will never be two
+                        // consecutive segments that are not at right angles to each other, so what we need to
+                        // know is whether we can adjust the endpoint of the previous segment to the values we
+                        // want, and the same question for the start values of the next segment.  the answer to
+                        // that is whether or not the segment in question would be rendered too small by such
+                        // a change. if that is the case (and the same goes for anchors) then we want to know
+                        // what an agreeable value is, and we use that.
+                        
+                        if (selectedSegment.i == 0) {
+                                                        
+                            var anchorLoc = _shiftAnchor(params.connection.endpoints[0], horizontal, horizontal ? newY1 : newX1);                            
+                            if (horizontal) 
+                                newY1 = newY2 = anchorLoc; 
+                            else
+                                newX1 = newX2 = anchorLoc;
+                        
+                            currentSegments[1][0] = newX2;
+                            currentSegments[1][1] = newY2;
+                            _updateSegmentOrientation(currentSegments[1]);                                                                                            
+                        }
+                        else if (selectedSegment.i == currentSegments.length - 1) {
+                            var anchorLoc = _shiftAnchor(params.connection.endpoints[1], horizontal, horizontal ? newY1 : newX1);                          
+                            if (horizontal) 
+                                newY1 = newY2 = anchorLoc; 
+                            else
+                                newX1 = newX2 = anchorLoc;
+                            
+                            currentSegments[currentSegments.length - 2][2] = newX1;
+                            currentSegments[currentSegments.length - 2][3] = newY1;
+                            _updateSegmentOrientation(currentSegments[currentSegments.length - 2]);
+                        }
+                        else {
+                            if (!horizontal) {
+                                currentSegments[selectedSegment.i - 1][2] = newX1;
+                                currentSegments[selectedSegment.i + 1][0] = newX2;                                                                
+                            }
+                            else {
+                                currentSegments[selectedSegment.i - 1][3] = newY1;                            
+                                currentSegments[selectedSegment.i + 1][1] = newY2;
+                            }
+                            _updateSegmentOrientation(currentSegments[selectedSegment.i + 1]);
+                            _updateSegmentOrientation(currentSegments[selectedSegment.i - 1]);                            
+                        }
+                                                                                                
+                        s[0] = newX1;
+                        s[1] = newY1;
+                        s[2] = newX2;
+                        s[3] = newY2;                                              
+                        
+                        params.connector.setSegments(currentSegments);
+                        params.connection.repaint();                        
+                        params.connection.endpoints[0].repaint();
+                        params.connection.endpoints[1].repaint();
+                        params.connector.setEdited(true);                        
+                    }
+                    else
+                        editing = false;
+                };
+                        
+            //bind to mousedown and mouseup, for editing
+            params.connector.bind(downEvent, function(c, e) {
+                var x = (e.pageX || e.page.x),
+                    y = (e.pageY || e.page.y),
+                    oe = jpcl.getElementObject(params.connection.getConnector().canvas),
+                    o = jpcl.getOffset(oe),                    
+                    minD = Infinity;
+
+                // TODO this is really the way we want to go: get the segment from the connector.
+                // for now it's just here to remind me what to change.
+                var __seg = params.connector.findSegmentForPoint(x-o.left, y-o.top);
+                console.log(__seg);
+                
+                currentSegments = params.connector.getOriginalSegments();
+                _collapseSegments();
+                for (var i = 0; i < currentSegments.length; i++) {                    
+                    var _s = findClosestPointOnPath(currentSegments[i], (x - o.left) , (y - o.top), i, params.connector.bounds);
+                    
+                    //var _s = currentSegments[i].findClosestPointOnPath(x - o.left, y - o.top);
+                    
+                    if (_s.d < minD) {
+                        selectedSegment = _s;
+                        segmentCoords = [ _s.s[0], _s.s[1], _s.s[2], _s.s[3] ]; // copy the coords at mousedown
+                        minD = _s.d;
+                    }
+                }
+                
+                downAt = [ x, y ];
+                
+                if (selectedSegment != null) {                    
+                    jpcl.bind(document, upEvent, documentMouseUp);
+                    jpcl.bind(document, moveEvent, documentMouseMove);                                      
+                    jpcl.addClass(document.body, params.connection._jsPlumb.instance.dragSelectClass);
+                    params.connection._jsPlumb.instance.setConnectionBeingDragged(true);
+                    params.connection.editStarted();                
+                    return false;
+                }
+            }, true);
+        }
+    };
+
+    jsPlumb.Connectors.AbstractConnector.prototype.shouldFireEvent = function(type, value, originalEvent) {
+        var out = !this.justEdited;
+        if (type == "click") {            
+            this.justEdited = false;
+        }
+        return out;
+    };
+
+// ------------------ augment the Connection prototype with the editing stuff --------------------------
+
+    var EDIT_STARTED = "editStarted", EDIT_COMPLETED = "editCompleted", EDIT_CANCELED = "editCanceled";
+
+    jsPlumb.Connection.prototype.setEditable = function(e) {
+        if (this.connector && this.connector.isEditable())
+            this._jsPlumb.editable = e;
+        
+        return this._jsPlumb.editable;
+    };
+
+    jsPlumb.Connection.prototype.isEditable = function() { return this._jsPlumb.editable; };
+
+    jsPlumb.Connection.prototype.editStarted = function() {  
+        this.setSuspendEvents(true);
+        this.fire(EDIT_STARTED, {
+            path:this.connector.getPath()
+        });            
+        this._jsPlumb.instance.setHoverSuspended(true);
+    };
+
+    jsPlumb.Connection.prototype.editCompleted = function() {            
+        this.fire(EDIT_COMPLETED, {
+            path:this.connector.getPath()
+        });       
+        this.setSuspendEvents(false);        
+        this._jsPlumb.instance.setHoverSuspended(false);
+        this.setHover(false);
+    };
+
+    jsPlumb.Connection.prototype.editCanceled = function() {
+        this.fire(EDIT_CANCELED, {
+            path:this.connector.getPath()
+        });        
+        this._jsPlumb.instance.setHoverSuspended(false);
+        this.setHover(false);
+    };
+        
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/connectors-bezier.js b/portal/static/unbound_reservation_static/src/connectors-bezier.js
new file mode 100644 (file)
index 0000000..5c5f307
--- /dev/null
@@ -0,0 +1,67 @@
+
+;(function() {
+
+       var Bezier = function(params) {
+        params = params || {};
+
+       var self = this,
+                       _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments),
+            stub = params.stub || 50,
+            majorAnchor = params.curviness || 150,
+            minorAnchor = 10;            
+
+        this.type = "Bezier";  
+        this.getCurviness = function() { return majorAnchor; };        
+        
+        this._findControlPoint = function(point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint) {
+               // determine if the two anchors are perpendicular to each other in their orientation.  we swap the control 
+               // points around if so (code could be tightened up)
+               var soo = sourceEndpoint.anchor.getOrientation(sourceEndpoint), 
+                       too = targetEndpoint.anchor.getOrientation(targetEndpoint),
+                       perpendicular = soo[0] != too[0] || soo[1] == too[1],
+               p = [];                
+               
+            if (!perpendicular) {
+                if (soo[0] === 0) // X
+                    p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);
+                else p.push(point[0] - (majorAnchor * soo[0]));
+                                 
+                if (soo[1] === 0) // Y
+                       p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);
+                else p.push(point[1] + (majorAnchor * too[1]));
+            }
+             else {
+                if (too[0] === 0) // X
+                       p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);
+                else p.push(point[0] + (majorAnchor * too[0]));
+                
+                if (too[1] === 0) // Y
+                       p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);
+                else p.push(point[1] + (majorAnchor * soo[1]));
+             }
+
+            return p;                
+        };        
+
+        this._compute = function(paintInfo, p) {                                
+                       var sp = p.sourcePos,
+                               tp = p.targetPos,                               
+                _w = Math.abs(sp[0] - tp[0]),
+                _h = Math.abs(sp[1] - tp[1]),            
+                _sx = sp[0] < tp[0] ? _w : 0,
+                _sy = sp[1] < tp[1] ? _h : 0,
+                _tx = sp[0] < tp[0] ? 0 : _w,
+                _ty = sp[1] < tp[1] ? 0 : _h,
+                _CP = self._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint),
+                _CP2 = self._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint);
+
+                       _super.addSegment(this, "Bezier", {
+                               x1:_sx, y1:_sy, x2:_tx, y2:_ty,
+                               cp1x:_CP[0], cp1y:_CP[1], cp2x:_CP2[0], cp2y:_CP2[1]
+                       });                    
+        }; 
+       };
+
+       jsPlumb.registerConnectorType(Bezier, "Bezier");
+
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/connectors-flowchart.js b/portal/static/unbound_reservation_static/src/connectors-flowchart.js
new file mode 100644 (file)
index 0000000..3b03cce
--- /dev/null
@@ -0,0 +1,362 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (simon.porritt@gmail.com)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+;(function() {
+   
+    /**
+     * Function: Constructor
+     * 
+     * Parameters:
+     *         stub - minimum length for the stub at each end of the connector. This can be an integer, giving a value for both ends of the connections, 
+     * or an array of two integers, giving separate values for each end. The default is an integer with value 30 (pixels). 
+     *  gap  - gap to leave between the end of the connector and the element on which the endpoint resides. if you make this larger than stub then you will see some odd looking behaviour.  
+                Like stub, this can be an array or a single value. defaults to 0 pixels for each end.     
+     * cornerRadius - optional, defines the radius of corners between segments. defaults to 0 (hard edged corners).
+     * alwaysRespectStubs - defaults to false. whether or not the connectors should always draw the stub, or, if the two elements
+                            are in close proximity to each other (closer than the sum of the two stubs), to adjust the stubs.
+     */
+    var Flowchart = function(params) {
+        this.type = "Flowchart";
+        params = params || {};
+        params.stub = params.stub == null ? 30 : params.stub;
+        var self = this,
+            _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments),             
+            midpoint = params.midpoint == null ? 0.5 : params.midpoint,
+            points = [], segments = [],
+            grid = params.grid,
+            alwaysRespectStubs = params.alwaysRespectStubs,
+            userSuppliedSegments = null,
+            lastx = null, lasty = null, lastOrientation,       
+            cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,      
+            sgn = function(n) { return n < 0 ? -1 : n === 0 ? 0 : 1; },            
+            /**
+             * helper method to add a segment.
+             */
+            addSegment = function(segments, x, y, paintInfo) {
+                if (lastx == x && lasty == y) return;
+                var lx = lastx == null ? paintInfo.sx : lastx,
+                    ly = lasty == null ? paintInfo.sy : lasty,
+                    o = lx == x ? "v" : "h",
+                    sgnx = sgn(x - lx),
+                    sgny = sgn(y - ly);
+                    
+                lastx = x;
+                lasty = y;                                                             
+                segments.push([lx, ly, x, y, o, sgnx, sgny]);
+            },
+            segLength = function(s) {
+                return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));    
+            },
+            _cloneArray = function(a) { var _a = []; _a.push.apply(_a, a); return _a;},
+            updateMinMax = function(a1) {
+                self.bounds.minX = Math.min(self.bounds.minX, a1[2]);
+                self.bounds.maxX = Math.max(self.bounds.maxX, a1[2]);
+                self.bounds.minY = Math.min(self.bounds.minY, a1[3]);
+                self.bounds.maxY = Math.max(self.bounds.maxY, a1[3]);    
+            },
+            writeSegments = function(conn, segments, paintInfo) {
+                var current, next;                
+                for (var i = 0; i < segments.length - 1; i++) {
+                    
+                    current = current || _cloneArray(segments[i]);
+                    next = _cloneArray(segments[i + 1]);
+                    if (cornerRadius > 0 && current[4] != next[4]) {
+                        var radiusToUse = Math.min(cornerRadius, segLength(current), segLength(next));
+                        // right angle. adjust current segment's end point, and next segment's start point.
+                        current[2] -= current[5] * radiusToUse;
+                        current[3] -= current[6] * radiusToUse;
+                        next[0] += next[5] * radiusToUse;
+                        next[1] += next[6] * radiusToUse;                                                                                                                                                              
+                        var ac = (current[6] == next[5] && next[5] == 1) ||
+                                 ((current[6] == next[5] && next[5] === 0) && current[5] != next[6]) ||
+                                 (current[6] == next[5] && next[5] == -1),
+                            sgny = next[1] > current[3] ? 1 : -1,
+                            sgnx = next[0] > current[2] ? 1 : -1,
+                            sgnEqual = sgny == sgnx,
+                            cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],
+                            cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];                                                        
+                        
+                        _super.addSegment(conn, "Straight", {
+                            x1:current[0], y1:current[1], x2:current[2], y2:current[3]
+                        });
+                            
+                        _super.addSegment(conn, "Arc", {
+                            r:radiusToUse, 
+                            x1:current[2], 
+                            y1:current[3], 
+                            x2:next[0], 
+                            y2:next[1],
+                            cx:cx,
+                            cy:cy,
+                            ac:ac
+                        });                                                
+                    }
+                    else {                 
+                        // dx + dy are used to adjust for line width.
+                        var dx = (current[2] == current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),
+                            dy = (current[3] == current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);
+                        _super.addSegment(conn, "Straight", {
+                            x1:current[0]- dx, y1:current[1]-dy, x2:current[2] + dx, y2:current[3] + dy
+                        });
+                    }                    
+                    current = next;
+                }
+                // last segment
+                _super.addSegment(conn, "Straight", {
+                    x1:next[0], y1:next[1], x2:next[2], y2:next[3]
+                });                             
+            };
+        
+        this.setSegments = function(s) {
+            userSuppliedSegments = s;
+        };
+        
+        this.isEditable = function() { return true; };
+        
+        /*
+            Function: getOriginalSegments
+            Gets the segments before the addition of rounded corners. This is used by the flowchart
+            connector editor, since it only wants to concern itself with the original segments.
+        */
+        this.getOriginalSegments = function() {
+            return userSuppliedSegments || segments;
+        };
+        
+        this._compute = function(paintInfo, params) {
+            
+            if (params.clearEdits)
+                userSuppliedSegments = null;
+            
+            if (userSuppliedSegments != null) {
+                writeSegments(this, userSuppliedSegments, paintInfo);                
+                return;
+            }
+            
+            segments = [];
+            lastx = null; lasty = null;
+            lastOrientation = null;          
+            
+            var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),
+                midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);                                                                                                    
+    
+            var findClearedLine = function(start, mult, anchorPos, dimension) {
+                    return start + (mult * (( 1 - anchorPos) * dimension) + _super.maxStub);
+                },
+                orientations = { x:[ 0, 1 ], y:[ 1, 0 ] },
+                commonStubCalculator = function(axis) {
+                    return [ paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY ];                    
+                },
+                stubCalculators = {
+                    perpendicular:commonStubCalculator,
+                    orthogonal:commonStubCalculator,
+                    opposite:function(axis) {  
+                        var pi = paintInfo,
+                            idx = axis == "x" ? 0 : 1, 
+                            areInProximity = {
+                                "x":function() {                                    
+                                    return ( (pi.so[idx] == 1 && ( 
+                                        ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||
+                                        ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||
+
+                                        ( (pi.so[idx] == -1 && ( 
+                                            ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||
+                                            ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));
+                                },
+                                "y":function() {                                     
+                                    return ( (pi.so[idx] == 1 && ( 
+                                        ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||
+                                        ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||
+
+                                        ( (pi.so[idx] == -1 && ( 
+                                        ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||
+                                        ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));
+                                }
+                            };
+
+                        if (!alwaysRespectStubs && areInProximity[axis]()) {                   
+                            return {
+                                "x":[(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],
+                                "y":[paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]
+                            }[axis];
+                        }
+                        else {
+                            return [ paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY ];   
+                        }
+                    }
+                },
+                lineCalculators = {
+                    perpendicular : function(axis, ss, oss, es, oes) {
+                        var pi = paintInfo, 
+                            sis = {
+                                x:[ [ [ 1,2,3,4 ], null, [ 2,1,4,3 ] ], null, [ [ 4,3,2,1 ], null, [ 3,4,1,2 ] ] ],
+                                y:[ [ [ 3,2,1,4 ], null, [ 2,3,4,1 ] ], null, [ [ 4,1,2,3 ], null, [ 1,4,3,2 ] ] ]
+                            },
+                            stubs = { 
+                                x:[ [ pi.startStubX, pi.endStubX ] , null, [ pi.endStubX, pi.startStubX ] ],
+                                y:[ [ pi.startStubY, pi.endStubY ] , null, [ pi.endStubY, pi.startStubY ] ]
+                            },
+                            midLines = {
+                                x:[ [ midx, pi.startStubY ], [ midx, pi.endStubY ] ],
+                                y:[ [ pi.startStubX, midy ], [ pi.endStubX, midy ] ]
+                            },
+                            linesToEnd = {
+                                x:[ [ pi.endStubX, pi.startStubY ] ],
+                                y:[ [ pi.startStubX, pi.endStubY ] ]
+                            },
+                            startToEnd = {
+                                x:[ [ pi.startStubX, pi.endStubY ], [ pi.endStubX, pi.endStubY ] ],        
+                                y:[ [ pi.endStubX, pi.startStubY ], [ pi.endStubX, pi.endStubY ] ]
+                            },
+                            startToMidToEnd = {
+                                x:[ [ pi.startStubX, midy ], [ pi.endStubX, midy ], [ pi.endStubX, pi.endStubY ] ],
+                                y:[ [ midx, pi.startStubY ], [ midx, pi.endStubY ], [ pi.endStubX, pi.endStubY ] ]
+                            },
+                            otherStubs = {
+                                x:[ pi.startStubY, pi.endStubY ],
+                                y:[ pi.startStubX, pi.endStubX ]                                    
+                            },
+                            soIdx = orientations[axis][0], toIdx = orientations[axis][1],
+                            _so = pi.so[soIdx] + 1,
+                            _to = pi.to[toIdx] + 1,
+                            otherFlipped = (pi.to[toIdx] == -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] == 1 && (otherStubs[axis][1] > otherStubs[axis][0])),
+                            stub1 = stubs[axis][_so][0],
+                            stub2 = stubs[axis][_so][1],
+                            segmentIndexes = sis[axis][_so][_to];
+
+                        if (pi.segment == segmentIndexes[3] || (pi.segment == segmentIndexes[2] && otherFlipped)) {
+                            return midLines[axis];       
+                        }
+                        else if (pi.segment == segmentIndexes[2] && stub2 < stub1) {
+                            return linesToEnd[axis];
+                        }
+                        else if ((pi.segment == segmentIndexes[2] && stub2 >= stub1) || (pi.segment == segmentIndexes[1] && !otherFlipped)) {
+                            return startToMidToEnd[axis];
+                        }
+                        else if (pi.segment == segmentIndexes[0] || (pi.segment == segmentIndexes[1] && otherFlipped)) {
+                            return startToEnd[axis];  
+                        }                                
+                    },
+                    orthogonal : function(axis, startStub, otherStartStub, endStub, otherEndStub) {                    
+                        var pi = paintInfo,                                            
+                            extent = {
+                                "x":pi.so[0] == -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),
+                                "y":pi.so[1] == -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)
+                            }[axis];
+                                                
+                        return {
+                            "x":[ [ extent, otherStartStub ],[ extent, otherEndStub ], [ endStub, otherEndStub ] ],
+                            "y":[ [ otherStartStub, extent ], [ otherEndStub, extent ], [ otherEndStub, endStub ] ]
+                        }[axis];                    
+                    },
+                    opposite : function(axis, ss, oss, es, oes) {                                                
+                        var pi = paintInfo,
+                            otherAxis = {"x":"y","y":"x"}[axis], 
+                            dim = {"x":"height","y":"width"}[axis],
+                            comparator = pi["is" + axis.toUpperCase() + "GreaterThanStubTimes2"];
+
+                        if (params.sourceEndpoint.elementId == params.targetEndpoint.elementId) {
+                            var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;
+                            return {
+                                "x":[ [ ss, _val ], [ es, _val ] ],
+                                "y":[ [ _val, ss ], [ _val, es ] ]
+                            }[axis];
+                            
+                        }                                                        
+                        else if (!comparator || (pi.so[idx] == 1 && ss > es) || (pi.so[idx] == -1 && ss < es)) {                                            
+                            return {
+                                "x":[[ ss, midy ], [ es, midy ]],
+                                "y":[[ midx, ss ], [ midx, es ]]
+                            }[axis];
+                        }
+                        else if ((pi.so[idx] == 1 && ss < es) || (pi.so[idx] == -1 && ss > es)) {
+                            return {
+                                "x":[[ midx, pi.sy ], [ midx, pi.ty ]],
+                                "y":[[ pi.sx, midy ], [ pi.tx, midy ]]
+                            }[axis];
+                        }                        
+                    }
+                };
+
+            var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),
+                idx = paintInfo.sourceAxis == "x" ? 0 : 1,
+                oidx = paintInfo.sourceAxis == "x" ? 1 : 0,                            
+                ss = stubs[idx],
+                oss = stubs[oidx],
+                es = stubs[idx + 2],
+                oes = stubs[oidx + 2];
+
+            // add the start stub segment.
+            addSegment(segments, stubs[0], stubs[1], paintInfo);           
+
+            // compute the rest of the line
+            var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);            
+            if (p) {
+                for (var i = 0; i < p.length; i++) {                   
+                    addSegment(segments, p[i][0], p[i][1], paintInfo);
+                }
+            }          
+            
+            // line to end stub
+            addSegment(segments, stubs[2], stubs[3], paintInfo);
+    
+            // end stub to end
+            addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);               
+            
+            writeSegments(this, segments, paintInfo);                            
+        };     
+
+        this.getPath = function() {
+            var _last = null, _lastAxis = null, s = [], segs = userSuppliedSegments || segments;
+            for (var i = 0; i < segs.length; i++) {
+                var seg = segs[i], axis = seg[4], axisIndex = (axis == "v" ? 3 : 2);
+                if (_last != null && _lastAxis === axis) {
+                    _last[axisIndex] = seg[axisIndex];                            
+                }
+                else {
+                    if (seg[0] != seg[2] || seg[1] != seg[3]) {
+                        s.push({
+                            start:[ seg[0], seg[1] ],
+                            end:[ seg[2], seg[3] ]
+                        });                    
+                        _last = seg;
+                        _lastAxis = seg[4];
+                    }
+                }
+            }
+            return s;
+        };     
+
+        this.setPath = function(path) {
+            userSuppliedSegments = [];
+            for (var i = 0; i < path.length; i++) {
+                 var lx = path[i].start[0],
+                    ly = path[i].start[1],
+                    x = path[i].end[0],
+                    y = path[i].end[1],
+                    o = lx == x ? "v" : "h",
+                    sgnx = sgn(x - lx),
+                    sgny = sgn(y - ly);
+
+                userSuppliedSegments.push([lx, ly, x, y, o, sgnx, sgny]);
+            }
+        };
+    };
+
+    jsPlumbUtil.extend(Flowchart, jsPlumb.Connectors.AbstractConnector);
+    jsPlumb.registerConnectorType(Flowchart, "Flowchart");
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/connectors-statemachine.js b/portal/static/unbound_reservation_static/src/connectors-statemachine.js
new file mode 100644 (file)
index 0000000..eac0f89
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * jsPlumb
+ *
+ * Title:jsPlumb 1.5.5
+ *
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.
+ *
+ * This file contains the state machine connectors.
+ *
+ * Thanks to Brainstorm Mobile Solutions for supporting the development of these.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (simon.porritt@gmail.com)
+ *
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ *
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+;(function() {
+
+       var Line = function(x1, y1, x2, y2) {
+
+               this.m = (y2 - y1) / (x2 - x1);
+               this.b = -1 * ((this.m * x1) - y1);
+       
+               this.rectIntersect = function(x,y,w,h) {
+                       var results = [], xInt, yInt;
+               
+                       //      try top face
+                       //      the equation of the top face is y = (0 * x) + b; y = b.
+                       xInt = (y - this.b) / this.m;
+                       // test that the X value is in the line's range.
+                       if (xInt >= x && xInt <= (x + w)) results.push([ xInt, (this.m * xInt) + this.b ]);
+               
+                       // try right face
+                       yInt = (this.m * (x + w)) + this.b;
+                       if (yInt >= y && yInt <= (y + h)) results.push([ (yInt - this.b) / this.m, yInt ]);
+               
+                       //      bottom face
+                       xInt = ((y + h) - this.b) / this.m;
+                       // test that the X value is in the line's range.
+                       if (xInt >= x && xInt <= (x + w)) results.push([ xInt, (this.m * xInt) + this.b ]);
+               
+                       // try left face
+                       yInt = (this.m * x) + this.b;
+                       if (yInt >= y && yInt <= (y + h)) results.push([ (yInt - this.b) / this.m, yInt ]);
+
+                       if (results.length == 2) {
+                               var midx = (results[0][0] + results[1][0]) / 2, midy = (results[0][1] + results[1][1]) / 2;
+                               results.push([ midx,midy ]);
+                               // now calculate the segment inside the rectangle where the midpoint lies.
+                               var xseg = midx <= x + (w / 2) ? -1 : 1,
+                                       yseg = midy <= y + (h / 2) ? -1 : 1;
+                               results.push([xseg, yseg]);
+                               return results;
+                       }
+               
+                       return null;
+
+               };
+       },
+       _segment = function(x1, y1, x2, y2) {
+               if (x1 <= x2 && y2 <= y1) return 1;
+               else if (x1 <= x2 && y1 <= y2) return 2;
+               else if (x2 <= x1 && y2 >= y1) return 3;
+               return 4;
+       },
+               
+               // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the
+               // two faces are parallel or perpendicular.  if they are parallel then the control point lies on the midpoint of the axis in which they
+               // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the
+               // center of that face.  if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and
+               // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element
+               // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.
+               //
+               // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located.  their contents are:
+               //
+               // 0 - absolute x
+               // 1 - absolute y
+               // 2 - proportional x in element (0 is left edge, 1 is right edge)
+               // 3 - proportional y in element (0 is top edge, 1 is bottom edge)
+               //      
+       _findControlPoint = function(midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {
+        // TODO (maybe)
+        // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.
+        if (distance <= proximityLimit) return [midx, midy];
+
+        if (segment === 1) {
+            if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];
+            else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];
+            else return [ midx + (-1 * dx) , midy + (-1 * dy) ];
+        }
+        else if (segment === 2) {
+            if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];
+            else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];
+            else return [ midx + (1 * dx) , midy + (-1 * dy) ];
+        }
+        else if (segment === 3) {
+            if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];
+            else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];
+            else return [ midx + (-1 * dx) , midy + (-1 * dy) ];
+        }
+        else if (segment === 4) {
+            if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];
+            else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];
+            else return [ midx + (1 * dx) , midy + (-1 * dy) ];
+        }
+
+       };      
+       
+       /**
+     * Class: Connectors.StateMachine
+     * Provides 'state machine' connectors.
+     */
+       /*
+        * Function: Constructor
+        * 
+        * Parameters:
+        * curviness -  measure of how "curvy" the connectors will be.  this is translated as the distance that the
+     *                Bezier curve's control point is from the midpoint of the straight line connecting the two
+     *              endpoints, and does not mean that the connector is this wide.  The Bezier curve never reaches
+     *              its control points; they act as gravitational masses. defaults to 10.
+        * margin       -       distance from element to start and end connectors, in pixels.  defaults to 5.
+        * proximityLimit  -   sets the distance beneath which the elements are consider too close together to bother
+        *                                              with fancy curves. by default this is 80 pixels.
+        * loopbackRadius       -       the radius of a loopback connector.  optional; defaults to 25.
+        * showLoopback   -   If set to false this tells the connector that it is ok to paint connections whose source and target is the same element with a connector running through the element. The default value for this is true; the connector always makes a loopback connection loop around the element rather than passing through it.
+       */
+       var StateMachine = function(params) {
+               params = params || {};
+               this.type = "StateMachine";
+
+               var self = this,
+                       _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments),
+                       curviness = params.curviness || 10,
+                       margin = params.margin || 5,
+                       proximityLimit = params.proximityLimit || 80,
+                       clockwise = params.orientation && params.orientation === "clockwise",
+                       loopbackRadius = params.loopbackRadius || 25,
+                       showLoopback = params.showLoopback !== false;
+               
+               this._compute = function(paintInfo, params) {
+                       var w = Math.abs(params.sourcePos[0] - params.targetPos[0]),
+                               h = Math.abs(params.sourcePos[1] - params.targetPos[1]),
+                               x = Math.min(params.sourcePos[0], params.targetPos[0]),
+                               y = Math.min(params.sourcePos[1], params.targetPos[1]);                         
+               
+                       if (!showLoopback || (params.sourceEndpoint.elementId !== params.targetEndpoint.elementId)) {                            
+                               var _sx = params.sourcePos[0] < params.targetPos[0] ? 0  : w,
+                                       _sy = params.sourcePos[1] < params.targetPos[1] ? 0:h,
+                                       _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,
+                                       _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;
+            
+                               // now adjust for the margin
+                               if (params.sourcePos[2] === 0) _sx -= margin;
+               if (params.sourcePos[2] === 1) _sx += margin;
+               if (params.sourcePos[3] === 0) _sy -= margin;
+               if (params.sourcePos[3] === 1) _sy += margin;
+               if (params.targetPos[2] === 0) _tx -= margin;
+               if (params.targetPos[2] === 1) _tx += margin;
+               if (params.targetPos[3] === 0) _ty -= margin;
+               if (params.targetPos[3] === 1) _ty += margin;
+
+               //
+                   // these connectors are quadratic bezier curves, having a single control point. if both anchors 
+               // are located at 0.5 on their respective faces, the control point is set to the midpoint and you
+                   // get a straight line.  this is also the case if the two anchors are within 'proximityLimit', since
+                       // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned 
+                       // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.
+                   // 
+                       // there may be two improvements to this.  firstly, we might actually support the notion of avoiding nodes
+               // in the UI, or at least making a good effort at doing so.  if a connection would pass underneath some node,
+               // for example, we might increase the distance the control point is away from the midpoint in a bid to
+               // steer it around that node.  this will work within limits, but i think those limits would also be the likely
+               // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.
+               //
+               // the second possible change is actually two possible changes: firstly, it is possible we should gradually
+               // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some
+               // point (which should be configurable).  secondly, we might slightly increase the 'curviness' for connectors
+               // with respect to how far their anchor is from the center of its respective face. this could either look cool,
+               // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.
+               //
+
+                               var _midx = (_sx + _tx) / 2, _midy = (_sy + _ty) / 2, 
+                   m2 = (-1 * _midx) / _midy, theta2 = Math.atan(m2),
+                   dy =  (m2 == Infinity || m2 == -Infinity) ? 0 : Math.abs(curviness / 2 * Math.sin(theta2)),
+                                   dx =  (m2 == Infinity || m2 == -Infinity) ? 0 : Math.abs(curviness / 2 * Math.cos(theta2)),
+                                   segment = _segment(_sx, _sy, _tx, _ty),
+                                   distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),                      
+                       // calculate the control point.  this code will be where we'll put in a rudimentary element avoidance scheme; it
+                       // will work by extending the control point to force the curve to be, um, curvier.
+                                       _controlPoint = _findControlPoint(_midx,
+                                                  _midy,
+                                                  segment,
+                                                  params.sourcePos,
+                                                  params.targetPos,
+                                                  curviness, curviness,
+                                                  distance,
+                                                  proximityLimit);
+
+                               _super.addSegment(this, "Bezier", {
+                                       x1:_tx, y1:_ty, x2:_sx, y2:_sy,
+                                       cp1x:_controlPoint[0], cp1y:_controlPoint[1],
+                                       cp2x:_controlPoint[0], cp2y:_controlPoint[1]
+                               });                             
+            }
+            else {
+               // a loopback connector.  draw an arc from one anchor to the other.             
+                       var x1 = params.sourcePos[0], x2 = params.sourcePos[0], y1 = params.sourcePos[1] - margin, y2 = params.sourcePos[1] - margin,                           
+                                       cx = x1, cy = y1 - loopbackRadius,                              
+                                       // canvas sizing stuff, to ensure the whole painted area is visible.
+                                       _w = 2 * loopbackRadius, 
+                                       _h = 2 * loopbackRadius,
+                                       _x = cx - loopbackRadius, 
+                                       _y = cy - loopbackRadius;
+
+                               paintInfo.points[0] = _x;
+                               paintInfo.points[1] = _y;
+                               paintInfo.points[2] = _w;
+                               paintInfo.points[3] = _h;
+                               
+                               // ADD AN ARC SEGMENT.
+                               _super.addSegment(this, "Arc", {
+                                       loopback:true,
+                                       x1:(x1 - _x) + 4,
+                                       y1:y1 - _y,
+                                       startAngle:0,
+                                       endAngle: 2 * Math.PI,
+                                       r:loopbackRadius,
+                                       ac:!clockwise,
+                                       x2:(x1 - _x) - 4,
+                                       y2:y1 - _y,
+                                       cx:cx - _x,
+                                       cy:cy - _y
+                               });
+            }                           
+        };                        
+       };
+       jsPlumb.registerConnectorType(StateMachine, "StateMachine");
+})();
+
+/*
+       // a possible rudimentary avoidance scheme, old now, perhaps not useful.
+        //      if (avoidSelector) {
+               //                  var testLine = new Line(sourcePos[0] + _sx,sourcePos[1] + _sy,sourcePos[0] + _tx,sourcePos[1] + _ty);
+               //                  var sel = jsPlumb.getSelector(avoidSelector);
+               //                  for (var i = 0; i < sel.length; i++) {
+               //                          var id = jsPlumb.getId(sel[i]);
+               //                          if (id != sourceEndpoint.elementId && id != targetEndpoint.elementId) {
+               //                                  o = jsPlumb.getOffset(id), s = jsPlumb.getSize(id);
+//
+//                                                 if (o && s) {
+//                                                         var collision = testLine.rectIntersect(o.left,o.top,s[0],s[1]);
+//                                                         if (collision) {
+                                                                   // set the control point to be a certain distance from the midpoint of the two points that
+                                                                   // the line crosses on the rectangle.
+                                                                   // TODO where will this 75 number come from?
+                                       //                          _controlX = collision[2][0] + (75 * collision[3][0]);
+                               //      /                           _controlY = collision[2][1] + (75 * collision[3][1]);
+//                                                         }
+//                                                 }
+                                       //  }
+       //                          }
+              //}
+    */
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/defaults.js b/portal/static/unbound_reservation_static/src/defaults.js
new file mode 100644 (file)
index 0000000..d65de53
--- /dev/null
@@ -0,0 +1,1509 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the default Connectors, Endpoint and Overlay definitions.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+;(function() { 
+                               
+       /**
+        * 
+        * Helper class to consume unused mouse events by components that are DOM elements and
+        * are used by all of the different rendering modes.
+        * 
+        */
+       jsPlumb.DOMElementComponent = jsPlumbUtil.extend(jsPlumb.jsPlumbUIComponent, function(params) {         
+               // when render mode is canvas, these functions may be called by the canvas mouse handler.  
+               // this component is safe to pipe this stuff to /dev/null.
+               this.mousemove = 
+               this.dblclick  = 
+               this.click = 
+               this.mousedown = 
+               this.mouseup = function(e) { };                                 
+       });
+       
+       jsPlumb.Segments = {
+               
+        /*
+         * Class: AbstractSegment
+         * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',
+         * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such
+         * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are
+         * much easier to do now.
+         *
+         * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.
+         * 
+         */ 
+        AbstractSegment : function(params) { 
+            this.params = params;
+            
+            /**
+            * Function: findClosestPointOnPath
+            * Finds the closest point on this segment to the given [x, y], 
+            * returning both the x and y of the point plus its distance from
+            * the supplied point, and its location along the length of the
+            * path inscribed by the segment.  This implementation returns
+            * Infinity for distance and null values for everything else;
+            * subclasses are expected to override.
+            */
+            this.findClosestPointOnPath = function(x, y) {
+                return {
+                    d:Infinity,
+                    x:null,
+                    y:null,
+                    l:null
+                };
+            };
+
+            this.getBounds = function() {
+                return {
+                    minX:Math.min(params.x1, params.x2),
+                    minY:Math.min(params.y1, params.y2),
+                    maxX:Math.max(params.x1, params.x2),
+                    maxY:Math.max(params.y1, params.y2)
+                };
+            };
+        },
+        Straight : function(params) {
+            var _super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
+                length, m, m2, x1, x2, y1, y2,
+                _recalc = function() {
+                    length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
+                    m = jsPlumbGeom.gradient({x:x1, y:y1}, {x:x2, y:y2});
+                    m2 = -1 / m;                
+                };
+                
+            this.type = "Straight";
+            
+            this.getLength = function() { return length; };
+            this.getGradient = function() { return m; };
+                
+            this.getCoordinates = function() {
+                return { x1:x1,y1:y1,x2:x2,y2:y2 };
+            };
+            this.setCoordinates = function(coords) {
+                x1 = coords.x1; y1 = coords.y1; x2 = coords.x2; y2 = coords.y2;
+                _recalc();
+            };
+            this.setCoordinates({x1:params.x1, y1:params.y1, x2:params.x2, y2:params.y2});
+
+            this.getBounds = function() {
+                return {
+                    minX:Math.min(x1, x2),
+                    minY:Math.min(y1, y2),
+                    maxX:Math.max(x1, x2),
+                    maxY:Math.max(y1, y2)
+                };
+            };
+            
+            /**
+             * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from
+             * 0 to 1 inclusive. for the straight line segment this is simple maths.
+             */
+             this.pointOnPath = function(location, absolute) {
+                if (location === 0 && !absolute)
+                    return { x:x1, y:y1 };
+                else if (location == 1 && !absolute)
+                    return { x:x2, y:y2 };
+                else {
+                    var l = absolute ? location > 0 ? location : length + location : location * length;
+                    return jsPlumbGeom.pointOnLine({x:x1, y:y1}, {x:x2, y:y2}, l);
+                }
+            };
+            
+            /**
+             * returns the gradient of the segment at the given point - which for us is constant.
+             */
+            this.gradientAtPoint = function(_) {
+                return m;
+            };
+            
+            /**
+             * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where 
+             * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.
+             * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.
+             */            
+            this.pointAlongPathFrom = function(location, distance, absolute) {            
+                var p = this.pointOnPath(location, absolute),
+                    farAwayPoint = distance <= 0 ? {x:x1, y:y1} : {x:x2, y:y2 };
+
+                /*
+                location == 1 ? {
+                                        x:x1 + ((x2 - x1) * 10),
+                                        y:y1 + ((y1 - y2) * 10)
+                                    } : 
+                */
+    
+                if (distance <= 0 && Math.abs(distance) > 1) distance *= -1;
+    
+                return jsPlumbGeom.pointOnLine(p, farAwayPoint, distance);
+            };
+            
+            // is c between a and b?
+            var within = function(a,b,c) {
+                return c >= Math.min(a,b) && c <= Math.max(a,b); 
+            };
+            // find which of a and b is closest to c
+            var closest = function(a,b,c) {
+                return Math.abs(c - a) < Math.abs(c - b) ? a : b;
+            };
+            
+            /**
+                Function: findClosestPointOnPath
+                Finds the closest point on this segment to [x,y]. See
+                notes on this method in AbstractSegment.
+            */
+            this.findClosestPointOnPath = function(x, y) {
+                var out = {
+                    d:Infinity,
+                    x:null,
+                    y:null,
+                    l:null,
+                    x1:x1,
+                    x2:x2,
+                    y1:y1,
+                    y2:y2
+                };
+
+                if (m === 0) {                  
+                    out.y = y1;
+                    out.x = within(x1, x2, x) ? x : closest(x1, x2, x);
+                }
+                else if (m == Infinity || m == -Infinity) {
+                    out.x = x1;                
+                    out.y = within(y1, y2, y) ? y : closest(y1, y2, y);
+                }
+                else {
+                    // closest point lies on normal from given point to this line.  
+                    var b = y1 - (m * x1),
+                        b2 = y - (m2 * x),                    
+                    // y1 = m.x1 + b and y1 = m2.x1 + b2
+                    // so m.x1 + b = m2.x1 + b2
+                    // x1(m - m2) = b2 - b
+                    // x1 = (b2 - b) / (m - m2)
+                        _x1 = (b2 -b) / (m - m2),
+                        _y1 = (m * _x1) + b;
+                                        
+                    out.x = within(x1,x2,_x1) ? _x1 : closest(x1,x2,_x1);//_x1;
+                    out.y = within(y1,y2,_y1) ? _y1 : closest(y1,y2,_y1);//_y1;                    
+                }
+
+                var fractionInSegment = jsPlumbGeom.lineLength([ out.x, out.y ], [ x1, y1 ]);
+                out.d = jsPlumbGeom.lineLength([x,y], [out.x, out.y]);
+                out.l = fractionInSegment / length;            
+                return out;
+            };        
+        },
+       
+        /*
+            Arc Segment. You need to supply:
+    
+            r   -   radius
+            cx  -   center x for the arc
+            cy  -   center y for the arc
+            ac  -   whether the arc is anticlockwise or not. default is clockwise.
+    
+            and then either:
+    
+            startAngle  -   startAngle for the arc.
+            endAngle    -   endAngle for the arc.
+    
+            or:
+    
+            x1          -   x for start point
+            y1          -   y for start point
+            x2          -   x for end point
+            y2          -   y for end point
+    
+        */
+        Arc : function(params) {
+            var _super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
+                _calcAngle = function(_x, _y) {
+                    return jsPlumbGeom.theta([params.cx, params.cy], [_x, _y]);    
+                },
+                _calcAngleForLocation = function(segment, location) {
+                    if (segment.anticlockwise) {
+                        var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,
+                            s = Math.abs(sa - segment.endAngle);
+                        return sa - (s * location);                    
+                    }
+                    else {
+                        var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,
+                            ss = Math.abs (ea - segment.startAngle);
+                    
+                        return segment.startAngle + (ss * location);
+                    }
+                },
+                TWO_PI = 2 * Math.PI;
+            
+            this.radius = params.r;
+            this.anticlockwise = params.ac;                    
+            this.type = "Arc";
+                
+            if (params.startAngle && params.endAngle) {
+                this.startAngle = params.startAngle;
+                this.endAngle = params.endAngle;            
+                this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));     
+                this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));            
+                this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));     
+                this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));                        
+            }
+            else {
+                this.startAngle = _calcAngle(params.x1, params.y1);
+                this.endAngle = _calcAngle(params.x2, params.y2);            
+                this.x1 = params.x1;
+                this.y1 = params.y1;
+                this.x2 = params.x2;
+                this.y2 = params.y2;            
+            }
+            
+            if (this.endAngle < 0) this.endAngle += TWO_PI;
+            if (this.startAngle < 0) this.startAngle += TWO_PI;   
+
+            // segment is used by vml     
+            this.segment = jsPlumbGeom.quadrant([this.x1, this.y1], [this.x2, this.y2]);
+            
+            // we now have startAngle and endAngle as positive numbers, meaning the
+            // absolute difference (|d|) between them is the sweep (s) of this arc, unless the
+            // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.
+            
+            var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;
+            this.sweep = Math.abs (ea - this.startAngle);
+            if (this.anticlockwise) this.sweep = TWO_PI - this.sweep;
+            var circumference = 2 * Math.PI * this.radius,
+                frac = this.sweep / TWO_PI,
+                length = circumference * frac;
+            
+            this.getLength = function() {
+                return length;
+            };
+
+            this.getBounds = function() {
+                return {
+                    minX:params.cx - params.r,
+                    maxX:params.cx + params.r,
+                    minY:params.cy - params.r,
+                    maxY:params.cy + params.r
+                };
+            };
+            
+            var VERY_SMALL_VALUE = 0.0000000001,
+                gentleRound = function(n) {
+                    var f = Math.floor(n), r = Math.ceil(n);
+                    if (n - f < VERY_SMALL_VALUE) 
+                        return f;    
+                    else if (r - n < VERY_SMALL_VALUE)
+                        return r;
+                    return n;
+                };
+            
+            /**
+             * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from
+             * 0 to 1 inclusive. 
+             */
+            this.pointOnPath = function(location, absolute) {            
+                
+                if (location === 0) {
+                    return { x:this.x1, y:this.y1, theta:this.startAngle };    
+                }
+                else if (location == 1) {
+                    return { x:this.x2, y:this.y2, theta:this.endAngle };                    
+                }
+                
+                if (absolute) {
+                    location = location / length;
+                }
+    
+                var angle = _calcAngleForLocation(this, location),
+                    _x = params.cx + (params.r * Math.cos(angle)),
+                    _y  = params.cy + (params.r * Math.sin(angle));                                    
+    
+                return { x:gentleRound(_x), y:gentleRound(_y), theta:angle };
+            };
+            
+            /**
+             * returns the gradient of the segment at the given point.
+             */
+            this.gradientAtPoint = function(location, absolute) {
+                var p = this.pointOnPath(location, absolute);
+                var m = jsPlumbGeom.normal( [ params.cx, params.cy ], [p.x, p.y ] );
+                if (!this.anticlockwise && (m == Infinity || m == -Infinity)) m *= -1;
+                return m;
+            };               
+                    
+            this.pointAlongPathFrom = function(location, distance, absolute) {
+                var p = this.pointOnPath(location, absolute),
+                    arcSpan = distance / circumference * 2 * Math.PI,
+                    dir = this.anticlockwise ? -1 : 1,
+                    startAngle = p.theta + (dir * arcSpan),                            
+                    startX = params.cx + (this.radius * Math.cos(startAngle)),
+                    startY = params.cy + (this.radius * Math.sin(startAngle)); 
+    
+                return {x:startX, y:startY};
+            };             
+        },
+       
+        Bezier : function(params) {
+            var _super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
+                curve = [      
+                    { x:params.x1, y:params.y1},
+                    { x:params.cp1x, y:params.cp1y },
+                    { x:params.cp2x, y:params.cp2y },
+                    { x:params.x2, y:params.y2 }
+                ],
+                // although this is not a strictly rigorous determination of bounds
+                // of a bezier curve, it works for the types of curves that this segment
+                // type produces.
+                bounds = {
+                    minX:Math.min(params.x1, params.x2, params.cp1x, params.cp2x),
+                    minY:Math.min(params.y1, params.y2, params.cp1y, params.cp2y),
+                    maxX:Math.max(params.x1, params.x2, params.cp1x, params.cp2x),
+                    maxY:Math.max(params.y1, params.y2, params.cp1y, params.cp2y)
+                };
+                
+            this.type = "Bezier";            
+            
+            var _translateLocation = function(_curve, location, absolute) {
+                if (absolute)
+                    location = jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);
+    
+                return location;
+            };         
+            
+            /**
+             * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from
+             * 0 to 1 inclusive. 
+             */
+            this.pointOnPath = function(location, absolute) {
+                location = _translateLocation(curve, location, absolute);                
+                return jsBezier.pointOnCurve(curve, location);
+            };
+            
+            /**
+             * returns the gradient of the segment at the given point.
+             */
+            this.gradientAtPoint = function(location, absolute) {
+                location = _translateLocation(curve, location, absolute);
+                return jsBezier.gradientAtPoint(curve, location);              
+            };               
+            
+            this.pointAlongPathFrom = function(location, distance, absolute) {
+                location = _translateLocation(curve, location, absolute);
+                return jsBezier.pointAlongCurveFrom(curve, location, distance);
+            };
+            
+            this.getLength = function() {
+                return jsBezier.getLength(curve);                              
+            };
+
+            this.getBounds = function() {
+                return bounds;
+            };
+        }
+    };
+
+    /*
+        Class: AbstractComponent
+        Superclass for AbstractConnector and AbstractEndpoint.
+    */
+    var AbstractComponent = function() {        
+        this.resetBounds = function() {
+            this.bounds = { minX:Infinity, minY:Infinity, maxX:-Infinity, maxY:-Infinity };
+        };
+        this.resetBounds();        
+    };
+       
+       /*
+        * Class: AbstractConnector
+        * Superclass for all Connectors; here is where Segments are managed.  This is exposed on jsPlumb just so it
+        * can be accessed from other files. You should not try to instantiate one of these directly.
+        *
+        * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch
+        * that request to. This is done by keeping track of the total connector length as segments are added, and also
+        * their cumulative ratios to the total length.  Then when the right segment is found it is a simple case of dispatching
+        * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)
+        */ 
+       jsPlumb.Connectors.AbstractConnector = function(params) {
+               
+        AbstractComponent.apply(this, arguments);        
+
+               var //self = this, 
+            segments = [],
+            editing = false,
+                       totalLength = 0,
+                       segmentProportions = [],
+                       segmentProportionalLengths = [],        
+            stub = params.stub || 0, 
+            sourceStub = jsPlumbUtil.isArray(stub) ? stub[0] : stub,
+            targetStub = jsPlumbUtil.isArray(stub) ? stub[1] : stub,
+            gap = params.gap || 0,
+            sourceGap = jsPlumbUtil.isArray(gap) ? gap[0] : gap,
+            targetGap = jsPlumbUtil.isArray(gap) ? gap[1] : gap,
+            userProvidedSegments = null,
+            edited = false,
+            paintInfo = null;            
+        
+        // subclasses should override.
+        this.isEditable = function() { return false; };                        
+        this.setEdited = function(ed) { edited = ed; };
+
+        // to be overridden by subclasses.
+        this.getPath = function() { };
+        this.setPath = function(path) { };
+        
+        /**
+        * Function: findSegmentForPoint
+        * Returns the segment that is closest to the given [x,y],
+        * null if nothing found.  This function returns a JS 
+        * object with:
+        *
+        *   d   -   distance from segment
+        *   l   -   proportional location in segment
+        *   x   -   x point on the segment
+        *   y   -   y point on the segment
+        *   s   -   the segment itself.
+        */ 
+        this.findSegmentForPoint = function(x, y) {
+            var out = { d:Infinity, s:null, x:null, y:null, l:null };
+            for (var i = 0; i < segments.length; i++) {
+                var _s = segments[i].findClosestPointOnPath(x, y);
+                if (_s.d < out.d) {
+                    out.d = _s.d; 
+                    out.l = _s.l; 
+                    out.x = _s.x;
+                    out.y = _s.y; 
+                    out.s = segments[i];
+                    out.x1 = _s.x1;
+                    out.x2 = _s.x2;
+                    out.y1 = _s.y1;
+                    out.y2 = _s.y2;
+                    out.index = i;
+                }
+            }
+            
+            return out;                
+        };
+                       
+               var _updateSegmentProportions = function() {
+                var curLoc = 0;
+                for (var i = 0; i < segments.length; i++) {
+                    var sl = segments[i].getLength();
+                    segmentProportionalLengths[i] = sl / totalLength;
+                    segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];
+                }
+            },
+               
+            /**
+             * returns [segment, proportion of travel in segment, segment index] for the segment 
+             * that contains the point which is 'location' distance along the entire path, where 
+             * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths 
+             * are made up of a list of segments, each of which contributes some fraction to
+             * the total length. 
+             * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location
+             * as the absolute distance in pixels, rather than a proportion of the total path. 
+             */
+            _findSegmentForLocation = function(location, absolute) {
+                if (absolute) {
+                    location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;
+                }
+    
+                var idx = segmentProportions.length - 1, inSegmentProportion = 1;
+                //if (location < 1) {
+                    for (var i = 0; i < segmentProportions.length; i++) {
+                        if (segmentProportions[i][1] >= location) {
+                            idx = i;
+                            // todo is this correct for all connector path types?
+                            inSegmentProportion = location == 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];                    
+                            break;
+                        }
+                    }
+                //}
+                return { segment:segments[idx], proportion:inSegmentProportion, index:idx };
+            },         
+            _addSegment = function(conn, type, params) {
+                if (params.x1 == params.x2 && params.y1 == params.y2) return;
+                var s = new jsPlumb.Segments[type](params);
+                segments.push(s);
+                totalLength += s.getLength();  
+                conn.updateBounds(s);                                  
+            },                                 
+            _clearSegments = function() {
+                totalLength = 0;
+                segments.splice(0, segments.length);
+                segmentProportions.splice(0, segmentProportions.length);
+                segmentProportionalLengths.splice(0, segmentProportionalLengths.length);
+            };
+        
+        this.setSegments = function(_segs) {
+            userProvidedSegments = [];
+            totalLength = 0;
+            for (var i = 0; i < _segs.length; i++) {      
+                userProvidedSegments.push(_segs[i]);
+                totalLength += _segs[i].getLength();                               
+            }            
+        };  
+        
+        var _prepareCompute = function(params) {
+            this.lineWidth = params.lineWidth;
+            var segment = jsPlumbGeom.quadrant(params.sourcePos, params.targetPos),
+                swapX = params.targetPos[0] < params.sourcePos[0],
+                swapY = params.targetPos[1] < params.sourcePos[1],
+                lw = params.lineWidth || 1,       
+                so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint), 
+                to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),
+                x = swapX ? params.targetPos[0] : params.sourcePos[0], 
+                y = swapY ? params.targetPos[1] : params.sourcePos[1],
+                w = Math.abs(params.targetPos[0] - params.sourcePos[0]),
+                h = Math.abs(params.targetPos[1] - params.sourcePos[1]);
+            
+            // if either anchor does not have an orientation set, we derive one from their relative
+            // positions.  we fix the axis to be the one in which the two elements are further apart, and
+            // point each anchor at the other element.  this is also used when dragging a new connection.
+            if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {
+                var index = w > h ? 0 : 1, oIndex = [1,0][index];
+                so = []; to = [];
+                so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;
+                to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;
+                so[oIndex] = 0; to[oIndex] = 0;
+            }                    
+            
+            var sx = swapX ? w + (sourceGap * so[0])  : sourceGap * so[0], 
+                sy = swapY ? h + (sourceGap * so[1])  : sourceGap * so[1], 
+                tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),
+                ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),
+                oProduct = ((so[0] * to[0]) + (so[1] * to[1]));        
+            
+            var result = {
+                sx:sx, sy:sy, tx:tx, ty:ty, lw:lw, 
+                xSpan:Math.abs(tx - sx),
+                ySpan:Math.abs(ty - sy),                
+                mx:(sx + tx) / 2,
+                my:(sy + ty) / 2,                
+                so:so, to:to, x:x, y:y, w:w, h:h,
+                segment : segment,
+                startStubX : sx + (so[0] * sourceStub), 
+                startStubY : sy + (so[1] * sourceStub),
+                endStubX : tx + (to[0] * targetStub), 
+                endStubY : ty + (to[1] * targetStub),
+                isXGreaterThanStubTimes2 : Math.abs(sx - tx) > (sourceStub + targetStub),
+                isYGreaterThanStubTimes2 : Math.abs(sy - ty) > (sourceStub + targetStub),
+                opposite:oProduct == -1,
+                perpendicular:oProduct === 0,
+                orthogonal:oProduct == 1,
+                sourceAxis : so[0] === 0 ? "y" : "x",
+                points:[x, y, w, h, sx, sy, tx, ty ]
+            };
+            result.anchorOrientation = result.opposite ? "opposite" : result.orthogonal ? "orthogonal" : "perpendicular";
+            return result;
+        };
+               
+               this.getSegments = function() { return segments; };
+
+        this.updateBounds = function(segment) {
+            var segBounds = segment.getBounds();
+            this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);
+            this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);
+            this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);
+            this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);              
+        };
+        
+        var dumpSegmentsToConsole = function() {
+            console.log("SEGMENTS:");
+            for (var i = 0; i < segments.length; i++) {
+                console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);
+            }
+        };
+               
+               this.pointOnPath = function(location, absolute) {
+            var seg = _findSegmentForLocation(location, absolute);      
+            return seg.segment && seg.segment.pointOnPath(seg.proportion, absolute) || [0,0];
+        };
+        
+        this.gradientAtPoint = function(location) {
+            var seg = _findSegmentForLocation(location, absolute);          
+            return seg.segment && seg.segment.gradientAtPoint(seg.proportion, absolute) || 0;
+        };
+        
+        this.pointAlongPathFrom = function(location, distance, absolute) {
+            var seg = _findSegmentForLocation(location, absolute);
+            // TODO what happens if this crosses to the next segment?
+            return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0,0];
+        };
+               
+               this.compute = function(params)  {
+            if (!edited)
+                paintInfo = _prepareCompute.call(this, params);
+            
+            _clearSegments();
+            this._compute(paintInfo, params);
+            this.x = paintInfo.points[0];
+            this.y = paintInfo.points[1];
+            this.w = paintInfo.points[2];
+            this.h = paintInfo.points[3];               
+            this.segment = paintInfo.segment;         
+            _updateSegmentProportions();            
+               };
+               
+               return {
+                       addSegment:_addSegment,
+            prepareCompute:_prepareCompute,
+            sourceStub:sourceStub,
+            targetStub:targetStub,
+            maxStub:Math.max(sourceStub, targetStub),            
+            sourceGap:sourceGap,
+            targetGap:targetGap,
+            maxGap:Math.max(sourceGap, targetGap)
+               };              
+       };
+    jsPlumbUtil.extend(jsPlumb.Connectors.AbstractConnector, AbstractComponent);
+       
+    /**
+     * Class: Connectors.Straight
+     * The Straight connector draws a simple straight line between the two anchor points.  It does not have any constructor parameters.
+     */
+    var Straight = jsPlumb.Connectors.Straight = function() {
+       this.type = "Straight";
+               var _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments);              
+
+        this._compute = function(paintInfo, _) {                        
+            _super.addSegment(this, "Straight", {x1:paintInfo.sx, y1:paintInfo.sy, x2:paintInfo.startStubX, y2:paintInfo.startStubY});                                                
+            _super.addSegment(this, "Straight", {x1:paintInfo.startStubX, y1:paintInfo.startStubY, x2:paintInfo.endStubX, y2:paintInfo.endStubY});                        
+            _super.addSegment(this, "Straight", {x1:paintInfo.endStubX, y1:paintInfo.endStubY, x2:paintInfo.tx, y2:paintInfo.ty});                                    
+        };                    
+    };
+    jsPlumbUtil.extend(jsPlumb.Connectors.Straight, jsPlumb.Connectors.AbstractConnector);
+    jsPlumb.registerConnectorType(Straight, "Straight");
+                    
+    /**
+     * Class:Connectors.Bezier
+     * This Connector draws a Bezier curve with two control points.  You can provide a 'curviness' value which gets applied to jsPlumb's
+     * internal voodoo machine and ends up generating locations for the two control points.  See the constructor documentation below.
+     */
+    /**
+     * Function:Constructor
+     * 
+     * Parameters:
+     *         curviness - How 'curvy' you want the curve to be! This is a directive for the placement of control points, not endpoints of the curve, so your curve does not 
+     * actually touch the given point, but it has the tendency to lean towards it.  The larger this value, the greater the curve is pulled from a straight line.
+     * Optional; defaults to 150.
+     * stub - optional value for a distance to travel from the connector's endpoint before beginning the Bezier curve. defaults to 0.
+     * 
+     */
+    var Bezier = function(params) {
+        params = params || {};
+
+       var _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments),
+            stub = params.stub || 50,
+            majorAnchor = params.curviness || 150,
+            minorAnchor = 10;            
+
+        this.type = "Bezier";  
+        this.getCurviness = function() { return majorAnchor; };        
+        
+        this._findControlPoint = function(point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint) {
+               // determine if the two anchors are perpendicular to each other in their orientation.  we swap the control 
+               // points around if so (code could be tightened up)
+               var soo = sourceEndpoint.anchor.getOrientation(sourceEndpoint), 
+                       too = targetEndpoint.anchor.getOrientation(targetEndpoint),
+                       perpendicular = soo[0] != too[0] || soo[1] == too[1],
+               p = [];                
+               
+            if (!perpendicular) {
+                if (soo[0] === 0) // X
+                    p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);
+                else p.push(point[0] - (majorAnchor * soo[0]));
+                                 
+                if (soo[1] === 0) // Y
+                       p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);
+                else p.push(point[1] + (majorAnchor * too[1]));
+            }
+             else {
+                if (too[0] === 0) // X
+                       p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);
+                else p.push(point[0] + (majorAnchor * too[0]));
+                
+                if (too[1] === 0) // Y
+                       p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);
+                else p.push(point[1] + (majorAnchor * soo[1]));
+             }
+
+            return p;                
+        };        
+
+        this._compute = function(paintInfo, p) {                                
+                       var sp = p.sourcePos,
+                               tp = p.targetPos,                               
+                _w = Math.abs(sp[0] - tp[0]),
+                _h = Math.abs(sp[1] - tp[1]),            
+                _sx = sp[0] < tp[0] ? _w : 0,
+                _sy = sp[1] < tp[1] ? _h : 0,
+                _tx = sp[0] < tp[0] ? 0 : _w,
+                _ty = sp[1] < tp[1] ? 0 : _h,
+                _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint),
+                _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint);
+
+                       _super.addSegment(this, "Bezier", {
+                               x1:_sx, y1:_sy, x2:_tx, y2:_ty,
+                               cp1x:_CP[0], cp1y:_CP[1], cp2x:_CP2[0], cp2y:_CP2[1]
+                       });                    
+        };               
+    };    
+    jsPlumbUtil.extend(Bezier, jsPlumb.Connectors.AbstractConnector);
+    jsPlumb.registerConnectorType(Bezier, "Bezier");
+    
+ // ********************************* END OF CONNECTOR TYPES *******************************************************************
+    
+ // ********************************* ENDPOINT TYPES *******************************************************************
+    
+    jsPlumb.Endpoints.AbstractEndpoint = function(params) {
+        AbstractComponent.apply(this, arguments);
+        var compute = this.compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {    
+            var out = this._compute.apply(this, arguments);
+            this.x = out[0];
+            this.y = out[1];
+            this.w = out[2];
+            this.h = out[3];
+            this.bounds.minX = this.x;
+            this.bounds.minY = this.y;
+            this.bounds.maxX = this.x + this.w;
+            this.bounds.maxY = this.y + this.h;
+            return out;
+        };
+        return {
+            compute:compute,
+            cssClass:params.cssClass
+        };
+    };
+    jsPlumbUtil.extend(jsPlumb.Endpoints.AbstractEndpoint, AbstractComponent);
+    
+    /**
+     * Class: Endpoints.Dot
+     * A round endpoint, with default radius 10 pixels.
+     */        
+       
+       /**
+        * Function: Constructor
+        * 
+        * Parameters:
+        * 
+        *      radius  -       radius of the endpoint.  defaults to 10 pixels.
+        */
+       jsPlumb.Endpoints.Dot = function(params) {        
+               this.type = "Dot";
+               var _super = jsPlumb.Endpoints.AbstractEndpoint.apply(this, arguments);
+               params = params || {};                          
+               this.radius = params.radius || 10;
+               this.defaultOffset = 0.5 * this.radius;
+               this.defaultInnerRadius = this.radius / 3;                      
+               
+               this._compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {
+                       this.radius = endpointStyle.radius || this.radius;
+                       var     x = anchorPoint[0] - this.radius,
+                               y = anchorPoint[1] - this.radius,
+                w = this.radius * 2,
+                h = this.radius * 2;
+
+            if (endpointStyle.strokeStyle) {
+                var lw = endpointStyle.lineWidth || 1;
+                x -= lw;
+                y -= lw;
+                w += (lw * 2);
+                h += (lw * 2);
+            }
+                       return [ x, y, w, h, this.radius ];
+               };
+       };
+    jsPlumbUtil.extend(jsPlumb.Endpoints.Dot, jsPlumb.Endpoints.AbstractEndpoint);
+       
+       /**
+        * Class: Endpoints.Rectangle
+        * A Rectangular Endpoint, with default size 20x20.
+        */
+       /**
+        * Function: Constructor
+        * 
+        * Parameters:
+        * 
+        *      width   - width of the endpoint. defaults to 20 pixels.
+        *      height  - height of the endpoint. defaults to 20 pixels.        
+        */
+       jsPlumb.Endpoints.Rectangle = function(params) {
+               this.type = "Rectangle";
+               var _super = jsPlumb.Endpoints.AbstractEndpoint.apply(this, arguments);
+               params = params || {};
+               this.width = params.width || 20;
+               this.height = params.height || 20;
+               
+               this._compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {
+                       var width = endpointStyle.width || this.width,
+                               height = endpointStyle.height || this.height,
+                               x = anchorPoint[0] - (width/2),
+                               y = anchorPoint[1] - (height/2);
+                
+                       return [ x, y, width, height];
+               };
+       };
+    jsPlumbUtil.extend(jsPlumb.Endpoints.Rectangle, jsPlumb.Endpoints.AbstractEndpoint);
+       
+
+    var DOMElementEndpoint = function(params) {
+        jsPlumb.DOMElementComponent.apply(this, arguments);        
+        this._jsPlumb.displayElements = [  ];                
+    };
+    jsPlumbUtil.extend(DOMElementEndpoint, jsPlumb.DOMElementComponent, {
+       // jsPlumb.Endpoints.AbstractEndpoint
+        getDisplayElements : function() { 
+            return this._jsPlumb.displayElements; 
+        },        
+        appendDisplayElement : function(el) {
+            this._jsPlumb.displayElements.push(el);
+        }
+    });
+
+       /**
+        * Class: Endpoints.Image
+        * Draws an image as the Endpoint.
+        */
+       /**
+        * Function: Constructor
+        * 
+        * Parameters:
+        * 
+        *      src     -       location of the image to use.
+
+    TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup
+    function will suffice
+
+    TODO this class still leaks memory.
+
+        */
+       jsPlumb.Endpoints.Image = function(params) {
+                               
+               this.type = "Image";
+               DOMElementEndpoint.apply(this, arguments);
+        jsPlumb.Endpoints.AbstractEndpoint.apply(this, arguments);
+               
+               var _onload = params.onload, 
+            src = params.src || params.url,
+            parent = params.parent,
+            clazz = params.cssClass ? " " + params.cssClass : "";
+
+        this._jsPlumb.img = new Image();               
+        this._jsPlumb.ready = false;
+        this._jsPlumb.initialized = false;
+        this._jsPlumb.deleted = false;
+        this._jsPlumb.widthToUse = params.width;
+        this._jsPlumb.heightToUse = params.height;
+        this._jsPlumb.endpoint = params.endpoint;
+
+               this._jsPlumb.img.onload = function() {
+            // check we weren't actually discarded before use (in fact mostly happens in tests)
+            if (this._jsPlumb != null) {
+                       this._jsPlumb.ready = true;            
+                       this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;
+                       this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;
+                if (_onload) {
+                    _onload(this);
+                }
+            }
+               }.bind(this);        
+
+        /*
+            Function: setImage
+            Sets the Image to use in this Endpoint.  
+
+            Parameters:
+            img         -   may be a URL or an Image object
+            onload      -   optional; a callback to execute once the image has loaded.
+        */
+        this._jsPlumb.endpoint.setImage = function(_img, onload) {
+            var s = _img.constructor == String ? _img : _img.src;
+            _onload = onload; 
+            this._jsPlumb.img.src = s;
+
+            if (this.canvas != null)
+                this.canvas.setAttribute("src", this._jsPlumb.img.src);
+        }.bind(this);
+
+        this._jsPlumb.endpoint.setImage(src, _onload);
+        /*        
+            var s = src.constructor == String ? src : src.src;
+            //_onload = onload; 
+            this._jsPlumb.img.src = src;
+
+            if (this.canvas != null)
+                this.canvas.setAttribute("src", this._jsPlumb.img.src);
+       // }.bind(this);
+
+        //this._jsPlumb.endpoint.setImage(src, _onload);*/
+
+               this._compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {
+                       this.anchorPoint = anchorPoint;
+                       if (this._jsPlumb.ready) return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2, 
+                                                                       this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];
+                       else return [0,0,0,0];
+               };
+               
+               this.canvas = document.createElement("img");
+               this.canvas.style.margin = 0;
+               this.canvas.style.padding = 0;
+               this.canvas.style.outline = 0;
+               this.canvas.style.position = "absolute";                
+               this.canvas.className = this._jsPlumb.instance.endpointClass + clazz;
+               if (this._jsPlumb.widthToUse) this.canvas.setAttribute("width", this._jsPlumb.widthToUse);
+               if (this._jsPlumb.heightToUse) this.canvas.setAttribute("height", this._jsPlumb.heightToUse);           
+               this._jsPlumb.instance.appendElement(this.canvas, parent);
+               this.attachListeners(this.canvas, this);                
+               
+               this.actuallyPaint = function(d, style, anchor) {
+                       if (!this._jsPlumb.deleted) {
+                               if (!this._jsPlumb.initialized) {
+                                       this.canvas.setAttribute("src", this._jsPlumb.img.src);
+                                       this.appendDisplayElement(this.canvas);
+                                       this._jsPlumb.initialized = true;
+                               }
+                               var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),
+                                       y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);
+                               jsPlumbUtil.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);
+                       }
+               };
+               
+               this.paint = function(style, anchor) {
+            if (this._jsPlumb != null) {  // may have been deleted
+                       if (this._jsPlumb.ready) {
+                               this.actuallyPaint(style, anchor);
+                       }
+                       else { 
+                               window.setTimeout(function() {                                          
+                                       this.paint(style, anchor);
+                               }.bind(this), 200);
+                       }
+            }
+               };                              
+       };
+    jsPlumbUtil.extend(jsPlumb.Endpoints.Image, [ DOMElementEndpoint, jsPlumb.Endpoints.AbstractEndpoint ], {
+        cleanup : function() {            
+            this._jsPlumb.deleted = true;
+            jsPlumbUtil.removeElement(this.canvas);
+            this.canvas = null;
+        } 
+    });
+       
+       /*
+        * Class: Endpoints.Blank
+        * An Endpoint that paints nothing (visible) on the screen.  Supports cssClass and hoverClass parameters like all Endpoints.
+        */
+       jsPlumb.Endpoints.Blank = function(params) {
+               var _super = jsPlumb.Endpoints.AbstractEndpoint.apply(this, arguments);
+               this.type = "Blank";
+               DOMElementEndpoint.apply(this, arguments);              
+               this._compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {
+                       return [anchorPoint[0], anchorPoint[1],10,0];
+               };
+               
+               this.canvas = document.createElement("div");
+               this.canvas.style.display = "block";
+               this.canvas.style.width = "1px";
+               this.canvas.style.height = "1px";
+               this.canvas.style.background = "transparent";
+               this.canvas.style.position = "absolute";
+               this.canvas.className = this._jsPlumb.endpointClass;
+               jsPlumb.appendElement(this.canvas, params.parent);
+               
+               this.paint = function(style, anchor) {
+                       jsPlumbUtil.sizeElement(this.canvas, this.x, this.y, this.w, this.h);   
+               };
+       };
+    jsPlumbUtil.extend(jsPlumb.Endpoints.Blank, [jsPlumb.Endpoints.AbstractEndpoint, DOMElementEndpoint], {
+        cleanup:function() {
+            if (this.canvas && this.canvas.parentNode) {
+                this.canvas.parentNode.removeChild(this.canvas);
+            }
+        }
+    });
+       
+       /*
+        * Class: Endpoints.Triangle
+        * A triangular Endpoint.  
+        */
+       /*
+        * Function: Constructor
+        * 
+        * Parameters:
+        * 
+        *      width   -       width of the triangle's base.  defaults to 55 pixels.
+        *      height  -       height of the triangle from base to apex.  defaults to 55 pixels.
+        */
+       jsPlumb.Endpoints.Triangle = function(params) {        
+               this.type = "Triangle";
+        var _super = jsPlumb.Endpoints.AbstractEndpoint.apply(this, arguments);
+               params = params || {  };
+               params.width = params.width || 55;
+               params.height = params.height || 55;
+               this.width = params.width;
+               this.height = params.height;
+               this._compute = function(anchorPoint, orientation, endpointStyle, connectorPaintStyle) {
+                       var width = endpointStyle.width || self.width,
+                       height = endpointStyle.height || self.height,
+                       x = anchorPoint[0] - (width/2),
+                       y = anchorPoint[1] - (height/2);
+                       return [ x, y, width, height ];
+               };
+       };
+// ********************************* END OF ENDPOINT TYPES *******************************************************************
+       
+
+// ********************************* OVERLAY DEFINITIONS ***********************************************************************    
+
+       var AbstractOverlay = jsPlumb.Overlays.AbstractOverlay = function(params) {
+               this.visible = true;
+        this.isAppendedAtTopLevel = true;
+               this.component = params.component;
+               this.loc = params.location == null ? 0.5 : params.location;
+        this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;            
+       };
+    AbstractOverlay.prototype = {
+        cleanup:function() {  
+           this.component = null;
+           this.canvas = null;
+           this.endpointLoc = null;
+        },
+        setVisible : function(val) { 
+            this.visible = val;
+            // TODO this is only actually necessary for canvas. so, the Canvas overlay should
+            // override setVisible and call this.
+            //this.component.repaint();
+        },
+        isVisible : function() { return this.visible; },
+        hide : function() { this.setVisible(false); },
+        show : function() { this.setVisible(true); },        
+        incrementLocation : function(amount) {
+            this.loc += amount;
+            this.component.repaint();
+        },
+        setLocation : function(l) {
+            this.loc = l;
+            this.component.repaint();
+        },
+        getLocation : function() {
+            return this.loc;
+        }
+    };
+       
+       
+       /*
+        * Class: Overlays.Arrow
+        * 
+        * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length
+        * of the arrow that lines from each tail point converge into.  The foldback point is defined using a decimal that indicates some fraction
+        * of the length of the arrow and has a default value of 0.623.  A foldback point value of 1 would mean that the arrow had a straight line
+        * across the tail.  
+        */
+       /*
+        * Function: Constructor
+        * 
+        * Parameters:
+        * 
+        *      length - distance in pixels from head to tail baseline. default 20.
+        *      width - width in pixels of the tail baseline. default 20.
+        *      fillStyle - style to use when filling the arrow.  defaults to "black".
+        *      strokeStyle - style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.
+        *      lineWidth - line width to use when stroking the arrow. defaults to 1, but only used if strokeStyle is not null.
+        *      foldback - distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to.  defaults to 0.623.
+        *      location - distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.
+        *      direction - indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.
+        */
+       jsPlumb.Overlays.Arrow = function(params) {
+               this.type = "Arrow";
+               AbstractOverlay.apply(this, arguments);
+        this.isAppendedAtTopLevel = false;
+               params = params || {};
+               var _ju = jsPlumbUtil, _jg = jsPlumbGeom;
+               
+       this.length = params.length || 20;
+       this.width = params.width || 20;
+       this.id = params.id;
+       var direction = (params.direction || 1) < 0 ? -1 : 1,
+           paintStyle = params.paintStyle || { lineWidth:1 },
+           // how far along the arrow the lines folding back in come to. default is 62.3%.
+           foldback = params.foldback || 0.623;
+               
+       this.computeMaxSize = function() { return self.width * 1.5; };          
+       //this.cleanup = function() { };  // nothing to clean up for Arrows    
+       this.draw = function(component, currentConnectionPaintStyle) {
+
+            var hxy, mid, txy, tail, cxy;
+            if (component.pointAlongPathFrom) {
+
+                if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {                    
+                    var l = parseInt(this.loc, 10),
+                        fromLoc = this.loc < 0 ? 1 : 0;
+                    hxy = component.pointAlongPathFrom(fromLoc, l, false);
+                    mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);
+                    txy = _jg.pointOnLine(hxy, mid, this.length);
+                }
+                else if (this.loc == 1) {                
+                                       hxy = component.pointOnPath(this.loc);                                             
+                    mid = component.pointAlongPathFrom(this.loc, -(this.length));
+                                       txy = _jg.pointOnLine(hxy, mid, this.length);
+                                       
+                                       if (direction == -1) {
+                                               var _ = txy;
+                                               txy = hxy;
+                                               hxy = _;
+                                       }
+                }
+                else if (this.loc === 0) {                                                         
+                                       txy = component.pointOnPath(this.loc);                    
+                                       mid = component.pointAlongPathFrom(this.loc, this.length);                    
+                                       hxy = _jg.pointOnLine(txy, mid, this.length);                    
+                                       if (direction == -1) {
+                                               var __ = txy;
+                                               txy = hxy;
+                                               hxy = __;
+                                       }
+                }
+                else {                    
+                           hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);
+                    mid = component.pointOnPath(this.loc);
+                    txy = _jg.pointOnLine(hxy, mid, this.length);
+                }
+
+                tail = _jg.perpendicularLineTo(hxy, txy, this.width);
+                cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);                       
+                       
+                       var d = { hxy:hxy, tail:tail, cxy:cxy },
+                           strokeStyle = paintStyle.strokeStyle || currentConnectionPaintStyle.strokeStyle,
+                           fillStyle = paintStyle.fillStyle || currentConnectionPaintStyle.strokeStyle,
+                           lineWidth = paintStyle.lineWidth || currentConnectionPaintStyle.lineWidth,
+                    info = {
+                        component:component, 
+                        d:d, 
+                        lineWidth:lineWidth, 
+                        strokeStyle:strokeStyle, 
+                        fillStyle:fillStyle,
+                        minX:Math.min(hxy.x, tail[0].x, tail[1].x),
+                        maxX:Math.max(hxy.x, tail[0].x, tail[1].x),
+                        minY:Math.min(hxy.y, tail[0].y, tail[1].y),
+                        maxY:Math.max(hxy.y, tail[0].y, tail[1].y)
+                    };                         
+                                                   
+                return info;
+            }
+            else return {component:component, minX:0,maxX:0,minY:0,maxY:0};
+       };
+    };    
+    jsPlumbUtil.extend(jsPlumb.Overlays.Arrow, AbstractOverlay);      
+    
+    /*
+     * Class: Overlays.PlainArrow
+        * 
+        * A basic arrow.  This is in fact just one instance of the more generic case in which the tail folds back on itself to some
+        * point along the length of the arrow: in this case, that foldback point is the full length of the arrow.  so it just does
+        * a 'call' to Arrow with foldback set appropriately.       
+        */
+    /*
+     * Function: Constructor
+     * See <Overlays.Arrow> for allowed parameters for this overlay.
+     */
+    jsPlumb.Overlays.PlainArrow = function(params) {
+       params = params || {};          
+       var p = jsPlumb.extend(params, {foldback:1});
+       jsPlumb.Overlays.Arrow.call(this, p);
+       this.type = "PlainArrow";
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.PlainArrow, jsPlumb.Overlays.Arrow);
+        
+    /*
+     * Class: Overlays.Diamond
+     * 
+        * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just
+        * happens that in this case, that point is greater than the length of the the arrow.    
+        * 
+        *      this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the
+        *      center is actually 1/4 of the way along for this guy.  but we don't have any knowledge of pixels at this point, so we're kind of
+        *      stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value
+        *      would be -l/4 in this case - move along one quarter of the total length.
+        */
+    /*
+     * Function: Constructor
+     * See <Overlays.Arrow> for allowed parameters for this overlay.
+     */
+    jsPlumb.Overlays.Diamond = function(params) {
+       params = params || {};          
+       var l = params.length || 40,
+           p = jsPlumb.extend(params, {length:l/2, foldback:2});
+       jsPlumb.Overlays.Arrow.call(this, p);
+       this.type = "Diamond";
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.Diamond, jsPlumb.Overlays.Arrow);
+
+    var _getDimensions = function(component) {
+        if (component._jsPlumb.cachedDimensions == null)
+            component._jsPlumb.cachedDimensions = component.getDimensions();
+        return component._jsPlumb.cachedDimensions;
+    };      
+       
+       // abstract superclass for overlays that add an element to the DOM.
+    var AbstractDOMOverlay = function(params) {
+               jsPlumb.DOMElementComponent.apply(this, arguments);
+       AbstractOverlay.apply(this, arguments);
+               
+               var jpcl = jsPlumb.CurrentLibrary;              
+               this.id = params.id;
+        this._jsPlumb.div = null;              
+        this._jsPlumb.initialised = false;
+        this._jsPlumb.component = params.component;
+        this._jsPlumb.cachedDimensions = null;
+        this._jsPlumb.create = params.create;
+               
+               this.getElement = function() {
+                       if (this._jsPlumb.div == null) {
+                var div = this._jsPlumb.div = jpcl.getDOMElement(this._jsPlumb.create(this._jsPlumb.component));                
+                div.style.position   =   "absolute";     
+                var clazz = params._jsPlumb.overlayClass + " " + 
+                    (this.cssClass ? this.cssClass : 
+                    params.cssClass ? params.cssClass : "");        
+                div.className = clazz;
+                this._jsPlumb.instance.appendElement(div, this._jsPlumb.component.parent);
+                this._jsPlumb.instance.getId(div);      
+                this.attachListeners(div, this);
+                this.canvas = div;
+                       }
+               return this._jsPlumb.div;
+       };
+                               
+               this.draw = function(component, currentConnectionPaintStyle, absolutePosition) {
+               var td = _getDimensions(this);
+               if (td != null && td.length == 2) {
+                               var cxy = { x:0,y:0 };
+
+                // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.
+                if (absolutePosition) {
+                    cxy = { x:absolutePosition[0], y:absolutePosition[1] };
+                }
+                else if (component.pointOnPath) {
+                    var loc = this.loc, absolute = false;
+                    if (jsPlumbUtil.isString(this.loc) || this.loc < 0 || this.loc > 1) {
+                        loc = parseInt(this.loc, 10);
+                        absolute = true;
+                    }
+                    cxy = component.pointOnPath(loc, absolute);  // a connection
+                }
+                else {
+                    var locToUse = this.loc.constructor == Array ? this.loc : this.endpointLoc;
+                    cxy = { x:locToUse[0] * component.w,
+                            y:locToUse[1] * component.h };      
+                } 
+                           
+                               var minx = cxy.x - (td[0] / 2),
+                                   miny = cxy.y - (td[1] / 2);
+
+                return {
+                    component:component, 
+                    d:{ minx:minx, miny:miny, td:td, cxy:cxy },
+                    minX:minx, 
+                    maxX:minx + td[0], 
+                    minY:miny, 
+                    maxY:miny + td[1]
+                };                                                             
+               }
+               else return {minX:0,maxX:0,minY:0,maxY:0};
+           };                          
+       };
+    jsPlumbUtil.extend(AbstractDOMOverlay, [jsPlumb.DOMElementComponent, AbstractOverlay], {
+        getDimensions : function() {            
+            return jsPlumb.CurrentLibrary.getSize(jsPlumb.CurrentLibrary.getElementObject(this.getElement()));            
+        },
+        setVisible : function(state) {
+            this._jsPlumb.div.style.display = state ? "block" : "none";
+        },
+        /*
+         * Function: clearCachedDimensions
+         * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are
+         * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but
+         * there are other reasons why the text dimensions might change - if you make a change through CSS, for
+         * example, you might change the font size.  in that case you should explicitly call this method.
+         */
+        clearCachedDimensions : function() {
+            this._jsPlumb.cachedDimensions = null;
+        },
+        cleanup : function() {
+            if (this._jsPlumb.div != null) 
+                jsPlumb.CurrentLibrary.removeElement(this._jsPlumb.div);
+        },
+        computeMaxSize : function() {
+            var td = _getDimensions(this);
+            return Math.max(td[0], td[1]);
+        },
+        reattachListeners : function(connector) {
+            if (this._jsPlumb.div) {
+                this.reattachListenersForElement(this._jsPlumb.div, this, connector);
+            }
+        },
+        paint : function(p, containerExtents) {
+            if (!this._jsPlumb.initialised) {
+                this.getElement();
+                p.component.appendDisplayElement(this._jsPlumb.div);
+                this.attachListeners(this._jsPlumb.div, p.component);
+                this._jsPlumb.initialised = true;
+            }
+            this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + "px";
+            this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + "px";            
+        }
+    });
+       
+       /*
+     * Class: Overlays.Custom
+     * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.
+     * The 'create' function is passed a Connection or Endpoint.
+     */
+    /*
+     * Function: Constructor
+     * 
+     * Parameters:
+     *         create - function for jsPlumb to call that returns a DOM element.
+     *         location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.
+     *         id - optional id to use for later retrieval of this overlay.
+     *         
+     */
+    jsPlumb.Overlays.Custom = function(params) {
+       this.type = "Custom";           
+       AbstractDOMOverlay.apply(this, arguments);                                                                      
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.Custom, AbstractDOMOverlay);
+
+    jsPlumb.Overlays.GuideLines = function() {
+        var self = this;
+        self.length = 50;
+        self.lineWidth = 5;
+        this.type = "GuideLines";
+        AbstractOverlay.apply(this, arguments);
+        jsPlumb.jsPlumbUIComponent.apply(this, arguments);
+        this.draw = function(connector, currentConnectionPaintStyle) {
+
+            var head = connector.pointAlongPathFrom(self.loc, self.length / 2),
+                mid = connector.pointOnPath(self.loc),
+                tail = jsPlumbGeom.pointOnLine(head, mid, self.length),
+                tailLine = jsPlumbGeom.perpendicularLineTo(head, tail, 40),
+                headLine = jsPlumbGeom.perpendicularLineTo(tail, head, 20);
+
+            return {
+                connector:connector,
+                head:head,
+                tail:tail,
+                headLine:headLine,
+                tailLine:tailLine,                
+                minX:Math.min(head.x, tail.x, headLine[0].x, headLine[1].x), 
+                minY:Math.min(head.y, tail.y, headLine[0].y, headLine[1].y), 
+                maxX:Math.max(head.x, tail.x, headLine[0].x, headLine[1].x), 
+                maxY:Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)
+            };
+        };
+
+       // this.cleanup = function() { };  // nothing to clean up for GuideLines
+    };
+    
+    /*
+     * Class: Overlays.Label
+     
+     */
+    /*
+     * Function: Constructor
+     * 
+     * Parameters:
+     *         cssClass - optional css class string to append to css class. This string is appended "as-is", so you can of course have multiple classes
+     *             defined.  This parameter is preferred to using labelStyle, borderWidth and borderStyle.
+     *         label - the label to paint.  May be a string or a function that returns a string.  Nothing will be painted if your label is null or your
+     *         label function returns null.  empty strings _will_ be painted.
+     *         location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.
+     *         id - optional id to use for later retrieval of this overlay.
+     * 
+     *         
+     */
+    jsPlumb.Overlays.Label =  function(params) {                  
+               this.labelStyle = params.labelStyle;
+        
+        var labelWidth = null, labelHeight =  null, labelText = null, labelPadding = null;
+               this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;
+               var p = jsPlumb.extend({
+            create : function() {
+                return document.createElement("div");
+            }}, params);
+       jsPlumb.Overlays.Custom.call(this, p);
+               this.type = "Label";            
+        this.label = params.label || "";
+        this.labelText = null;
+        if (this.labelStyle) {
+            var el = this.getElement();            
+            this.labelStyle.font = this.labelStyle.font || "12px sans-serif";
+            el.style.font = this.labelStyle.font;
+            el.style.color = this.labelStyle.color || "black";
+            if (this.labelStyle.fillStyle) el.style.background = this.labelStyle.fillStyle;
+            if (this.labelStyle.borderWidth > 0) {
+                var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : "black";
+                el.style.border = this.labelStyle.borderWidth  + "px solid " + dStyle;
+            }
+            if (this.labelStyle.padding) el.style.padding = this.labelStyle.padding;            
+        }
+
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.Label, jsPlumb.Overlays.Custom, {
+        cleanup:function() {
+            this.div = null;
+            this.label = null;
+            this.labelText = null;
+            this.cssClass = null;
+            this.labelStyle = null;
+        },
+        getLabel : function() {
+            return this.label;
+        },
+        /*
+         * Function: setLabel
+         * sets the label's, um, label.  you would think i'd call this function
+         * 'setText', but you can pass either a Function or a String to this, so
+         * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep
+         * that in mind if you need escaped HTML.
+         */
+        setLabel : function(l) {
+            this.label = l;
+            this.labelText = null;
+            this.clearCachedDimensions();
+            this.update();
+            this.component.repaint();
+        },
+        getDimensions : function() {                
+            this.update();
+            return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);
+        },
+        update : function() {
+            if (typeof this.label == "function") {
+                var lt = this.label(this);
+                this.getElement().innerHTML = lt.replace(/\r\n/g, "<br/>");
+            }
+            else {
+                if (this.labelText == null) {
+                    this.labelText = this.label;
+                    this.getElement().innerHTML = this.labelText.replace(/\r\n/g, "<br/>");
+                }
+            }
+        }
+    });                
+
+ // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************
+    
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/dom-adapter.js b/portal/static/unbound_reservation_static/src/dom-adapter.js
new file mode 100644 (file)
index 0000000..c0b2a4c
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the base functionality for DOM type adapters. 
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+;(function() {
+    
+               var canvasAvailable = !!document.createElement('canvas').getContext,
+               svgAvailable = !!window.SVGAngle || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"),
+               // http://stackoverflow.com/questions/654112/how-do-you-detect-support-for-vml-or-svg-in-a-browser
+               vmlAvailable = function() {                 
+            if (vmlAvailable.vml === undefined) { 
+                var a = document.body.appendChild(document.createElement('div'));
+               a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
+               var b = a.firstChild;
+               if (b != null && b.style != null) {
+                       b.style.behavior = "url(#default#VML)";
+                       vmlAvailable.vml = b ? typeof b.adj == "object": true;
+                   }
+                   else
+                       vmlAvailable.vml = false;
+               a.parentNode.removeChild(a);
+            }
+            return vmlAvailable.vml;
+               };
+        
+    /**
+               Manages dragging for some instance of jsPlumb.
+       */
+       var DragManager = function(_currentInstance) {          
+               var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},                        
+                       // elementids mapped to the draggable to which they belong.
+                       _draggablesForElements = {};                    
+
+        /**
+            register some element as draggable.  right now the drag init stuff is done elsewhere, and it is
+            possible that will continue to be the case.
+        */
+               this.register = function(el) {
+            var jpcl = jsPlumb.CurrentLibrary,
+               _el = jpcl.getElementObject(el),
+               id = _currentInstance.getId(el),                
+                parentOffset = jpcl.getOffset(_el);
+                    
+            if (!_draggables[id]) {
+                _draggables[id] = el;
+                _dlist.push(el);
+                _delements[id] = {};
+            }
+                               
+                       // look for child elements that have endpoints and register them against this draggable.
+                       var _oneLevel = function(p, startOffset) {
+                if (p) {                                                                                       
+                    for (var i = 0; i < p.childNodes.length; i++) {
+                        if (p.childNodes[i].nodeType != 3 && p.childNodes[i].nodeType != 8) {
+                            var cEl = jpcl.getElementObject(p.childNodes[i]),
+                                cid = _currentInstance.getId(p.childNodes[i], null, true);
+                            if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {
+                                var cOff = jpcl.getOffset(cEl);
+                                _delements[id][cid] = {
+                                    id:cid,
+                                    offset:{
+                                        left:cOff.left - parentOffset.left,
+                                        top:cOff.top - parentOffset.top
+                                    }
+                                };
+                                _draggablesForElements[cid] = id;
+                            }
+                            _oneLevel(p.childNodes[i]);
+                        }      
+                    }
+                }
+                       };
+
+                       _oneLevel(el);
+               };
+               
+               // refresh the offsets for child elements of this element. 
+               this.updateOffsets = function(elId) {
+                       var jpcl = jsPlumb.CurrentLibrary,
+                               el = jpcl.getElementObject(elId),
+                               domEl = jpcl.getDOMElement(el),
+                               id = _currentInstance.getId(domEl),
+                               children = _delements[id],
+                               parentOffset = jpcl.getOffset(el);
+                               
+                       if (children) {
+                               for (var i in children) {
+                                       var cel = jpcl.getElementObject(i),
+                                               cOff = jpcl.getOffset(cel);
+                                               
+                                       _delements[id][i] = {
+                                               id:i,
+                                               offset:{
+                                                       left:cOff.left - parentOffset.left,
+                                                       top:cOff.top - parentOffset.top
+                                               }
+                                       };
+                                       _draggablesForElements[i] = id;
+                               }
+                       }
+               };
+
+               /**
+                       notification that an endpoint was added to the given el.  we go up from that el's parent
+                       node, looking for a parent that has been registered as a draggable. if we find one, we add this
+                       el to that parent's list of elements to update on drag (if it is not there already)
+               */
+               this.endpointAdded = function(el) {
+                       var jpcl = jsPlumb.CurrentLibrary, b = document.body, id = _currentInstance.getId(el), 
+                               c = jpcl.getElementObject(el), 
+                               cLoc = jsPlumb.CurrentLibrary.getOffset(c),
+                               p = el.parentNode, done = p == b;
+
+                       _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;
+
+                       while (p != null && p != b) {
+                               var pid = _currentInstance.getId(p, null, true);
+                               if (pid && _draggables[pid]) {
+                                       var idx = -1, pEl = jpcl.getElementObject(p), pLoc = jpcl.getOffset(pEl);
+                                       
+                                       if (_delements[pid][id] == null) {                                              
+                                               _delements[pid][id] = {
+                                                       id:id,
+                                                       offset:{
+                                                               left:cLoc.left - pLoc.left,
+                                                               top:cLoc.top - pLoc.top
+                                                       }
+                                               };
+                                               _draggablesForElements[id] = pid;
+                                       }
+                                       break;
+                               }
+                               p = p.parentNode;
+                       }       
+               };
+
+               this.endpointDeleted = function(endpoint) {
+                       if (_elementsWithEndpoints[endpoint.elementId]) {
+                               _elementsWithEndpoints[endpoint.elementId]--;
+                               if (_elementsWithEndpoints[endpoint.elementId] <= 0) {
+                                       for (var i in _delements) {
+                                               if (_delements[i]) {
+                            delete _delements[i][endpoint.elementId];
+                            delete _draggablesForElements[endpoint.elementId];
+                        }
+                                       }
+                               }
+                       }               
+               };      
+               
+               this.changeId = function(oldId, newId) {                                
+                       _delements[newId] = _delements[oldId];                  
+                       _delements[oldId] = {};
+                       _draggablesForElements[newId] = _draggablesForElements[oldId];
+                       _draggablesForElements[oldId] = null;                   
+               };
+
+               this.getElementsForDraggable = function(id) {
+                       return _delements[id];  
+               };
+
+               this.elementRemoved = function(elementId) {
+                       var elId = _draggablesForElements[elementId];
+                       if (elId) {
+                               delete _delements[elId][elementId];
+                               delete _draggablesForElements[elementId];
+                       }
+               };
+
+               this.reset = function() {
+                       _draggables = {};
+                       _dlist = [];
+                       _delements = {};
+                       _elementsWithEndpoints = {};
+               };
+
+               //
+               // notification drag ended. from 1.5.5 we check automatically if need to update some
+               // ancestor's offsets.
+               //
+               this.dragEnded = function(el) {                 
+                       var id = _currentInstance.getId(el),
+                               ancestor = _draggablesForElements[id];
+
+                       if (ancestor) this.updateOffsets(ancestor);
+               };
+
+               this.setParent = function(el, elId, p, pId) {
+                       var current = _draggablesForElements[elId];
+                       if (current) {
+                               if (!_delements[pId])
+                                       _delements[pId] = {};
+                               _delements[pId][elId] = _delements[current][elId];
+                               delete _delements[current][elId];
+                               var pLoc = jsPlumb.CurrentLibrary.getOffset(p),
+                                       cLoc = jsPlumb.CurrentLibrary.getOffset(el);
+                               _delements[pId][elId].offset = {
+                                       left:cLoc.left - pLoc.left,
+                                       top:cLoc.top - pLoc.top
+                               };                              
+                               _draggablesForElements[elId] = pId;
+                       }                       
+               };
+               
+       };
+        
+    // for those browsers that dont have it.  they still don't have it! but at least they won't crash.
+       if (!window.console)
+               window.console = { time:function(){}, timeEnd:function(){}, group:function(){}, groupEnd:function(){}, log:function(){} };
+            
+    window.jsPlumbAdapter = {
+        
+        headless:false,
+
+        getAttribute:function(el, attName) {
+               return el.getAttribute(attName);
+        },
+
+        setAttribute:function(el, a, v) {
+               el.setAttribute(a, v);
+        },
+        
+        appendToRoot : function(node) {
+            document.body.appendChild(node);
+        },
+        getRenderModes : function() {
+            return [ "canvas", "svg", "vml" ];
+        },
+        isRenderModeAvailable : function(m) {
+            return {
+                "canvas":canvasAvailable,
+                "svg":svgAvailable,
+                "vml":vmlAvailable()
+            }[m];
+        },
+        getDragManager : function(_jsPlumb) {
+            return new DragManager(_jsPlumb);
+        },
+        setRenderMode : function(mode) {
+            var renderMode;
+            
+            if (mode) {
+                               mode = mode.toLowerCase();            
+                                   
+                var canvasAvailable = this.isRenderModeAvailable("canvas"),
+                    svgAvailable = this.isRenderModeAvailable("svg"),
+                    vmlAvailable = this.isRenderModeAvailable("vml");
+                
+                // now test we actually have the capability to do this.                                                
+                if (mode === "svg") {
+                    if (svgAvailable) renderMode = "svg";
+                    else if (canvasAvailable) renderMode = "canvas";
+                    else if (vmlAvailable) renderMode = "vml";
+                }
+                else if (mode === "canvas" && canvasAvailable) renderMode = "canvas";
+                else if (vmlAvailable) renderMode = "vml";
+            }
+
+                       return renderMode;
+        }
+    };
+    
+
+    /*
+
+    addClass:
+
+    add: function( elem, classNames ) {
+    jQuery.each((classNames || "").split(/\s+/), function(i, className){
+        if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
+            elem.className += (elem.className ? " " : "") + className;
+        });
+    },
+    */
+
+    /*
+
+       removeClass:
+
+    elem.className = classNames !== undefined ?
+       jQuery.grep(elem.className.split(/\s+/), function(className){
+               return !jQuery.className.has( classNames, className );
+       }).join(" ") :
+
+*/
+
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/dom.jsPlumb.js b/portal/static/unbound_reservation_static/src/dom.jsPlumb.js
new file mode 100644 (file)
index 0000000..453337c
--- /dev/null
@@ -0,0 +1,438 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the basic adapter that does not require any support library such as jquery, yui or mootools.
+
+       but it's not yet there.  currently this is a copy of the jquery adapter.
+
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */ 
+/* 
+ * the library specific functions, such as find offset, get id, get attribute, extend etc.  
+ * the full list is:
+ * 
+ * addClass                            adds a class to the given element
+ * animate                             calls the underlying library's animate functionality
+ * appendElement               appends a child element to a parent element.
+ * bind                                        binds some event to an element
+ * dragEvents                  a dictionary of event names
+ * extend                              extend some js object with another.  probably not overly necessary; jsPlumb could just do this internally.
+ * getAttribute                        gets some attribute from an element
+ * getDragObject               gets the object that is being dragged, by extracting it from the arguments passed to a drag callback
+ * getDragScope                        gets the drag scope for a given element.
+ * getDropScope                        gets the drop scope for a given element.
+ * getElementObject            turns an id or dom element into an element object of the underlying library's type.
+ * getOffset                   gets an element's offset
+ * getOriginalEvent     gets the original browser event from some wrapper event
+ * getPageXY                   gets the page event's xy location.
+ * getParent                   gets the parent of some element.
+ * getScrollLeft               gets an element's scroll left.  TODO: is this actually used?  will it be?
+ * getScrollTop                        gets an element's scroll top.  TODO: is this actually used?  will it be?
+ * getSize                             gets an element's size.
+ * getUIPosition               gets the position of some element that is currently being dragged, by extracting it from the arguments passed to a drag callback.
+ * hasClass                            returns whether or not the given element has the given class.
+ * initDraggable               initializes an element to be draggable 
+ * initDroppable               initializes an element to be droppable
+ * isDragSupported             returns whether or not drag is supported for some element.
+ * isDropSupported             returns whether or not drop is supported for some element.
+ * removeClass                 removes a class from a given element.
+ * removeElement               removes some element completely from the DOM.
+ * setAttribute                        sets an attribute on some element.
+ * setDraggable                        sets whether or not some element should be draggable.
+ * setDragScope                        sets the drag scope for a given element.
+ * setOffset                   sets the offset of some element.
+ * trigger                             triggers some event on an element.
+ * unbind                              unbinds some listener from some element.
+ */
+(function($) { 
+       
+       //var getBoundingClientRectSupported = "getBoundingClientRect" in document.documentElement;
+
+    /*
+
+    METHODS TO USE/INVESTIGATE:
+
+        getBoundingClientRect
+        element.matches(...)
+        document.querySelector/querySelectorAll
+        element.classList (has add and remove methods)
+
+     */
+
+    
+    var _setClassName = function(el, val) {        
+            if (el.className.baseVal) 
+                el.className.baseVal = val;
+            else 
+                el.className = val;
+        },
+        _getClassName = function(el) {
+            return el.className.baseVal != null ? el.className.baseVal : el.className;
+        },
+        _classManip = function(el, add, clazz) {
+                 var classesToAddOrRemove = clazz.split(" "),                  
+                         curClasses = _getClassName(el).split(" ");
+                       
+            for (var i = 0; i < classesToAddOrRemove.length; i++) {
+                if (add) {
+                    if (curClasses.indexOf(classesToAddOrRemove[i]) == -1)
+                        curClasses.push(classesToAddOrRemove[i]);
+                }
+                else {
+                    var idx = curClasses.indexOf(classesToAddOrRemove[i]);
+                    if (idx != -1)
+                        curClasses.splice(idx, 1);
+                }
+            }
+            
+            _setClassName(el, curClasses.join(" "));
+        },
+        _addClass = function(el, clazz) {
+            _classManip(el, true, clazz);
+        },
+        _removeClass = function(el, clazz) {
+            _classManip(el, false, clazz);
+        };
+    
+
+       jsPlumb.CurrentLibrary = {                                              
+               
+               /**
+                * adds the given class to the element object.
+                */
+               addClass : function(el, clazz) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       try {
+                               if (el[0].className.constructor == SVGAnimatedString) {
+                                       jsPlumbUtil.svg.addClass(el[0], clazz);                    
+                               }
+                       }
+                       catch (e) {
+                               // SVGAnimatedString not supported; no problem.
+                       }
+            try {                
+                el.addClass(clazz);
+            }
+            catch (e) {
+                // you probably have jQuery 1.9 and Firefox.  
+            }
+               },
+               
+               /**
+                * animates the given element.
+                */
+               animate : function(el, properties, options) {
+                       el.animate(properties, options);
+               },                              
+               
+               /**
+                * appends the given child to the given parent.
+                */
+               appendElement : function(child, parent) {
+                       jsPlumb.CurrentLibrary.getElementObject(parent).append(child);                  
+               },   
+
+               /**
+               * executes an ajax call.
+               */
+               ajax : function(params) {
+                       params = params || {};
+                       params.type = params.type || "get";
+                       $.ajax(params);
+               },
+               
+               /**
+                * event binding wrapper.  it just so happens that jQuery uses 'bind' also.  yui3, for example,
+                * uses 'on'.
+                */
+               bind : function(el, event, callback) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       el.bind(event, callback);
+               },
+               
+               /**
+         * mapping of drag events for jQuery
+         */
+               dragEvents : {
+                       'start':'start', 'stop':'stop', 'drag':'drag', 'step':'step',
+                       'over':'over', 'out':'out', 'drop':'drop', 'complete':'complete'
+               },
+                               
+               /**
+                * wrapper around the library's 'extend' functionality (which it hopefully has.
+                * otherwise you'll have to do it yourself). perhaps jsPlumb could do this for you
+                * instead.  it's not like its hard.
+                */
+               extend : function(o1, o2) {
+                       return $.extend(o1, o2);
+               },
+               
+               /**
+                * gets the named attribute from the given element object.  
+                */
+               getAttribute : function(el, attName) {
+                       return el.attr(attName);
+               },
+               
+               getClientXY : function(eventObject) {
+                       return [eventObject.clientX, eventObject.clientY];
+               },
+               
+               /**
+                * takes the args passed to an event function and returns you an object representing that which is being dragged.
+                */
+               getDragObject : function(eventArgs) {
+                       return eventArgs[1].draggable || eventArgs[1].helper;
+               },
+               
+               getDragScope : function(el) {
+                       return el.draggable("option", "scope");
+               },
+
+               getDropEvent : function(args) {
+                       return args[0];
+               },
+               
+               getDropScope : function(el) {
+                       return el.droppable("option", "scope");         
+               },
+
+               /**
+               * gets a DOM element from the given input, which might be a string (in which case we just do document.getElementById),
+               * a selector (in which case we return el[0]), or a DOM element already (we assume this if it's not either of the other
+               * two cases).  this is the opposite of getElementObject below.
+               */
+               getDOMElement : function(el) {
+                       if (typeof(el) == "string") return document.getElementById(el);
+                       else if (el.context || el.length != null) return el[0];
+                       else return el;
+               },
+       
+               /**
+                * gets an "element object" from the given input.  this means an object that is used by the
+                * underlying library on which jsPlumb is running.  'el' may already be one of these objects,
+                * in which case it is returned as-is.  otherwise, 'el' is a String, the library's lookup 
+                * function is used to find the element, using the given String as the element's id.
+                * 
+                */             
+               getElementObject : function(el) {                       
+                       return typeof(el) == "string" ? $("#" + el) : $(el);
+               },
+               
+               /**
+                 * gets the offset for the element object.  this should return a js object like this:
+                 *
+                 * { left:xxx, top: xxx }
+                */
+               getOffset : function(el) {
+                       return el.offset();
+               },
+
+               getOriginalEvent : function(e) {
+                       return e.originalEvent;
+               },
+               
+               getPageXY : function(eventObject) {
+                       return [eventObject.pageX, eventObject.pageY];
+               },
+               
+               getParent : function(el) {
+                       return jsPlumb.CurrentLibrary.getElementObject(el).parent();
+               },
+                                                                                                               
+               getScrollLeft : function(el) {
+                       return el.scrollLeft();
+               },
+               
+               getScrollTop : function(el) {
+                       return el.scrollTop();
+               },
+               
+               getSelector : function(context, spec) {
+            if (arguments.length == 2)
+                return jsPlumb.CurrentLibrary.getElementObject(context).find(spec);
+            else
+                return $(context);
+               },
+               
+               /**
+                * gets the size for the element object, in an array : [ width, height ].
+                */
+               getSize : function(el) {
+                       return [el.outerWidth(), el.outerHeight()];
+               },
+
+        getTagName : function(el) {
+            var e = jsPlumb.CurrentLibrary.getElementObject(el);
+            return e.length > 0 ? e[0].tagName : null;
+        },
+               
+               /**
+                * takes the args passed to an event function and returns you an object that gives the
+                * position of the object being moved, as a js object with the same params as the result of
+                * getOffset, ie: { left: xxx, top: xxx }.
+                * 
+                * different libraries have different signatures for their event callbacks.  
+                * see getDragObject as well
+                */
+               getUIPosition : function(eventArgs, zoom) {
+                       
+                       zoom = zoom || 1;
+                       // this code is a workaround for the case that the element being dragged has a margin set on it. jquery UI passes
+                       // in the wrong offset if the element has a margin (it doesn't take the margin into account).  the getBoundingClientRect
+                       // method, which is in pretty much all browsers now, reports the right numbers.  but it introduces a noticeable lag, which
+                       // i don't like.
+            
+                       /*if ( getBoundingClientRectSupported ) {
+                               var r = eventArgs[1].helper[0].getBoundingClientRect();
+                               return { left : r.left, top: r.top };
+                       } else {*/
+                       if (eventArgs.length == 1) {
+                               ret = { left: eventArgs[0].pageX, top:eventArgs[0].pageY };
+                       }
+                       else {
+                               var ui = eventArgs[1],
+                                 _offset = ui.offset;
+                                 
+                               ret = _offset || ui.absolutePosition;
+                               
+                               // adjust ui position to account for zoom, because jquery ui does not do this.
+                               ui.position.left /= zoom;
+                               ui.position.top /= zoom;
+                       }
+            return { left:ret.left / zoom, top: ret.top / zoom };
+               },              
+               
+               hasClass : function(el, clazz) {
+                       return el.hasClass(clazz);
+               },
+               
+               /**
+                * initialises the given element to be draggable.
+                */
+               initDraggable : function(el, options, isPlumbedComponent) {
+                       options = options || {};
+                       // remove helper directive if present and no override
+                       if (!options.doNotRemoveHelper)
+                               options.helper = null;
+                       if (isPlumbedComponent)
+                               options['scope'] = options['scope'] || jsPlumb.Defaults.Scope;
+                       el.draggable(options);
+               },
+               
+               /**
+                * initialises the given element to be droppable.
+                */
+               initDroppable : function(el, options) {
+                       options['scope'] = options['scope'] || jsPlumb.Defaults.Scope;
+                       el.droppable(options);
+               },
+               
+               isAlreadyDraggable : function(el) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       return el.hasClass("ui-draggable");
+               },
+               
+               /**
+                * returns whether or not drag is supported (by the library, not whether or not it is disabled) for the given element.
+                */
+               isDragSupported : function(el, options) {
+                       return el.draggable;
+               },                              
+                                               
+               /**
+                * returns whether or not drop is supported (by the library, not whether or not it is disabled) for the given element.
+                */
+               isDropSupported : function(el, options) {
+                       return el.droppable;
+               },                                                      
+               
+               /**
+                * removes the given class from the element object.
+                */
+               removeClass : function(el, clazz) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       try {
+                               if (el[0].className.constructor == SVGAnimatedString) {
+                                       jsPlumbUtil.svg.removeClass(el[0], clazz);
+                    return;
+                               }
+                       }
+                       catch (e) {
+                               // SVGAnimatedString not supported; no problem.
+                       }
+                       el.removeClass(clazz);
+               },
+               
+               removeElement : function(element) {                     
+                       jsPlumb.CurrentLibrary.getElementObject(element).remove();
+               },
+               
+               /**
+                * sets the named attribute on the given element object.  
+                */
+               setAttribute : function(el, attName, attValue) {
+                       el.attr(attName, attValue);
+               },
+               
+               /**
+                * sets the draggable state for the given element
+                */
+               setDraggable : function(el, draggable) {
+                       el.draggable("option", "disabled", !draggable);
+               },
+               
+               /**
+                * sets the drag scope.  probably time for a setDragOption method (roll this and the one above together)
+                * @param el
+                * @param scope
+                */
+               setDragScope : function(el, scope) {
+                       el.draggable("option", "scope", scope);
+               },
+               
+               setOffset : function(el, o) {
+                       jsPlumb.CurrentLibrary.getElementObject(el).offset(o);
+               },
+               
+               /**
+                * note that jquery ignores the name of the event you wanted to trigger, and figures it out for itself.
+                * the other libraries do not.  yui, in fact, cannot even pass an original event.  we have to pull out stuff
+                * from the originalEvent to put in an options object for YUI. 
+                * @param el
+                * @param event
+                * @param originalEvent
+                */
+               trigger : function(el, event, originalEvent) {
+                       //originalEvent.stopPropagation();
+                       //jsPlumb.CurrentLibrary.getElementObject(el).trigger(originalEvent);
+            var h = jQuery._data(jsPlumb.CurrentLibrary.getElementObject(el)[0], "handle");
+            h(originalEvent);
+            //originalEvent.stopPropagation();
+               },
+               
+               /**
+                * event unbinding wrapper.  it just so happens that jQuery uses 'unbind' also.  yui3, for example,
+                * uses..something else.
+                */
+               unbind : function(el, event, callback) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       el.unbind(event, callback);
+               }
+       };
+       
+       $(document).ready(jsPlumb.init);
+       
+})(jQuery);
diff --git a/portal/static/unbound_reservation_static/src/drag.js b/portal/static/unbound_reservation_static/src/drag.js
new file mode 100644 (file)
index 0000000..d71db02
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * this is experimental and probably will not be used.  solutions exist for most libraries.  but of course if
+ * i want to support multiple scopes at some stage then i will have to do dragging inside jsPlumb.
+ */ 
+;(function() {
+    
+    window.jsPlumbDrag = function(_jsPlumb) {
+      
+        var ta = new TouchAdapter();
+        
+        this.draggable = function(selector) {
+            var el, elId, da = [], elo, d = false,
+                isInSelector = function(el) {
+                    if (typeof selector == "string")
+                        return selector === _jsPlumb.getId(el);
+                    
+                    for (var i = 0; i < selector.length; i++) {
+                        var _sel = jsPlumb.CurrentLibrary.getDOMElement(selector[i]);
+                        if (_sel == el) return true;
+                    }
+                    return false;
+                };
+                               
+                       ta.bind(document, "mousedown", function(e) {
+                var target = e.target || e.srcElement;
+                if (isInSelector(target)) {
+                    el = jsPlumb.CurrentLibrary.getElementObject(target);
+                    elId = _jsPlumb.getId(el);
+                    elo = jsPlumb.CurrentLibrary.getOffset(el);
+                    da = [e.pageX, e.pageY];
+                    d = true;
+                }
+                       });
+                       
+                       ta.bind(document, "mousemove", function(e) {
+                               if (d) {
+                                       var dx = e.pageX - da[0],
+                                               dy = e.pageY - da[1];
+                                               
+                                       jsPlumb.CurrentLibrary.setOffset(el, {
+                                               left:elo.left + dx,
+                                               top:elo.top + dy
+                                       });
+                                       _jsPlumb.repaint(elId);
+                                       e.preventDefault();
+                                       e.stopPropagation();
+                               }
+                       });
+                       ta.bind(document, "mouseup", function(e) {
+                               el = null;
+                               d = false;                              
+                       });    
+        };
+        
+        var isIOS = ((/iphone|ipad/gi).test(navigator.appVersion));
+        if (isIOS)
+            _jsPlumb.draggable = this.draggable;
+        
+    };
+    
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/endpoint.js b/portal/static/unbound_reservation_static/src/endpoint.js
new file mode 100644 (file)
index 0000000..8da35a5
--- /dev/null
@@ -0,0 +1,997 @@
+
+;(function() {
+        
+    // create the drag handler for a connection
+    var _makeConnectionDragHandler = function(placeholder, _jsPlumb) {
+        var stopped = false;
+        return {
+            drag : function() {
+                if (stopped) {
+                    stopped = false;
+                    return true;
+                }
+                var _ui = jsPlumb.CurrentLibrary.getUIPosition(arguments, _jsPlumb.getZoom());
+        
+                if (placeholder.element) {
+                    jsPlumb.CurrentLibrary.setOffset(placeholder.element, _ui);                    
+                    _jsPlumb.repaint(placeholder.element, _ui);
+                }
+            },
+            stopDrag : function() {
+                stopped = true;
+            }
+        };
+    };
+        
+    // creates a placeholder div for dragging purposes, adds it to the DOM, and pre-computes its offset.    
+    var _makeDraggablePlaceholder = function(placeholder, parent, _jsPlumb) {
+        var n = document.createElement("div");
+        n.style.position = "absolute";
+        var placeholderDragElement = jsPlumb.CurrentLibrary.getElementObject(n);
+        jsPlumb.CurrentLibrary.appendElement(n, parent);
+        var id = _jsPlumb.getId(n);
+        _jsPlumb.updateOffset( { elId : id });
+        // create and assign an id, and initialize the offset.
+        placeholder.id = id;
+        placeholder.element = n;
+    };
+    
+    // create a floating endpoint (for drag connections)
+    var _makeFloatingEndpoint = function(paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint) {                      
+        var floatingAnchor = new jsPlumb.FloatingAnchor( { reference : referenceAnchor, referenceCanvas : referenceCanvas, jsPlumbInstance:_jsPlumb });
+        //setting the scope here should not be the way to fix that mootools issue.  it should be fixed by not
+        // adding the floating endpoint as a droppable.  that makes more sense anyway!
+        return _newEndpoint({ paintStyle : paintStyle, endpoint : endpoint, anchor : floatingAnchor, source : sourceElement, scope:"__floating" });
+    };
+
+    var typeParameters = [ "connectorStyle", "connectorHoverStyle", "connectorOverlays",
+                "connector", "connectionType", "connectorClass", "connectorHoverClass" ];
+
+    // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,
+    // or no connection to it is found, we return the first connection in our list.
+    var findConnectionToUseForDynamicAnchor = function(ep, elementWithPrecedence) {
+        var idx = 0;
+        if (elementWithPrecedence != null) {
+            for (var i = 0; i < ep.connections.length; i++) {
+                if (ep.connections[i].sourceId == elementWithPrecedence || ep.connections[i].targetId == elementWithPrecedence) {
+                    idx = i;
+                    break;
+                }
+            }
+        }
+        
+        return ep.connections[idx];
+    };
+
+    var findConnectionIndex = function(conn, ep) {
+        return jsPlumbUtil.findWithFunction(ep.connections, function(c) { return c.id == conn.id; });
+    };
+
+    jsPlumb.Endpoint = function(params) {
+        var _jsPlumb = params._jsPlumb,
+            jpcl = jsPlumb.CurrentLibrary,
+            _att = jsPlumbAdapter.getAttribute,
+            _gel = jpcl.getElementObject,
+            _dom = jpcl.getDOMElement,
+            _ju = jsPlumbUtil,            
+            _newConnection = params.newConnection,
+            _newEndpoint = params.newEndpoint,
+            _finaliseConnection = params.finaliseConnection,
+            _fireDetachEvent = params.fireDetachEvent,
+            _fireMoveEvent = params.fireMoveEvent,
+            floatingConnections = params.floatingConnections;
+        
+        this.idPrefix = "_jsplumb_e_";                 
+        this.defaultLabelLocation = [ 0.5, 0.5 ];
+        this.defaultOverlayKeys = ["Overlays", "EndpointOverlays"];
+        this.parent = params.parent;
+        OverlayCapableJsPlumbUIComponent.apply(this, arguments);        
+        
+// TYPE                
+                
+        this.getDefaultType = function() {                                                             
+            return {
+                parameters:{},
+                scope:null,
+                maxConnections:this._jsPlumb.instance.Defaults.MaxConnections,
+                paintStyle:this._jsPlumb.instance.Defaults.EndpointStyle || jsPlumb.Defaults.EndpointStyle,
+                endpoint:this._jsPlumb.instance.Defaults.Endpoint || jsPlumb.Defaults.Endpoint,
+                hoverPaintStyle:this._jsPlumb.instance.Defaults.EndpointHoverStyle || jsPlumb.Defaults.EndpointHoverStyle,                             
+                overlays:this._jsPlumb.instance.Defaults.EndpointOverlays || jsPlumb.Defaults.EndpointOverlays,
+                connectorStyle:params.connectorStyle,                          
+                connectorHoverStyle:params.connectorHoverStyle,
+                connectorClass:params.connectorClass,
+                connectorHoverClass:params.connectorHoverClass,
+                connectorOverlays:params.connectorOverlays,
+                connector:params.connector,
+                connectorTooltip:params.connectorTooltip
+            };
+        };
+                               
+// END TYPE
+            
+        this._jsPlumb.enabled = !(params.enabled === false);
+        this._jsPlumb.visible = true;        
+        this.element = _dom(params.source);  
+        this._jsPlumb.uuid = params.uuid;
+        this._jsPlumb.floatingEndpoint = null;  
+        var inPlaceCopy = null;
+        if (this._jsPlumb.uuid) params.endpointsByUUID[this._jsPlumb.uuid] = this;
+        this.elementId = params.elementId;
+        
+        this._jsPlumb.connectionCost = params.connectionCost;
+        this._jsPlumb.connectionsDirected = params.connectionsDirected;        
+        this._jsPlumb.currentAnchorClass = "";
+        this._jsPlumb.events = {};
+            
+        var  _updateAnchorClass = function() {
+            jpcl.removeClass(this.element, _jsPlumb.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);
+            this.removeClass(_jsPlumb.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);
+            this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();
+            this.addClass(_jsPlumb.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);
+            jpcl.addClass(this.element, _jsPlumb.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);
+        }.bind(this);
+        
+        this.setAnchor = function(anchorParams, doNotRepaint) {
+            this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);
+            this.anchor = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);
+            _updateAnchorClass();
+            this.anchor.bind("anchorChanged", function(currentAnchor) {
+                this.fire("anchorChanged", {endpoint:this, anchor:currentAnchor});
+                _updateAnchorClass();
+            }.bind(this));
+            if (!doNotRepaint)
+                this._jsPlumb.instance.repaint(this.elementId);
+            return this;
+        };
+
+        var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || "Top");
+        this.setAnchor(anchorParamsToUse, true);
+
+        // endpoint delegates to first connection for hover, if there is one.
+        var internalHover = function(state) {
+          if (this.connections.length > 0)
+            this.connections[0].setHover(state, false);
+          else
+            this.setHover(state);
+        }.bind(this);
+            
+        // ANCHOR MANAGER
+        if (!params._transient) // in place copies, for example, are transient.  they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.
+            this._jsPlumb.instance.anchorManager.add(this, this.elementId);
+        
+        this.setEndpoint = function(ep) {
+
+            if (this.endpoint != null) {
+                this.endpoint.cleanup();
+                this.endpoint.destroy();
+            }
+
+            var _e = function(t, p) {
+                var rm = _jsPlumb.getRenderMode();
+                if (jsPlumb.Endpoints[rm][t]) return new jsPlumb.Endpoints[rm][t](p);
+                if (!_jsPlumb.Defaults.DoNotThrowErrors)
+                    throw { msg:"jsPlumb: unknown endpoint type '" + t + "'" };
+            };            
+
+            var endpointArgs = {
+                _jsPlumb:this._jsPlumb.instance,
+                cssClass:params.cssClass,
+                parent:params.parent,
+                container:params.container,
+                tooltip:params.tooltip,
+                connectorTooltip:params.connectorTooltip,
+                endpoint:this
+            };
+            if (_ju.isString(ep)) 
+                this.endpoint = _e(ep, endpointArgs);
+            else if (_ju.isArray(ep)) {
+                endpointArgs = _ju.merge(ep[1], endpointArgs);
+                this.endpoint = _e(ep[0], endpointArgs);
+            }
+            else {
+                this.endpoint = ep.clone();
+            }
+
+            // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,
+            // and the clone is left in its place while the original one goes off on a magical journey. 
+            // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by
+            // the whole world.
+            var argsForClone = jsPlumb.extend({}, endpointArgs);                                               
+            this.endpoint.clone = function() {
+                // TODO this, and the code above, can be refactored to be more dry.
+                if (_ju.isString(ep)) 
+                    return _e(ep, endpointArgs);
+                else if (_ju.isArray(ep)) {
+                    endpointArgs = _ju.merge(ep[1], endpointArgs);
+                    return _e(ep[0], endpointArgs);
+                }
+            }.bind(this);
+
+            this.type = this.endpoint.type;
+            // bind listeners from endpoint to self, with the internal hover function defined above.
+            this.bindListeners(this.endpoint, this, internalHover);
+        };
+         
+        this.setEndpoint(params.endpoint || _jsPlumb.Defaults.Endpoint || jsPlumb.Defaults.Endpoint || "Dot");                                                                     
+        this.setPaintStyle(params.paintStyle || params.style || _jsPlumb.Defaults.EndpointStyle || jsPlumb.Defaults.EndpointStyle, true);
+        this.setHoverPaintStyle(params.hoverPaintStyle || _jsPlumb.Defaults.EndpointHoverStyle || jsPlumb.Defaults.EndpointHoverStyle, true);
+        this._jsPlumb.paintStyleInUse = this.getPaintStyle();
+
+        _ju.copyValues(typeParameters, params, this);        
+
+        this.isSource = params.isSource || false;
+        this.isTarget = params.isTarget || false;        
+        this._jsPlumb.maxConnections = params.maxConnections || _jsPlumb.Defaults.MaxConnections; // maximum number of connections this endpoint can be the source of.                
+        this.canvas = this.endpoint.canvas;            
+        // add anchor class (need to do this on construction because we set anchor first)
+        this.addClass(_jsPlumb.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);    
+        jpcl.addClass(this.element, _jsPlumb.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);
+        this.connections = params.connections || [];
+        this.connectorPointerEvents = params["connector-pointer-events"];
+        
+        this.scope = params.scope || _jsPlumb.getDefaultScope();        
+        this.timestamp = null;
+        this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;
+        this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;
+        if (params.connectionsDetachable === false || params.detachable === false)
+            this.connectionsDetachable = false;
+        this.dragAllowedWhenFull = params.dragAllowedWhenFull || true;
+        
+        if (params.onMaxConnections)
+            this.bind("maxConnections", params.onMaxConnections);        
+        
+        //
+        // add a connection. not part of public API.
+        //
+        this.addConnection = function(connection) {
+            this.connections.push(connection);                  
+            this[(this.connections.length > 0 ? "add" : "remove") + "Class"](_jsPlumb.endpointConnectedClass);       
+            this[(this.isFull() ? "add" : "remove") + "Class"](_jsPlumb.endpointFullClass); 
+        };     
+        
+        this.detachFromConnection = function(connection, idx) {
+            idx = idx == null ? findConnectionIndex(connection, this) : idx;
+            if (idx >= 0) {
+                this.connections.splice(idx, 1);
+                this[(this.connections.length > 0 ? "add" : "remove") + "Class"](_jsPlumb.endpointConnectedClass);       
+                this[(this.isFull() ? "add" : "remove") + "Class"](_jsPlumb.endpointFullClass);                 
+            }
+        };
+
+        this.detach = function(connection, ignoreTarget, forceDetach, fireEvent, originalEvent, endpointBeingDeleted, connectionIndex) {
+
+            var idx = connectionIndex == null ? findConnectionIndex(connection, this) : connectionIndex,
+                actuallyDetached = false;
+                fireEvent = (fireEvent !== false);
+
+            if (idx >= 0) {                            
+                if (forceDetach || connection._forceDetach || (connection.isDetachable() && connection.isDetachAllowed(connection) && this.isDetachAllowed(connection) )) {
+
+                    //connection.setHover(false);
+
+                    _jsPlumb.deleteObject({
+                        connection:connection, 
+                        fireEvent:(!ignoreTarget && fireEvent), 
+                        originalEvent:originalEvent
+                    });
+                    actuallyDetached = true;                       
+                }
+            }
+            return actuallyDetached;
+        };     
+
+        this.detachAll = function(fireEvent, originalEvent) {
+            while (this.connections.length > 0) {
+                // TODO this could pass the index in to the detach method to save some time (index will always be zero in this while loop)
+                // TODO now it defaults to fireEvent true.  will that mess with things?
+                this.detach(this.connections[0], false, true, fireEvent !== false, originalEvent, this, 0);
+            }
+            return this;
+        };                
+        this.detachFrom = function(targetEndpoint, fireEvent, originalEvent) {
+            var c = [];
+            for ( var i = 0; i < this.connections.length; i++) {
+                if (this.connections[i].endpoints[1] == targetEndpoint || this.connections[i].endpoints[0] == targetEndpoint) {
+                    c.push(this.connections[i]);
+                }
+            }
+            for ( var j = 0; j < c.length; j++) {
+                this.detach(c[j], false, true, fireEvent, originalEvent);                              
+            }
+            return this;
+        };             
+        
+        this.getElement = function() {
+            return this.element;
+        };             
+                 
+        // container not supported in 1.5.5; you cannot change the container once it is set.
+        // it might come back int a future release.
+        this.setElement = function(el/*, container*/) {
+            var parentId = this._jsPlumb.instance.getId(el),
+                curId = this.elementId;
+            // remove the endpoint from the list for the current endpoint's element
+            _ju.removeWithFunction(params.endpointsByElement[this.elementId], function(e) {
+                return e.id == this.id;
+            }.bind(this));
+            this.element = _dom(el);
+            this.elementId = _jsPlumb.getId(this.element);                         
+            _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);
+            _jsPlumb.dragManager.endpointAdded(this.element);            
+            _ju.addToList(params.endpointsByElement, parentId, this);            
+            return this;
+        };
+                
+        /**
+         * private but must be exposed.
+         */
+        this.makeInPlaceCopy = function() {
+            var loc = this.anchor.getCurrentLocation({element:this}),
+                o = this.anchor.getOrientation(this),
+                acc = this.anchor.getCssClass(),
+                inPlaceAnchor = {
+                    bind:function() { },
+                    compute:function() { return [ loc[0], loc[1] ]; },
+                    getCurrentLocation : function() { return [ loc[0], loc[1] ]; },
+                    getOrientation:function() { return o; },
+                    getCssClass:function() { return acc; }
+                };
+
+            return _newEndpoint( { 
+                anchor : inPlaceAnchor, 
+                source : this.element, 
+                paintStyle : this.getPaintStyle(), 
+                endpoint : params.hideOnDrag ? "Blank" : this.endpoint,
+                _transient:true,
+                scope:this.scope
+            });
+        };
+                
+
+        /**
+         * private but needs to be exposed.
+         */
+        this.isFloating = function() {
+            return this.anchor != null && this.anchor.isFloating;
+        };
+        
+        /**
+         * returns a connection from the pool; used when dragging starts.  just gets the head of the array if it can.
+         */
+        this.connectorSelector = function() {
+            var candidate = this.connections[0];
+            if (this.isTarget && candidate) return candidate;
+            else {
+                return (this.connections.length < this._jsPlumb.maxConnections) || this._jsPlumb.maxConnections == -1 ? null : candidate;
+            }
+        };        
+        
+        this.setStyle = this.setPaintStyle;        
+        
+        this.paint = function(params) {
+            params = params || {};
+            var timestamp = params.timestamp, recalc = !(params.recalc === false);                                                             
+            if (!timestamp || this.timestamp !== timestamp) {                                          
+                
+                // TODO check: is this is a safe performance enhancement?
+                var info = _jsPlumb.updateOffset({ elId:this.elementId, timestamp:timestamp/*, recalc:recalc*/ });                
+
+                var xy = params.offset ? params.offset.o : info.o;
+                if(xy != null) {
+                    var ap = params.anchorPoint,connectorPaintStyle = params.connectorPaintStyle;
+                    if (ap == null) {
+                        var wh = params.dimensions || info.s,                       
+                            anchorParams = { xy : [ xy.left, xy.top ], wh : wh, element : this, timestamp : timestamp };
+                        if (recalc && this.anchor.isDynamic && this.connections.length > 0) {
+                            var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),
+                                oIdx = c.endpoints[0] == this ? 1 : 0,
+                                oId = oIdx === 0 ? c.sourceId : c.targetId,
+                                oInfo = _jsPlumb.getCachedData(oId),
+                                oOffset = oInfo.o, oWH = oInfo.s;
+                            anchorParams.txy = [ oOffset.left, oOffset.top ];
+                            anchorParams.twh = oWH;
+                            anchorParams.tElement = c.endpoints[oIdx];
+                        }
+                        ap = this.anchor.compute(anchorParams);
+                    }
+                                        
+                    this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);
+                    this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);                                   
+                    this.timestamp = timestamp;
+
+                    // paint overlays
+                    for ( var i = 0; i < this._jsPlumb.overlays.length; i++) {
+                        var o = this._jsPlumb.overlays[i];
+                        if (o.isVisible()) { 
+                            this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);
+                            o.paint(this._jsPlumb.overlayPlacements[i]);    
+                        }
+                    }
+                }
+            }
+        };
+
+        this.repaint = this.paint; 
+
+        var draggingInitialised = false;
+        this.initDraggable = function() {
+            // is this a connection source? we make it draggable and have the
+            // drag listener maintain a connection with a floating endpoint.
+            if (!draggingInitialised && jpcl.isDragSupported(this.element)) {
+                var placeholderInfo = { id:null, element:null },
+                    jpc = null,
+                    existingJpc = false,
+                    existingJpcParams = null,
+                    _dragHandler = _makeConnectionDragHandler(placeholderInfo, _jsPlumb);
+
+                var start = function() {    
+                // drag might have started on an endpoint that is not actually a source, but which has
+                // one or more connections.
+                    jpc = this.connectorSelector();
+                    var _continue = true;
+                    // if not enabled, return
+                    if (!this.isEnabled()) _continue = false;
+                    // if no connection and we're not a source, return.
+                    if (jpc == null && !this.isSource) _continue = false;
+                    // otherwise if we're full and not allowed to drag, also return false.
+                    if (this.isSource && this.isFull() && !this.dragAllowedWhenFull) _continue = false;
+                    // if the connection was setup as not detachable or one of its endpoints
+                    // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable
+                    // is set to false...
+                    if (jpc != null && !jpc.isDetachable()) _continue = false;
+
+                    if (_continue === false) {
+                        // this is for mootools and yui. returning false from this causes jquery to stop drag.
+                        // the events are wrapped in both mootools and yui anyway, but i don't think returning
+                        // false from the start callback would stop a drag.
+                        if (jpcl.stopDrag) jpcl.stopDrag();
+                        _dragHandler.stopDrag();
+                        return false;
+                    }
+
+                    // clear hover for all connections for this endpoint before continuing.
+                    for (var i = 0; i < this.connections.length; i++)
+                        this.connections[i].setHover(false);
+
+                    this.addClass("endpointDrag");
+                    _jsPlumb.setConnectionBeingDragged(true);
+
+                    // if we're not full but there was a connection, make it null. we'll create a new one.
+                    if (jpc && !this.isFull() && this.isSource) jpc = null;
+
+                    _jsPlumb.updateOffset( { elId : this.elementId });
+                    inPlaceCopy = this.makeInPlaceCopy();
+                    inPlaceCopy.referenceEndpoint = this;
+                    inPlaceCopy.paint();                                                                
+                    
+                    _makeDraggablePlaceholder(placeholderInfo, this.parent, _jsPlumb);
+                    
+                    // set the offset of this div to be where 'inPlaceCopy' is, to start with.
+                    // TODO merge this code with the code in both Anchor and FloatingAnchor, because it
+                    // does the same stuff.
+                    var ipcoel = _gel(inPlaceCopy.canvas),
+                        ipco = jsPlumb.CurrentLibrary.getOffset(ipcoel, _jsPlumb),
+                        po = _jsPlumb.adjustForParentOffsetAndScroll([ipco.left, ipco.top], inPlaceCopy.canvas),
+                        canvasElement = _gel(this.canvas);                               
+                        
+                    jpcl.setOffset(placeholderInfo.element, {left:po[0], top:po[1]});                                                           
+                    
+                    // when using makeSource and a parent, we first draw the source anchor on the source element, then
+                    // move it to the parent.  note that this happens after drawing the placeholder for the
+                    // first time.
+                    if (this.parentAnchor) this.anchor = _jsPlumb.makeAnchor(this.parentAnchor, this.elementId, _jsPlumb);
+                    
+                    // store the id of the dragging div and the source element. the drop function will pick these up.                   
+                    _jsPlumb.setAttribute(this.canvas, "dragId", placeholderInfo.id);
+                    _jsPlumb.setAttribute(this.canvas, "elId", this.elementId);
+
+                    this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), this.anchor, this.endpoint, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint);
+                    // TODO we should not know about DOM here. make the library adapter do this (or the 
+                        // dom adapter)
+                    this.canvas.style.visibility = "hidden";            
+                    
+                    if (jpc == null) {                                                                                                                                                         
+                        this.anchor.locked = true;
+                        this.setHover(false, false);                        
+                        // create a connection. one end is this endpoint, the other is a floating endpoint.                    
+                        jpc = _newConnection({
+                            sourceEndpoint : this,
+                            targetEndpoint : this._jsPlumb.floatingEndpoint,
+                            source : this.endpointWillMoveTo || this.element,  // for makeSource with parent option.  ensure source element is represented correctly.
+                            target : placeholderInfo.element,
+                            anchors : [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],
+                            paintStyle : params.connectorStyle, // this can be null. Connection will use the default.
+                            hoverPaintStyle:params.connectorHoverStyle,
+                            connector : params.connector, // this can also be null. Connection will use the default.
+                            overlays : params.connectorOverlays,
+                            type:this.connectionType,
+                            cssClass:this.connectorClass,
+                            hoverClass:this.connectorHoverClass
+                        });
+                        jpc.pending = true; // mark this connection as not having been established.
+                        jpc.addClass(_jsPlumb.draggingClass);
+                        this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);
+                        // fire an event that informs that a connection is being dragged                        
+                        _jsPlumb.fire("connectionDrag", jpc);
+
+                    } else {
+                        existingJpc = true;
+                        jpc.setHover(false);                        
+                        // if existing connection, allow to be dropped back on the source endpoint (issue 51).
+                        _initDropTarget(ipcoel, false, true);
+                        // new anchor idx
+                        var anchorIdx = jpc.endpoints[0].id == this.id ? 0 : 1;
+                        jpc.floatingAnchorIndex = anchorIdx;                    // save our anchor index as the connection's floating index.                        
+                        this.detachFromConnection(jpc);                         // detach from the connection while dragging is occurring.
+                        
+                        // store the original scope (issue 57)
+                        var dragScope = jsPlumb.CurrentLibrary.getDragScope(canvasElement);
+                        _jsPlumb.setAttribute(this.canvas, "originalScope", dragScope);
+                        // now we want to get this endpoint's DROP scope, and set it for now: we can only be dropped on drop zones
+                        // that have our drop scope (issue 57).
+                        var dropScope = jpcl.getDropScope(canvasElement);
+                        jpcl.setDragScope(canvasElement, dropScope);
+
+                        // fire an event that informs that a connection is being dragged. we do this before
+                        // replacing the original target with the floating element info.
+                        _jsPlumb.fire("connectionDrag", jpc);
+                
+                        // now we replace ourselves with the temporary div we created above:
+                        if (anchorIdx === 0) {
+                            existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];
+                            jpc.source = placeholderInfo.element;
+                            jpc.sourceId = placeholderInfo.id;
+                        } else {
+                            existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];
+                            jpc.target = placeholderInfo.element;
+                            jpc.targetId = placeholderInfo.id;
+                        }
+
+                        // lock the other endpoint; if it is dynamic it will not move while the drag is occurring.
+                        jpc.endpoints[anchorIdx === 0 ? 1 : 0].anchor.locked = true;
+                        // store the original endpoint and assign the new floating endpoint for the drag.
+                        jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];
+                        
+                        // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)
+                        jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();
+                        jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;
+                        jpc.suspendedElementType = anchorIdx === 0 ? "source" : "target";
+                        
+                        jpc.suspendedEndpoint.setHover(false);
+                        this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;
+                        jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;
+
+                        jpc.addClass(_jsPlumb.draggingClass);
+                        this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);                    
+
+                    }
+                    // register it and register connection on it.
+                    floatingConnections[placeholderInfo.id] = jpc;
+                    _jsPlumb.anchorManager.addFloatingConnection(placeholderInfo.id, jpc);               
+                    // only register for the target endpoint; we will not be dragging the source at any time
+                    // before this connection is either discarded or made into a permanent connection.
+                    _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);
+                    // tell jsplumb about it
+                    _jsPlumb.currentlyDragging = true;
+                }.bind(this);
+
+                var dragOptions = params.dragOptions || {},
+                    defaultOpts = jsPlumb.extend( {}, jpcl.defaultDragOptions),
+                    startEvent = jpcl.dragEvents.start,
+                    stopEvent = jpcl.dragEvents.stop,
+                    dragEvent = jpcl.dragEvents.drag;
+                
+                dragOptions = jsPlumb.extend(defaultOpts, dragOptions);
+                dragOptions.scope = dragOptions.scope || this.scope;
+                dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);
+                // extracted drag handler function so can be used by makeSource
+                dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);
+                dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent],
+                    function() {        
+
+                        _jsPlumb.setConnectionBeingDragged(false);  
+                        // if no endpoints, jpc already cleaned up.
+                        if (jpc.endpoints != null) {          
+                            // get the actual drop event (decode from library args to stop function)
+                            var originalEvent = jpcl.getDropEvent(arguments);                                       
+                            // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)
+                            var idx = jpc.floatingAnchorIndex == null ? 1 : jpc.floatingAnchorIndex;
+                            jpc.endpoints[idx === 0 ? 1 : 0].anchor.locked = false;
+                            // WHY does this need to happen?  i suppose because the connection might not get 
+                            // deleted.  TODO: i dont want to know about css classes inside jsplumb, ideally.
+                            jpc.removeClass(_jsPlumb.draggingClass);   
+                        
+                            // if we have the floating endpoint then the connection has not been dropped
+                            // on another endpoint.  If it is a new connection we throw it away. If it is an 
+                            // existing connection we check to see if we should reattach it, throwing it away 
+                            // if not.
+                            if (jpc.endpoints[idx] == this._jsPlumb.floatingEndpoint) {
+                                // 6a. if the connection was an existing one...
+                                if (existingJpc && jpc.suspendedEndpoint) {
+                                    // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the
+                                    // floating endpoint has been replaced.
+                                    if (idx === 0) {
+                                        jpc.source = existingJpcParams[0];
+                                        jpc.sourceId = existingJpcParams[1];
+                                    } else {
+                                        jpc.target = existingJpcParams[0];
+                                        jpc.targetId = existingJpcParams[1];
+                                    }
+                                    
+                                    // restore the original scope (issue 57)
+                                    jpcl.setDragScope(existingJpcParams[2], existingJpcParams[3]);
+                                    jpc.endpoints[idx] = jpc.suspendedEndpoint;
+                                    // IF the connection should be reattached, or the other endpoint refuses detach, then
+                                    // reset the connection to its original state
+                                    if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !jpc.endpoints[idx === 0 ? 1 : 0].detach(jpc, false, false, true, originalEvent)) {                                   
+                                        jpc.setHover(false);
+                                        jpc.floatingAnchorIndex = null;
+                                        jpc._forceDetach = null;
+                                        jpc._forceReattach = null;
+                                        this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);
+                                        jpc.suspendedEndpoint.addConnection(jpc);
+                                        _jsPlumb.repaint(existingJpcParams[1]);
+                                    }
+                                }                                                               
+                            }
+                        }
+
+                        // remove the element associated with the floating endpoint 
+                        // (and its associated floating endpoint and visual artefacts)                                        
+                        _jsPlumb.remove(placeholderInfo.element, false);
+                        // remove the inplace copy
+                        _jsPlumb.remove(inPlaceCopy.canvas, false);
+
+                        // makeTargets sets this flag, to tell us we have been replaced and should delete ourself.
+                        if (this.deleteAfterDragStop) {                        
+                            _jsPlumb.deleteObject({endpoint:this});
+                        }
+                        else {
+                            if (this._jsPlumb) {
+                                this._jsPlumb.floatingEndpoint = null;
+                                // repaint this endpoint.
+                                // make our canvas visible (TODO: hand off to library; we should not know about DOM)
+                                this.canvas.style.visibility = "visible";
+                                // unlock our anchor
+                                this.anchor.locked = false;
+                                this.paint({recalc:false});                        
+                            }
+                        }                                                    
+
+                        // although the connection is no longer valid, there are use cases where this is useful.
+                        _jsPlumb.fire("connectionDragStop", jpc, originalEvent);
+
+                        // tell jsplumb that dragging is finished.
+                        _jsPlumb.currentlyDragging = false;
+
+                        jpc = null;
+
+                    }.bind(this));
+                
+                var i = _gel(this.canvas);              
+                jpcl.initDraggable(i, dragOptions, true, _jsPlumb);
+
+                draggingInitialised = true;
+            }
+        };
+
+        // if marked as source or target at create time, init the dragging.
+        if (this.isSource || this.isTarget)
+            this.initDraggable();        
+
+        // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections
+        // back onto the endpoint you detached it from.
+        var _initDropTarget = function(canvas, forceInit, isTransient, endpoint) {
+            if ((this.isTarget || forceInit) && jpcl.isDropSupported(this.element)) {
+                var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || jsPlumb.Defaults.DropOptions;
+                dropOptions = jsPlumb.extend( {}, dropOptions);
+                dropOptions.scope = dropOptions.scope || this.scope;
+                var dropEvent = jpcl.dragEvents.drop,
+                    overEvent = jpcl.dragEvents.over,
+                    outEvent = jpcl.dragEvents.out,
+                    drop = function() {                        
+
+                        this.removeClass(_jsPlumb.endpointDropAllowedClass);
+                        this.removeClass(_jsPlumb.endpointDropForbiddenClass);
+                                                    
+                        var originalEvent = jpcl.getDropEvent(arguments),
+                            draggable = _gel(jpcl.getDragObject(arguments)),
+                            id = _jsPlumb.getAttribute(draggable, "dragId"),
+                            elId = _jsPlumb.getAttribute(draggable, "elId"),                                           
+                            scope = _jsPlumb.getAttribute(draggable, "originalScope"),
+                            jpc = floatingConnections[id];
+                            
+                        // if this is a drop back where the connection came from, mark it force rettach and
+                        // return; the stop handler will reattach. without firing an event.
+                        var redrop = jpc.suspendedEndpoint && (jpc.suspendedEndpoint.id == this.id ||
+                                        this.referenceEndpoint && jpc.suspendedEndpoint.id == this.referenceEndpoint.id) ;                                                     
+                        if (redrop) {                                                          
+                            jpc._forceReattach = true;
+                            return;
+                        }
+
+                        if (jpc != null) {
+                            var idx = jpc.floatingAnchorIndex == null ? 1 : jpc.floatingAnchorIndex, oidx = idx === 0 ? 1 : 0;
+                            
+                            // restore the original scope if necessary (issue 57)                                              
+                            if (scope) jsPlumb.CurrentLibrary.setDragScope(draggable, scope);                                                  
+                            
+                            var endpointEnabled = endpoint != null ? endpoint.isEnabled() : true;
+                            
+                            if (this.isFull()) {
+                                this.fire("maxConnections", { 
+                                    endpoint:this, 
+                                    connection:jpc, 
+                                    maxConnections:this._jsPlumb.maxConnections 
+                                }, originalEvent);
+                            }
+                                                            
+                            if (!this.isFull() && !(idx === 0 && !this.isSource) && !(idx == 1 && !this.isTarget) && endpointEnabled) {
+                                var _doContinue = true;
+
+                                // the second check here is for the case that the user is dropping it back
+                                // where it came from.
+                                if (jpc.suspendedEndpoint && jpc.suspendedEndpoint.id != this.id) {
+                                    if (idx === 0) {
+                                        jpc.source = jpc.suspendedEndpoint.element;
+                                        jpc.sourceId = jpc.suspendedEndpoint.elementId;
+                                    } else {
+                                        jpc.target = jpc.suspendedEndpoint.element;
+                                        jpc.targetId = jpc.suspendedEndpoint.elementId;
+                                    }
+
+                                    if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition("beforeDetach", jpc))
+                                        _doContinue = false;                                                           
+                                }
+            
+                                // these have to be set before testing for beforeDrop.
+                                if (idx === 0) {
+                                    jpc.source = this.element;
+                                    jpc.sourceId = this.elementId;
+                                } else {
+                                    jpc.target = this.element;
+                                    jpc.targetId = this.elementId;
+                                }
+                                                            
+// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop                                                                                                                                
+                                    
+                                // we want to execute this regardless.
+                                var commonFunction = function() {
+                                    jpc.floatingAnchorIndex = null;
+                                };     
+                                                                                                
+                                var continueFunction = function() {
+                                    jpc.pending = false;
+
+                                    // remove this jpc from the current endpoint
+                                    jpc.endpoints[idx].detachFromConnection(jpc);
+                                    if (jpc.suspendedEndpoint) jpc.suspendedEndpoint.detachFromConnection(jpc);
+                                    jpc.endpoints[idx] = this;
+                                    this.addConnection(jpc);
+                                    
+                                    // copy our parameters in to the connection:
+                                    var params = this.getParameters();
+                                    for (var aParam in params)
+                                        jpc.setParameter(aParam, params[aParam]);
+
+                                    if (!jpc.suspendedEndpoint) {  
+                                        // if not an existing connection and
+                                        if (params.draggable)
+                                            jsPlumb.CurrentLibrary.initDraggable(this.element, dragOptions, true, _jsPlumb);
+                                    }
+                                    else {
+                                        var suspendedElement = jpc.suspendedEndpoint.getElement(), suspendedElementId = jpc.suspendedEndpoint.elementId;
+                                        _fireMoveEvent({
+                                            index:idx,
+                                            originalSourceId:idx === 0 ? suspendedElementId : jpc.sourceId,
+                                            newSourceId:idx === 0 ? this.elementId : jpc.sourceId,
+                                            originalTargetId:idx == 1 ? suspendedElementId : jpc.targetId,
+                                            newTargetId:idx == 1 ? this.elementId : jpc.targetId,
+                                            originalSourceEndpoint:idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],
+                                            newSourceEndpoint:idx === 0 ? this : jpc.endpoints[0],
+                                            originalTargetEndpoint:idx == 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],
+                                            newTargetEndpoint:idx == 1 ? this : jpc.endpoints[1],
+                                            connection:jpc
+                                        }, originalEvent);
+                                       /* var suspendedElement = jpc.suspendedEndpoint.getElement(), suspendedElementId = jpc.suspendedEndpoint.elementId;
+                                        // fire a detach event
+                                        _fireDetachEvent({
+                                            source : idx === 0 ? suspendedElement : jpc.source, 
+                                            target : idx == 1 ? suspendedElement : jpc.target,
+                                            sourceId : idx === 0 ? suspendedElementId : jpc.sourceId, 
+                                            targetId : idx == 1 ? suspendedElementId : jpc.targetId,
+                                            sourceEndpoint : idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0], 
+                                            targetEndpoint : idx == 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],
+                                            connection : jpc
+                                        }, true, originalEvent);*/
+                                    }
+
+                                    // TODO this is like the makeTarget drop code.
+                                    if (idx == 1)
+                                        _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.suspendedElementId, jpc.targetId, jpc);
+                                    else                                    
+                                        _jsPlumb.anchorManager.sourceChanged(jpc.suspendedEndpoint.elementId, jpc.sourceId, jpc);                                   
+
+                                    // finalise will inform the anchor manager and also add to
+                                    // connectionsByScope if necessary.
+                                    // TODO if this is not set to true, then dragging a connection's target to a new
+                                    // target causes the connection to be forgotten. however if it IS set to true, then
+                                    // the opposite happens: dragging by source causes the connection to get forgotten
+                                    // about and then if you delete it jsplumb breaks.
+                                    _finaliseConnection(jpc, null, originalEvent/*, true*/);
+                                    
+                                    commonFunction();
+                                }.bind(this);
+                                
+                                var dontContinueFunction = function() {
+                                    // otherwise just put it back on the endpoint it was on before the drag.
+                                    if (jpc.suspendedEndpoint) {                                                                       
+                                        jpc.endpoints[idx] = jpc.suspendedEndpoint;
+                                        jpc.setHover(false);
+                                        jpc._forceDetach = true;
+                                        if (idx === 0) {
+                                            jpc.source = jpc.suspendedEndpoint.element;
+                                            jpc.sourceId = jpc.suspendedEndpoint.elementId;
+                                        } else {
+                                            jpc.target = jpc.suspendedEndpoint.element;
+                                            jpc.targetId = jpc.suspendedEndpoint.elementId;
+                                        }
+                                        jpc.suspendedEndpoint.addConnection(jpc);
+
+                                        jpc.endpoints[0].repaint();
+                                        jpc.repaint();
+                                        _jsPlumb.repaint(jpc.sourceId);
+                                        jpc._forceDetach = false;
+                                    }
+                                    
+                                    commonFunction();
+                                };
+                                
+// --------------------------------------
+                                // now check beforeDrop.  this will be available only on Endpoints that are setup to
+                                // have a beforeDrop condition (although, secretly, under the hood all Endpoints and 
+                                // the Connection have them, because they are on jsPlumbUIComponent.  shhh!), because
+                                // it only makes sense to have it on a target endpoint.
+                                _doContinue = _doContinue && this.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, this);
+                                                                                                                    
+                                if (_doContinue) {
+                                    continueFunction();
+                                }
+                                else {
+                                    dontContinueFunction();
+                                }
+                            }
+                            _jsPlumb.currentlyDragging = false;
+                        }
+                    }.bind(this);
+                
+                dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop);
+                dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function() {                                 
+                    var draggable = jpcl.getDragObject(arguments),
+                        id = _jsPlumb.getAttribute(draggable, "dragId"),
+                        _jpc = floatingConnections[id];
+                        
+                    if (_jpc != null) {                                                                
+                        var idx = _jpc.floatingAnchorIndex == null ? 1 : _jpc.floatingAnchorIndex;
+                        // here we should fire the 'over' event if we are a target and this is a new connection,
+                        // or we are the same as the floating endpoint.                                                                
+                        var _cont = (this.isTarget && _jpc.floatingAnchorIndex !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id == _jpc.suspendedEndpoint.id);
+                        if (_cont) {
+                            var bb = _jsPlumb.checkCondition("checkDropAllowed", { 
+                                sourceEndpoint:_jpc.endpoints[idx], 
+                                targetEndpoint:this,
+                                connection:_jpc
+                            }); 
+                            this[(bb ? "add" : "remove") + "Class"](_jsPlumb.endpointDropAllowedClass);
+                            this[(bb ? "remove" : "add") + "Class"](_jsPlumb.endpointDropForbiddenClass);
+                            _jpc.endpoints[idx].anchor.over(this.anchor, this);
+                        }
+                    }                                          
+                }.bind(this)); 
+
+                dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function() {                                   
+                    var draggable = jpcl.getDragObject(arguments),
+                        id = _jsPlumb.getAttribute( draggable, "dragId"),
+                        _jpc = floatingConnections[id];
+                        
+                    if (_jpc != null) {
+                        var idx = _jpc.floatingAnchorIndex == null ? 1 : _jpc.floatingAnchorIndex;
+                        var _cont = (this.isTarget && _jpc.floatingAnchorIndex !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id == _jpc.suspendedEndpoint.id);
+                        if (_cont) {
+                            this.removeClass(_jsPlumb.endpointDropAllowedClass);
+                            this.removeClass(_jsPlumb.endpointDropForbiddenClass);
+                            _jpc.endpoints[idx].anchor.out();
+                        }
+                    }
+                }.bind(this));
+                jpcl.initDroppable(canvas, dropOptions, true, isTransient);
+            }
+        }.bind(this);
+        
+        // initialise the endpoint's canvas as a drop target.  this will be ignored if the endpoint is not a target or drag is not supported.
+        _initDropTarget(_gel(this.canvas), true, !(params._transient || this.anchor.isFloating), this);
+        
+         // finally, set type if it was provided
+         if (params.type)
+            this.addType(params.type, params.data, _jsPlumb.isSuspendDrawing());
+
+        return this;                                           
+    };
+
+    jsPlumbUtil.extend(jsPlumb.Endpoint, OverlayCapableJsPlumbUIComponent, {
+        getTypeDescriptor : function() { return "endpoint"; },        
+        isVisible : function() { return this._jsPlumb.visible; },
+        setVisible : function(v, doNotChangeConnections, doNotNotifyOtherEndpoint) {
+            this._jsPlumb.visible = v;
+            if (this.canvas) this.canvas.style.display = v ? "block" : "none";
+            this[v ? "showOverlays" : "hideOverlays"]();
+            if (!doNotChangeConnections) {
+                for (var i = 0; i < this.connections.length; i++) {
+                    this.connections[i].setVisible(v);
+                    if (!doNotNotifyOtherEndpoint) {
+                        var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;
+                        // only change the other endpoint if this is its only connection.
+                        if (this.connections[i].endpoints[oIdx].connections.length == 1) this.connections[i].endpoints[oIdx].setVisible(v, true, true);
+                    }
+                }
+            }
+        },
+        getAttachedElements : function() {
+            return this.connections;
+        },
+        applyType : function(t, doNotRepaint) {         
+            if (t.maxConnections != null) this._jsPlumb.maxConnections = t.maxConnections;
+            if (t.scope) this.scope = t.scope;
+            jsPlumbUtil.copyValues(typeParameters, t, this);
+            if (t.anchor) {
+                this.anchor = this._jsPlumb.instance.makeAnchor(t.anchor);
+            }
+        },
+        isEnabled : function() { return this._jsPlumb.enabled; },
+        setEnabled : function(e) { this._jsPlumb.enabled = e; },
+        cleanup : function() {            
+            jsPlumb.CurrentLibrary.removeClass(this.element, this._jsPlumb.instance.endpointAnchorClassPrefix + "_" + this._jsPlumb.currentAnchorClass);            
+            this.anchor = null;
+            this.endpoint.cleanup();
+            this.endpoint.destroy();
+            this.endpoint = null;
+            // drag/drop
+            var i = jsPlumb.CurrentLibrary.getElementObject(this.canvas);              
+            jsPlumb.CurrentLibrary.destroyDraggable(i);
+            jsPlumb.CurrentLibrary.destroyDroppable(i);
+        },
+        setHover : function(h) {
+            if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged())
+                this.endpoint.setHover(h);            
+        },
+        isFull : function() {
+            return !(this.isFloating() || this._jsPlumb.maxConnections < 1 || this.connections.length < this._jsPlumb.maxConnections);              
+        },
+        getConnectionCost : function() { return this._jsPlumb.connectionCost; },
+        setConnectionCost : function(c) {
+            this._jsPlumb.connectionCost = c; 
+        },
+        areConnectionsDirected : function() { return this._jsPlumb.connectionsDirected; },
+        setConnectionsDirected : function(b) { this._jsPlumb.connectionsDirected = b; },
+        setElementId : function(_elId) {
+            this.elementId = _elId;
+            this.anchor.elementId = _elId;
+        },        
+        setReferenceElement : function(_el) {
+            this.element = jsPlumb.CurrentLibrary.getDOMElement(_el);
+        },
+        setDragAllowedWhenFull : function(allowed) {
+            this.dragAllowedWhenFull = allowed;
+        },
+        equals : function(endpoint) {
+            return this.anchor.equals(endpoint.anchor);
+        },
+        getUuid : function() {
+            return this._jsPlumb.uuid;
+        },
+        computeAnchor : function(params) {
+            return this.anchor.compute(params);
+        }
+    });
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/jquery.jsPlumb.js b/portal/static/unbound_reservation_static/src/jquery.jsPlumb.js
new file mode 100644 (file)
index 0000000..c7f7e05
--- /dev/null
@@ -0,0 +1,390 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the jQuery adapter.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */ 
+/* 
+ * the library specific functions, such as find offset, get id, get attribute, extend etc.  
+ * the full list is:
+ * 
+ * addClass                            adds a class to the given element
+ * animate                             calls the underlying library's animate functionality
+ * appendElement               appends a child element to a parent element.
+ * bind                                        binds some event to an element
+ * dragEvents                  a dictionary of event names
+ * extend                              extend some js object with another.  probably not overly necessary; jsPlumb could just do this internally.
+ * getDragObject               gets the object that is being dragged, by extracting it from the arguments passed to a drag callback
+ * getDragScope                        gets the drag scope for a given element.
+ * getDropScope                        gets the drop scope for a given element.
+ * getElementObject            turns an id or dom element into an element object of the underlying library's type.
+ * getOffset                   gets an element's offset
+ * getOriginalEvent     gets the original browser event from some wrapper event
+ * getPageXY                   gets the page event's xy location.
+ * getParent                   gets the parent of some element.
+ * getScrollLeft               gets an element's scroll left.  TODO: is this actually used?  will it be?
+ * getScrollTop                        gets an element's scroll top.  TODO: is this actually used?  will it be?
+ * getSize                             gets an element's size.
+ * getUIPosition               gets the position of some element that is currently being dragged, by extracting it from the arguments passed to a drag callback.
+ * hasClass                            returns whether or not the given element has the given class.
+ * initDraggable               initializes an element to be draggable 
+ * initDroppable               initializes an element to be droppable
+ * isDragSupported             returns whether or not drag is supported for some element.
+ * isDropSupported             returns whether or not drop is supported for some element.
+ * removeClass                 removes a class from a given element.
+ * removeElement               removes some element completely from the DOM. 
+ * setDragFilter               sets a filter for some element that indicates areas of the element that should not respond to dragging.
+ * setDraggable                        sets whether or not some element should be draggable.
+ * setDragScope                        sets the drag scope for a given element.
+ * setOffset                   sets the offset of some element.
+ * trigger                             triggers some event on an element.
+ * unbind                              unbinds some listener from some element.
+ */
+(function($) { 
+       
+       //var getBoundingClientRectSupported = "getBoundingClientRect" in document.documentElement;
+
+       var _getElementObject = function(el) {                  
+               return typeof(el) == "string" ? $("#" + el) : $(el);
+       };
+
+       jsPlumb.CurrentLibrary = {                                              
+               
+               /**
+                * adds the given class to the element object.
+                */
+               addClass : function(el, clazz) {
+                       el = _getElementObject(el);
+                       try {
+                               if (el[0].className.constructor == SVGAnimatedString) {
+                                       jsPlumbUtil.svg.addClass(el[0], clazz);                    
+                               }
+                       }
+                       catch (e) {
+                               // SVGAnimatedString not supported; no problem.
+                       }
+            try {                
+                el.addClass(clazz);
+            }
+            catch (e) {
+                // you probably have jQuery 1.9 and Firefox.  
+            }
+               },
+               
+               /**
+                * animates the given element.
+                */
+               animate : function(el, properties, options) {
+                       el.animate(properties, options);
+               },                              
+               
+               /**
+                * appends the given child to the given parent.
+
+TODO: REMOVE!
+
+                */
+               appendElement : function(child, parent) {
+                       _getElementObject(parent).append(child);                        
+               },   
+
+               /**
+               * executes an ajax call.
+               */
+               ajax : function(params) {
+                       params = params || {};
+                       params.type = params.type || "get";
+                       $.ajax(params);
+               },
+               
+               /**
+                * event binding wrapper.  it just so happens that jQuery uses 'bind' also.  yui3, for example,
+                * uses 'on'.
+                */
+               bind : function(el, event, callback) {
+                       el = _getElementObject(el);
+                       el.bind(event, callback);
+               },
+
+               destroyDraggable : function(el) {
+                       if ($(el).data("draggable"))
+                               $(el).draggable("destroy");
+               },
+
+               destroyDroppable : function(el) {
+                       if ($(el).data("droppable"))
+                               $(el).droppable("destroy");
+               },
+               
+               /**
+         * mapping of drag events for jQuery
+         */
+               dragEvents : {
+                       'start':'start', 'stop':'stop', 'drag':'drag', 'step':'step',
+                       'over':'over', 'out':'out', 'drop':'drop', 'complete':'complete'
+               },
+                               
+               /**
+                * wrapper around the library's 'extend' functionality (which it hopefully has.
+                * otherwise you'll have to do it yourself). perhaps jsPlumb could do this for you
+                * instead.  it's not like its hard.
+                */
+               extend : function(o1, o2) {
+                       return $.extend(o1, o2);
+               },              
+               
+               getClientXY : function(eventObject) {
+                       return [eventObject.clientX, eventObject.clientY];
+               },
+               
+               /**
+                * takes the args passed to an event function and returns you an object representing that which is being dragged.
+                */
+               getDragObject : function(eventArgs) {
+                       return eventArgs[1].draggable || eventArgs[1].helper;
+               },
+               
+               getDragScope : function(el) {
+                       return $(el).draggable("option", "scope");
+               },
+
+               getDropEvent : function(args) {
+                       return args[0];
+               },
+               
+               getDropScope : function(el) {
+                       return $(el).droppable("option", "scope");              
+               },
+
+               /**
+               * gets a DOM element from the given input, which might be a string (in which case we just do document.getElementById),
+               * a selector (in which case we return el[0]), or a DOM element already (we assume this if it's not either of the other
+               * two cases).  this is the opposite of getElementObject below.
+               */
+               getDOMElement : function(el) {
+                       if (el == null) return null;
+                       if (typeof(el) == "string") return document.getElementById(el);
+                       else if (el.context || el.length != null) return el[0];
+                       else return el;
+               },
+       
+               /**
+                * gets an "element object" from the given input.  this means an object that is used by the
+                * underlying library on which jsPlumb is running.  'el' may already be one of these objects,
+                * in which case it is returned as-is.  otherwise, 'el' is a String, the library's lookup 
+                * function is used to find the element, using the given String as the element's id.
+                * 
+                */             
+               getElementObject : _getElementObject,
+               
+               /**
+                 * gets the offset for the element object.  this should return a js object like this:
+                 *
+                 * { left:xxx, top: xxx }
+                */
+               getOffset : function(el) {
+                       return el.offset();
+               },
+
+               getOriginalEvent : function(e) {
+                       return e.originalEvent;
+               },
+               
+               getPageXY : function(eventObject) {
+                       return [eventObject.pageX, eventObject.pageY];
+               },
+               
+               getParent : function(el) {
+                       return _getElementObject(el).parent();
+               },
+                                                                                                               
+               getScrollLeft : function(el) {
+                       return el.scrollLeft();
+               },
+               
+               getScrollTop : function(el) {
+                       return el.scrollTop();
+               },
+               
+               getSelector : function(context, spec) {
+            if (arguments.length == 2)
+                return _getElementObject(context).find(spec);
+            else
+                return $(context);
+               },
+               
+               /**
+                * gets the size for the element object, in an array : [ width, height ].
+                */
+               getSize : function(el) {
+                       el = $(el);
+                       return [el.outerWidth(), el.outerHeight()];
+               },
+
+        getTagName : function(el) {
+            var e = _getElementObject(el);
+            return e.length > 0 ? e[0].tagName : null;
+        },
+               
+               /**
+                * takes the args passed to an event function and returns you an object that gives the
+                * position of the object being moved, as a js object with the same params as the result of
+                * getOffset, ie: { left: xxx, top: xxx }.
+                * 
+                * different libraries have different signatures for their event callbacks.  
+                * see getDragObject as well
+                */
+               getUIPosition : function(eventArgs, zoom) {
+                       
+                       zoom = zoom || 1;
+                       // this code is a workaround for the case that the element being dragged has a margin set on it. jquery UI passes
+                       // in the wrong offset if the element has a margin (it doesn't take the margin into account).  the getBoundingClientRect
+                       // method, which is in pretty much all browsers now, reports the right numbers.  but it introduces a noticeable lag, which
+                       // i don't like.
+            
+                       /*if ( getBoundingClientRectSupported ) {
+                               var r = eventArgs[1].helper[0].getBoundingClientRect();
+                               return { left : r.left, top: r.top };
+                       } else {*/
+                       if (eventArgs.length == 1) {
+                               ret = { left: eventArgs[0].pageX, top:eventArgs[0].pageY };
+                       }
+                       else {
+                               var ui = eventArgs[1],
+                                 _offset = ui.offset;
+                                 
+                               ret = _offset || ui.absolutePosition;
+                               
+                               // adjust ui position to account for zoom, because jquery ui does not do this.
+                               ui.position.left /= zoom;
+                               ui.position.top /= zoom;
+                       }
+            return { left:ret.left / zoom, top: ret.top / zoom };
+               },              
+               
+               hasClass : function(el, clazz) {
+                       return el.hasClass(clazz);
+               },
+               
+               /**
+                * initialises the given element to be draggable.
+                */
+               initDraggable : function(el, options, isPlumbedComponent, _jsPlumb) {
+                       options = options || {};
+                       el = $(el);
+
+                       options.start = jsPlumbUtil.wrap(options.start, function() {
+                               $("body").addClass(_jsPlumb.dragSelectClass);
+                       }, false);
+
+                       options.stop = jsPlumbUtil.wrap(options.stop, function() {
+                               $("body").removeClass(_jsPlumb.dragSelectClass);
+                       });
+
+                       // remove helper directive if present and no override
+                       if (!options.doNotRemoveHelper)
+                               options.helper = null;
+                       if (isPlumbedComponent)
+                               options.scope = options.scope || jsPlumb.Defaults.Scope;
+                       el.draggable(options);
+               },
+               
+               /**
+                * initialises the given element to be droppable.
+                */
+               initDroppable : function(el, options) {
+                       options.scope = options.scope || jsPlumb.Defaults.Scope;
+                       $(el).droppable(options);
+               },
+               
+               isAlreadyDraggable : function(el) {
+                       return $(el).hasClass("ui-draggable");
+               },
+               
+               /**
+                * returns whether or not drag is supported (by the library, not whether or not it is disabled) for the given element.
+                */
+               isDragSupported : function(el, options) {
+                       return $(el).draggable;
+               },                              
+                                               
+               /**
+                * returns whether or not drop is supported (by the library, not whether or not it is disabled) for the given element.
+                */
+               isDropSupported : function(el, options) {
+                       return $(el).droppable;
+               },                                                      
+               
+               /**
+                * removes the given class from the element object.
+                */
+               removeClass : function(el, clazz) {
+                       el = _getElementObject(el);
+                       try {
+                               if (el[0].className.constructor == SVGAnimatedString) {
+                                       jsPlumbUtil.svg.removeClass(el[0], clazz);
+                    return;
+                               }
+                       }
+                       catch (e) {
+                               // SVGAnimatedString not supported; no problem.
+                       }
+                       el.removeClass(clazz);
+               },
+               
+               removeElement : function(element) {                     
+                       _getElementObject(element).remove();
+               },              
+
+               setDragFilter : function(el, filter) {
+                       if (jsPlumb.CurrentLibrary.isAlreadyDraggable(el))
+                               el.draggable("option", "cancel", filter);
+               },
+               
+               setDraggable : function(el, draggable) {
+                       el.draggable("option", "disabled", !draggable);
+               },
+               
+               setDragScope : function(el, scope) {
+                       el.draggable("option", "scope", scope);
+               },
+               
+               setOffset : function(el, o) {
+                       _getElementObject(el).offset(o);
+               },
+               
+               /**
+                * note that jquery ignores the name of the event you wanted to trigger, and figures it out for itself.
+                * the other libraries do not.  yui, in fact, cannot even pass an original event.  we have to pull out stuff
+                * from the originalEvent to put in an options object for YUI. 
+                * @param el
+                * @param event
+                * @param originalEvent
+                */
+               trigger : function(el, event, originalEvent) {
+                       var h = jQuery._data(_getElementObject(el)[0], "handle");
+            h(originalEvent);
+               },
+               
+               unbind : function(el, event, callback) {
+                       el = _getElementObject(el);
+                       el.unbind(event, callback);
+               }
+       };
+       
+       $(document).ready(jsPlumb.init);
+       
+})(jQuery);
+
diff --git a/portal/static/unbound_reservation_static/src/jsPlumb.js b/portal/static/unbound_reservation_static/src/jsPlumb.js
new file mode 100644 (file)
index 0000000..c464b47
--- /dev/null
@@ -0,0 +1,2997 @@
+/**
+ * @module jsPlumb
+ * @description Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.   
+ * 
+ * - [Demo Site](http://jsplumb.org)
+ * - [GitHub](http://github.com/sporritt/jsplumb)
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (simon.porritt@gmail.com)
+ */
+;(function() {
+                       
+    var _ju = jsPlumbUtil,
+       _addClass = function(el, clazz) { jsPlumb.CurrentLibrary.addClass(_gel(el), clazz); },
+               _hasClass = function(el, clazz) { return jsPlumb.CurrentLibrary.hasClass(_gel(el), clazz); },
+               _removeClass = function(el, clazz) { jsPlumb.CurrentLibrary.removeClass(_gel(el), clazz); },
+               _gel = function(el) { return jsPlumb.CurrentLibrary.getElementObject(el); },
+               _dom = function(el) { return jsPlumb.CurrentLibrary.getDOMElement(el); },               
+               _getOffset = function(el, _instance) {
+            var o = jsPlumb.CurrentLibrary.getOffset(_gel(el));
+                       if (_instance != null) {
+                var z = _instance.getZoom();
+                return {left:o.left / z, top:o.top / z };    
+            }
+            else
+                return o;
+        },             
+               _getSize = function(el) {
+            return jsPlumb.CurrentLibrary.getSize(_gel(el));
+        },
+               
+               /**
+                * creates a timestamp, using milliseconds since 1970, but as a string.
+                */
+               _timestamp = function() { return "" + (new Date()).getTime(); },
+
+               // helper method to update the hover style whenever it, or paintStyle, changes.
+               // we use paintStyle as the foundation and merge hoverPaintStyle over the
+               // top.
+               _updateHoverStyle = function(component) {
+                       if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {
+                               var mergedHoverStyle = {};
+                               jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);
+                               jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);
+                               delete component._jsPlumb.hoverPaintStyle;
+                               // we want the fillStyle of paintStyle to override a gradient, if possible.
+                               if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fillStyle)
+                                       delete mergedHoverStyle.gradient;
+                               component._jsPlumb.hoverPaintStyle = mergedHoverStyle;
+                       }
+               },              
+               events = [ "click", "dblclick", "mouseenter", "mouseout", "mousemove", "mousedown", "mouseup", "contextmenu" ],
+               eventFilters = { "mouseout":"mouseexit" },
+               _updateAttachedElements = function(component, state, timestamp, sourceElement) {
+                       var affectedElements = component.getAttachedElements();
+                       if (affectedElements) {
+                               for (var i = 0, j = affectedElements.length; i < j; i++) {
+                                       if (!sourceElement || sourceElement != affectedElements[i])
+                                               affectedElements[i].setHover(state, true, timestamp);                   // tell the attached elements not to inform their own attached elements.
+                               }
+                       }
+               },
+               _splitType = function(t) { return t == null ? null : t.split(" "); },           
+               _applyTypes = function(component, params, doNotRepaint) {
+                       if (component.getDefaultType) {
+                               var td = component.getTypeDescriptor();
+                                       
+                               var o = _ju.merge({}, component.getDefaultType());
+                               for (var i = 0, j = component._jsPlumb.types.length; i < j; i++)
+                                       o = _ju.merge(o, component._jsPlumb.instance.getType(component._jsPlumb.types[i], td));                                         
+                                       
+                               if (params) {
+                                       o = _ju.populate(o, params);
+                               }
+                       
+                               component.applyType(o, doNotRepaint);                                   
+                               if (!doNotRepaint) component.repaint();
+                       }
+               },              
+
+// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------
+
+               jsPlumbUIComponent = window.jsPlumbUIComponent = function(params) {
+
+                       jsPlumbUtil.EventGenerator.apply(this, arguments);
+
+                       var self = this, 
+                               a = arguments,                                                          
+                               idPrefix = self.idPrefix,
+                               id = idPrefix + (new Date()).getTime(),
+                               jpcl = jsPlumb.CurrentLibrary;
+
+                       this._jsPlumb = { 
+                               instance: params._jsPlumb,
+                               parameters:params.parameters || {},
+                               paintStyle:null,
+                               hoverPaintStyle:null,
+                               paintStyleInUse:null,
+                               hover:false,
+                               beforeDetach:params.beforeDetach,
+                               beforeDrop:params.beforeDrop,
+                               overlayPlacements : [],
+                               hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass || jsPlumb.Defaults.HoverClass,
+                               types:[]
+                       };
+
+                       this.getId = function() { return id; }; 
+                       
+                       // all components can generate events
+                       
+                       if (params.events) {
+                               for (var i in params.events)
+                                       self.bind(i, params.events[i]);
+                       }
+
+                       // all components get this clone function.
+                       // TODO issue 116 showed a problem with this - it seems 'a' that is in
+                       // the clone function's scope is shared by all invocations of it, the classic
+                       // JS closure problem.  for now, jsPlumb does a version of this inline where 
+                       // it used to call clone.  but it would be nice to find some time to look
+                       // further at this.
+                       this.clone = function() {
+                               var o = {};//new Object();
+                               this.constructor.apply(o, a);
+                               return o;
+                       }.bind(this);                           
+                                               
+                       // user can supply a beforeDetach callback, which will be executed before a detach
+                       // is performed; returning false prevents the detach.                   
+                       this.isDetachAllowed = function(connection) {
+                               var r = true;
+                               if (this._jsPlumb.beforeDetach) {
+                                       try { 
+                                               r = this._jsPlumb.beforeDetach(connection); 
+                                       }
+                                       catch (e) { _ju.log("jsPlumb: beforeDetach callback failed", e); }
+                               }
+                               return r;
+                       };
+                       
+                       // user can supply a beforeDrop callback, which will be executed before a dropped
+                       // connection is confirmed. user can return false to reject connection.                 
+                       this.isDropAllowed = function(sourceId, targetId, scope, connection, dropEndpoint) {
+                               var r = this._jsPlumb.instance.checkCondition("beforeDrop", { 
+                                       sourceId:sourceId, 
+                                       targetId:targetId, 
+                                       scope:scope,
+                                       connection:connection,
+                                       dropEndpoint:dropEndpoint 
+                               });
+                               if (this._jsPlumb.beforeDrop) {
+                                       try { 
+                                               r = this._jsPlumb.beforeDrop({ 
+                                                       sourceId:sourceId, 
+                                                       targetId:targetId, 
+                                                       scope:scope, 
+                                                       connection:connection,
+                                                       dropEndpoint:dropEndpoint
+                                               }); 
+                                       }
+                                       catch (e) { _ju.log("jsPlumb: beforeDrop callback failed", e); }
+                               }
+                               return r;
+                       };                                                                                                      
+
+                   var boundListeners = [],
+                       bindAListener = function(obj, type, fn) {
+                               boundListeners.push([obj, type, fn]);
+                               obj.bind(type, fn);
+                           },
+                       domListeners = [],
+               bindOne = function(o, c, evt) {
+                                       var filteredEvent = eventFilters[evt] || evt,
+                                               fn = function(ee) {
+                                                       c.fire(filteredEvent, c, ee);
+                                               };
+                                       domListeners.push([o, evt, fn]);
+                                       jpcl.bind(o, evt, fn);
+                               },
+                               unbindOne = function(o, evt, fn) {
+                                       var filteredEvent = eventFilters[evt] || evt;
+                                       jpcl.unbind(o, evt, fn);
+                               };
+
+            this.bindListeners = function(obj, _self, _hoverFunction) {
+                bindAListener(obj, "click", function(ep, e) { _self.fire("click", _self, e); });             
+               bindAListener(obj, "dblclick", function(ep, e) { _self.fire("dblclick", _self, e); });
+                bindAListener(obj, "contextmenu", function(ep, e) { _self.fire("contextmenu", _self, e); });
+                bindAListener(obj, "mouseenter", function(ep, e) {
+                    if (!_self.isHover()) {
+                        _hoverFunction(true);
+                        _self.fire("mouseenter", _self, e);
+                    }
+                });
+                bindAListener(obj, "mouseexit", function(ep, e) {
+                    if (_self.isHover()) {
+                        _hoverFunction(false);
+                        _self.fire("mouseexit", _self, e);
+                    }
+                });      
+                bindAListener(obj, "mousedown", function(ep, e) { _self.fire("mousedown", _self, e); });
+                bindAListener(obj, "mouseup", function(ep, e) { _self.fire("mouseup", _self, e); });
+            };
+
+            this.unbindListeners = function() {
+               for (var i = 0; i < boundListeners.length; i++) {
+                       var o = boundListeners[i];
+                       o[0].unbind(o[1], o[2]);
+               }               
+               boundListeners = null;
+            };            
+                   
+                   this.attachListeners = function(o, c) {
+                               for (var i = 0, j = events.length; i < j; i++) {
+                                       bindOne(o, c, events[i]);                       
+                               }
+                       };      
+                       this.detachListeners = function() {
+                               for (var i = 0; i < domListeners.length; i++) {
+                                       unbindOne(domListeners[i][0], domListeners[i][1], domListeners[i][2]);
+                               }
+                               domListeners = null;
+                       };                          
+                   
+                   this.reattachListenersForElement = function(o) {
+                           if (arguments.length > 1) {
+                               for (var i = 0, j = events.length; i < j; i++)
+                                       unbindOne(o, events[i]);
+                               for (i = 1, j = arguments.length; i < j; i++)
+                                       this.attachListeners(o, arguments[i]);
+                       }
+                   };                                                                
+               };
+
+               jsPlumbUtil.extend(jsPlumbUIComponent, jsPlumbUtil.EventGenerator, {
+                       
+                       getParameter : function(name) { 
+                               return this._jsPlumb.parameters[name]; 
+                       },
+                       
+                       setParameter : function(name, value) { 
+                               this._jsPlumb.parameters[name] = value; 
+                       },
+                       
+                       getParameters : function() { 
+                               return this._jsPlumb.parameters; 
+                       },                      
+                       
+                       setParameters : function(p) { 
+                               this._jsPlumb.parameters = p; 
+                       },                      
+                       
+                       addClass : function(clazz) {
+                           if (this.canvas != null)
+                               _addClass(this.canvas, clazz);
+                       },
+                                               
+                       removeClass : function(clazz) {
+                           if (this.canvas != null)
+                               _removeClass(this.canvas, clazz);
+                       },
+                       
+                       setType : function(typeId, params, doNotRepaint) {                              
+                               this._jsPlumb.types = _splitType(typeId) || [];
+                               _applyTypes(this, params, doNotRepaint);                                                                        
+                       },
+                       
+                       getType : function() {
+                               return this._jsPlumb.types;
+                       },
+                       
+                       reapplyTypes : function(params, doNotRepaint) {
+                               _applyTypes(this, params, doNotRepaint);
+                       },
+                       
+                       hasType : function(typeId) {
+                               return jsPlumbUtil.indexOf(this._jsPlumb.types, typeId) != -1;
+                       },
+                       
+                       addType : function(typeId, params, doNotRepaint) {
+                               var t = _splitType(typeId), _cont = false;
+                               if (t != null) {
+                                       for (var i = 0, j = t.length; i < j; i++) {
+                                               if (!this.hasType(t[i])) {
+                                                       this._jsPlumb.types.push(t[i]);
+                                                       _cont = true;                                           
+                                               }
+                                       }
+                                       if (_cont) _applyTypes(this, params, doNotRepaint);
+                               }
+                       },
+                       
+                       removeType : function(typeId, doNotRepaint) {
+                               var t = _splitType(typeId), _cont = false, _one = function(tt) {
+                                               var idx = _ju.indexOf(this._jsPlumb.types, tt);
+                                               if (idx != -1) {
+                                                       this._jsPlumb.types.splice(idx, 1);
+                                                       return true;
+                                               }
+                                               return false;
+                                       }.bind(this);
+                               
+                               if (t != null) {
+                                       for (var i = 0,j = t.length; i < j; i++) {
+                                               _cont = _one(t[i]) || _cont;
+                                       }
+                                       if (_cont) _applyTypes(this, null, doNotRepaint);
+                               }
+                       },
+                       
+                       toggleType : function(typeId, params, doNotRepaint) {
+                               var t = _splitType(typeId);
+                               if (t != null) {
+                                       for (var i = 0, j = t.length; i < j; i++) {
+                                               var idx = jsPlumbUtil.indexOf(this._jsPlumb.types, t[i]);
+                                               if (idx != -1)
+                                                       this._jsPlumb.types.splice(idx, 1);
+                                               else
+                                                       this._jsPlumb.types.push(t[i]);
+                                       }
+                                               
+                                       _applyTypes(this, params, doNotRepaint);
+                               }
+                       },
+                       applyType : function(t, doNotRepaint) {
+                               this.setPaintStyle(t.paintStyle, doNotRepaint);                         
+                               this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);
+                               if (t.parameters){
+                                       for (var i in t.parameters)
+                                               this.setParameter(i, t.parameters[i]);
+                               }
+                       },
+                       setPaintStyle : function(style, doNotRepaint) {
+//                     this._jsPlumb.paintStyle = jsPlumb.extend({}, style);
+// TODO figure out if we want components to clone paintStyle so as not to share it.
+                               this._jsPlumb.paintStyle = style;
+                       this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;
+                       _updateHoverStyle(this);
+                       if (!doNotRepaint) this.repaint();
+                   },
+                   getPaintStyle : function() {
+                       return this._jsPlumb.paintStyle;
+                   },
+                   setHoverPaintStyle : function(style, doNotRepaint) {                        
+                       //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);
+// TODO figure out if we want components to clone paintStyle so as not to share it.                    
+                       this._jsPlumb.hoverPaintStyle = style;
+                       _updateHoverStyle(this);
+                       if (!doNotRepaint) this.repaint();
+                   },
+                   getHoverPaintStyle : function() {
+                       return this._jsPlumb.hoverPaintStyle;
+                   },
+                       cleanup:function() {            
+                               this.unbindListeners();
+                               this.detachListeners();
+                       },
+                       destroy:function() {
+                               this.cleanupListeners();
+                               this.clone = null;                              
+                               this._jsPlumb = null;
+                       },
+                       
+                       isHover : function() { return this._jsPlumb.hover; },
+                       
+                       setHover : function(hover, ignoreAttachedElements, timestamp) {
+                               var jpcl = jsPlumb.CurrentLibrary;
+                       // while dragging, we ignore these events.  this keeps the UI from flashing and
+                       // swishing and whatevering.
+                               if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {
+                   
+                               this._jsPlumb.hover = hover;
+                        
+                    if (this.canvas != null) {
+                        if (this._jsPlumb.instance.hoverClass != null) {                            
+                            jpcl[hover ? "addClass" : "removeClass"](this.canvas, this._jsPlumb.instance.hoverClass);                                                                      
+                        }                                              
+                    }
+                                       if (this._jsPlumb.hoverPaintStyle != null) {
+                                               this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;
+                                               if (!this._jsPlumb.instance.isSuspendDrawing()) {
+                                                       timestamp = timestamp || _timestamp();
+                                                       this.repaint({timestamp:timestamp, recalc:false});
+                                               }
+                                       }
+                                       // get the list of other affected elements, if supported by this component.
+                                       // for a connection, its the endpoints.  for an endpoint, its the connections! surprise.
+                                       if (this.getAttachedElements && !ignoreAttachedElements)
+                                               _updateAttachedElements(this, hover, _timestamp(), this);
+                               }
+                   }
+               });
+
+// ------------------------------ END jsPlumbUIComponent --------------------------------------------
+
+// ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------
+
+               var _internalLabelOverlayId = "__label",
+                       // helper to get the index of some overlay
+                       _getOverlayIndex = function(component, id) {
+                               var idx = -1;
+                               for (var i = 0, j = component._jsPlumb.overlays.length; i < j; i++) {
+                                       if (id === component._jsPlumb.overlays[i].id) {
+                                               idx = i;
+                                               break;
+                                       }
+                               }
+                               return idx;
+                       },
+                       // this is a shortcut helper method to let people add a label as
+                       // overlay.                                             
+                       _makeLabelOverlay = function(component, params) {
+
+                               var _params = {
+                                       cssClass:params.cssClass,
+                                       labelStyle : component.labelStyle,                                      
+                                       id:_internalLabelOverlayId,
+                                       component:component,
+                                       _jsPlumb:component._jsPlumb.instance  // TODO not necessary, since the instance can be accessed through the component.
+                               },
+                               mergedParams = jsPlumb.extend(_params, params);
+
+                               return new jsPlumb.Overlays[component._jsPlumb.instance.getRenderMode()].Label( mergedParams );
+                       },
+                       _processOverlay = function(component, o) {
+                               var _newOverlay = null;
+                               if (_ju.isArray(o)) {   // this is for the shorthand ["Arrow", { width:50 }] syntax
+                                       // there's also a three arg version:
+                                       // ["Arrow", { width:50 }, {location:0.7}] 
+                                       // which merges the 3rd arg into the 2nd.
+                                       var type = o[0],
+                                               // make a copy of the object so as not to mess up anyone else's reference...
+                                               p = jsPlumb.extend({component:component, _jsPlumb:component._jsPlumb.instance}, o[1]);
+                                       if (o.length == 3) jsPlumb.extend(p, o[2]);
+                                       _newOverlay = new jsPlumb.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);                                       
+                               } else if (o.constructor == String) {
+                                       _newOverlay = new jsPlumb.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component:component, _jsPlumb:component._jsPlumb.instance});
+                               } else {
+                                       _newOverlay = o;
+                               }                                                                               
+                                       
+                               component._jsPlumb.overlays.push(_newOverlay);
+                       },
+                       _calculateOverlaysToAdd = function(component, params) {
+                               var defaultKeys = component.defaultOverlayKeys || [], o = params.overlays,
+                                       checkKey = function(k) {
+                                               return component._jsPlumb.instance.Defaults[k] || jsPlumb.Defaults[k] || [];
+                                       };
+                               
+                               if (!o) o = [];
+
+                               for (var i = 0, j = defaultKeys.length; i < j; i++)
+                                       o.unshift.apply(o, checkKey(defaultKeys[i]));
+                               
+                               return o;
+                       },              
+                       OverlayCapableJsPlumbUIComponent = window.OverlayCapableJsPlumbUIComponent = function(params) {
+
+                               jsPlumbUIComponent.apply(this, arguments);
+                               this._jsPlumb.overlays = [];                    
+
+                               var _overlays = _calculateOverlaysToAdd(this, params);
+                               if (_overlays) {
+                                       for (var i = 0, j = _overlays.length; i < j; i++) {
+                                               _processOverlay(this, _overlays[i]);
+                                       }
+                               }
+                               
+                               if (params.label) {
+                                       var loc = params.labelLocation || this.defaultLabelLocation || 0.5,
+                                               labelStyle = params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle || jsPlumb.Defaults.LabelStyle;
+
+                                       this._jsPlumb.overlays.push(_makeLabelOverlay(this, {
+                                               label:params.label,
+                                               location:loc,
+                                               labelStyle:labelStyle
+                                       }));
+                               }                                                         
+                       };
+
+               jsPlumbUtil.extend(OverlayCapableJsPlumbUIComponent, jsPlumbUIComponent, {
+                       applyType : function(t, doNotRepaint) {                 
+                               this.removeAllOverlays(doNotRepaint);
+                               if (t.overlays) {
+                                       for (var i = 0, j = t.overlays.length; i < j; i++)
+                                               this.addOverlay(t.overlays[i], true);
+                               }
+                       },
+                       setHover : function(hover, ignoreAttachedElements, timestamp) {            
+                               if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {
+                       for (var i = 0, j = this._jsPlumb.overlays.length; i < j; i++) {
+                                               this._jsPlumb.overlays[i][hover ? "addClass":"removeClass"](this._jsPlumb.instance.hoverClass);
+                                       }
+                               }
+            },
+            addOverlay : function(overlay, doNotRepaint) { 
+                               _processOverlay(this, overlay); 
+                               if (!doNotRepaint) this.repaint();
+                       },
+                       getOverlay : function(id) {
+                               var idx = _getOverlayIndex(this, id);
+                               return idx >= 0 ? this._jsPlumb.overlays[idx] : null;
+                       },                      
+                       getOverlays : function() {
+                               return this._jsPlumb.overlays;
+                       },                      
+                       hideOverlay : function(id) {
+                               var o = this.getOverlay(id);
+                               if (o) o.hide();
+                       },
+                       hideOverlays : function() {
+                               for (var i = 0, j = this._jsPlumb.overlays.length; i < j; i++)
+                                       this._jsPlumb.overlays[i].hide();
+                       },
+                       showOverlay : function(id) {
+                               var o = this.getOverlay(id);
+                               if (o) o.show();
+                       },
+                       showOverlays : function() {
+                               for (var i = 0, j = this._jsPlumb.overlays.length; i < j; i++)
+                                       this._jsPlumb.overlays[i].show();
+                       },
+                       removeAllOverlays : function(doNotRepaint) {
+                               for (var i = 0, j = this._jsPlumb.overlays.length; i < j; i++) {
+                                       if (this._jsPlumb.overlays[i].cleanup) this._jsPlumb.overlays[i].cleanup();
+                               }
+
+                               this._jsPlumb.overlays.splice(0, this._jsPlumb.overlays.length);
+                               this._jsPlumb.overlayPositions = null;
+                               if (!doNotRepaint)
+                                       this.repaint();
+                       },
+                       removeOverlay : function(overlayId) {
+                               var idx = _getOverlayIndex(this, overlayId);
+                               if (idx != -1) {
+                                       var o = this._jsPlumb.overlays[idx];
+                                       if (o.cleanup) o.cleanup();
+                                       this._jsPlumb.overlays.splice(idx, 1);
+                                       this._jsPlumb.overlayPositions && delete this._jsPlumb.overlayPositions[overlayId];
+                               }
+                       },
+                       removeOverlays : function() {
+                               for (var i = 0, j = arguments.length; i < j; i++)
+                                       this.removeOverlay(arguments[i]);
+                       },
+                       getLabel : function() {
+                               var lo = this.getOverlay(_internalLabelOverlayId);
+                               return lo != null ? lo.getLabel() : null;
+                       },              
+                       getLabelOverlay : function() {
+                               return this.getOverlay(_internalLabelOverlayId);
+                       },
+                       setLabel : function(l) {
+                               var lo = this.getOverlay(_internalLabelOverlayId);
+                               if (!lo) {
+                                       var params = l.constructor == String || l.constructor == Function ? { label:l } : l;
+                                       lo = _makeLabelOverlay(this, params);   
+                                       this._jsPlumb.overlays.push(lo);
+                               }
+                               else {
+                                       if (l.constructor == String || l.constructor == Function) lo.setLabel(l);
+                                       else {
+                                               if (l.label) lo.setLabel(l.label);
+                                               if (l.location) lo.setLocation(l.location);
+                                       }
+                               }
+                               
+                               if (!this._jsPlumb.instance.isSuspendDrawing()) 
+                                       this.repaint();
+                       },
+                       cleanup:function() {
+                               for (var i = 0; i < this._jsPlumb.overlays.length; i++) {
+                                       this._jsPlumb.overlays[i].cleanup();
+                                       this._jsPlumb.overlays[i].destroy();
+                               }
+                               this._jsPlumb.overlays.splice(0);
+                               this._jsPlumb.overlayPositions = null;
+                       },
+                       setVisible:function(v) {
+                               this[v ? "showOverlays" : "hideOverlays"]();
+                       },
+                       setAbsoluteOverlayPosition:function(overlay, xy) {
+                               this._jsPlumb.overlayPositions = this._jsPlumb.overlayPositions || {};
+                               this._jsPlumb.overlayPositions[overlay.id] = xy;
+                       },
+                       getAbsoluteOverlayPosition:function(overlay) {
+                               return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;
+                       }
+               });             
+
+// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------
+               
+               var _jsPlumbInstanceIndex = 0,
+                       getInstanceIndex = function() {
+                               var i = _jsPlumbInstanceIndex + 1;
+                               _jsPlumbInstanceIndex++;
+                               return i;
+                       };
+
+               var jsPlumbInstance = window.jsPlumbInstance = function(_defaults) {
+                               
+                       this.Defaults = {
+                               Anchor : "BottomCenter",
+                               Anchors : [ null, null ],
+                   ConnectionsDetachable : true,
+                   ConnectionOverlays : [ ],
+                   Connector : "Bezier",
+                               Container : null,
+                               DoNotThrowErrors:false,
+                               DragOptions : { },
+                               DropOptions : { },
+                               Endpoint : "Dot",
+                               EndpointOverlays : [ ],
+                               Endpoints : [ null, null ],
+                               EndpointStyle : { fillStyle : "#456" },
+                               EndpointStyles : [ null, null ],
+                               EndpointHoverStyle : null,
+                               EndpointHoverStyles : [ null, null ],
+                               HoverPaintStyle : null,
+                               LabelStyle : { color : "black" },
+                               LogEnabled : false,
+                               Overlays : [ ],
+                               MaxConnections : 1, 
+                               PaintStyle : { lineWidth : 8, strokeStyle : "#456" },            
+                               ReattachConnections:false,
+                               RenderMode : "svg",
+                               Scope : "jsPlumb_DefaultScope"
+                       };
+                       if (_defaults) jsPlumb.extend(this.Defaults, _defaults);
+               
+                       this.logEnabled = this.Defaults.LogEnabled;
+                       this._connectionTypes = {};
+                       this._endpointTypes = {};               
+
+                       jsPlumbUtil.EventGenerator.apply(this);
+
+                       var _currentInstance = this,
+                               _instanceIndex = getInstanceIndex(),
+                               _bb = _currentInstance.bind,
+                               _initialDefaults = {},
+                   _zoom = 1,
+                   _info = function(el) {
+                       var _el = _dom(el);     
+                       return { el:_el, id:(jsPlumbUtil.isString(el) && _el == null) ? el : _getId(_el) };
+                   };
+            
+               this.getInstanceIndex = function() { return _instanceIndex; };
+
+               this.setZoom = function(z, repaintEverything) {
+               _zoom = z;
+               if (repaintEverything) _currentInstance.repaintEverything();
+               };
+               this.getZoom = function() { return _zoom; };
+                        
+                       for (var i in this.Defaults)
+                               _initialDefaults[i] = this.Defaults[i];
+                       
+                       this.bind = function(event, fn) {               
+                               if ("ready" === event && initialized) fn();
+                               else _bb.apply(_currentInstance,[event, fn]);
+                       };
+
+                       _currentInstance.importDefaults = function(d) {
+                               for (var i in d) {
+                                       _currentInstance.Defaults[i] = d[i];
+                               }       
+                               return _currentInstance;
+                       };              
+                       
+                       _currentInstance.restoreDefaults = function() {
+                               _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);
+                               return _currentInstance;
+                       };
+               
+                   var log = null,
+                       resizeTimer = null,
+                       initialized = false,
+                       // TODO remove from window scope       
+                       connections = [],
+                       // map of element id -> endpoint lists. an element can have an arbitrary
+                       // number of endpoints on it, and not all of them have to be connected
+                       // to anything.         
+                       endpointsByElement = {},
+                       endpointsByUUID = {},
+                       offsets = {},
+                       offsetTimestamps = {},
+                       floatingConnections = {},
+                       draggableStates = {},           
+                       connectionBeingDragged = false,
+                       sizes = [],
+                       _suspendDrawing = false,
+                       _suspendedAt = null,
+                       DEFAULT_SCOPE = this.Defaults.Scope,
+                       renderMode = null,  // will be set in init()            
+                       _curIdStamp = 1,
+                       _idstamp = function() { return "" + _curIdStamp++; },                                                   
+               
+                               //
+                               // appends an element to some other element, which is calculated as follows:
+                               // 
+                               // 1. if _currentInstance.Defaults.Container exists, use that element.
+                               // 2. if the 'parent' parameter exists, use that.
+                               // 3. otherwise just use the root element (for DOM usage, the document body).
+                               // 
+                               //
+                               _appendElement = function(el, parent) {
+                                       if (_currentInstance.Defaults.Container)
+                                               jsPlumb.CurrentLibrary.appendElement(el, _currentInstance.Defaults.Container);
+                                       else if (!parent)
+                                               jsPlumbAdapter.appendToRoot(el);
+                                       else
+                                               jsPlumb.CurrentLibrary.appendElement(el, parent);
+                               },              
+                               
+                               //
+                               // YUI, for some reason, put the result of a Y.all call into an object that contains
+                               // a '_nodes' array, instead of handing back an array-like object like the other
+                               // libraries do.
+                               //
+                               _convertYUICollection = function(c) {
+                                       return c._nodes ? c._nodes : c;
+                               },                
+
+                       //
+                       // Draws an endpoint and its connections. this is the main entry point into drawing connections as well
+                       // as endpoints, since jsPlumb is endpoint-centric under the hood.
+                       // 
+                       // @param element element to draw (of type library specific element object)
+                       // @param ui UI object from current library's event system. optional.
+                       // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.
+                       // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared
+                       ///
+                       _draw = function(element, ui, timestamp, clearEdits) {
+
+                               // TODO is it correct to filter by headless at this top level? how would a headless adapter ever repaint?
+                   if (!jsPlumbAdapter.headless && !_suspendDrawing) {
+                                   var id = _getId(element),
+                                       repaintEls = _currentInstance.dragManager.getElementsForDraggable(id);                      
+
+                                   if (timestamp == null) timestamp = _timestamp();
+
+                                   // update the offset of everything _before_ we try to draw anything.
+                                   var o = _updateOffset( { elId : id, offset : ui, recalc : false, timestamp : timestamp });
+
+                               if (repaintEls) {
+                                   for (var i in repaintEls) {                                                                                                                         
+                                       // TODO this seems to cause a lag, but we provide the offset, so in theory it 
+                                       // should not.  is the timestamp failing?
+                                               _updateOffset( { 
+                                                       elId : repaintEls[i].id, 
+                                                       offset : {
+                                                                       left:o.o.left + repaintEls[i].offset.left,
+                                                               top:o.o.top + repaintEls[i].offset.top
+                                                       }, 
+                                                       recalc : false, 
+                                                       timestamp : timestamp 
+                                               });
+                                       }
+                                   }   
+                                                         
+
+                                   _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);
+                                   
+                                   if (repaintEls) {
+                                           for (var j in repaintEls) {
+                                                       _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);                         
+                                           }
+                                       }               
+                   }
+                       },
+
+                       //
+                       // executes the given function against the given element if the first
+                       // argument is an object, or the list of elements, if the first argument
+                       // is a list. the function passed in takes (element, elementId) as
+                       // arguments.
+                       //
+                       _elementProxy = function(element, fn) {
+                               var retVal = null, el, id;
+                               if (_ju.isArray(element)) {
+                                       retVal = [];
+                                       for ( var i = 0, j = element.length; i < j; i++) {
+                                               el = _gel(element[i]);
+                                               id = _currentInstance.getAttribute(el, "id");
+                                               retVal.push(fn(el, id)); // append return values to what we will return
+                                       }
+                               } else {
+                                       el = _gel(element);
+                                       id = _currentInstance.getAttribute(el, "id");
+                                       retVal = fn(el, id);
+                               }
+                               return retVal;
+                       },                              
+
+                       //
+                       // gets an Endpoint by uuid.
+                       //
+                       _getEndpoint = function(uuid) { return endpointsByUUID[uuid]; },
+
+               /**
+                * inits a draggable if it's not already initialised.
+                * TODO: somehow abstract this to the adapter, because the concept of "draggable" has no
+                * place on the server.
+                */
+               _initDraggableIfNecessary = function(element, isDraggable, dragOptions) {
+                       // TODO move to DragManager?
+                       if (!jsPlumbAdapter.headless) {
+                               var _draggable = isDraggable == null ? false : isDraggable, jpcl = jsPlumb.CurrentLibrary;
+                               if (_draggable) {
+                                       if (jpcl.isDragSupported(element) && !jpcl.isAlreadyDraggable(element)) {
+                                               var options = dragOptions || _currentInstance.Defaults.DragOptions || jsPlumb.Defaults.DragOptions;
+                                               options = jsPlumb.extend( {}, options); // make a copy.
+                                               var dragEvent = jpcl.dragEvents.drag,
+                                                       stopEvent = jpcl.dragEvents.stop,
+                                                       startEvent = jpcl.dragEvents.start;
+       
+                                               options[startEvent] = _ju.wrap(options[startEvent], function() {
+                                                       _currentInstance.setHoverSuspended(true);                                                       
+                                                       _currentInstance.select({source:element}).addClass(_currentInstance.elementDraggingClass + " " + _currentInstance.sourceElementDraggingClass, true);
+                                                       _currentInstance.select({target:element}).addClass(_currentInstance.elementDraggingClass + " " + _currentInstance.targetElementDraggingClass, true);
+                                                       _currentInstance.setConnectionBeingDragged(true);
+                                               });
+       
+                                               options[dragEvent] = _ju.wrap(options[dragEvent], function() {                            
+                                                       var ui = jpcl.getUIPosition(arguments, _currentInstance.getZoom());
+                                                       _draw(element, ui, null, true);
+                                                       _addClass(element, "jsPlumb_dragged");
+                                               });
+                                               options[stopEvent] = _ju.wrap(options[stopEvent], function() {
+                                                       var ui = jpcl.getUIPosition(arguments, _currentInstance.getZoom());
+                                                       _draw(element, ui);
+                                                       _removeClass(element, "jsPlumb_dragged");
+                                                       _currentInstance.setHoverSuspended(false);                                                      
+                                                       _currentInstance.select({source:element}).removeClass(_currentInstance.elementDraggingClass + " " + _currentInstance.sourceElementDraggingClass, true);
+                                                       _currentInstance.select({target:element}).removeClass(_currentInstance.elementDraggingClass + " " + _currentInstance.targetElementDraggingClass, true);
+                                                       _currentInstance.setConnectionBeingDragged(false);
+                                                       _currentInstance.dragManager.dragEnded(element);
+                                               });
+                                               var elId = _getId(element); // need ID
+                                               draggableStates[elId] = true;  
+                                               var draggable = draggableStates[elId];
+                                               options.disabled = draggable == null ? false : !draggable;
+                                               jpcl.initDraggable(element, options, false, _currentInstance);
+                                               _currentInstance.dragManager.register(element);
+                                       }
+                               }
+                       }
+               },
+               
+               /*
+               * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.
+               */
+               _prepareConnectionParams = function(params, referenceParams) {
+                       var _p = jsPlumb.extend( { }, params);
+                       if (referenceParams) jsPlumb.extend(_p, referenceParams);
+                       
+                       // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.
+                       if (_p.source) {
+                               if (_p.source.endpoint) 
+                                       _p.sourceEndpoint = _p.source;
+                               else
+                                       _p.source = _dom(_p.source);
+                       }
+                       if (_p.target) {
+                               if (_p.target.endpoint) 
+                                       _p.targetEndpoint = _p.target;
+                               else
+                                       _p.target = _dom(_p.target);
+                       }
+                       
+                       // test for endpoint uuids to connect
+                       if (params.uuids) {
+                               _p.sourceEndpoint = _getEndpoint(params.uuids[0]);
+                               _p.targetEndpoint = _getEndpoint(params.uuids[1]);
+                       }                                               
+
+                       // now ensure that if we do have Endpoints already, they're not full.
+                       // source:
+                       if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {
+                               _ju.log(_currentInstance, "could not add connection; source endpoint is full");
+                               return;
+                       }
+
+                       // target:
+                       if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {
+                               _ju.log(_currentInstance, "could not add connection; target endpoint is full");
+                               return;
+                       }
+                       
+                       // if source endpoint mandates connection type and nothing specified in our params, use it.
+                       if (!_p.type && _p.sourceEndpoint)
+                               _p.type = _p.sourceEndpoint.connectionType;
+                       
+                       // copy in any connectorOverlays that were specified on the source endpoint.
+                       // it doesnt copy target endpoint overlays.  i'm not sure if we want it to or not.
+                       if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {
+                               _p.overlays = _p.overlays || [];
+                               for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {
+                                       _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);
+                               }
+                       }               
+            
+            // pointer events
+            if (!_p["pointer-events"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents)
+                _p["pointer-events"] = _p.sourceEndpoint.connectorPointerEvents;
+                                                                       
+                       // if there's a target specified (which of course there should be), and there is no
+                       // target endpoint specified, and 'newConnection' was not set to true, then we check to
+                       // see if a prior call to makeTarget has provided us with the specs for the target endpoint, and
+                       // we use those if so.  additionally, if the makeTarget call was specified with 'uniqueEndpoint' set
+                       // to true, then if that target endpoint has already been created, we re-use it.
+
+                       var tid, tep, existingUniqueEndpoint, newEndpoint;
+
+                       // TODO: this code can be refactored to be a little dry.
+                       if (_p.target && !_p.target.endpoint && !_p.targetEndpoint && !_p.newConnection) {
+                               tid = _getId(_p.target);
+                               tep =_targetEndpointDefinitions[tid];
+                               existingUniqueEndpoint = _targetEndpoints[tid];                 
+
+                               if (tep) {                      
+                                       // if target not enabled, return.
+                                       if (!_targetsEnabled[tid]) return;
+
+                                       // TODO this is dubious. i think it is there so that the endpoint can subsequently
+                                       // be dragged (ie it kicks off the draggable registration). but it is dubious.
+                                       tep.isTarget = true;
+
+                                       // check for max connections??                                          
+                                       newEndpoint = existingUniqueEndpoint != null ? existingUniqueEndpoint : _currentInstance.addEndpoint(_p.target, tep);
+                                       if (_targetEndpointsUnique[tid]) _targetEndpoints[tid] = newEndpoint;
+                                        _p.targetEndpoint = newEndpoint;
+                                        // TODO test options to makeTarget to see if we should do this?
+                                        newEndpoint._doNotDeleteOnDetach = false; // reset.
+                                        newEndpoint._deleteOnDetach = true;                                     
+                               }
+                       }
+
+                       // same thing, but for source.
+                       if (_p.source && !_p.source.endpoint && !_p.sourceEndpoint && !_p.newConnection) {
+                               tid = _getId(_p.source);
+                               tep = _sourceEndpointDefinitions[tid];
+                               existingUniqueEndpoint = _sourceEndpoints[tid];                         
+
+                               if (tep) {
+                                       // if source not enabled, return.                                       
+                                       if (!_sourcesEnabled[tid]) return;
+
+                                       // TODO this is dubious. i think it is there so that the endpoint can subsequently
+                                       // be dragged (ie it kicks off the draggable registration). but it is dubious.
+                                       //tep.isSource = true;
+                               
+                                       newEndpoint = existingUniqueEndpoint != null ? existingUniqueEndpoint : _currentInstance.addEndpoint(_p.source, tep);
+                                       if (_sourceEndpointsUnique[tid]) _sourceEndpoints[tid] = newEndpoint;
+                                        _p.sourceEndpoint = newEndpoint;
+                                        // TODO test options to makeSource to see if we should do this?
+                                        newEndpoint._doNotDeleteOnDetach = false; // reset.
+                                        newEndpoint._deleteOnDetach = true;
+                               }
+                       }
+                       
+                       return _p;
+               },
+               
+               _newConnection = function(params) {
+                       var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),
+                           endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint,
+                           parent = jsPlumb.CurrentLibrary.getParent;
+                       
+                       if (params.container)
+                               params.parent = params.container;
+                       else {
+                               if (params.sourceEndpoint)
+                                       params.parent = params.sourceEndpoint.parent;
+                               else if (params.source.constructor == endpointFunc)
+                                       params.parent = params.source.parent;
+                               else params.parent = parent(params.source);
+                       }
+                       
+                       params._jsPlumb = _currentInstance;
+            params.newConnection = _newConnection;
+            params.newEndpoint = _newEndpoint;
+            params.endpointsByUUID = endpointsByUUID;             
+            params.endpointsByElement = endpointsByElement;  
+            params.finaliseConnection = _finaliseConnection;
+                       var con = new connectionFunc(params);
+                       con.id = "con_" + _idstamp();
+                       _eventFireProxy("click", "click", con);
+                       _eventFireProxy("dblclick", "dblclick", con);
+            _eventFireProxy("contextmenu", "contextmenu", con);
+
+            // if the connection is draggable, then maybe we need to tell the target endpoint to init the
+            // dragging code. it won't run again if it already configured to be draggable.
+            if (con.isDetachable()) {
+               con.endpoints[0].initDraggable();
+               con.endpoints[1].initDraggable();
+            }
+
+                       return con;
+               },
+               
+               //
+               // adds the connection to the backing model, fires an event if necessary and then redraws
+               //
+               _finaliseConnection = function(jpc, params, originalEvent, doInformAnchorManager) {
+            params = params || {};
+                       // add to list of connections (by scope).
+            if (!jpc.suspendedEndpoint)
+                           connections.push(jpc);
+                       
+            // always inform the anchor manager
+            // except that if jpc has a suspended endpoint it's not true to say the
+            // connection is new; it has just (possibly) moved. the question is whether
+            // to make that call here or in the anchor manager.  i think perhaps here.
+            if (jpc.suspendedEndpoint == null || doInformAnchorManager)
+               _currentInstance.anchorManager.newConnection(jpc);
+
+                       // force a paint
+                       _draw(jpc.source);
+                       
+                       // fire an event
+                       if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {
+                       
+                               var eventArgs = {
+                                       connection:jpc,
+                                       source : jpc.source, target : jpc.target,
+                                       sourceId : jpc.sourceId, targetId : jpc.targetId,
+                                       sourceEndpoint : jpc.endpoints[0], targetEndpoint : jpc.endpoints[1]
+                               };
+                       
+                               _currentInstance.fire("connection", eventArgs, originalEvent);
+                       }
+               },
+               
+               _eventFireProxy = function(event, proxyEvent, obj) {
+                       obj.bind(event, function(originalObject, originalEvent) {
+                               _currentInstance.fire(proxyEvent, obj, originalEvent);
+                       });
+               },
+               
+               /*
+                * for the given endpoint params, returns an appropriate parent element for the UI elements that will be added.
+                * this function is used by _newEndpoint (directly below), and also in the makeSource function in jsPlumb.
+                * 
+                *   the logic is to first look for a "container" member of params, and pass that back if found.  otherwise we
+                *   handoff to the 'getParent' function in the current library.
+                */
+               _getParentFromParams = function(params) {
+                       if (params.container)
+                               return params.container;
+                       else {
+                var tag = jsPlumb.CurrentLibrary.getTagName(params.source),
+                    p = jsPlumb.CurrentLibrary.getParent(params.source);
+                if (tag && tag.toLowerCase() === "td")
+                    return jsPlumb.CurrentLibrary.getParent(p);
+                else return p;
+            }
+               },
+               
+               /*
+                       factory method to prepare a new endpoint.  this should always be used instead of creating Endpoints
+                       manually, since this method attaches event listeners and an id.
+               */
+               _newEndpoint = function(params) {
+                               var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;
+                               var _p = jsPlumb.extend({}, params);                            
+                               _p.parent = _getParentFromParams(_p);
+                               _p._jsPlumb = _currentInstance;
+                _p.newConnection = _newConnection;
+                _p.newEndpoint = _newEndpoint;                
+                _p.endpointsByUUID = endpointsByUUID;             
+                _p.endpointsByElement = endpointsByElement;  
+                _p.finaliseConnection = _finaliseConnection;
+                _p.fireDetachEvent = fireDetachEvent;
+                _p.fireMoveEvent = fireMoveEvent;
+                _p.floatingConnections = floatingConnections;
+                _p.getParentFromParams = _getParentFromParams;
+                _p.elementId = _getId(_p.source);                
+                               var ep = new endpointFunc(_p);                  
+                               ep.id = "ep_" + _idstamp();
+                               _eventFireProxy("click", "endpointClick", ep);
+                               _eventFireProxy("dblclick", "endpointDblClick", ep);
+                               _eventFireProxy("contextmenu", "contextmenu", ep);
+                               if (!jsPlumbAdapter.headless)
+                                       _currentInstance.dragManager.endpointAdded(_p.source);
+                       return ep;
+               },
+               
+               /*
+                * performs the given function operation on all the connections found
+                * for the given element id; this means we find all the endpoints for
+                * the given element, and then for each endpoint find the connectors
+                * connected to it. then we pass each connection in to the given
+                * function.             
+                */
+               _operation = function(elId, func, endpointFunc) {
+                       var endpoints = endpointsByElement[elId];
+                       if (endpoints && endpoints.length) {
+                               for ( var i = 0, ii = endpoints.length; i < ii; i++) {
+                                       for ( var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {
+                                               var retVal = func(endpoints[i].connections[j]);
+                                               // if the function passed in returns true, we exit.
+                                               // most functions return false.
+                                               if (retVal) return;
+                                       }
+                                       if (endpointFunc) endpointFunc(endpoints[i]);
+                               }
+                       }
+               },      
+               
+               _setDraggable = function(element, draggable) {
+                       return _elementProxy(element, function(el, id) {
+                               draggableStates[id] = draggable;
+                               if (jsPlumb.CurrentLibrary.isDragSupported(el)) {
+                                       jsPlumb.CurrentLibrary.setDraggable(el, draggable);
+                               }
+                       });
+               },
+               /*
+                * private method to do the business of hiding/showing.
+                * 
+                * @param el
+                *            either Id of the element in question or a library specific
+                *            object for the element.
+                * @param state
+                *            String specifying a value for the css 'display' property
+                *            ('block' or 'none').
+                */
+               _setVisible = function(el, state, alsoChangeEndpoints) {
+                       state = state === "block";
+                       var endpointFunc = null;
+                       if (alsoChangeEndpoints) {
+                               if (state) endpointFunc = function(ep) {
+                                       ep.setVisible(true, true, true);
+                               };
+                               else endpointFunc = function(ep) {
+                                       ep.setVisible(false, true, true);
+                               };
+                       }
+                       var info = _info(el);
+                       _operation(info.id, function(jpc) {
+                               if (state && alsoChangeEndpoints) {             
+                                       // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.
+                                       // this block will only set a connection to be visible if the other endpoint in the connection is also visible.
+                                       var oidx = jpc.sourceId === info.id ? 1 : 0;
+                                       if (jpc.endpoints[oidx].isVisible()) jpc.setVisible(true);
+                               }
+                               else  // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.
+                                       jpc.setVisible(state);
+                       }, endpointFunc);
+               },
+               /*
+                * toggles the draggable state of the given element(s).
+                * el is either an id, or an element object, or a list of ids/element objects.
+                */
+               _toggleDraggable = function(el) {
+                       return _elementProxy(el, function(el, elId) {
+                               var state = draggableStates[elId] == null ? false : draggableStates[elId];
+                               state = !state;
+                               draggableStates[elId] = state;
+                               jsPlumb.CurrentLibrary.setDraggable(el, state);
+                               return state;
+                       });
+               },
+               /**
+                * private method to do the business of toggling hiding/showing.
+                */
+               _toggleVisible = function(elId, changeEndpoints) {
+                       var endpointFunc = null;
+                       if (changeEndpoints) {
+                               endpointFunc = function(ep) {
+                                       var state = ep.isVisible();
+                                       ep.setVisible(!state);
+                               };
+                       }
+                       _operation(elId, function(jpc) {
+                               var state = jpc.isVisible();
+                               jpc.setVisible(!state);                         
+                       }, endpointFunc);
+                       // todo this should call _elementProxy, and pass in the
+                       // _operation(elId, f) call as a function. cos _toggleDraggable does
+                       // that.
+               },
+               /**
+                * updates the offset and size for a given element, and stores the
+                * values. if 'offset' is not null we use that (it would have been
+                * passed in from a drag call) because it's faster; but if it is null,
+                * or if 'recalc' is true in order to force a recalculation, we get the current values.
+                */
+               _updateOffset = function(params) {
+                       var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;
+                       if (_suspendDrawing && !timestamp) timestamp = _suspendedAt;
+                       if (!recalc) {
+                               if (timestamp && timestamp === offsetTimestamps[elId]) {                        
+                                       return {o:params.offset || offsets[elId], s:sizes[elId]};
+                               }
+                       }                       
+                       if (recalc || !offset) { // if forced repaint or no offset available, we recalculate.
+                               // get the current size and offset, and store them
+                               s = _gel(elId);
+                               if (s != null) {                                                
+                                       sizes[elId] = _getSize(s);
+                                       offsets[elId] = _getOffset(s, _currentInstance);
+                                       offsetTimestamps[elId] = timestamp;
+                               }
+                       } else {
+                               offsets[elId] = offset;
+                if (sizes[elId] == null) {
+                    s = _gel(elId);
+                    if (s != null) sizes[elId] = _getSize(s);
+                }
+                offsetTimestamps[elId] = timestamp;
+            }
+                       
+                       if(offsets[elId] && !offsets[elId].right) {
+                               offsets[elId].right = offsets[elId].left + sizes[elId][0];
+                               offsets[elId].bottom = offsets[elId].top + sizes[elId][1];      
+                               offsets[elId].width = sizes[elId][0];
+                               offsets[elId].height = sizes[elId][1];  
+                               offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);
+                               offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);                         
+                       }
+                       return {o:offsets[elId], s:sizes[elId]};
+               },
+
+               // TODO comparison performance
+               _getCachedData = function(elId) {
+                       var o = offsets[elId];
+                       if (!o) 
+                return _updateOffset({elId:elId});
+                       else
+                return {o:o, s:sizes[elId]};
+               },
+
+               /**
+                * gets an id for the given element, creating and setting one if
+                * necessary.  the id is of the form
+                *
+                *      jsPlumb_<instance index>_<index in instance>
+                *
+                * where "index in instance" is a monotonically increasing integer that starts at 0,
+                * for each instance.  this method is used not only to assign ids to elements that do not
+                * have them but also to connections and endpoints.
+                */
+               _getId = function(element, uuid, doNotCreateIfNotFound) {
+                       if (jsPlumbUtil.isString(element)) return element;                      
+                       if (element == null) return null;                       
+                       var id = jsPlumbAdapter.getAttribute(element, "id");
+                       if (!id || id === "undefined") {
+                               // check if fixed uuid parameter is given
+                               if (arguments.length == 2 && arguments[1] !== undefined)
+                                       id = uuid;
+                               else if (arguments.length == 1 || (arguments.length == 3 && !arguments[2]))
+                                       id = "jsPlumb_" + _instanceIndex + "_" + _idstamp();
+                               
+                if (!doNotCreateIfNotFound) jsPlumbAdapter.setAttribute(element, "id", id);
+                       }
+                       return id;
+               };
+
+               this.setConnectionBeingDragged = function(v) {
+                       connectionBeingDragged = v;
+               };
+               this.isConnectionBeingDragged = function() {
+                       return connectionBeingDragged;
+               };
+    
+               this.connectorClass = "_jsPlumb_connector";                     
+               this.hoverClass = "_jsPlumb_hover";                     
+               this.endpointClass = "_jsPlumb_endpoint";               
+               this.endpointConnectedClass = "_jsPlumb_endpoint_connected";            
+               this.endpointFullClass = "_jsPlumb_endpoint_full";              
+               this.endpointDropAllowedClass = "_jsPlumb_endpoint_drop_allowed";               
+               this.endpointDropForbiddenClass = "_jsPlumb_endpoint_drop_forbidden";           
+               this.overlayClass = "_jsPlumb_overlay";                         
+               this.draggingClass = "_jsPlumb_dragging";               
+               this.elementDraggingClass = "_jsPlumb_element_dragging";                        
+               this.sourceElementDraggingClass = "_jsPlumb_source_element_dragging";
+               this.targetElementDraggingClass = "_jsPlumb_target_element_dragging";
+               this.endpointAnchorClassPrefix = "_jsPlumb_endpoint_anchor";
+               this.hoverSourceClass = "_jsPlumb_source_hover";        
+               this.hoverTargetClass = "_jsPlumb_target_hover";
+               this.dragSelectClass = "_jsPlumb_drag_select";
+
+               this.Anchors = {};              
+               this.Connectors = {  "canvas":{}, "svg":{}, "vml":{} };                         
+               this.Endpoints = { "canvas":{}, "svg":{}, "vml":{} };
+               this.Overlays = { "canvas":{}, "svg":{}, "vml":{}};             
+               this.ConnectorRenderers = {};                           
+               this.SVG = "svg";
+               this.CANVAS = "canvas";         
+               this.VML = "vml";
+                               
+
+// --------------------------- jsPLumbInstance public API ---------------------------------------------------------
+                                       
+               
+               this.addEndpoint = function(el, params, referenceParams) {
+                       referenceParams = referenceParams || {};
+                       var p = jsPlumb.extend({}, referenceParams);
+                       jsPlumb.extend(p, params);
+                       p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint || jsPlumb.Defaults.Endpoint;
+                       p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle || jsPlumb.Defaults.EndpointStyle;
+            // YUI wrapper
+                       el = _convertYUICollection(el);                                                 
+
+                       var results = [], 
+                               inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];
+                                               
+                       for (var i = 0, j = inputs.length; i < j; i++) {
+                               var _el = _dom(inputs[i]), id = _getId(_el);
+                               p.source = _el;
+
+                _updateOffset({ elId : id, timestamp:_suspendedAt });
+                               var e = _newEndpoint(p);
+                               if (p.parentAnchor) e.parentAnchor = p.parentAnchor;
+                               _ju.addToList(endpointsByElement, id, e);
+                               var myOffset = offsets[id], 
+                                       myWH = sizes[id],
+                                       anchorLoc = e.anchor.compute( { xy : [ myOffset.left, myOffset.top ], wh : myWH, element : e, timestamp:_suspendedAt }),
+                                       endpointPaintParams = { anchorLoc : anchorLoc, timestamp:_suspendedAt };
+                               
+                               if (_suspendDrawing) endpointPaintParams.recalc = false;
+                               if (!_suspendDrawing) e.paint(endpointPaintParams);
+                               
+                               results.push(e);
+                               e._doNotDeleteOnDetach = true; // mark this as being added via addEndpoint.                             
+                       }
+                       
+                       return results.length == 1 ? results[0] : results;
+               };
+               
+               
+               this.addEndpoints = function(el, endpoints, referenceParams) {
+                       var results = [];
+                       for ( var i = 0, j = endpoints.length; i < j; i++) {
+                               var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);
+                               if (_ju.isArray(e))
+                                       Array.prototype.push.apply(results, e);
+                               else results.push(e);
+                       }
+                       return results;
+               };
+               
+               this.animate = function(el, properties, options) {
+                       options = options || {};
+                       var ele = _gel(el), 
+                               id = _getId(el),
+                               stepFunction = jsPlumb.CurrentLibrary.dragEvents.step,
+                               completeFunction = jsPlumb.CurrentLibrary.dragEvents.complete;
+
+                       options[stepFunction] = _ju.wrap(options[stepFunction], function() {
+                               _currentInstance.repaint(id);
+                       });
+
+                       // onComplete repaints, just to make sure everything looks good at the end of the animation.
+                       options[completeFunction] = _ju.wrap(options[completeFunction], function() {
+                               _currentInstance.repaint(id);
+                       });
+
+                       jsPlumb.CurrentLibrary.animate(ele, properties, options);
+               };              
+               
+               /**
+               * checks for a listener for the given condition, executing it if found, passing in the given value.
+               * condition listeners would have been attached using "bind" (which is, you could argue, now overloaded, since
+               * firing click events etc is a bit different to what this does).  i thought about adding a "bindCondition"
+               * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these
+               * condition events anyway.
+               */
+               this.checkCondition = function(conditionName, value) {
+                       var l = _currentInstance.getListener(conditionName),
+                               r = true;
+                               
+                       if (l && l.length > 0) {
+                               try {
+                                       for (var i = 0, j = l.length; i < j; i++) {
+                                               r = r && l[i](value); 
+                                       }
+                               }
+                               catch (e) { 
+                                       _ju.log(_currentInstance, "cannot check condition [" + conditionName + "]" + e); 
+                               }
+                       }
+                       return r;
+               };
+               
+               /**
+                * checks a condition asynchronously: fires the event handler and passes the handler
+                * a 'proceed' function and a 'stop' function. The handler MUST execute one or other
+                * of these once it has made up its mind.
+                *
+                * Note that although this reads the listener list for the given condition, it
+                * does not loop through and hit each listener, because that, with asynchronous
+                * callbacks, would be messy. so it uses only the first listener registered.
+                */ 
+               this.checkASyncCondition = function(conditionName, value, proceed, stop) {
+                       var l = _currentInstance.getListener(conditionName);
+                               
+                       if (l && l.length > 0) {
+                               try {
+                                       l[0](value, proceed, stop);                                     
+                               }
+                               catch (e) { 
+                                       _ju.log(_currentInstance, "cannot asynchronously check condition [" + conditionName + "]" + e); 
+                               }
+                       }       
+               };
+
+               
+               this.connect = function(params, referenceParams) {
+                       // prepare a final set of parameters to create connection with
+                       var _p = _prepareConnectionParams(params, referenceParams), jpc;
+                       // TODO probably a nicer return value if the connection was not made.  _prepareConnectionParams
+                       // will return null (and log something) if either endpoint was full.  what would be nicer is to 
+                       // create a dedicated 'error' object.
+                       if (_p) {
+                               // create the connection.  it is not yet registered 
+                               jpc = _newConnection(_p);
+                               // now add it the model, fire an event, and redraw
+                               _finaliseConnection(jpc, _p);                                                                           
+                       }
+                       return jpc;
+               };              
+               
+               this.deleteEndpoint = function(object, doNotRepaintAfterwards) {
+                       var _is = _currentInstance.setSuspendDrawing(true);
+                       var endpoint = (typeof object == "string") ? endpointsByUUID[object] : object;                  
+                       if (endpoint) {         
+                               _currentInstance.deleteObject({
+                                       endpoint:endpoint
+                               });
+                       }
+                       if(!_is) _currentInstance.setSuspendDrawing(false, doNotRepaintAfterwards);
+                       return _currentInstance;                                                                        
+               };              
+               
+               this.deleteEveryEndpoint = function() {
+                       var _is = _currentInstance.setSuspendDrawing(true);
+                       for ( var id in endpointsByElement) {
+                               var endpoints = endpointsByElement[id];
+                               if (endpoints && endpoints.length) {
+                                       for ( var i = 0, j = endpoints.length; i < j; i++) {
+                                               _currentInstance.deleteEndpoint(endpoints[i], true);
+                                       }
+                               }
+                       }                       
+                       endpointsByElement = {};                        
+                       endpointsByUUID = {};
+                       _currentInstance.anchorManager.reset();
+                       _currentInstance.dragManager.reset();                                                   
+                       if(!_is) _currentInstance.setSuspendDrawing(false);
+                       return _currentInstance;
+               };
+
+               var fireDetachEvent = function(jpc, doFireEvent, originalEvent) {
+            // may have been given a connection, or in special cases, an object
+            var connType =  _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),
+                argIsConnection = jpc.constructor == connType,
+                params = argIsConnection ? {
+                    connection:jpc,
+                                   source : jpc.source, target : jpc.target,
+                                   sourceId : jpc.sourceId, targetId : jpc.targetId,
+                                   sourceEndpoint : jpc.endpoints[0], targetEndpoint : jpc.endpoints[1]
+                } : jpc;
+
+                       if (doFireEvent)
+                               _currentInstance.fire("connectionDetached", params, originalEvent);
+                       
+            _currentInstance.anchorManager.connectionDetached(params);
+               };      
+
+               var fireMoveEvent = function(params, evt) {
+                       _currentInstance.fire("connectionMoved", params, evt);
+               };
+
+               this.unregisterEndpoint = function(endpoint) {
+                       if (endpoint._jsPlumb.uuid) endpointsByUUID[endpoint._jsPlumb.uuid] = null;                             
+                       _currentInstance.anchorManager.deleteEndpoint(endpoint);                        
+                       // TODO at least replace this with a removeWithFunction call.                   
+                       for (var e in endpointsByElement) {
+                               var endpoints = endpointsByElement[e];
+                               if (endpoints) {
+                                       var newEndpoints = [];
+                                       for (var i = 0, j = endpoints.length; i < j; i++)
+                                               if (endpoints[i] != endpoint) newEndpoints.push(endpoints[i]);
+                                       
+                                       endpointsByElement[e] = newEndpoints;
+                               }
+                               if(endpointsByElement[e].length <1){
+                                       delete endpointsByElement[e];
+                               }
+                       }
+               };
+                               
+               this.detach = function() {
+
+            if (arguments.length === 0) return;
+            var connType =  _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),
+                firstArgIsConnection = arguments[0].constructor == connType,
+                params = arguments.length == 2 ? firstArgIsConnection ? (arguments[1] || {}) : arguments[0] : arguments[0],
+                fireEvent = (params.fireEvent !== false),
+                forceDetach = params.forceDetach,
+                conn = firstArgIsConnection ? arguments[0] : params.connection;
+                                                    
+                               if (conn) {             
+                    if (forceDetach || jsPlumbUtil.functionChain(true, false, [
+                            [ conn.endpoints[0], "isDetachAllowed", [ conn ] ],    
+                            [ conn.endpoints[1], "isDetachAllowed", [ conn ] ],
+                            [ conn, "isDetachAllowed", [ conn ] ],
+                            [ _currentInstance, "checkCondition", [ "beforeDetach", conn ] ] ])) {
+                        
+                        conn.endpoints[0].detach(conn, false, true, fireEvent); 
+                    }
+                }
+                else {
+                                       var _p = jsPlumb.extend( {}, params); // a backwards compatibility hack: source should be thought of as 'params' in this case.
+                                       // test for endpoint uuids to detach
+                                       if (_p.uuids) {
+                                               _getEndpoint(_p.uuids[0]).detachFrom(_getEndpoint(_p.uuids[1]), fireEvent);
+                                       } else if (_p.sourceEndpoint && _p.targetEndpoint) {
+                                               _p.sourceEndpoint.detachFrom(_p.targetEndpoint);
+                                       } else {
+                                               var sourceId = _getId(_dom(_p.source)),
+                                                   targetId = _getId(_dom(_p.target));
+                                               _operation(sourceId, function(jpc) {
+                                                   if ((jpc.sourceId == sourceId && jpc.targetId == targetId) || (jpc.targetId == sourceId && jpc.sourceId == targetId)) {
+                                                           if (_currentInstance.checkCondition("beforeDetach", jpc)) {
+                                    jpc.endpoints[0].detach(jpc, false, true, fireEvent);
+                                                               }
+                                                       }
+                                               });
+                                       }
+                               }
+               };
+
+               this.detachAllConnections = function(el, params) {
+            params = params || {};
+            el = _dom(el);
+                       var id = _getId(el),
+                endpoints = endpointsByElement[id];
+                       if (endpoints && endpoints.length) {
+                               for ( var i = 0, j = endpoints.length; i < j; i++) {
+                                       endpoints[i].detachAll(params.fireEvent !== false);
+                               }
+                       }
+                       return _currentInstance;
+               };
+
+               this.detachEveryConnection = function(params) {
+            params = params || {};
+            _currentInstance.doWhileSuspended(function() {
+                               for ( var id in endpointsByElement) {
+                                       var endpoints = endpointsByElement[id];
+                                       if (endpoints && endpoints.length) {
+                                               for ( var i = 0, j = endpoints.length; i < j; i++) {
+                                                       endpoints[i].detachAll(params.fireEvent !== false);
+                                               }
+                                       }
+                               }
+                               connections.splice(0);
+                       });
+                       return _currentInstance;
+               };
+
+               /// not public.  but of course its exposed. how to change this.
+               this.deleteObject = function(params) {
+                       var result = {
+                                       endpoints : {}, 
+                                       connections : {},
+                                       endpointCount:0,
+                                       connectionCount:0
+                               },
+                               fireEvent = params.fireEvent !== false,
+                               deleteAttachedObjects = params.deleteAttachedObjects !== false;
+
+                       var unravelConnection = function(connection) {
+                               if(connection != null && result.connections[connection.id] == null) {
+                                       if (connection._jsPlumb != null) connection.setHover(false);
+                                       result.connections[connection.id] = connection;
+                                       result.connectionCount++;
+                                       if (deleteAttachedObjects) {
+                                               for (var j = 0; j < connection.endpoints.length; j++) {
+                                                       if (connection.endpoints[j]._deleteOnDetach)
+                                                               unravelEndpoint(connection.endpoints[j]);
+                                               }
+                                       }                                       
+                               }
+                       };
+                       var unravelEndpoint = function(endpoint) {
+                               if(endpoint != null && result.endpoints[endpoint.id] == null) {
+                                       if (endpoint._jsPlumb != null) endpoint.setHover(false);
+                                       result.endpoints[endpoint.id] = endpoint;
+                                       result.endpointCount++;
+
+                                       if (deleteAttachedObjects) {
+                                               for (var i = 0; i < endpoint.connections.length; i++) {
+                                                       var c = endpoint.connections[i];
+                                                       unravelConnection(c);                                           
+                                               }
+                                       }
+                               }
+                       };
+
+                       if (params.connection) 
+                               unravelConnection(params.connection);
+                       else unravelEndpoint(params.endpoint);
+
+                       // loop through connections
+                       for (var i in result.connections) {
+                               var c = result.connections[i];
+                               c.endpoints[0].detachFromConnection(c);
+                               c.endpoints[1].detachFromConnection(c);
+                               //_currentInstance.unregisterConnection(c);
+                               jsPlumbUtil.removeWithFunction(connections, function(_c) {
+                                   return c.id == _c.id;
+                               });
+                               fireDetachEvent(c, fireEvent, params.originalEvent);
+                               c.cleanup();
+                               c.destroy();
+                       }
+
+                       // loop through endpoints
+                       for (var j in result.endpoints) {
+                               var e = result.endpoints[j];    
+                               _currentInstance.unregisterEndpoint(e);
+                               // FIRE some endpoint deleted event?
+                               e.cleanup();
+                               e.destroy();
+                       }       
+
+                       return result;
+               };
+               this.draggable = function(el, options) {
+                       var i,j,ele;
+                       // allows for array or jquery/mootools selector
+                       if (typeof el == 'object' && el.length) {
+                               for (i = 0, j = el.length; i < j; i++) {
+                                       ele = _dom(el[i]);
+                                       if (ele) _initDraggableIfNecessary(ele, true, options);
+                               }
+                       } 
+                       // allows for YUI selector
+                       else if (el._nodes) {   // TODO this is YUI specific; really the logic should be forced
+                               // into the library adapters (for jquery and mootools aswell)
+                               for (i = 0, j = el._nodes.length; i < j; i++) {
+                                       ele = _dom(el._nodes[i]);
+                                       if (ele) _initDraggableIfNecessary(ele, true, options);
+                               }
+                       }
+                       else {                          
+                               ele = _dom(el);
+                               if (ele) _initDraggableIfNecessary(ele, true, options);
+                       }
+                       return _currentInstance;
+               };
+
+
+               // just a library-agnostic wrapper.
+               this.extend = function(o1, o2) {
+                       return jsPlumb.CurrentLibrary.extend(o1, o2);
+               };
+
+               // helpers for select/selectEndpoints
+               var _setOperation = function(list, func, args, selector) {
+                               for (var i = 0, j = list.length; i < j; i++) {
+                                       list[i][func].apply(list[i], args);
+                               }       
+                               return selector(list);
+                       },
+                       _getOperation = function(list, func, args) {
+                               var out = [];
+                               for (var i = 0, j = list.length; i < j; i++) {                                  
+                                       out.push([ list[i][func].apply(list[i], args), list[i] ]);
+                               }       
+                               return out;
+                       },
+                       setter = function(list, func, selector) {
+                               return function() {
+                                       return _setOperation(list, func, arguments, selector);
+                               };
+                       },
+                       getter = function(list, func) {
+                               return function() {
+                                       return _getOperation(list, func, arguments);
+                               };      
+                       },
+                       prepareList = function(input, doNotGetIds) {
+                               var r = [];
+                               if (input) {
+                                       if (typeof input == 'string') {
+                                               if (input === "*") return input;
+                                               r.push(input);
+                                       }
+                                       else {
+                                               input = _gel(input);
+                                               if (doNotGetIds) r = input;
+                                               else { 
+                                                       for (var i = 0, j = input.length; i < j; i++) 
+                                                               r.push(_info(input[i]).id);
+                                               }       
+                                       }
+                               }
+                               return r;
+                       },
+                       filterList = function(list, value, missingIsFalse) {
+                               if (list === "*") return true;
+                               return list.length > 0 ? jsPlumbUtil.indexOf(list, value) != -1 : !missingIsFalse;
+                       };
+
+               // get some connections, specifying source/target/scope
+               this.getConnections = function(options, flat) {
+                       if (!options) {
+                               options = {};
+                       } else if (options.constructor == String) {
+                               options = { "scope": options };
+                       }
+                       var scope = options.scope || _currentInstance.getDefaultScope(),
+                               scopes = prepareList(scope, true),
+                               sources = prepareList(options.source),
+                               targets = prepareList(options.target),                  
+                               results = (!flat && scopes.length > 1) ? {} : [],
+                               _addOne = function(scope, obj) {
+                                       if (!flat && scopes.length > 1) {
+                                               var ss = results[scope];
+                                               if (ss == null) {
+                                                       ss = results[scope] = [];
+                                               }
+                                               ss.push(obj);
+                                       } else results.push(obj);
+                               };
+                       
+                       for ( var j = 0, jj = connections.length; j < jj; j++) {
+                               var c = connections[j];
+                               if (filterList(scopes, c.scope) && filterList(sources, c.sourceId) && filterList(targets, c.targetId))
+                                       _addOne(c.scope, c);
+                       }
+                       
+                       return results;
+               };
+               
+               var _curryEach = function(list, executor) {
+                               return function(f) {
+                                       for (var i = 0, ii = list.length; i < ii; i++) {
+                                               f(list[i]);
+                                       }
+                                       return executor(list);
+                               };              
+                       },
+                       _curryGet = function(list) {
+                               return function(idx) {
+                                       return list[idx];
+                               };
+                       };
+                       
+               var _makeCommonSelectHandler = function(list, executor) {
+            var out = {
+                    length:list.length,
+                                   each:_curryEach(list, executor),
+                                   get:_curryGet(list)
+                },
+                setters = ["setHover", "removeAllOverlays", "setLabel", "addClass", "addOverlay", "removeOverlay", 
+                           "removeOverlays", "showOverlay", "hideOverlay", "showOverlays", "hideOverlays", "setPaintStyle",
+                           "setHoverPaintStyle", "setSuspendEvents", "setParameter", "setParameters", "setVisible", 
+                           "repaint", "addType", "toggleType", "removeType", "removeClass", "setType", "bind", "unbind" ],
+                
+                getters = ["getLabel", "getOverlay", "isHover", "getParameter", "getParameters", "getPaintStyle",
+                           "getHoverPaintStyle", "isVisible", "hasType", "getType", "isSuspendEvents" ],
+                i, ii;
+            
+            for (i = 0, ii = setters.length; i < ii; i++)
+                out[setters[i]] = setter(list, setters[i], executor);
+            
+            for (i = 0, ii = getters.length; i < ii; i++)
+                out[getters[i]] = getter(list, getters[i]);       
+            
+            return out;
+               };
+               
+               var     _makeConnectionSelectHandler = function(list) {
+                       var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);
+                       return jsPlumb.CurrentLibrary.extend(common, {
+                               // setters                                                                      
+                               setDetachable:setter(list, "setDetachable", _makeConnectionSelectHandler),
+                               setReattach:setter(list, "setReattach", _makeConnectionSelectHandler),
+                               setConnector:setter(list, "setConnector", _makeConnectionSelectHandler),                        
+                               detach:function() {
+                                       for (var i = 0, ii = list.length; i < ii; i++)
+                                               _currentInstance.detach(list[i]);
+                               },                              
+                               // getters
+                               isDetachable:getter(list, "isDetachable"),
+                               isReattach:getter(list, "isReattach")
+                       });
+               };
+               
+               var     _makeEndpointSelectHandler = function(list) {
+                       var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);
+                       return jsPlumb.CurrentLibrary.extend(common, {
+                               setEnabled:setter(list, "setEnabled", _makeEndpointSelectHandler),                              
+                               setAnchor:setter(list, "setAnchor", _makeEndpointSelectHandler),
+                               isEnabled:getter(list, "isEnabled"),
+                               detachAll:function() {
+                                       for (var i = 0, ii = list.length; i < ii; i++)
+                                               list[i].detachAll();
+                               },
+                               "remove":function() {
+                                       for (var i = 0, ii = list.length; i < ii; i++)
+                                               _currentInstance.deleteObject({endpoint:list[i]});
+                               }
+                       });
+               };
+                       
+
+               this.select = function(params) {
+                       params = params || {};
+                       params.scope = params.scope || "*";
+                       return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));                                                       
+               };              
+
+               this.selectEndpoints = function(params) {
+                       params = params || {};
+                       params.scope = params.scope || "*";
+                       var noElementFilters = !params.element && !params.source && !params.target,                     
+                               elements = noElementFilters ? "*" : prepareList(params.element),
+                               sources = noElementFilters ? "*" : prepareList(params.source),
+                               targets = noElementFilters ? "*" : prepareList(params.target),
+                               scopes = prepareList(params.scope, true);
+                       
+                       var ep = [];
+                       
+                       for (var el in endpointsByElement) {
+                               var either = filterList(elements, el, true),
+                                       source = filterList(sources, el, true),
+                                       sourceMatchExact = sources != "*",
+                                       target = filterList(targets, el, true),
+                                       targetMatchExact = targets != "*"; 
+                                       
+                               // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.  
+                               if ( either || source  || target ) {
+                                       inner:
+                                       for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {
+                                               var _ep = endpointsByElement[el][i];
+                                               if (filterList(scopes, _ep.scope, true)) {
+                                               
+                                                       var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),
+                                                               noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);
+                                               
+                                                       if (noMatchSource || noMatchTarget)                                                               
+                                                                 continue inner; 
+                                                                                                               
+                                                       ep.push(_ep);           
+                                               }
+                                       }
+                               }                                       
+                       }
+                       
+                       return _makeEndpointSelectHandler(ep);
+               };
+
+               // get all connections managed by the instance of jsplumb.
+               this.getAllConnections = function() { return connections; };
+               this.getDefaultScope = function() { return DEFAULT_SCOPE; };
+               // get an endpoint by uuid.
+               this.getEndpoint = _getEndpoint;                                
+               // get endpoints for some element.
+               this.getEndpoints = function(el) { return endpointsByElement[_info(el).id]; };          
+               // gets the default endpoint type. used when subclassing. see wiki.
+               this.getDefaultEndpointType = function() { return jsPlumb.Endpoint; };          
+               // gets the default connection type. used when subclassing.  see wiki.
+               this.getDefaultConnectionType = function() { return jsPlumb.Connection; };
+               /*
+                * Gets an element's id, creating one if necessary. really only exposed
+                * for the lib-specific functionality to access; would be better to pass
+                * the current instance into the lib-specific code (even though this is
+                * a static call. i just don't want to expose it to the public API).
+                */
+               this.getId = _getId;
+               this.getOffset = function(id) { 
+                       var o = offsets[id]; 
+                       return _updateOffset({elId:id});
+               };
+
+               this.getSelector = function() {
+                       return jsPlumb.CurrentLibrary.getSelector.apply(null, arguments);
+               };
+               
+               // get the size of the element with the given id, perhaps from cache.
+               this.getSize = function(id) { 
+                       var s = sizes[id]; 
+                       if (!s) _updateOffset({elId:id});
+                       return sizes[id];
+               };              
+               
+               this.appendElement = _appendElement;
+               
+               var _hoverSuspended = false;
+               this.isHoverSuspended = function() { return _hoverSuspended; };
+               this.setHoverSuspended = function(s) { _hoverSuspended = s; };
+
+               var _isAvailable = function(m) {
+                       return function() {
+                               return jsPlumbAdapter.isRenderModeAvailable(m);
+                       };
+               };
+               this.isCanvasAvailable = _isAvailable("canvas");
+               this.isSVGAvailable = _isAvailable("svg");
+               this.isVMLAvailable = _isAvailable("vml");
+
+               // set an element's connections to be hidden
+               this.hide = function(el, changeEndpoints) {
+                       _setVisible(el, "none", changeEndpoints);
+                       return _currentInstance;
+               };
+               
+               // exposed for other objects to use to get a unique id.
+               this.idstamp = _idstamp;
+
+               this.connectorsInitialized = false;
+               var connectorTypes = [], rendererTypes = ["canvas", "svg", "vml"];
+               this.registerConnectorType = function(connector, name) {
+                       connectorTypes.push([connector, name]);
+               };
+               
+               /**
+                * callback from the current library to tell us to prepare ourselves (attach
+                * mouse listeners etc; can't do that until the library has provided a bind method)              
+                */
+               this.init = function() {
+                       var _oneType = function(renderer, name, fn) {
+                               jsPlumb.Connectors[renderer][name] = function() {
+                                       fn.apply(this, arguments);
+                                       jsPlumb.ConnectorRenderers[renderer].apply(this, arguments);            
+                               };
+                               jsPlumbUtil.extend(jsPlumb.Connectors[renderer][name], [ fn, jsPlumb.ConnectorRenderers[renderer]]);
+                       };
+
+                       if (!jsPlumb.connectorsInitialized) {
+                               for (var i = 0; i < connectorTypes.length; i++) {
+                                       for (var j = 0; j < rendererTypes.length; j++) {
+                                               _oneType(rendererTypes[j], connectorTypes[i][1], connectorTypes[i][0]);                                                                                         
+                                       }
+
+                               }
+                               jsPlumb.connectorsInitialized = true;
+                       }
+                       
+                       if (!initialized) {                
+                _currentInstance.anchorManager = new jsPlumb.AnchorManager({jsPlumbInstance:_currentInstance});                
+                               _currentInstance.setRenderMode(_currentInstance.Defaults.RenderMode);  // calling the method forces the capability logic to be run.                                                                                                             
+                               initialized = true;
+                               _currentInstance.fire("ready", _currentInstance);
+                       }
+               }.bind(this);           
+               
+               this.log = log;
+               this.jsPlumbUIComponent = jsPlumbUIComponent;           
+
+               /*
+                * Creates an anchor with the given params.
+                * 
+                * 
+                * Returns: The newly created Anchor.
+                * Throws: an error if a named anchor was not found.
+                */
+               this.makeAnchor = function() {
+                       var pp, _a = function(t, p) {
+                               if (jsPlumb.Anchors[t]) return new jsPlumb.Anchors[t](p);
+                               if (!_currentInstance.Defaults.DoNotThrowErrors)
+                                       throw { msg:"jsPlumb: unknown anchor type '" + t + "'" };
+                       };
+                       if (arguments.length === 0) return null;
+                       var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;                        
+                       // if it appears to be an anchor already...
+                       if (specimen.compute && specimen.getOrientation) return specimen;  //TODO hazy here about whether it should be added or is already added somehow.
+                       // is it the name of an anchor type?
+                       else if (typeof specimen == "string") {
+                               newAnchor = _a(arguments[0], {elementId:elementId, jsPlumbInstance:_currentInstance});
+                       }
+                       // is it an array? it will be one of:
+                       //              an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.
+                       //              an array of arrays - this defines some dynamic anchors
+                       //              an array of numbers - this defines a single anchor.                             
+                       else if (_ju.isArray(specimen)) {
+                               if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {
+                                       // if [spec, params] format
+                                       if (specimen.length == 2 && _ju.isObject(specimen[1])) {
+                                               // if first arg is a string, its a named anchor with params
+                                               if (_ju.isString(specimen[0])) {
+                                                       pp = jsPlumb.extend({elementId:elementId, jsPlumbInstance:_currentInstance}, specimen[1]);
+                                                       newAnchor = _a(specimen[0], pp);
+                                               }
+                                               // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine
+                                               // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.
+                                               else {
+                                                       pp = jsPlumb.extend({elementId:elementId, jsPlumbInstance:_currentInstance, anchors:specimen[0]}, specimen[1]);
+                                                       newAnchor = new jsPlumb.DynamicAnchor(pp);
+                                               }
+                                       }
+                                       else
+                                               newAnchor = new jsPlumb.DynamicAnchor({anchors:specimen, selector:null, elementId:elementId, jsPlumbInstance:jsPlumbInstance});
+
+                               }
+                               else {
+                                       var anchorParams = {
+                                               x:specimen[0], y:specimen[1],
+                                               orientation : (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0,0],
+                                               offsets : (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],
+                                               elementId:elementId,
+                        jsPlumbInstance:jsPlumbInstance,
+                        cssClass:specimen.length == 7 ? specimen[6] : null
+                                       };                                              
+                                       newAnchor = new jsPlumb.Anchor(anchorParams);
+                                       newAnchor.clone = function() { return new jsPlumb.Anchor(anchorParams); };                                                                                      
+                               }
+                       }
+                       
+                       if (!newAnchor.id) newAnchor.id = "anchor_" + _idstamp();
+                       return newAnchor;
+               };
+
+               /**
+                * makes a list of anchors from the given list of types or coords, eg
+                * ["TopCenter", "RightMiddle", "BottomCenter", [0, 1, -1, -1] ]
+                */
+               this.makeAnchors = function(types, elementId, jsPlumbInstance) {
+                       var r = [];
+                       for ( var i = 0, ii = types.length; i < ii; i++) {
+                               if (typeof types[i] == "string")
+                                       r.push(jsPlumb.Anchors[types[i]]({elementId:elementId, jsPlumbInstance:jsPlumbInstance}));
+                               else if (_ju.isArray(types[i]))
+                                       r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));
+                       }
+                       return r;
+               };
+
+               /**
+                * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor
+                * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will
+                * not need to provide this - i think). 
+                */
+               this.makeDynamicAnchor = function(anchors, anchorSelector) {
+                       return new jsPlumb.DynamicAnchor({anchors:anchors, selector:anchorSelector, elementId:null, jsPlumbInstance:_currentInstance});
+               };
+               
+// --------------------- makeSource/makeTarget ---------------------------------------------- 
+               
+               var _targetEndpointDefinitions = {},
+                       _targetEndpoints = {},
+                       _targetEndpointsUnique = {},
+                       _targetMaxConnections = {},
+                       _setEndpointPaintStylesAndAnchor = function(ep, epIndex) {
+                               ep.paintStyle = ep.paintStyle ||
+                                                               _currentInstance.Defaults.EndpointStyles[epIndex] ||
+                                   _currentInstance.Defaults.EndpointStyle ||
+                                   jsPlumb.Defaults.EndpointStyles[epIndex] ||
+                                   jsPlumb.Defaults.EndpointStyle;
+                               ep.hoverPaintStyle = ep.hoverPaintStyle ||
+                                  _currentInstance.Defaults.EndpointHoverStyles[epIndex] ||
+                                  _currentInstance.Defaults.EndpointHoverStyle ||
+                                  jsPlumb.Defaults.EndpointHoverStyles[epIndex] ||
+                                  jsPlumb.Defaults.EndpointHoverStyle;                            
+
+                               ep.anchor = ep.anchor ||
+                               _currentInstance.Defaults.Anchors[epIndex] ||
+                               _currentInstance.Defaults.Anchor ||
+                               jsPlumb.Defaults.Anchors[epIndex] ||
+                               jsPlumb.Defaults.Anchor;                           
+                                       
+                               ep.endpoint = ep.endpoint ||
+                                                         _currentInstance.Defaults.Endpoints[epIndex] ||
+                                                         _currentInstance.Defaults.Endpoint ||
+                                                         jsPlumb.Defaults.Endpoints[epIndex] ||
+                                                         jsPlumb.Defaults.Endpoint;
+                       },
+                       // TODO put all the source stuff inside one parent, keyed by id.
+                       _sourceEndpointDefinitions = {},
+                       _sourceEndpoints = {},
+                       _sourceEndpointsUnique = {},
+                       _sourcesEnabled = {},
+                       _sourceTriggers = {},
+                       _sourceMaxConnections = {},
+                       _targetsEnabled = {},
+                       selectorFilter = function(evt, _el, selector) {             
+                var t = evt.target || evt.srcElement, ok = false, 
+                    sel = _currentInstance.getSelector(_el, selector);
+                for (var j = 0; j < sel.length; j++) {
+                    if (sel[j] == t) {
+                        ok = true;
+                        break;
+                    }
+                }
+                return ok;                 
+               };
+
+               // see API docs
+               this.makeTarget = function(el, params, referenceParams) {                                               
+                       
+                       // put jsplumb ref into params without altering the params passed in
+                       var p = jsPlumb.extend({_jsPlumb:_currentInstance}, referenceParams);
+                       jsPlumb.extend(p, params);
+
+                       // calculate appropriate paint styles and anchor from the params given                  
+                       _setEndpointPaintStylesAndAnchor(p, 1);                               
+
+                       var jpcl = jsPlumb.CurrentLibrary,
+                           targetScope = p.scope || _currentInstance.Defaults.Scope,
+                           deleteEndpointsOnDetach = !(p.deleteEndpointsOnDetach === false),
+                           maxConnections = p.maxConnections || -1,
+                               onMaxConnections = p.onMaxConnections,
+
+                               _doOne = function(el) {
+                                       
+                                       // get the element's id and store the endpoint definition for it.  jsPlumb.connect calls will look for one of these,
+                                       // and use the endpoint definition if found.
+                                       // decode the info for this element (id and element)
+                                       var elInfo = _info(el), 
+                                               elid = elInfo.id,
+                                               proxyComponent = new jsPlumbUIComponent(p),
+                                               dropOptions = jsPlumb.extend({}, p.dropOptions || {});
+
+                                       // store the definitions keyed against the element id.
+                                       _targetEndpointDefinitions[elid] = p;
+                                       _targetEndpointsUnique[elid] = p.uniqueEndpoint;
+                                       _targetMaxConnections[elid] = maxConnections;
+                                       _targetsEnabled[elid] = true;                           
+
+                                       var _drop = function() {
+                                               _currentInstance.currentlyDragging = false;
+                                               var originalEvent = jsPlumb.CurrentLibrary.getDropEvent(arguments),
+                                                       targetCount = _currentInstance.select({target:elid}).length,
+                                                       draggable = _gel(jpcl.getDragObject(arguments)),
+                                                       id = _currentInstance.getAttribute(draggable, "dragId"),                                                                                
+                                                       scope = _currentInstance.getAttribute(draggable, "originalScope"),
+                                                       jpc = floatingConnections[id],
+                                                       idx = jpc.endpoints[0].isFloating() ? 0 : 1,
+                                                       // this is not necessarily correct. if the source is being dragged,
+                                                       // then the source endpoint is actually the currently suspended endpoint.
+                                                       source = jpc.endpoints[0],
+                                                       _endpoint = p.endpoint ? jsPlumb.extend({}, p.endpoint) : {};                                   
+                                                       
+                                               if (!_targetsEnabled[elid] || _targetMaxConnections[elid] > 0 && targetCount >= _targetMaxConnections[elid]){
+                                                       if (onMaxConnections) {
+                                                               // TODO here we still have the id of the floating element, not the
+                                                               // actual target.
+                                                               onMaxConnections({
+                                                                       element:elInfo.el,
+                                                                       connection:jpc
+                                                               }, originalEvent);
+                                                       }
+                                                       return false;
+                                               }
+
+                                               // unlock the source anchor to allow it to refresh its position if necessary
+                                               source.anchor.locked = false;                                   
+                                                                                       
+                                               // restore the original scope if necessary (issue 57)
+                                               if (scope) jpcl.setDragScope(draggable, scope);         
+
+                                               // if no suspendedEndpoint and not pending, it is likely there was a drop on two 
+                                               // elements that are on top of each other. abort.
+                                               if (jpc.suspendedEndpoint == null && !jpc.pending)
+                                                       return false;           
+                                               
+                                               // check if drop is allowed here.                                       
+                                               // if the source is being dragged then in fact
+                                               // the source and target ids to pass into the drop interceptor are
+                                               // source - elid
+                                               // target - jpc's targetId
+                                               // 
+                                               // otherwise the ids are
+                                               // source - jpc.sourceId
+                                               // target - elid
+                                               //
+                                               var _continue = proxyComponent.isDropAllowed(idx === 0 ? elid : jpc.sourceId, idx === 0 ? jpc.targetId : elid, jpc.scope, jpc, null);                                                   
+
+                                               // reinstate any suspended endpoint; this just puts the connection back into
+                                               // a state in which it will report sensible values if someone asks it about
+                                               // its target.  we're going to throw this connection away shortly so it doesnt matter
+                                               // if we manipulate it a bit.
+                                               if (jpc.suspendedEndpoint) {
+                                                       jpc[idx ? "targetId" : "sourceId"] = jpc.suspendedEndpoint.elementId;
+                                                       jpc[idx ? "target" : "source"] = jpc.suspendedEndpoint.element;
+                                                       jpc.endpoints[idx] = jpc.suspendedEndpoint;
+                                               }                                                                                                                                                                                                               
+                                               
+                                               if (_continue) {
+                                                                                                                                       
+                                                       // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint
+                            // is set.
+                                                       var _el = jpcl.getElementObject(elInfo.el),
+                                                               newEndpoint = _targetEndpoints[elid];
+
+                            // if no cached endpoint, or there was one but it has been cleaned up
+                            // (ie. detached), then create a new one.
+                            if (newEndpoint == null || newEndpoint._jsPlumb == null)
+                                newEndpoint = _currentInstance.addEndpoint(_el, p);
+
+                                                       if (p.uniqueEndpoint) _targetEndpoints[elid] = newEndpoint;  // may of course just store what it just pulled out. that's ok.
+                                                       // TODO test options to makeTarget to see if we should do this?
+                                                       newEndpoint._doNotDeleteOnDetach = false; // reset.
+                                                       newEndpoint._deleteOnDetach = true;
+                                                                                                                                       
+                                                       // if the anchor has a 'positionFinder' set, then delegate to that function to find
+                                                       // out where to locate the anchor.
+                                                       if (newEndpoint.anchor.positionFinder != null) {
+                                                               var dropPosition = jpcl.getUIPosition(arguments, _currentInstance.getZoom()),
+                                                               elPosition = _getOffset(_el, _currentInstance),
+                                                               elSize = _getSize(_el),
+                                                               ap = newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);
+                                                               newEndpoint.anchor.x = ap[0];
+                                                               newEndpoint.anchor.y = ap[1];
+                                                               // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to
+                                                               // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation 
+                                                               // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be
+                                                               // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which
+                                                               // the target is furthest away from the source.
+                                                       }
+                                                       
+                                                       // change the target endpoint and target element information. really this should be 
+                                                       // done on a method on connection
+                                                       jpc[idx ? "target" : "source"] = newEndpoint.element;
+                                                       jpc[idx ? "targetId" : "sourceId"] = newEndpoint.elementId;
+                                                       jpc.endpoints[idx].detachFromConnection(jpc);
+                                                       if (jpc.endpoints[idx]._deleteOnDetach)
+                                                               jpc.endpoints[idx].deleteAfterDragStop = true; // tell this endpoint to delet itself after drag stop.
+                                                       // set new endpoint, and configure the settings for endpoints to delete on detach
+                                                       newEndpoint.addConnection(jpc);
+                                                       jpc.endpoints[idx] = newEndpoint;
+                                                       jpc.deleteEndpointsOnDetach = deleteEndpointsOnDetach;                                          
+
+                                                       // inform the anchor manager to update its target endpoint for this connection.
+                                                       // TODO refactor to make this a single method.
+                                                       if (idx == 1)
+                                                               _currentInstance.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.suspendedElementId, jpc.targetId, jpc);
+                                                       else
+                                                               _currentInstance.anchorManager.sourceChanged(jpc.suspendedEndpoint.elementId, jpc.sourceId, jpc);
+
+                                                       _finaliseConnection(jpc, null, originalEvent);
+                                                       jpc.pending = false;
+
+                                               }                               
+                                               // if not allowed to drop...
+                                               else {
+                                                       // TODO this code is identical (pretty much) to what happens when a connection
+                                                       // dragged from a normal endpoint is in this situation. refactor.
+                                                       // is this an existing connection, and will we reattach?
+                                                       // TODO also this assumes the source needs to detach - is that always valid?
+                                                       if (jpc.suspendedEndpoint) {                                                    
+                                                               if (jpc.isReattach()) {
+                                                                       jpc.setHover(false);
+                                                                       jpc.floatingAnchorIndex = null;
+                                                                       jpc.suspendedEndpoint.addConnection(jpc);
+                                                                       _currentInstance.repaint(source.elementId);
+                                                               }
+                                                               else
+                                                                       source.detach(jpc, false, true, true, originalEvent);  // otherwise, detach the connection and tell everyone about it.
+                                                       }
+                                                       
+                                               }                                                                                                               
+                                       };
+                                       
+                                       // wrap drop events as needed and initialise droppable
+                                       var dropEvent = jpcl.dragEvents.drop;
+                                       dropOptions.scope = dropOptions.scope || targetScope;
+                                       dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop);                               
+                                       jpcl.initDroppable(_gel(elInfo.el), dropOptions, true);
+                               };
+                       
+                       // YUI collection fix
+                       el = _convertYUICollection(el);                 
+                       // make an array if only given one element
+                       var inputs = el.length && el.constructor != String ? el : [ el ];
+                                               
+                       // register each one in the list.
+                       for (var i = 0, ii = inputs.length; i < ii; i++) {                                                      
+                               _doOne(inputs[i]);
+                       }
+
+                       return _currentInstance;
+               };
+
+               // see api docs
+               this.unmakeTarget = function(el, doNotClearArrays) {
+                       var info = _info(el);
+
+                       jsPlumb.CurrentLibrary.destroyDroppable(info.el);
+                       // TODO this is not an exhaustive unmake of a target, since it does not remove the droppable stuff from
+                       // the element.  the effect will be to prevent it from behaving as a target, but it's not completely purged.
+                       if (!doNotClearArrays) {
+                               delete _targetEndpointDefinitions[info.id];
+                               delete _targetEndpointsUnique[info.id];
+                               delete _targetMaxConnections[info.id];
+                               delete _targetsEnabled[info.id];                
+                       }
+
+                       return _currentInstance;
+               };                                              
+
+           // see api docs
+               this.makeSource = function(el, params, referenceParams) {
+                       var p = jsPlumb.extend({}, referenceParams);
+                       jsPlumb.extend(p, params);
+                       _setEndpointPaintStylesAndAnchor(p, 0);   
+                       var jpcl = jsPlumb.CurrentLibrary,
+                               maxConnections = p.maxConnections || -1,
+                               onMaxConnections = p.onMaxConnections,
+                               _doOne = function(elInfo) {
+                                       // get the element's id and store the endpoint definition for it.  jsPlumb.connect calls will look for one of these,
+                                       // and use the endpoint definition if found.
+                                       var elid = elInfo.id,
+                                               _el = _gel(elInfo.el),
+                                               parentElement = function() {
+                                                       return p.parent == null ? null : p.parent === "parent" ? elInfo.el.parentNode : _dom(p.parent);
+                                               },
+                                               idToRegisterAgainst = p.parent != null ? _currentInstance.getId(parentElement()) : elid;
+                                       
+                                       _sourceEndpointDefinitions[idToRegisterAgainst] = p;
+                                       _sourceEndpointsUnique[idToRegisterAgainst] = p.uniqueEndpoint;
+                                       _sourcesEnabled[idToRegisterAgainst] = true;
+
+                                       var stopEvent = jpcl.dragEvents.stop,
+                                               dragEvent = jpcl.dragEvents.drag,
+                                               dragOptions = jsPlumb.extend({ }, p.dragOptions || {}),
+                                               existingDrag = dragOptions.drag,
+                                               existingStop = dragOptions.stop,
+                                               ep = null,
+                                               endpointAddedButNoDragYet = false;
+                               
+                                       _sourceMaxConnections[idToRegisterAgainst] = maxConnections;    
+
+                                       // set scope if its not set in dragOptions but was passed in in params
+                                       dragOptions.scope = dragOptions.scope || p.scope;
+
+                                       dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function() {
+                                               if (existingDrag) existingDrag.apply(this, arguments);
+                                               endpointAddedButNoDragYet = false;
+                                       });
+                                       
+                                       dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function() { 
+
+                                               if (existingStop) existingStop.apply(this, arguments);                                                          
+                           _currentInstance.currentlyDragging = false;                                         
+                                               if (ep._jsPlumb != null) { // if not cleaned up...
+
+                                                       jpcl.unbind(ep.canvas, "mousedown"); 
+                                                                       
+                                                       // reset the anchor to the anchor that was initially provided. the one we were using to drag
+                                                       // the connection was just a placeholder that was located at the place the user pressed the
+                                                       // mouse button to initiate the drag.
+                                                       var anchorDef = p.anchor || _currentInstance.Defaults.Anchor,
+                                                               oldAnchor = ep.anchor,
+                                                               oldConnection = ep.connections[0],
+                                                               newAnchor = _currentInstance.makeAnchor(anchorDef, elid, _currentInstance),
+                                                               _el = ep.element;
+
+                                                       // if the anchor has a 'positionFinder' set, then delegate to that function to find
+                                                       // out where to locate the anchor. issue 117.
+                                                       if (newAnchor.positionFinder != null) {
+                                                               var elPosition = _getOffset(_el, _currentInstance),
+                                                                       elSize = _getSize(_el),
+                                                                       dropPosition = { left:elPosition.left + (oldAnchor.x * elSize[0]), top:elPosition.top + (oldAnchor.y * elSize[1]) },
+                                                                       ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);
+
+                                                               newAnchor.x = ap[0];
+                                                               newAnchor.y = ap[1];
+                                                       }
+
+                                                       ep.setAnchor(newAnchor, true);                                                                                                                                                                                  
+                                                       
+                                                       if (p.parent) {                                         
+                                                               var parent = parentElement();
+                                                               if (parent) {   
+                                                                       var potentialParent = p.container || _currentInstance.Defaults.Container || jsPlumb.Defaults.Container;
+                                                                       ep.setElement(parent, potentialParent);
+                                                               }
+                                                       }                                               
+                                                       
+                                                       ep.repaint();                   
+                                                       _currentInstance.repaint(ep.elementId);                                                                                                                                         
+                                                       _currentInstance.repaint(oldConnection.targetId);
+                                               }                               
+                                       });
+                                       // when the user presses the mouse, add an Endpoint, if we are enabled.
+                                       var mouseDownListener = function(e) {
+
+                                               // if disabled, return.
+                                               if (!_sourcesEnabled[idToRegisterAgainst]) return;
+                           
+                           // if a filter was given, run it, and return if it says no.
+                                               if (p.filter) {
+                                                       var evt = jpcl.getOriginalEvent(e),
+                                                               r = jsPlumbUtil.isString(p.filter) ? selectorFilter(evt, _el, p.filter) : p.filter(evt, _el);
+                                                       
+                                                       if (r === false) return;
+                                               }
+                                               
+                                               // if maxConnections reached
+                                               var sourceCount = _currentInstance.select({source:idToRegisterAgainst}).length;
+                                               if (_sourceMaxConnections[idToRegisterAgainst] >= 0 && sourceCount >= _sourceMaxConnections[idToRegisterAgainst]) {
+                                                       if (onMaxConnections) {
+                                                               onMaxConnections({
+                                                                       element:_el,
+                                                                       maxConnections:maxConnections
+                                                               }, e);
+                                                       }
+                                                       return false;
+                                               }                                       
+
+                                               // make sure we have the latest offset for this div 
+                                               var myOffsetInfo = _updateOffset({elId:elid}).o,
+                                                       z = _currentInstance.getZoom(),         
+                                                       x = ( ((e.pageX || e.page.x) / z) - myOffsetInfo.left) / myOffsetInfo.width, 
+                                                   y = ( ((e.pageY || e.page.y) / z) - myOffsetInfo.top) / myOffsetInfo.height,
+                                                   parentX = x, 
+                                                   parentY = y;                                        
+                                                               
+                                               // if there is a parent, the endpoint will actually be added to it now, rather than the div
+                                               // that was the source.  in that case, we have to adjust the anchor position so it refers to
+                                               // the parent.
+                                               if (p.parent) {
+                                                       var pEl = parentElement(), pId = _getId(pEl);
+                                                       myOffsetInfo = _updateOffset({elId:pId}).o;
+                                                       parentX = ((e.pageX || e.page.x) - myOffsetInfo.left) / myOffsetInfo.width; 
+                                                   parentY = ((e.pageY || e.page.y) - myOffsetInfo.top) / myOffsetInfo.height;
+                                               }                                                                                       
+                                               
+                                               // we need to override the anchor in here, and force 'isSource', but we don't want to mess with
+                                               // the params passed in, because after a connection is established we're going to reset the endpoint
+                                               // to have the anchor we were given.
+                                               var tempEndpointParams = {};
+                                               jsPlumb.extend(tempEndpointParams, p);
+                                               tempEndpointParams.isSource = true;
+                                               tempEndpointParams.anchor = [x,y,0,0];
+                                               tempEndpointParams.parentAnchor = [ parentX, parentY, 0, 0 ];
+                                               tempEndpointParams.dragOptions = dragOptions;
+                                               // if a parent was given we need to turn that into a "container" argument.  this is, by default,
+                                               // the parent of the element we will move to, so parent of p.parent in this case.  however, if
+                                               // the user has specified a 'container' on the endpoint definition or on 
+                                               // the defaults, we should use that.
+                                               if (p.parent) {
+                                                       var potentialParent = tempEndpointParams.container || _currentInstance.Defaults.Container || jsPlumb.Defaults.Container;
+                                                       if (potentialParent)
+                                                               tempEndpointParams.container = potentialParent;
+                                                       else
+                                                               tempEndpointParams.container = jsPlumb.CurrentLibrary.getParent(parentElement());
+                                               }
+                                               
+                                               ep = _currentInstance.addEndpoint(elid, tempEndpointParams);
+
+                                               endpointAddedButNoDragYet = true;
+                                               // we set this to prevent connections from firing attach events before this function has had a chance
+                                               // to move the endpoint.
+                                               ep.endpointWillMoveAfterConnection = p.parent != null;
+                                               ep.endpointWillMoveTo = p.parent ? parentElement() : null;
+
+                                               // TODO test options to makeSource to see if we should do this?
+                                               ep._doNotDeleteOnDetach = false; // reset.
+                                               ep._deleteOnDetach = true;
+
+                           var _delTempEndpoint = function() {
+                                                       // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools
+                                                       // it is fired even if dragging has occurred, in which case we would blow away a perfectly
+                                                       // legitimate endpoint, were it not for this check.  the flag is set after adding an
+                                                       // endpoint and cleared in a drag listener we set in the dragOptions above.
+                                                       if(endpointAddedButNoDragYet) {
+                                                                endpointAddedButNoDragYet = false;
+                                                               _currentInstance.deleteEndpoint(ep);
+                               }
+                                               };
+
+                                               _currentInstance.registerListener(ep.canvas, "mouseup", _delTempEndpoint);
+                           _currentInstance.registerListener(_el, "mouseup", _delTempEndpoint);
+                                               
+                                               // and then trigger its mousedown event, which will kick off a drag, which will start dragging
+                                               // a new connection from this endpoint.
+                                               jpcl.trigger(ep.canvas, "mousedown", e);
+                                               
+                                       };
+                      
+                       // register this on jsPlumb so that it can be cleared by a reset.
+                       _currentInstance.registerListener(_el, "mousedown", mouseDownListener);
+                       _sourceTriggers[elid] = mouseDownListener;
+
+                       // lastly, if a filter was provided, set it as a dragFilter on the element,
+                       // to prevent the element drag function from kicking in when we want to
+                       // drag a new connection
+                       if (p.filter && jsPlumbUtil.isString(p.filter)) {
+                               jpcl.setDragFilter(_el, p.filter);
+                       }
+                               };
+                       
+                       el = _convertYUICollection(el);                 
+                       
+                       var inputs = el.length && el.constructor != String ? el : [ el ];
+                                               
+                       for (var i = 0, ii = inputs.length; i < ii; i++) {                      
+                               _doOne(_info(inputs[i]));
+                       }
+
+                       return _currentInstance;
+               };
+       
+               // see api docs         
+               this.unmakeSource = function(el, doNotClearArrays) {
+                       var info = _info(el),
+                               mouseDownListener = _sourceTriggers[info.id];
+                       
+                       if (mouseDownListener) 
+                               _currentInstance.unregisterListener(info.el, "mousedown", mouseDownListener);
+
+                       if (!doNotClearArrays) {
+                               delete _sourceEndpointDefinitions[info.id];
+                               delete _sourceEndpointsUnique[info.id];
+                               delete _sourcesEnabled[info.id];
+                               delete _sourceTriggers[info.id];
+                               delete _sourceMaxConnections[info.id];
+                       }
+
+                       return _currentInstance;
+               };
+
+               // see api docs
+               this.unmakeEverySource = function() {
+                       for (var i in _sourcesEnabled)
+                               _currentInstance.unmakeSource(i, true);
+
+                       _sourceEndpointDefinitions = {};
+                       _sourceEndpointsUnique = {};
+                       _sourcesEnabled = {};
+                       _sourceTriggers = {};
+               };
+               
+               // see api docs
+               this.unmakeEveryTarget = function() {
+                       for (var i in _targetsEnabled)
+                               _currentInstance.unmakeTarget(i, true);
+                       
+                       _targetEndpointDefinitions = {};
+                       _targetEndpointsUnique = {};
+                       _targetMaxConnections = {};
+                       _targetsEnabled = {};
+
+                       return _currentInstance;
+               };                      
+
+               // does the work of setting a source enabled or disabled.
+               var _setEnabled = function(type, el, state, toggle) {
+                       var a = type == "source" ? _sourcesEnabled : _targetsEnabled;                                                                   
+                       el = _convertYUICollection(el);
+
+                       if (_ju.isString(el)) a[el] = toggle ? !a[el] : state;
+                       else if (el.length) {                           
+                               for (var i = 0, ii = el.length; i < ii; i++) {
+                                       var info = _info(el[i]);
+                                       a[info.id] = toggle ? !a[info.id] : state;
+                               }
+                       }       
+                       return _currentInstance;
+               };
+
+               this.toggleSourceEnabled = function(el) {
+                       _setEnabled("source", el, null, true);  
+                       return _currentInstance.isSourceEnabled(el);
+               };
+
+               this.setSourceEnabled = function(el, state) { return _setEnabled("source", el, state); };
+               this.isSource = function(el) { return _sourcesEnabled[_info(el).id] != null; };         
+               this.isSourceEnabled = function(el) { return _sourcesEnabled[_info(el).id] === true; };
+
+               this.toggleTargetEnabled = function(el) {
+                       _setEnabled("target", el, null, true);  
+                       return _currentInstance.isTargetEnabled(el);
+               };
+               
+               this.isTarget = function(el) { return _targetsEnabled[_info(el).id] != null; };         
+               this.isTargetEnabled = function(el) { return _targetsEnabled[_info(el).id] === true; };
+               this.setTargetEnabled = function(el, state) { return _setEnabled("target", el, state); };
+
+// --------------------- end makeSource/makeTarget ----------------------------------------------                              
+                               
+               this.ready = function(fn) {
+                       _currentInstance.bind("ready", fn);
+               };
+
+               // repaint some element's endpoints and connections
+               this.repaint = function(el, ui, timestamp) {
+                       // support both lists...
+                       if (typeof el == 'object' && el.length)
+                               for ( var i = 0, ii = el.length; i < ii; i++) {                 
+                                       _draw(el[i], ui, timestamp);
+                               }
+                       else // ...and single strings.                                                          
+                               _draw(el, ui, timestamp);
+                               
+                       return _currentInstance;
+               };
+
+               // repaint every endpoint and connection.
+               this.repaintEverything = function(clearEdits) { 
+                       // TODO this timestamp causes continuous anchors to not repaint properly.
+                       // fix this. do not just take out the timestamp. it runs a lot faster with 
+                       // the timestamp included.
+                       //var timestamp = null;
+                       var timestamp = _timestamp();
+                       for ( var elId in endpointsByElement) {
+                               _draw(elId, null, timestamp, clearEdits);                               
+                       }
+                       return _currentInstance;
+               };
+
+               
+               this.removeAllEndpoints = function(el, recurse) {
+            var _one = function(_el) {                                 
+                var info = _info(_el),
+                    ebe = endpointsByElement[info.id],
+                    i, ii;
+
+                if (ebe) {
+                    for ( i = 0, ii = ebe.length; i < ii; i++) 
+                        _currentInstance.deleteEndpoint(ebe[i]);
+                }
+                delete endpointsByElement[info.id];
+                
+                if (recurse) {
+                    if (info.el && info.el.nodeType != 3 && info.el.nodeType != 8 ) {
+                        for ( i = 0, ii = info.el.childNodes.length; i < ii; i++) {
+                            _one(info.el.childNodes[i]);
+                        }
+                    }
+                }
+                
+            };
+            _one(el);
+                       return _currentInstance;
+               };
+                    
+        /**
+        * Remove the given element, including cleaning up all endpoints registered for it.
+        * This is exposed in the public API but also used internally by jsPlumb when removing the
+        * element associated with a connection drag.
+        */
+        this.remove = function(el, doNotRepaint) {
+               var info = _info(el);           
+            _currentInstance.doWhileSuspended(function() {
+               _currentInstance.removeAllEndpoints(info.id, true);
+               _currentInstance.dragManager.elementRemoved(info.id);
+               delete floatingConnections[info.id];     
+               _currentInstance.anchorManager.clearFor(info.id);                                               
+               _currentInstance.anchorManager.removeFloatingConnection(info.id);
+            }, doNotRepaint === false);
+            if(info.el) jsPlumb.CurrentLibrary.removeElement(info.el);
+        };
+
+               var _registeredListeners = {},
+                       _unbindRegisteredListeners = function() {
+                               for (var i in _registeredListeners) {
+                                       for (var j = 0, jj = _registeredListeners[i].length; j < jj; j++) {
+                                               var info = _registeredListeners[i][j];
+                                               jsPlumb.CurrentLibrary.unbind(info.el, info.event, info.listener);
+                                       }
+                               }
+                               _registeredListeners = {};
+                       };
+
+        // internal register listener method.  gives us a hook to clean things up
+        // with if the user calls jsPlumb.reset.
+        this.registerListener = function(el, type, listener) {
+            jsPlumb.CurrentLibrary.bind(el, type, listener);
+            jsPlumbUtil.addToList(_registeredListeners, type, {el:el, event:type, listener:listener});
+        };
+
+        this.unregisterListener = function(el, type, listener) {
+               jsPlumb.CurrentLibrary.unbind(el, type, listener);
+               jsPlumbUtil.removeWithFunction(_registeredListeners, function(rl) {
+                       return rl.type == type && rl.listener == listener;
+               });
+        };
+               
+               this.reset = function() {                       
+                       _currentInstance.deleteEveryEndpoint();
+                       _currentInstance.unbind();
+                       _targetEndpointDefinitions = {};
+                       _targetEndpoints = {};
+                       _targetEndpointsUnique = {};
+                       _targetMaxConnections = {};
+                       _sourceEndpointDefinitions = {};
+                       _sourceEndpoints = {};
+                       _sourceEndpointsUnique = {};
+                       _sourceMaxConnections = {};
+                       connections.splice(0);
+                       _unbindRegisteredListeners();
+                       _currentInstance.anchorManager.reset();
+                       if (!jsPlumbAdapter.headless)
+                               _currentInstance.dragManager.reset();
+               };
+               
+
+               this.setDefaultScope = function(scope) {
+                       DEFAULT_SCOPE = scope;
+                       return _currentInstance;
+               };
+
+               // sets whether or not some element should be currently draggable.
+               this.setDraggable = _setDraggable;
+
+               // sets the id of some element, changing whatever we need to to keep track.
+               this.setId = function(el, newId, doNotSetAttribute) {
+                       // 
+                       var id;
+
+                       if (jsPlumbUtil.isString(el)) {
+                               id = el;                                
+                       }
+                       else {
+                               el = _dom(el);
+                               id = _currentInstance.getId(el);
+                       }
+
+                       var sConns = _currentInstance.getConnections({source:id, scope:'*'}, true),
+                               tConns = _currentInstance.getConnections({target:id, scope:'*'}, true);
+
+                       newId = "" + newId;
+
+                       if (!doNotSetAttribute) {
+                               el = _dom(id);
+                               jsPlumbAdapter.setAttribute(el, "id", newId);
+                       }
+                       else
+                               el = _dom(newId);
+
+                       endpointsByElement[newId] = endpointsByElement[id] || [];
+                       for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {
+                               endpointsByElement[newId][i].setElementId(newId);
+                               endpointsByElement[newId][i].setReferenceElement(el);
+                       }
+                       delete endpointsByElement[id];
+
+                       _currentInstance.anchorManager.changeId(id, newId);
+                       if (!jsPlumbAdapter.headless)           
+                               _currentInstance.dragManager.changeId(id, newId);
+
+                       var _conns = function(list, epIdx, type) {
+                               for (var i = 0, ii = list.length; i < ii; i++) {
+                                       list[i].endpoints[epIdx].setElementId(newId);
+                                       list[i].endpoints[epIdx].setReferenceElement(el);
+                                       list[i][type + "Id"] = newId;
+                                       list[i][type] = el;
+                               }
+                       };
+                       _conns(sConns, 0, "source");
+                       _conns(tConns, 1, "target");
+
+                       _currentInstance.repaint(newId);
+               };              
+
+               this.setDebugLog = function(debugLog) {
+                       log = debugLog;
+               };
+                                       
+               this.setSuspendDrawing = function(val, repaintAfterwards) {
+                       var curVal = _suspendDrawing;
+                   _suspendDrawing = val;
+                               if (val) _suspendedAt = new Date().getTime(); else _suspendedAt = null;
+                   if (repaintAfterwards) _currentInstance.repaintEverything();
+                   return curVal;
+               };
+               
+        // returns whether or not drawing is currently suspended.              
+               this.isSuspendDrawing = function() {
+                       return _suspendDrawing;
+               };
+            
+        // return timestamp for when drawing was suspended.
+        this.getSuspendedAt = function() { return _suspendedAt; };
+
+        /**
+        * @doc function
+        * @name jsPlumb.class:doWhileSuspended
+        * @param {function} fn Function to run while suspended.
+        * @param {boolean} doNotRepaintAfterwards If true, jsPlumb won't run a full repaint. Otherwise it will.
+        * @description Suspends drawing, runs the given function, then re-enables drawing (and repaints, unless you tell it not to)
+        */
+        this.doWhileSuspended = function(fn, doNotRepaintAfterwards) {     
+               var _wasSuspended = _currentInstance.isSuspendDrawing();                
+               if (!_wasSuspended)
+                               _currentInstance.setSuspendDrawing(true);
+                       try {
+                               fn();
+                       }
+                       catch (e) {
+                               _ju.log("Function run while suspended failed", e);
+                       }                       
+                       if (!_wasSuspended)
+                               _currentInstance.setSuspendDrawing(false, !doNotRepaintAfterwards);
+        };
+            
+        this.updateOffset = _updateOffset;
+        this.getOffset = function(elId) { return offsets[elId]; };
+        this.getSize = function(elId) { return sizes[elId]; };            
+        this.getCachedData = _getCachedData;
+        this.timestamp = _timestamp;
+               
+               
+               
+               /**
+                * @doc function
+                * @name jsPlumb.class:setRenderMode
+                * @param {string} mode One of `jsPlumb.SVG, `jsPlumb.VML` or `jsPlumb.CANVAS`.
+                * @description Sets render mode.  jsPlumb will fall back to VML if it determines that
+                * what you asked for is not supported (and that VML is).  If you asked for VML but the browser does
+                * not support it, jsPlumb uses SVG.
+                * @return {string} The render mode that jsPlumb set, which of course may be different from that requested.
+                */
+               this.setRenderMode = function(mode) {                   
+                       renderMode = jsPlumbAdapter.setRenderMode(mode);
+                       var i, ii;
+                       // only add this if the renderer is canvas; we dont want these listeners registered on te
+                       // entire document otherwise.
+                       if (renderMode == jsPlumb.CANVAS) {
+                               var bindOne = function(event) {
+                       jsPlumb.CurrentLibrary.bind(document, event, function(e) {
+                           if (!_currentInstance.currentlyDragging && renderMode == jsPlumb.CANVAS) {
+                               // try connections first
+                               for (i = 0, ii = connections.length; i < ii; i++ ) {
+                                var t = connections[i].getConnector()[event](e);
+                                if (t) return; 
+                            }
+                               for (var el in endpointsByElement) {
+                                   var ee = endpointsByElement[el];
+                                   for ( i = 0, ii = ee.length; i < ii; i++ ) {
+                                       if (ee[i].endpoint[event] && ee[i].endpoint[event](e)) return;
+                                   }
+                               }
+                           }
+                       });                                     
+                               };
+                               bindOne("click");bindOne("dblclick");bindOne("mousemove");bindOne("mousedown");bindOne("mouseup");bindOne("contextmenu");                               
+                       }
+
+                       return renderMode;
+               };
+               
+               /**
+                * @doc function
+                * @name jsPlumb.class:getRenderMode
+                * @description Gets the current render mode for this instance of jsPlumb.
+                * @return {string} The current render mode - "canvas", "svg" or "vml".
+                */
+               this.getRenderMode = function() { return renderMode; };
+               
+               this.show = function(el, changeEndpoints) {
+                       _setVisible(el, "block", changeEndpoints);
+                       return _currentInstance;
+               };              
+
+               /**
+                * gets some test hooks. nothing writable.
+                */
+               this.getTestHarness = function() {
+                       return {
+                               endpointsByElement : endpointsByElement,  
+                               endpointCount : function(elId) {
+                                       var e = endpointsByElement[elId];
+                                       return e ? e.length : 0;
+                               },
+                               connectionCount : function(scope) {
+                                       scope = scope || DEFAULT_SCOPE;
+                                       var c = _currentInstance.getConnections({scope:scope});
+                                       return c ? c.length : 0;
+                               },
+                               getId : _getId,
+                               makeAnchor:self.makeAnchor,
+                               makeDynamicAnchor:self.makeDynamicAnchor
+                       };
+               };
+               
+               
+               // TODO: update this method to return the current state.
+               this.toggleVisible = _toggleVisible;
+               this.toggleDraggable = _toggleDraggable;                                                
+               this.addListener = this.bind;
+               
+        /*
+            helper method to take an xy location and adjust it for the parent's offset and scroll.
+        */
+               this.adjustForParentOffsetAndScroll = function(xy, el) {
+
+                       var offsetParent = null, result = xy;
+                       if (el.tagName.toLowerCase() === "svg" && el.parentNode) {
+                               offsetParent = el.parentNode;
+                       }
+                       else if (el.offsetParent) {
+                               offsetParent = el.offsetParent;                                 
+                       }
+                       if (offsetParent != null) {
+                               var po = offsetParent.tagName.toLowerCase() === "body" ? {left:0,top:0} : _getOffset(offsetParent, _currentInstance),
+                                       so = offsetParent.tagName.toLowerCase() === "body" ? {left:0,top:0} : {left:offsetParent.scrollLeft, top:offsetParent.scrollTop};                                       
+
+                               // i thought it might be cool to do this:
+                               //      lastReturnValue[0] = lastReturnValue[0] - offsetParent.offsetLeft + offsetParent.scrollLeft;
+                               //      lastReturnValue[1] = lastReturnValue[1] - offsetParent.offsetTop + offsetParent.scrollTop;                                      
+                               // but i think it ignores margins.  my reasoning was that it's quicker to not hand off to some underlying                                       
+                               // library.
+                               
+                               result[0] = xy[0] - po.left + so.left;
+                               result[1] = xy[1] - po.top + so.top;
+                       }
+               
+                       return result;
+                       
+               };
+
+               if (!jsPlumbAdapter.headless) {
+                       _currentInstance.dragManager = jsPlumbAdapter.getDragManager(_currentInstance);
+                       _currentInstance.recalculateOffsets = _currentInstance.dragManager.updateOffsets;
+           }       
+                                   
+    };
+
+    jsPlumbUtil.extend(jsPlumbInstance, jsPlumbUtil.EventGenerator, {
+       setAttribute : function(el, a, v) {
+               jsPlumbAdapter.setAttribute(el, a, v);
+       },
+       getAttribute : function(el, a) {
+               return jsPlumbAdapter.getAttribute(jsPlumb.CurrentLibrary.getDOMElement(el), a);
+       },      
+       registerConnectionType : function(id, type) {
+               this._connectionTypes[id] = jsPlumb.extend({}, type);
+       },      
+       registerConnectionTypes : function(types) {
+               for (var i in types)
+                       this._connectionTypes[i] = jsPlumb.extend({}, types[i]);
+       },              
+       registerEndpointType : function(id, type) {
+               this._endpointTypes[id] = jsPlumb.extend({}, type);
+       },      
+       registerEndpointTypes : function(types) {
+               for (var i in types)
+                       this._endpointTypes[i] = jsPlumb.extend({}, types[i]);
+       },      
+       getType : function(id, typeDescriptor) {
+               return typeDescriptor ===  "connection" ? this._connectionTypes[id] : this._endpointTypes[id];
+       },
+       setIdChanged : function(oldId, newId) {
+               this.setId(oldId, newId, true);
+       },
+       // set parent: change the parent for some node and update all the registrations we need to.
+       setParent : function(el, newParent) {
+               var jpcl = jsPlumb.CurrentLibrary,
+                       _el = jpcl.getElementObject(el),
+                       _dom = jpcl.getDOMElement(_el),
+                       _id = this.getId(_dom),
+                       _pel = jpcl.getElementObject(newParent),
+                       _pdom = jpcl.getDOMElement(_pel),
+                       _pid = this.getId(_pdom);
+
+               _dom.parentNode.removeChild(_dom);
+               _pdom.appendChild(_dom);
+               this.dragManager.setParent(_el, _id, _pel, _pid);
+       }
+    });
+
+// --------------------- static instance + AMD registration -------------------------------------------        
+       
+// create static instance and assign to window if window exists.       
+       var jsPlumb = new jsPlumbInstance();
+       // register on window if defined (lets us run on server)
+       if (typeof window != 'undefined') window.jsPlumb = jsPlumb;     
+       // add 'getInstance' method to static instance
+       /**
+       * @name jsPlumb.getInstance
+       * @param {object} [_defaults] Optional default settings for the new instance.
+       * @desc Gets a new instance of jsPlumb.
+       */
+       jsPlumb.getInstance = function(_defaults) {
+               var j = new jsPlumbInstance(_defaults);
+               j.init();
+               return j;
+       };
+// maybe register static instance as an AMD module, and getInstance method too.
+       if ( typeof define === "function") {
+               define( "jsplumb", [], function () { return jsPlumb; } );
+               define( "jsplumbinstance", [], function () { return jsPlumb.getInstance(); } );
+       }
+ // CommonJS 
+       if (typeof exports !== 'undefined') {
+      exports.jsPlumb = jsPlumb;
+       }
+       
+       
+// --------------------- end static instance + AMD registration -------------------------------------------            
+       
+})();
diff --git a/portal/static/unbound_reservation_static/src/mootools.jsPlumb.js b/portal/static/unbound_reservation_static/src/mootools.jsPlumb.js
new file mode 100644 (file)
index 0000000..4dd18db
--- /dev/null
@@ -0,0 +1,454 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the MooTools adapter.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+;(function() {
+       
+       /*
+        * overrides the FX class to inject 'step' functionality, which MooTools does not
+        * offer, and which makes me sad.  they don't seem keen to add it, either, despite
+        * the fact that it could be useful:
+        * 
+        * https://mootools.lighthouseapp.com/projects/2706/tickets/668
+        * 
+        */
+       var jsPlumbMorph = new Class({
+               Extends:Fx.Morph,
+               onStep : null,
+               initialize : function(el, options) {
+                       this.parent(el, options);
+                       if (options.onStep) {
+                               this.onStep = options.onStep;
+                       }
+               },
+               step : function(now) {
+                       this.parent(now);
+                       if (this.onStep) { 
+                               try { this.onStep(); } 
+                               catch(e) { } 
+                       }
+               }
+       });
+       
+       var _droppables = {},
+       _droppableOptions = {},
+       _draggablesByScope = {},
+       _draggablesById = {},
+       _droppableScopesById = {};
+       /*
+        * 
+        */
+       var _executeDroppableOption = function(el, dr, event, originalEvent) {
+               if (dr) {
+                       var id = dr.get("id");
+                       if (id) {
+                               var options = _droppableOptions[id];
+                               if (options) {
+                                       if (options[event]) {
+                                               options[event](el, dr, originalEvent);
+                                       }
+                               }
+                       }
+               }
+       };      
+       
+       var _checkHover = function(el, entering) {
+               if (el) {
+                       var id = el.get("id");
+                       if (id) {
+                               var options = _droppableOptions[id];
+                               if (options) {
+                                       if (options.hoverClass) {
+                                               if (entering) el.addClass(options.hoverClass);
+                                               else el.removeClass(options.hoverClass);
+                                       }
+                               }
+                       }
+               }
+       };
+
+       /**
+        * adds the given value to the given list, with the given scope. creates the scoped list
+        * if necessary.
+        * used by initDraggable and initDroppable.
+        */
+       var _add = function(list, _scope, value) {
+               var l = list[_scope];
+               if (!l) {
+                       l = [];
+                       list[_scope] = l;
+               }
+               l.push(value);
+       };
+       
+       /*
+        * gets an "element object" from the given input.  this means an object that is used by the
+        * underlying library on which jsPlumb is running.  'el' may already be one of these objects,
+        * in which case it is returned as-is.  otherwise, 'el' is a String, the library's lookup 
+        * function is used to find the element, using the given String as the element's id.
+        */
+       var _getElementObject = function(el) {
+         return $(el);
+       };
+               
+       jsPlumb.CurrentLibrary = {                              
+               
+               /**
+                * adds the given class to the element object.
+                */
+               addClass : function(el, clazz) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       try {
+                               if (el.className.constructor == SVGAnimatedString) {
+                                       jsPlumbUtil.svg.addClass(el, clazz);
+                               }
+                               else el.addClass(clazz);
+                       }
+                       catch (e) {                             
+                               // SVGAnimatedString not supported; no problem.
+                               el.addClass(clazz);
+                       }                                               
+               },      
+                       
+               animate : function(el, properties, options) {                   
+                       var m = new jsPlumbMorph(el, options);
+                       m.start(properties);
+               },
+               
+               appendElement : function(child, parent) {
+                       _getElementObject(parent).grab(child);                  
+               },
+               
+               bind : function(el, event, callback) {
+                       var els = jsPlumbUtil.isString(el) || typeof el.length == "undefined" ? [ _getElementObject(el) ] : $$(el);
+                       //el = _getElementObject(el);
+                       for (var i = 0; i < els.length; i++)
+                               els[i].addEvent(event, callback);
+               },
+
+               destroyDraggable : function(el) {
+                       // TODO
+                       var id = jsPlumb.getId(el), d = _draggablesById[id];
+                       if (d) {
+                               for (var i = 0; i < d.length; i++)
+                                       d[i].detach();
+
+                               delete _draggablesById[id];
+                       }
+               },
+
+               destroyDroppable : function(el) {
+                       // TODO
+               },
+               
+               dragEvents : {
+                       'start':'onStart', 'stop':'onComplete', 'drag':'onDrag', 'step':'onStep',
+                       'over':'onEnter', 'out':'onLeave','drop':'onDrop', 'complete':'onComplete'
+               },
+
+               /*
+                * wrapper around the library's 'extend' functionality (which it hopefully has.
+                * otherwise you'll have to do it yourself). perhaps jsPlumb could do this for you
+                * instead.  it's not like its hard.
+                */
+               extend : function(o1, o2) {
+                       return $extend(o1, o2);
+               },
+               
+               getClientXY : function(eventObject) {
+                       return [eventObject.event.clientX, eventObject.event.clientY];
+               },
+               
+               getDragObject : function(eventArgs) {
+                       return eventArgs[0];
+               },
+               
+               getDragScope : function(el) {
+                       var id = jsPlumb.getId(el),
+                           drags = _draggablesById[id];
+                       return drags[0].scope;
+               },
+       
+               getDropEvent : function(args) {                 
+                       return args[2];
+               },
+               
+               getDropScope : function(el) {
+                       var id = jsPlumb.getId(el);
+                       return _droppableScopesById[id];
+               },
+               
+               getDOMElement : function(el) { 
+                       if (el == null) return null;
+                       // MooTools just decorates the DOM elements. so we have either an ID or an Element here.
+                       return typeof(el) == "string" ? document.getElementById(el) : el; 
+               },
+                                                       
+               getElementObject : _getElementObject,
+               
+               /*
+                 gets the offset for the element object.  this should return a js object like this:
+                 
+                 { left:xxx, top: xxx}
+                */
+               getOffset : function(el) {
+                       var p = el.getPosition();
+                       return { left:p.x, top:p.y };
+               },      
+               
+               getOriginalEvent : function(e) {
+                       return e.event;
+               },                      
+               
+               getPageXY : function(eventObject) {
+                       return [eventObject.event.pageX, eventObject.event.pageY];
+               },
+               
+               getParent : function(el) {
+                       return jsPlumb.CurrentLibrary.getElementObject(el).getParent();
+               },
+               
+               getScrollLeft : function(el) {
+                       return null;
+               },
+               
+               getScrollTop : function(el) {
+                       return null;
+               },
+               
+               getSelector : function(context, spec) {
+            if (arguments.length == 2) {
+                return jsPlumb.CurrentLibrary.getElementObject(context).getElements(spec);
+            }
+            else
+                            return $$(context);
+               },
+               
+               getSize : function(el) {
+                       var s = el.getSize();
+                       return [s.x, s.y];
+               },
+
+        getTagName : function(el) {
+            var e = jsPlumb.CurrentLibrary.getElementObject(el);
+            return e != null ? e.tagName : null;
+        },
+               
+               /*
+                * takes the args passed to an event function and returns you an object that gives the
+                * position of the object being moved, as a js object with the same params as the result of
+                * getOffset, ie: { left: xxx, top: xxx }.
+                */
+               getUIPosition : function(eventArgs, zoom) {
+                 var ui = eventArgs[0],
+                         el = jsPlumb.CurrentLibrary.getElementObject(ui),
+                         p = el.getPosition();
+                       
+                 zoom = zoom || 1;               
+                       
+                 return { left:p.x / zoom, top:p.y / zoom};
+               },              
+               
+               hasClass : function(el, clazz) {
+                       return el.hasClass(clazz);
+               },
+               
+               initDraggable : function(el, options, isPlumbedComponent, _jsPlumb) {
+                       var id = jsPlumb.getId(el);
+                       var drag = _draggablesById[id];
+                       if (!drag) {
+                               var originalZIndex = 0,
+                    originalCursor = null,
+                                   dragZIndex = jsPlumb.Defaults.DragOptions.zIndex || 2000;
+                
+                               options.onStart = jsPlumbUtil.wrap(options.onStart, function() {
+                    originalZIndex = this.element.getStyle('z-index');
+                                       this.element.setStyle('z-index', dragZIndex);
+                    drag.originalZIndex = originalZIndex;
+                                       if (jsPlumb.Defaults.DragOptions.cursor) {
+                                               originalCursor = this.element.getStyle('cursor');
+                                               this.element.setStyle('cursor', jsPlumb.Defaults.DragOptions.cursor);
+                                       }
+                                       $(document.body).addClass(_jsPlumb.dragSelectClass);
+                               });
+                               
+                               options.onComplete = jsPlumbUtil.wrap(options.onComplete, function() {
+                                       this.element.setStyle('z-index', originalZIndex);
+                                       if (originalCursor) {
+                                               this.element.setStyle('cursor', originalCursor);
+                                       }                    
+                                       $(document.body).removeClass(_jsPlumb.dragSelectClass);
+                               });
+                               
+                               // DROPPABLES - only relevant if this is a plumbed component, ie. not just the result of the user making some DOM element
+                // draggable.  this is the only library adapter that has to care about this parameter.
+                               var scope = "" + (options.scope || jsPlumb.Defaults.Scope),
+                                   filterFunc = function(entry) {
+                                           return entry.get("id") != el.get("id");
+                                   },
+                                   droppables = _droppables[scope] ? _droppables[scope].filter(filterFunc) : [];
+
+                if (isPlumbedComponent) {
+
+                                   options.droppables = droppables;
+                                   options.onLeave = jsPlumbUtil.wrap(options.onLeave, function(el, dr) {
+                                       if (dr) {
+                                               _checkHover(dr, false);
+                                               _executeDroppableOption(el, dr, 'onLeave');
+                                           }
+                                   });
+                                   options.onEnter = jsPlumbUtil.wrap(options.onEnter, function(el, dr) {
+                                           if (dr) {
+                                                   _checkHover(dr, true);
+                                                   _executeDroppableOption(el, dr, 'onEnter');
+                                           }
+                                   });
+                                   options.onDrop = function(el, dr, event) {
+                                           if (dr) {
+                                                   _checkHover(dr, false);
+                                                   _executeDroppableOption(el, dr, 'onDrop', event);
+                                           }
+                                   };
+                }
+                else
+                    options.droppables = [];
+                               
+                               drag = new Drag.Move(el, options);
+                               drag.scope = scope;
+                drag.originalZIndex = originalZIndex;
+                _add(_draggablesById, el.get("id"), drag);
+                               // again, only keep a record of this for scope stuff if this is a plumbed component (an endpoint)
+                if (isPlumbedComponent) {
+                                   _add(_draggablesByScope, scope, drag);
+                }
+                               // test for disabled.
+                               if (options.disabled) drag.detach();
+                       }
+                       return drag;
+               },
+               
+               initDroppable : function(el, options, isPlumbedComponent, isPermanent) {
+                       var scope = options.scope;
+            _add(_droppables, scope, el);
+                       var id = jsPlumb.getId(el);
+
+            el.setAttribute("_isPermanentDroppable", isPermanent);  // we use this to clear out droppables on drag complete.
+                       _droppableOptions[id] = options;
+                       _droppableScopesById[id] = scope;
+                       var filterFunc = function(entry) { return entry.element != el; },
+                           draggables = _draggablesByScope[scope] ? _draggablesByScope[scope].filter(filterFunc) : [];
+                       for (var i = 0; i < draggables.length; i++) {
+                               draggables[i].droppables.push(el);
+                       }
+               },
+               
+               isAlreadyDraggable : function(el) {
+                       return _draggablesById[jsPlumb.getId(el)] != null;
+               },                                                                              
+               
+               isDragSupported : function(el, options) {
+                       return typeof Drag != 'undefined' ;
+               },      
+               
+               /*
+                * you need Drag.Move imported to make drop work.
+                */
+               isDropSupported : function(el, options) {
+                       return (typeof Drag !== undefined && typeof Drag.Move !== undefined);
+               },
+               
+               /**
+                * removes the given class from the element object.
+                */
+               removeClass : function(el, clazz) {
+                       el = jsPlumb.CurrentLibrary.getElementObject(el);
+                       try {
+                               if (el.className.constructor == SVGAnimatedString) {
+                                       jsPlumbUtil.svg.removeClass(el, clazz);
+                               }
+                               else el.removeClass(clazz);
+                       }
+                       catch (e) {                             
+                               // SVGAnimatedString not supported; no problem.
+                               el.removeClass(clazz);
+                       }
+               },
+               
+               removeElement : function(element, parent) {
+            var el = _getElementObject(element);
+                       if (el) el.dispose();  // ??
+               },
+
+               setDragFilter : function(el, filter) {
+                       jsPlumbUtil.log("NOT IMPLEMENTED: setDragFilter");
+               },
+               
+               setDraggable : function(el, draggable) {
+                       var draggables = _draggablesById[el.get("id")];
+                       if (draggables) {
+                               draggables.each(function(d) {
+                                       if (draggable) d.attach(); else d.detach();
+                               });
+                       }
+               },
+               
+               setDragScope : function(el, scope) {
+                       var drag = _draggablesById[el.get("id")];
+                       var filterFunc = function(entry) {
+                               return entry.get("id") != el.get("id");
+                       };
+                       var droppables = _droppables[scope] ? _droppables[scope].filter(filterFunc) : [];
+                       drag[0].droppables = droppables;
+               },
+               
+               setOffset : function(el, o) {
+                       _getElementObject(el).setPosition({x:o.left, y:o.top});
+               },
+
+        stopDrag : function() {
+            for (var i in _draggablesById) {
+                for (var j = 0; j < _draggablesById[i].length; j++) {
+                    var d = _draggablesById[i][j];
+                    d.stop();
+                    if (d.originalZIndex !== 0)
+                        d.element.setStyle("z-index", d.originalZIndex);
+                }
+            }
+        },
+               
+               /**
+                * note that jquery ignores the name of the event you wanted to trigger, and figures it out for itself.
+                * the other libraries do not.  yui, in fact, cannot even pass an original event.  we have to pull out stuff
+                * from the originalEvent to put in an options object for YUI. 
+                * @param el
+                * @param event
+                * @param originalEvent
+                */
+               trigger : function(el, event, originalEvent) {
+                       originalEvent.stopPropagation();
+                       _getElementObject(el).fireEvent(event, originalEvent);
+               },
+               
+               unbind : function(el, event, callback) {
+                       el = _getElementObject(el);
+                       el.removeEvent(event, callback);
+               }
+       };
+       
+       window.addEvent('domready', jsPlumb.init);
+})();
diff --git a/portal/static/unbound_reservation_static/src/overlays-guidelines.js b/portal/static/unbound_reservation_static/src/overlays-guidelines.js
new file mode 100644 (file)
index 0000000..df1dfd9
--- /dev/null
@@ -0,0 +1,73 @@
+    // this is really just a test overlay, so its undocumented and doesnt take any parameters. but i was loth to delete it.
+    jsPlumb.Overlays.GuideLines = function() {
+        var self = this;
+        self.length = 50;
+        self.lineWidth = 5;
+        this.type = "GuideLines";
+               AbstractOverlay.apply(this, arguments);
+        jsPlumb.jsPlumbUIComponent.apply(this, arguments);
+        this.draw = function(connector, currentConnectionPaintStyle, connectorDimensions) {
+
+            var head = connector.pointAlongPathFrom(self.loc, self.length / 2),
+                mid = connector.pointOnPath(self.loc),
+                tail = jsPlumbGeom.pointOnLine(head, mid, self.length),
+                tailLine = jsPlumbGeom.perpendicularLineTo(head, tail, 40),
+                headLine = jsPlumbGeom.perpendicularLineTo(tail, head, 20);
+
+            self.paint(connector, [head, tail, tailLine, headLine], self.lineWidth, "red", null, connectorDimensions);
+
+            return [Math.min(head.x, tail.x), Math.min(head.y, tail.y), Math.max(head.x, tail.x), Math.max(head.y,tail.y)];
+        };
+
+        this.computeMaxSize = function() { return 50; };
+
+       this.cleanup = function() { };  // nothing to clean up for GuideLines
+    };
+
+// a test
+    jsPlumb.Overlays.svg.GuideLines = function() {
+        var path = null, self = this, path2 = null, p1_1, p1_2;
+        jsPlumb.Overlays.GuideLines.apply(this, arguments);
+        this.paint = function(connector, d, lineWidth, strokeStyle, fillStyle) {
+               if (path == null) {
+                       path = _node("path");
+                       connector.svg.appendChild(path);
+                       self.attachListeners(path, connector);
+                       self.attachListeners(path, self);
+
+                p1_1 = _node("path");
+                       connector.svg.appendChild(p1_1);
+                       self.attachListeners(p1_1, connector);
+                       self.attachListeners(p1_1, self);
+
+                p1_2 = _node("path");
+                       connector.svg.appendChild(p1_2);
+                       self.attachListeners(p1_2, connector);
+                       self.attachListeners(p1_2, self);
+
+               }
+
+               _attr(path, {
+                       "d"             :       makePath(d[0], d[1]),
+                       stroke  :       "red",
+                       fill    :       null
+               });
+
+            _attr(p1_1, {
+                       "d"             :       makePath(d[2][0], d[2][1]),
+                       stroke  :       "blue",
+                       fill    :       null
+               });
+
+            _attr(p1_2, {
+                       "d"             :       makePath(d[3][0], d[3][1]),
+                       stroke  :       "green",
+                       fill    :       null
+               });
+       };
+
+        var makePath = function(d1, d2) {
+            return "M " + d1.x + "," + d1.y +
+                   " L" + d2.x + "," + d2.y;
+        };
+    };
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/renderers-canvas.js b/portal/static/unbound_reservation_static/src/renderers-canvas.js
new file mode 100644 (file)
index 0000000..cf5cf76
--- /dev/null
@@ -0,0 +1,535 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the HTML5 canvas renderers.  Support for canvas was dropped in 1.4.2.
+ * This is being kept around because canvas might make a comeback as a single-page solution
+ * that also supports node rendering.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+;(function() {
+
+       
+// ********************************* CANVAS RENDERERS FOR CONNECTORS AND ENDPOINTS *******************************************************************
+               
+       // TODO refactor to renderer common script.  put a ref to jsPlumb.sizeCanvas in there too.
+       var _connectionBeingDragged = null,
+           _hasClass = function(el, clazz) { return jsPlumb.CurrentLibrary.hasClass(_getElementObject(el), clazz); },
+           _getElementObject = function(el) { return jsPlumb.CurrentLibrary.getElementObject(el); },
+           _getOffset = function(el) { return jsPlumb.CurrentLibrary.getOffset(_getElementObject(el)); },
+           _pageXY = function(el) { return jsPlumb.CurrentLibrary.getPageXY(el); },
+           _clientXY = function(el) { return jsPlumb.CurrentLibrary.getClientXY(el); };
+       
+       /*
+        * Class:CanvasMouseAdapter
+        * Provides support for mouse events on canvases.  
+        */
+       var CanvasMouseAdapter = window.CanvasMouseAdapter = function() {
+               var self = this;
+               this.overlayPlacements = [];
+               jsPlumb.jsPlumbUIComponent.apply(this, arguments);
+               jsPlumbUtil.EventGenerator.apply(this, arguments);
+               /**
+                * returns whether or not the given event is ojver a painted area of the canvas. 
+                */
+           this._over = function(e) {                                                          
+                       var o = _getOffset(_getElementObject(self.canvas)),
+                               pageXY = _pageXY(e),
+                               x = pageXY[0] - o.left, y = pageXY[1] - o.top;
+                       if (x > 0 && y > 0 && x < self.canvas.width && y < self.canvas.height) {
+                               // first check overlays
+                               for ( var i = 0; i < self.overlayPlacements.length; i++) {
+                                       var p = self.overlayPlacements[i];
+                                       if (p && (p[0] <= x && p[1] >= x && p[2] <= y && p[3] >= y))
+                                               return true;
+                               }                       
+                               // then the canvas
+                               var d = self.canvas.getContext("2d").getImageData(parseInt(x, 10), parseInt(y, 10), 1, 1);
+                               return d.data[0] !== 0 || d.data[1] !== 0 || d.data[2] !== 0 || d.data[3] !== 0;                  
+                       }
+                       return false;
+           };
+           
+           var _mouseover = false, _mouseDown = false, _posWhenMouseDown = null, _mouseWasDown = false,
+                   _nullSafeHasClass = function(el, clazz) {
+                       return el !== null && _hasClass(el, clazz);
+                   };
+           this.mousemove = function(e) {                  
+               var pageXY = _pageXY(e), clientXY = _clientXY(e),          
+               ee = document.elementFromPoint(clientXY[0], clientXY[1]),
+               eventSourceWasOverlay = _nullSafeHasClass(ee, "_jsPlumb_overlay");              
+                       var _continue = _connectionBeingDragged === null && (_nullSafeHasClass(ee, "_jsPlumb_endpoint") || _nullSafeHasClass(ee, "_jsPlumb_connector"));
+                       if (!_mouseover && _continue && self._over(e)) {
+                               _mouseover = true;
+                               self.fire("mouseenter", self, e);               
+                               return true;
+                       }
+                       // TODO here there is a remote chance that the overlay the mouse moved onto
+                       // is actually not an overlay for the current component. a more thorough check would
+                       // be to ensure the overlay belonged to the current component.  
+                       else if (_mouseover && (!self._over(e) || !_continue) && !eventSourceWasOverlay) {
+                               _mouseover = false;
+                               self.fire("mouseexit", self, e);                                
+                       }
+                       self.fire("mousemove", self, e);
+           };
+                                           
+           this.click = function(e) {                  
+                       if (_mouseover && self._over(e) && !_mouseWasDown) 
+                       self.fire("click", self, e);                    
+               _mouseWasDown = false;
+           };
+           
+           this.dblclick = function(e) {
+               if (_mouseover && self._over(e) && !_mouseWasDown) 
+                       self.fire("dblclick", self, e);                 
+               _mouseWasDown = false;
+           };
+           
+           this.mousedown = function(e) {
+               if(self._over(e) && !_mouseDown) {
+                       _mouseDown = true;                      
+                       _posWhenMouseDown = _getOffset(_getElementObject(self.canvas));
+                       self.fire("mousedown", self, e);
+               }
+           };
+           
+           this.mouseup = function(e) {
+               _mouseDown = false;
+               self.fire("mouseup", self, e);
+           };
+
+        this.contextmenu = function(e) {
+          if (_mouseover && self._over(e) && !_mouseWasDown)
+            self.fire("contextmenu", self, e);
+          _mouseWasDown = false;
+        };
+       };
+       jsPlumbUtil.extend(CanvasMouseAdapter, [ jsPlumb.jsPlumbUIComponent, jsPlumbUtil.EventGenerator ]);             
+       
+       var _newCanvas = function(params) {
+               var canvas = document.createElement("canvas");
+               params._jsPlumb.instance.appendElement(canvas, params.parent);
+               canvas.style.position = "absolute";
+               if (params["class"]) canvas.className = params["class"];
+               // set an id. if no id on the element and if uuid was supplied it
+               // will be used, otherwise we'll create one.
+               params._jsPlumb.instance.getId(canvas, params.uuid);
+               if (params.tooltip) canvas.setAttribute("title", params.tooltip);
+
+               return canvas;
+       };      
+
+       var CanvasComponent = window.CanvasComponent = function(params) {
+               CanvasMouseAdapter.apply(this, arguments);
+
+               var displayElements = [ ];
+               this.getDisplayElements = function() { return displayElements; };
+               this.appendDisplayElement = function(el) { displayElements.push(el); };
+       };
+       jsPlumbUtil.extend(CanvasComponent, CanvasMouseAdapter, {
+               setVisible:function(state) {                    
+                       this.canvas.style.display = state ? "block" : "none";
+               }
+       });
+       
+       var segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ];
+       var maybeMakeGradient = function(ctx, style, gradientFunction) {
+               if (style.gradient) {
+                       var g = gradientFunction();
+                       for ( var i = 0; i < style.gradient.stops.length; i++)
+                               g.addColorStop(style.gradient.stops[i][0], style.gradient.stops[i][1]);
+                       ctx.strokeStyle = g;
+               }
+       };
+       var segmentRenderer = function(segment, ctx, style, dx, dy) {   
+               ({
+                       "Straight":function(segment, ctx, style, dx, dy) {
+                               var d = segment.params;
+                               ctx.save();
+                               maybeMakeGradient(ctx, style, function() { return ctx.createLinearGradient(d.x1, d.y1, d.x2, d.y2); });
+                               ctx.beginPath();
+                               ctx.translate(dx, dy);                          
+                               if (style.dashstyle && style.dashstyle.split(" ").length === 2) {                       
+                                       // only a very simple dashed style is supported - having two values, which define the stroke length 
+                                       // (as a multiple of the stroke width) and then the space length (also as a multiple of stroke width). 
+                                       var ds = style.dashstyle.split(" ");
+                                       if (ds.length !== 2) ds = [2, 2];
+                                       var dss = [ ds[0] * style.lineWidth, ds[1] * style.lineWidth ],
+                                               m = (d.x2- d.x1) / (d.y2 - d.y1),
+                                               s = jsPlumbUtil.segment([d.x1, d.y1], [ d.x2, d.y2 ]),
+                                               sm = segmentMultipliers[s],
+                                               theta = Math.atan(m),
+                                               l = Math.sqrt(Math.pow(d.x2 - d.x1, 2) + Math.pow(d.y2 - d.y1, 2)),
+                                               repeats = Math.floor(l / (dss[0] + dss[1])),
+                                               curPos = [d.x1, d.y1];
+
+                                       
+                                       // TODO: the question here is why could we not support this in all connector types? it's really
+                                       // just a case of going along and asking jsPlumb for the next point on the path a few times, until it
+                                       // reaches the end. every type of connector supports that method, after all.  but right now its only the
+                                       // bezier connector that gives you back the new location on the path along with the x,y coordinates, which
+                                       // we would need. we'd start out at loc=0 and ask for the point along the path that is dss[0] pixels away.
+                                       // we then ask for the point that is (dss[0] + dss[1]) pixels away; and from that one we need not just the
+                                       // x,y but the location, cos we're gonna plug that location back in in order to find where that dash ends.
+                                       //
+                                       // it also strikes me that it should be trivial to support arbitrary dash styles (having more or less than two
+                                       // entries). you'd just iterate that array using a step size of 2, and generify the (rss[0] + rss[1])
+                                       // computation to be sum(rss[0]..rss[n]).                                       
+
+                                       for (var i = 0; i < repeats; i++) {
+                                               ctx.moveTo(curPos[0], curPos[1]);
+
+                                               var nextEndX = curPos[0] + (Math.abs(Math.sin(theta) * dss[0]) * sm[0]),
+                                                       nextEndY = curPos[1] + (Math.abs(Math.cos(theta) * dss[0]) * sm[1]),
+                                                       nextStartX = curPos[0] + (Math.abs(Math.sin(theta) * (dss[0] + dss[1]))  * sm[0]),
+                                                       nextStartY = curPos[1] + (Math.abs(Math.cos(theta) * (dss[0] + dss[1])) * sm[1]);
+
+                                               ctx.lineTo(nextEndX, nextEndY);
+                                               curPos = [nextStartX, nextStartY];                                      
+                                       }
+
+                                       // now draw the last bit
+                                       ctx.moveTo(curPos[0], curPos[1]);
+                                       ctx.lineTo(d.x2, d.y2);                                                 
+
+                               }               
+                       else {
+                                       ctx.moveTo(d.x1, d.y1);
+                                       ctx.lineTo(d.x2, d.y2);
+                       }                               
+
+                               ctx.stroke();
+
+                               ctx.restore();
+                       },
+                       "Bezier":function(segment, ctx, style, dx, dy) {                                
+                               var d = segment.params;
+                               ctx.save();
+                               maybeMakeGradient(ctx, style, function() { return ctx.createLinearGradient(d.x2 + dx, d.y2 + dy, d.x1 + dx, d.y1 + dy); });
+                               ctx.beginPath();
+                               ctx.translate(dx, dy);
+                               ctx.moveTo(d.x1, d.y1);
+                               ctx.bezierCurveTo(d.cp1x, d.cp1y, d.cp2x, d.cp2y, d.x2, d.y2);
+                               ctx.stroke();
+                               ctx.restore();
+                       },
+                       "Arc":function(segment, ctx, style, dx, dy) {
+                               var d = segment.params;
+                               ctx.save();
+                               ctx.beginPath();
+                               ctx.translate(dx, dy);                          
+                               ctx.arc(d.cx, d.cy, d.r, segment.startAngle, segment.endAngle, d.ac);
+                               ctx.stroke();
+                               ctx.restore();
+                       }
+               })[segment.type](segment, ctx, style, dx, dy);  
+       };
+       
+       /**
+        * Class:CanvasConnector
+        * Superclass for Canvas Connector renderers.
+        */
+       var CanvasConnector = jsPlumb.ConnectorRenderers.canvas = function(params) {
+               CanvasComponent.apply(this, arguments);
+               
+               var _paintOneStyle = function(aStyle, dx, dy) {
+                       this.ctx.save();
+                       jsPlumb.extend(this.ctx, aStyle);
+
+                       var segments = this.getSegments();                              
+                       for (var i = 0; i < segments.length; i++) {
+                               segmentRenderer(segments[i], this.ctx, aStyle, dx, dy);
+                       }
+                       this.ctx.restore();
+               }.bind(this);
+
+               var clazz = this._jsPlumb.instance.connectorClass + " " + (params.cssClass || "");
+               this.canvas = _newCanvas({ 
+                       "class":clazz, 
+                       _jsPlumb:this._jsPlumb,
+                       parent:params.parent
+               });     
+               this.ctx = this.canvas.getContext("2d");
+               
+               this.appendDisplayElement(this.canvas);
+               
+               this.paint = function(style, anchor, extents) {                                         
+                       if (style != null) {                                                    
+
+                               var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p,
+                                       dx = 0, dy = 0;
+
+                               if (extents != null) {
+                                       if (extents.xmin < 0) {
+                                               xy[0] += extents.xmin;
+                                               dx = -extents.xmin;
+                                       }
+                                       if (extents.ymin < 0) {
+                                               xy[1] += extents.ymin;
+                                               dy = -extents.ymin;
+                                       }
+                                       wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);
+                                       wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);
+                               }
+
+                               this.translateX = dx;
+                               this.translateY = dy;
+                               
+                               jsPlumbUtil.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);                               
+                               
+                               if (style.outlineColor != null) {
+                                       var outlineWidth = style.outlineWidth || 1,
+                                       outlineStrokeWidth = style.lineWidth + (2 * outlineWidth),
+                                       outlineStyle = {
+                                               strokeStyle:style.outlineColor,
+                                               lineWidth:outlineStrokeWidth
+                                       };
+                                       _paintOneStyle(outlineStyle, dx, dy);
+                               }
+                               _paintOneStyle(style, dx, dy);
+                       }
+               };                              
+       };              
+       jsPlumbUtil.extend(CanvasConnector, CanvasComponent);
+               
+       
+       /**
+        * Class:CanvasEndpoint
+        * Superclass for Canvas Endpoint renderers.
+        */
+       var CanvasEndpoint = function(params) {
+               CanvasComponent.apply(this, arguments);         
+               var clazz = this._jsPlumb.instance.endpointClass + " " + (params.cssClass || ""),
+                       canvasParams = { 
+                       "class":clazz, 
+                       _jsPlumb:this._jsPlumb,
+                       parent:params.parent,
+                       tooltip:self.tooltip
+               };
+               this.canvas = _newCanvas(canvasParams); 
+               this.ctx = this.canvas.getContext("2d");
+
+               this.appendDisplayElement(this.canvas);
+               
+               this.paint = function(style, anchor, extents) {
+                       jsPlumbUtil.sizeElement(this.canvas, this.x, this.y, this.w, this.h);                   
+                       if (style.outlineColor != null) {
+                               var outlineWidth = style.outlineWidth || 1,
+                               outlineStrokeWidth = style.lineWidth + (2 * outlineWidth);
+                               var outlineStyle = {
+                                       strokeStyle:style.outlineColor,
+                                       lineWidth:outlineStrokeWidth
+                               };
+                       }
+                       
+                       this._paint.apply(this, arguments);
+               };
+       };
+       jsPlumbUtil.extend(CanvasEndpoint, CanvasComponent);
+       
+       jsPlumb.Endpoints.canvas.Dot = function(params) {               
+               jsPlumb.Endpoints.Dot.apply(this, arguments);
+               CanvasEndpoint.apply(this, arguments);
+               var self = this,                
+               parseValue = function(value) {
+                       try { return parseInt(value, 10); }
+                       catch(e) {
+                               if (value.substring(value.length - 1) == '%')
+                                       return parseInt(value.substring(0, value - 1), 10);
+                       }
+               },                                              
+               calculateAdjustments = function(gradient) {
+                       var offsetAdjustment = self.defaultOffset, innerRadius = self.defaultInnerRadius;
+                       if (gradient.offset) offsetAdjustment = parseValue(gradient.offset);
+               if (gradient.innerRadius) innerRadius = parseValue(gradient.innerRadius);
+               return [offsetAdjustment, innerRadius];
+               };
+               this._paint = function(style) {
+                       if (style != null) {                    
+                               var ctx = self.canvas.getContext('2d'), 
+                                       orientation = params.endpoint.anchor.getOrientation(params.endpoint);
+
+                               jsPlumb.extend(ctx, style);                                                     
+                   if (style.gradient) {               
+                       var adjustments = calculateAdjustments(style.gradient), 
+                       yAdjust = orientation[1] == 1 ? adjustments[0] * -1 : adjustments[0],
+                       xAdjust = orientation[0] == 1 ? adjustments[0] * -1:  adjustments[0],
+                       g = ctx.createRadialGradient(self.radius, self.radius, self.radius, self.radius + xAdjust, self.radius + yAdjust, adjustments[1]);
+                           for (var i = 0; i < style.gradient.stops.length; i++)
+                               g.addColorStop(style.gradient.stops[i][0], style.gradient.stops[i][1]);
+                           ctx.fillStyle = g;
+                   }                           
+                               ctx.beginPath();    
+                               //ctx.translate(dx, dy);                                                
+                               ctx.arc(self.radius, self.radius, self.radius, 0, Math.PI*2, true);
+                               ctx.closePath();                                
+                               if (style.fillStyle || style.gradient) ctx.fill();
+                               if (style.strokeStyle) ctx.stroke();
+                       }
+       };
+       };      
+       jsPlumbUtil.extend(jsPlumb.Endpoints.canvas.Dot, [ jsPlumb.Endpoints.Dot, CanvasEndpoint ]);
+               
+       jsPlumb.Endpoints.canvas.Rectangle = function(params) {
+               
+               var self = this;
+               jsPlumb.Endpoints.Rectangle.apply(this, arguments);
+               CanvasEndpoint.apply(this, arguments);                          
+               
+       this._paint = function(style) {
+                               
+                       var ctx = self.canvas.getContext("2d"), 
+                               orientation = params.endpoint.anchor.getOrientation(params.endpoint);
+
+                       jsPlumb.extend(ctx, style);
+                       
+                       /* canvas gradient */
+                   if (style.gradient) {
+                       // first figure out which direction to run the gradient in (it depends on the orientation of the anchors)
+                       var y1 = orientation[1] == 1 ? self.h : orientation[1] === 0 ? self.h / 2 : 0;
+                               var y2 = orientation[1] == -1 ? self.h : orientation[1] === 0 ? self.h / 2 : 0;
+                               var x1 = orientation[0] == 1 ? self.w : orientation[0] === 0 ? self.w / 2 : 0;
+                               var x2 = orientation[0] == -1 ? self.w : orientation[0] === 0 ? self.w / 2 : 0;
+                           var g = ctx.createLinearGradient(x1,y1,x2,y2);
+                           for (var i = 0; i < style.gradient.stops.length; i++)
+                       g.addColorStop(style.gradient.stops[i][0], style.gradient.stops[i][1]);
+                   ctx.fillStyle = g;
+                   }
+                       
+                       ctx.beginPath();
+                       ctx.rect(0, 0, self.w, self.h);
+                       ctx.closePath();                                
+                       if (style.fillStyle || style.gradient) ctx.fill();
+                       if (style.strokeStyle) ctx.stroke();
+       };
+       };              
+       jsPlumbUtil.extend(jsPlumb.Endpoints.canvas.Rectangle, [ jsPlumb.Endpoints.Rectangle, CanvasEndpoint ]);
+       
+       jsPlumb.Endpoints.canvas.Triangle = function(params) {
+                                       
+               var self = this;
+               jsPlumb.Endpoints.Triangle.apply(this, arguments);
+               CanvasEndpoint.apply(this, arguments);                  
+               
+       this._paint = function(style) {                                         
+                       var ctx = self.canvas.getContext('2d'),
+                               offsetX = 0, offsetY = 0, angle = 0,
+                               orientation = params.endpoint.anchor.getOrientation(params.endpoint);
+                       
+                       if( orientation[0] == 1 ) {
+                               offsetX = self.width;
+                               offsetY = self.height;
+                               angle = 180;
+                       }
+                       if( orientation[1] == -1 ) {
+                               offsetX = self.width;
+                               angle = 90;
+                       }
+                       if( orientation[1] == 1 ) {
+                               offsetY = self.height;
+                               angle = -90;
+                       }
+                       
+                       ctx.fillStyle = style.fillStyle;
+                       
+                       ctx.translate(offsetX, offsetY);
+                       ctx.rotate(angle * Math.PI/180);
+
+                       ctx.beginPath();
+                       ctx.moveTo(0, 0);
+                       ctx.lineTo(self.width/2, self.height/2);
+                       ctx.lineTo(0, self.height);
+                       ctx.closePath();
+                       if (style.fillStyle || style.gradient) ctx.fill();
+                       if (style.strokeStyle) ctx.stroke();                            
+       };
+       };      
+       jsPlumbUtil.extend(jsPlumb.Endpoints.canvas.Triangle, [ jsPlumb.Endpoints.Triangle, CanvasEndpoint ]);
+       
+       /*
+        * Canvas Image Endpoint: uses the default version, which creates an <img> tag.
+        */
+       jsPlumb.Endpoints.canvas.Image = jsPlumb.Endpoints.Image;
+       
+       /*
+        * Blank endpoint in all renderers is just the default Blank endpoint.
+        */
+       jsPlumb.Endpoints.canvas.Blank = jsPlumb.Endpoints.Blank;
+               
+// ********************************* END OF CANVAS RENDERERS *******************************************************************    
+    
+    jsPlumb.Overlays.canvas.Label = jsPlumb.Overlays.Label;
+       jsPlumb.Overlays.canvas.Custom = jsPlumb.Overlays.Custom;
+    
+    /**
+     * a placeholder right now, really just exists to mirror the fact that there are SVG and VML versions of this. 
+     */
+    var CanvasOverlay = function() { 
+       jsPlumb.jsPlumbUIComponent.apply(this, arguments);
+    };
+    jsPlumbUtil.extend(CanvasOverlay, jsPlumb.jsPlumbUIComponent, {
+       setVisible : function(state) {
+           this.visible = state;
+           this.component.repaint();
+       }
+    });
+    
+    var AbstractCanvasArrowOverlay = function(superclass, originalArgs) {
+       superclass.apply(this, originalArgs);
+       CanvasOverlay.apply(this, originalArgs);
+       this.paint = function(params, containerExtents) {
+               var ctx = params.component.ctx, d = params.d;
+               
+               if (d) {
+                       ctx.save();
+                               ctx.lineWidth = params.lineWidth;
+                               ctx.beginPath();
+                               ctx.translate(params.component.translateX, params.component.translateY);
+                               ctx.moveTo(d.hxy.x, d.hxy.y);
+                               ctx.lineTo(d.tail[0].x, d.tail[0].y);
+                               ctx.lineTo(d.cxy.x, d.cxy.y);
+                               ctx.lineTo(d.tail[1].x, d.tail[1].y);
+                               ctx.lineTo(d.hxy.x, d.hxy.y);
+                               ctx.closePath();                                                
+                                                       
+                               if (params.strokeStyle) {
+                                       ctx.strokeStyle = params.strokeStyle;
+                                       ctx.stroke();
+                               }
+                               if (params.fillStyle) {
+                                       ctx.fillStyle = params.fillStyle;                       
+                                       ctx.fill();
+                               }
+                               ctx.restore();
+                       }
+       };
+    }; 
+    
+    jsPlumb.Overlays.canvas.Arrow = function() {
+       AbstractCanvasArrowOverlay.apply(this, [jsPlumb.Overlays.Arrow, arguments]);            
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.canvas.Arrow, [ jsPlumb.Overlays.Arrow, CanvasOverlay ] );
+    
+    jsPlumb.Overlays.canvas.PlainArrow = function() {
+       AbstractCanvasArrowOverlay.apply(this, [jsPlumb.Overlays.PlainArrow, arguments]);       
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.canvas.PlainArrow, [ jsPlumb.Overlays.PlainArrow, CanvasOverlay ] );
+    
+    jsPlumb.Overlays.canvas.Diamond = function() {
+       AbstractCanvasArrowOverlay.apply(this, [jsPlumb.Overlays.Diamond, arguments]);          
+    };         
+    jsPlumbUtil.extend(jsPlumb.Overlays.canvas.Diamond, [ jsPlumb.Overlays.Diamond, CanvasOverlay ] );
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/renderers-svg.js b/portal/static/unbound_reservation_static/src/renderers-svg.js
new file mode 100644 (file)
index 0000000..6d7f601
--- /dev/null
@@ -0,0 +1,628 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the SVG renderers.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+/**
+ * SVG support for jsPlumb.
+ * 
+ * things to investigate:
+ * 
+ * gradients:  https://developer.mozilla.org/en/svg_in_html_introduction
+ * css:http://tutorials.jenkov.com/svg/svg-and-css.html
+ * text on a path: http://www.w3.org/TR/SVG/text.html#TextOnAPath
+ * pointer events: https://developer.mozilla.org/en/css/pointer-events
+ *
+ * IE9 hover jquery: http://forum.jquery.com/topic/1-6-2-broke-svg-hover-events
+ *
+ */
+;(function() {
+       
+// ************************** SVG utility methods ******************************************** 
+       
+       var svgAttributeMap = {
+               "joinstyle":"stroke-linejoin",
+               "stroke-linejoin":"stroke-linejoin",            
+               "stroke-dashoffset":"stroke-dashoffset",
+               "stroke-linecap":"stroke-linecap"
+       },
+       STROKE_DASHARRAY = "stroke-dasharray",
+       DASHSTYLE = "dashstyle",
+       LINEAR_GRADIENT = "linearGradient",
+       RADIAL_GRADIENT = "radialGradient",
+       FILL = "fill",
+       STOP = "stop",
+       STROKE = "stroke",
+       STROKE_WIDTH = "stroke-width",
+       STYLE = "style",
+       NONE = "none",
+       JSPLUMB_GRADIENT = "jsplumb_gradient_",
+       LINE_WIDTH = "lineWidth",
+       ns = {
+               svg:"http://www.w3.org/2000/svg",
+               xhtml:"http://www.w3.org/1999/xhtml"
+       },
+       _attr = function(node, attributes) {
+               for (var i in attributes)
+                       node.setAttribute(i, "" + attributes[i]);
+       },      
+       _node = function(name, attributes) {
+               var n = document.createElementNS(ns.svg, name);
+               attributes = attributes || {};
+               attributes.version = "1.1";
+               attributes.xmlns = ns.xhtml;
+               _attr(n, attributes);
+               return n;
+       },
+       _pos = function(d) { return "position:absolute;left:" + d[0] + "px;top:" + d[1] + "px"; },      
+       _clearGradient = function(parent) {
+               for (var i = 0; i < parent.childNodes.length; i++) {
+                       if (parent.childNodes[i].tagName == LINEAR_GRADIENT || parent.childNodes[i].tagName == RADIAL_GRADIENT)
+                               parent.removeChild(parent.childNodes[i]);
+               }
+       },              
+       _updateGradient = function(parent, node, style, dimensions, uiComponent) {
+               var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();
+               // first clear out any existing gradient
+               _clearGradient(parent);
+               // this checks for an 'offset' property in the gradient, and in the absence of it, assumes
+               // we want a linear gradient. if it's there, we create a radial gradient.
+               // it is possible that a more explicit means of defining the gradient type would be
+               // better. relying on 'offset' means that we can never have a radial gradient that uses
+               // some default offset, for instance.
+               // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would
+               // not show gradients when the line was perfectly horizontal or vertical.
+               var g;
+               if (!style.gradient.offset) {
+                       g = _node(LINEAR_GRADIENT, {id:id, gradientUnits:"userSpaceOnUse"});
+               }
+               else {
+                       g = _node(RADIAL_GRADIENT, {
+                               id:id
+                       });                     
+               }
+               
+               parent.appendChild(g);
+               
+               // the svg radial gradient seems to treat stops in the reverse 
+               // order to how canvas does it.  so we want to keep all the maths the same, but
+               // iterate the actual style declarations in reverse order, if the x indexes are not in order.
+               for (var i = 0; i < style.gradient.stops.length; i++) {
+                       var styleToUse = uiComponent.segment == 1 ||  uiComponent.segment == 2 ? i: style.gradient.stops.length - 1 - i,                        
+                               stopColor = jsPlumbUtil.convertStyle(style.gradient.stops[styleToUse][1], true),
+                               s = _node(STOP, {"offset":Math.floor(style.gradient.stops[i][0] * 100) + "%", "stop-color":stopColor});
+
+                       g.appendChild(s);
+               }
+               var applyGradientTo = style.strokeStyle ? STROKE : FILL;
+        //document.location.toString()
+               //node.setAttribute(STYLE, applyGradientTo + ":url(#" + id + ")");
+        node.setAttribute(STYLE, applyGradientTo + ":url(" + document.location.toString() + "#" + id + ")");
+       },
+       _applyStyles = function(parent, node, style, dimensions, uiComponent) {
+               
+               if (style.gradient) {
+                       _updateGradient(parent, node, style, dimensions, uiComponent);                  
+               }
+               else {
+                       // make sure we clear any existing gradient
+                       _clearGradient(parent);
+                       node.setAttribute(STYLE, "");
+               }
+               
+               node.setAttribute(FILL, style.fillStyle ? jsPlumbUtil.convertStyle(style.fillStyle, true) : NONE);
+               node.setAttribute(STROKE, style.strokeStyle ? jsPlumbUtil.convertStyle(style.strokeStyle, true) : NONE);                
+               if (style.lineWidth) {
+                       node.setAttribute(STROKE_WIDTH, style.lineWidth);
+               }
+       
+               // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like
+               // the syntax in VML but is actually kind of nasty: values are given in the pixel
+               // coordinate space, whereas in VML they are multiples of the width of the stroked
+               // line, which makes a lot more sense.  for that reason, jsPlumb is supporting both
+               // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from
+               // VML, which will be the preferred method.  the code below this converts a dashstyle
+               // attribute given in terms of stroke width into a pixel representation, by using the
+               // stroke's lineWidth. 
+               if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {
+                       var sep = style[DASHSTYLE].indexOf(",") == -1 ? " " : ",",
+                       parts = style[DASHSTYLE].split(sep),
+                       styleToUse = "";
+                       parts.forEach(function(p) {
+                               styleToUse += (Math.floor(p * style.lineWidth) + sep);
+                       });
+                       node.setAttribute(STROKE_DASHARRAY, styleToUse);
+               }               
+               else if(style[STROKE_DASHARRAY]) {
+                       node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);
+               }
+               
+               // extra attributes such as join type, dash offset.
+               for (var i in svgAttributeMap) {
+                       if (style[i]) {
+                               node.setAttribute(svgAttributeMap[i], style[i]);
+                       }
+               }
+       },
+       _decodeFont = function(f) {
+               var r = /([0-9].)(p[xt])\s(.*)/, 
+                       bits = f.match(r);
+
+               return {size:bits[1] + bits[2], font:bits[3]};          
+       },
+       _classManip = function(el, add, clazz) {
+               var classesToAddOrRemove = clazz.split(" "),
+                       className = el.className,
+                       curClasses = className.baseVal.split(" ");
+                       
+               for (var i = 0; i < classesToAddOrRemove.length; i++) {
+                       if (add) {
+                               if (curClasses.indexOf(classesToAddOrRemove[i]) == -1)
+                                       curClasses.push(classesToAddOrRemove[i]);
+                       }
+                       else {
+                               var idx = curClasses.indexOf(classesToAddOrRemove[i]);
+                               if (idx != -1)
+                                       curClasses.splice(idx, 1);
+                       }
+               }
+               
+               el.className.baseVal = curClasses.join(" ");
+       },
+       _addClass = function(el, clazz) { _classManip(el, true, clazz); },
+       _removeClass = function(el, clazz) { _classManip(el, false, clazz); },
+       _appendAtIndex = function(svg, path, idx) {
+               if (svg.childNodes.length > idx) {
+                       svg.insertBefore(path, svg.childNodes[idx]);
+               }
+               else svg.appendChild(path);
+       };
+       
+       /**
+               utility methods for other objects to use.
+       */
+       jsPlumbUtil.svg = {
+               addClass:_addClass,
+               removeClass:_removeClass,
+               node:_node,
+               attr:_attr,
+               pos:_pos
+       };
+       
+ // ************************** / SVG utility methods ********************************************      
+       
+       /*
+        * Base class for SVG components.
+        */     
+       var SvgComponent = function(params) {
+               var pointerEventsSpec = params.pointerEventsSpec || "all", renderer = {};
+                       
+               jsPlumb.jsPlumbUIComponent.apply(this, params.originalArgs);
+               this.canvas = null;this.path = null;this.svg = null; 
+       
+               var clazz = params.cssClass + " " + (params.originalArgs[0].cssClass || ""),            
+                       svgParams = {
+                               "style":"",
+                               "width":0,
+                               "height":0,
+                               "pointer-events":pointerEventsSpec,
+                               "position":"absolute"
+                       };                              
+               this.svg = _node("svg", svgParams);
+               if (params.useDivWrapper) {
+                       this.canvas = document.createElement("div");
+                       this.canvas.style.position = "absolute";
+                       jsPlumbUtil.sizeElement(this.canvas,0,0,1,1);
+                       this.canvas.className = clazz;
+               }
+               else {
+                       _attr(this.svg, { "class":clazz });
+                       this.canvas = this.svg;
+               }
+                       
+               params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);
+               if (params.useDivWrapper) this.canvas.appendChild(this.svg);
+               
+               // TODO this displayElement stuff is common between all components, across all
+               // renderers.  would be best moved to jsPlumbUIComponent.
+               var displayElements = [ this.canvas ];
+               this.getDisplayElements = function() { 
+                       return displayElements; 
+               };
+               
+               this.appendDisplayElement = function(el) {
+                       displayElements.push(el);
+               };      
+               
+               this.paint = function(style, anchor, extents) {                         
+                       if (style != null) {
+                               
+                               var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;
+                               if (extents != null) {
+                                       if (extents.xmin < 0) xy[0] += extents.xmin;
+                                       if (extents.ymin < 0) xy[1] += extents.ymin;
+                                       wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);
+                                       wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);
+                               }
+
+                               if (params.useDivWrapper) {                                     
+                                       jsPlumbUtil.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);
+                                       xy[0] = 0; xy[1] = 0;
+                                       p = _pos([ 0, 0 ]);
+                               }
+                               else
+                                       p = _pos([ xy[0], xy[1] ]);
+                
+                renderer.paint.apply(this, arguments);                                         
+                
+                       _attr(this.svg, {
+                               "style":p,
+                               "width": wh[0],
+                               "height": wh[1]
+                       });                                                     
+                       }
+           };
+               
+               return {
+                       renderer:renderer
+               };
+       };
+       jsPlumbUtil.extend(SvgComponent, jsPlumb.jsPlumbUIComponent, {
+               cleanup:function() {
+                       jsPlumbUtil.removeElement(this.canvas);            
+                       this.svg = null;
+                       this.canvas = null;
+                       this.path = null;                       
+               },
+               setVisible:function(v) {
+                       if (this.canvas) {
+                               this.canvas.style.display = v ? "block" : "none";
+                       }
+                       if (this.bgCanvas) {
+                               this.bgCanvas.style.display = v ? "block" : "none";
+                       }
+               }
+       });
+       
+       /*
+        * Base class for SVG connectors.
+        */ 
+       var SvgConnector = jsPlumb.ConnectorRenderers.svg = function(params) {
+               var self = this,
+                       _super = SvgComponent.apply(this, [ { 
+                               cssClass:params._jsPlumb.connectorClass, 
+                               originalArgs:arguments, 
+                               pointerEventsSpec:"none", 
+                               _jsPlumb:params._jsPlumb
+                       } ]);   
+
+               /*this.pointOnPath = function(location, absolute) {
+                       if (!self.path) return [0,0];
+                       var p = absolute ? location : location * self.path.getTotalLength();
+                       return self.path.getPointAtLength(p);
+               };*/                    
+
+               _super.renderer.paint = function(style, anchor, extents) {
+                       
+                       var segments = self.getSegments(), p = "", offset = [0,0];                      
+                       if (extents.xmin < 0) offset[0] = -extents.xmin;
+                       if (extents.ymin < 0) offset[1] = -extents.ymin;                        
+                       
+                       // create path from segments.   
+                       for (var i = 0; i < segments.length; i++) {
+                               p += jsPlumb.Segments.svg.SegmentRenderer.getPath(segments[i]);
+                               p += " ";
+                       }                       
+                       
+                       var a = { 
+                                       d:p,
+                                       transform:"translate(" + offset[0] + "," + offset[1] + ")",
+                                       "pointer-events":params["pointer-events"] || "visibleStroke"
+                               }, 
+                outlineStyle = null,
+                d = [self.x,self.y,self.w,self.h];                                             
+                       
+                       // outline style.  actually means drawing an svg object underneath the main one.
+                       if (style.outlineColor) {
+                               var outlineWidth = style.outlineWidth || 1,
+                                       outlineStrokeWidth = style.lineWidth + (2 * outlineWidth);
+                               outlineStyle = jsPlumb.CurrentLibrary.extend({}, style);
+                               outlineStyle.strokeStyle = jsPlumbUtil.convertStyle(style.outlineColor);
+                               outlineStyle.lineWidth = outlineStrokeWidth;
+                               
+                               if (self.bgPath == null) {
+                                       self.bgPath = _node("path", a);
+                               _appendAtIndex(self.svg, self.bgPath, 0);
+                               self.attachListeners(self.bgPath, self);
+                               }
+                               else {
+                                       _attr(self.bgPath, a);
+                               }
+                               
+                               _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);
+                       }                       
+                       
+               if (self.path == null) {
+                       self.path = _node("path", a);
+                       _appendAtIndex(self.svg, self.path, style.outlineColor ? 1 : 0);
+                       self.attachListeners(self.path, self);                                  
+               }
+               else {
+                       _attr(self.path, a);
+               }
+                               
+               _applyStyles(self.svg, self.path, style, d, self);
+               };
+               
+               this.reattachListeners = function() {
+                       if (this.bgPath) this.reattachListenersForElement(this.bgPath, this);
+                       if (this.path) this.reattachListenersForElement(this.path, this);
+               };
+       };
+       jsPlumbUtil.extend(jsPlumb.ConnectorRenderers.svg, SvgComponent);
+
+// ******************************* svg segment renderer *****************************************************  
+               
+       jsPlumb.Segments.svg = {
+               SegmentRenderer : {             
+                       getPath : function(segment) {
+                               return ({
+                                       "Straight":function() {
+                                               var d = segment.getCoordinates();
+                                               return "M " + d.x1 + " " + d.y1 + " L " + d.x2 + " " + d.y2;    
+                                       },
+                                       "Bezier":function() {
+                                               var d = segment.params;
+                                               return "M " + d.x1 + " " + d.y1 + 
+                                                       " C " + d.cp1x + " " + d.cp1y + " " + d.cp2x + " " + d.cp2y + " " + d.x2 + " " + d.y2;                  
+                                       },
+                                       "Arc":function() {
+                                               var d = segment.params,
+                                                       laf = segment.sweep > Math.PI ? 1 : 0,
+                                                       sf = segment.anticlockwise ? 0 : 1;                     
+
+                                               return "M" + segment.x1 + " " + segment.y1 + " A " + segment.radius + " " + d.r + " 0 " + laf + "," + sf + " " + segment.x2 + " " + segment.y2;
+                                       }
+                               })[segment.type]();     
+                       }
+               }
+       };
+       
+// ******************************* /svg segments *****************************************************
+   
+    /*
+        * Base class for SVG endpoints.
+        */
+       var SvgEndpoint = window.SvgEndpoint = function(params) {
+               var _super = SvgComponent.apply(this, [ {
+                               cssClass:params._jsPlumb.endpointClass, 
+                               originalArgs:arguments, 
+                               pointerEventsSpec:"all",
+                               useDivWrapper:true,
+                               _jsPlumb:params._jsPlumb
+                       } ]);
+                       
+               _super.renderer.paint = function(style) {
+                       var s = jsPlumb.extend({}, style);
+                       if (s.outlineColor) {
+                               s.strokeWidth = s.outlineWidth;
+                               s.strokeStyle = jsPlumbUtil.convertStyle(s.outlineColor, true);
+                       }
+                       
+                       if (this.node == null) {
+                               this.node = this.makeNode(s);
+                               this.svg.appendChild(this.node);
+                               this.attachListeners(this.node, this);
+                       }
+                       else if (this.updateNode != null) {
+                               this.updateNode(this.node);
+                       }
+                       _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);
+                       _pos(this.node, [ this.x, this.y ]);
+               }.bind(this);
+                               
+       };
+       jsPlumbUtil.extend(SvgEndpoint, SvgComponent, {
+               reattachListeners : function() {
+                       if (this.node) this.reattachListenersForElement(this.node, this);
+               }
+       });
+       
+       /*
+        * SVG Dot Endpoint
+        */
+       jsPlumb.Endpoints.svg.Dot = function() {
+               jsPlumb.Endpoints.Dot.apply(this, arguments);
+               SvgEndpoint.apply(this, arguments);             
+               this.makeNode = function(style) { 
+                       return _node("circle", {
+                "cx"   :       this.w / 2,
+                "cy"   :       this.h / 2,
+                "r"            :       this.radius
+            });                        
+               };
+               this.updateNode = function(node) {
+                       _attr(node, {
+                               "cx":this.w / 2,
+                               "cy":this.h  / 2,
+                               "r":this.radius
+                       });
+               };
+       };
+       jsPlumbUtil.extend(jsPlumb.Endpoints.svg.Dot, [jsPlumb.Endpoints.Dot, SvgEndpoint]);
+       
+       /*
+        * SVG Rectangle Endpoint 
+        */
+       jsPlumb.Endpoints.svg.Rectangle = function() {
+               jsPlumb.Endpoints.Rectangle.apply(this, arguments);
+               SvgEndpoint.apply(this, arguments);             
+               this.makeNode = function(style) {
+                       return _node("rect", {
+                               "width"     :   this.w,
+                               "height"    :   this.h
+                       });
+               };
+               this.updateNode = function(node) {
+                       _attr(node, {
+                               "width":this.w,
+                               "height":this.h
+                       });
+               };                      
+       };              
+       jsPlumbUtil.extend(jsPlumb.Endpoints.svg.Rectangle, [jsPlumb.Endpoints.Rectangle, SvgEndpoint]);
+       
+       /*
+        * SVG Image Endpoint is the default image endpoint.
+        */
+       jsPlumb.Endpoints.svg.Image = jsPlumb.Endpoints.Image;
+       /*
+        * Blank endpoint in svg renderer is the default Blank endpoint.
+        */
+       jsPlumb.Endpoints.svg.Blank = jsPlumb.Endpoints.Blank;  
+       /*
+        * Label overlay in svg renderer is the default Label overlay.
+        */
+       jsPlumb.Overlays.svg.Label = jsPlumb.Overlays.Label;
+       /*
+        * Custom overlay in svg renderer is the default Custom overlay.
+        */
+       jsPlumb.Overlays.svg.Custom = jsPlumb.Overlays.Custom;
+               
+       var AbstractSvgArrowOverlay = function(superclass, originalArgs) {
+       superclass.apply(this, originalArgs);
+       jsPlumb.jsPlumbUIComponent.apply(this, originalArgs);
+        this.isAppendedAtTopLevel = false;
+       var self = this;
+       this.path = null;
+       this.paint = function(params, containerExtents) {
+               // only draws on connections, not endpoints.
+               if (params.component.svg && containerExtents) {
+                       if (this.path == null) {
+                               this.path = _node("path", {
+                                       "pointer-events":"all"  
+                               });
+                               params.component.svg.appendChild(this.path);
+                               
+                               this.attachListeners(this.path, params.component);
+                               this.attachListeners(this.path, this);
+                       }
+                       var clazz = originalArgs && (originalArgs.length == 1) ? (originalArgs[0].cssClass || "") : "",
+                               offset = [0,0];
+
+                       if (containerExtents.xmin < 0) offset[0] = -containerExtents.xmin;
+                       if (containerExtents.ymin < 0) offset[1] = -containerExtents.ymin;
+                       
+                       _attr(this.path, { 
+                               "d"                     :       makePath(params.d),
+                               "class"         :       clazz,
+                               stroke          :       params.strokeStyle ? params.strokeStyle : null,
+                               fill            :       params.fillStyle ? params.fillStyle : null,
+                               transform       :       "translate(" + offset[0] + "," + offset[1] + ")"
+                       });             
+               }
+       };
+       var makePath = function(d) {
+               return "M" + d.hxy.x + "," + d.hxy.y +
+                               " L" + d.tail[0].x + "," + d.tail[0].y + 
+                               " L" + d.cxy.x + "," + d.cxy.y + 
+                               " L" + d.tail[1].x + "," + d.tail[1].y + 
+                               " L" + d.hxy.x + "," + d.hxy.y;
+       };
+       this.reattachListeners = function() {
+                       if (this.path) this.reattachListenersForElement(this.path, this);
+               };              
+    };
+    jsPlumbUtil.extend(AbstractSvgArrowOverlay, [jsPlumb.jsPlumbUIComponent, jsPlumb.Overlays.AbstractOverlay], {
+       cleanup : function() {
+               if (this.path != null) jsPlumb.CurrentLibrary.removeElement(this.path);
+       },
+       setVisible:function(v) {
+               if(this.path != null) (this.path.style.display = (v ? "block" : "none"));
+       }
+    });
+    
+    jsPlumb.Overlays.svg.Arrow = function() {
+       AbstractSvgArrowOverlay.apply(this, [jsPlumb.Overlays.Arrow, arguments]);       
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.svg.Arrow, [ jsPlumb.Overlays.Arrow, AbstractSvgArrowOverlay ]);
+    
+    jsPlumb.Overlays.svg.PlainArrow = function() {
+       AbstractSvgArrowOverlay.apply(this, [jsPlumb.Overlays.PlainArrow, arguments]);          
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.svg.PlainArrow, [ jsPlumb.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);
+    
+    jsPlumb.Overlays.svg.Diamond = function() {
+       AbstractSvgArrowOverlay.apply(this, [jsPlumb.Overlays.Diamond, arguments]);     
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.svg.Diamond, [ jsPlumb.Overlays.Diamond, AbstractSvgArrowOverlay ]);
+
+    // a test
+    jsPlumb.Overlays.svg.GuideLines = function() {
+        var path = null, self = this, p1_1, p1_2;        
+        jsPlumb.Overlays.GuideLines.apply(this, arguments);
+        this.paint = function(params, containerExtents) {
+               if (path == null) {
+                       path = _node("path");
+                       params.connector.svg.appendChild(path);
+                       self.attachListeners(path, params.connector);
+                       self.attachListeners(path, self);
+
+                p1_1 = _node("path");
+                       params.connector.svg.appendChild(p1_1);
+                       self.attachListeners(p1_1, params.connector);
+                       self.attachListeners(p1_1, self);
+
+                p1_2 = _node("path");
+                       params.connector.svg.appendChild(p1_2);
+                       self.attachListeners(p1_2, params.connector);
+                       self.attachListeners(p1_2, self);
+               }
+
+               var offset =[0,0];
+               if (containerExtents.xmin < 0) offset[0] = -containerExtents.xmin;
+               if (containerExtents.ymin < 0) offset[1] = -containerExtents.ymin;
+
+               _attr(path, {
+                       "d"             :       makePath(params.head, params.tail),
+                       stroke  :       "red",
+                       fill    :       null,
+                       transform:"translate(" + offset[0] + "," + offset[1] + ")"
+               });
+
+            _attr(p1_1, {
+                       "d"             :       makePath(params.tailLine[0], params.tailLine[1]),
+                       stroke  :       "blue",
+                       fill    :       null,
+                       transform:"translate(" + offset[0] + "," + offset[1] + ")"
+               });
+
+            _attr(p1_2, {
+                       "d"             :       makePath(params.headLine[0], params.headLine[1]),
+                       stroke  :       "green",
+                       fill    :       null,
+                       transform:"translate(" + offset[0] + "," + offset[1] + ")"
+               });
+       };
+
+        var makePath = function(d1, d2) {
+            return "M " + d1.x + "," + d1.y +
+                   " L" + d2.x + "," + d2.y;
+        };        
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.svg.GuideLines, jsPlumb.Overlays.GuideLines);
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/renderers-vml.js b/portal/static/unbound_reservation_static/src/renderers-vml.js
new file mode 100644 (file)
index 0000000..5a9d414
--- /dev/null
@@ -0,0 +1,529 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the VML renderers.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+;(function() {
+       
+       // http://ajaxian.com/archives/the-vml-changes-in-ie-8
+       // http://www.nczonline.net/blog/2010/01/19/internet-explorer-8-document-and-browser-modes/
+       // http://www.louisremi.com/2009/03/30/changes-in-vml-for-ie8-or-what-feature-can-the-ie-dev-team-break-for-you-today/
+       
+       var vmlAttributeMap = {
+               "stroke-linejoin":"joinstyle",
+               "joinstyle":"joinstyle",                
+               "endcap":"endcap",
+               "miterlimit":"miterlimit"
+       },
+       jsPlumbStylesheet = null;
+       
+       if (document.createStyleSheet && document.namespaces) {                 
+               
+               var ruleClasses = [
+                               ".jsplumb_vml", "jsplumb\\:textbox", "jsplumb\\:oval", "jsplumb\\:rect", 
+                               "jsplumb\\:stroke", "jsplumb\\:shape", "jsplumb\\:group"
+                       ],
+                       rule = "behavior:url(#default#VML);position:absolute;";
+
+               jsPlumbStylesheet = document.createStyleSheet();
+
+               for (var i = 0; i < ruleClasses.length; i++)
+                       jsPlumbStylesheet.addRule(ruleClasses[i], rule);
+
+               // in this page it is also mentioned that IE requires the extra arg to the namespace
+               // http://www.louisremi.com/2009/03/30/changes-in-vml-for-ie8-or-what-feature-can-the-ie-dev-team-break-for-you-today/
+               // but someone commented saying they didn't need it, and it seems jsPlumb doesnt need it either.
+               // var iev = document.documentMode;
+               //if (!iev || iev < 8)
+                       document.namespaces.add("jsplumb", "urn:schemas-microsoft-com:vml");
+               //else
+               //      document.namespaces.add("jsplumb", "urn:schemas-microsoft-com:vml", "#default#VML");
+       }
+       
+       jsPlumb.vml = {};
+       
+       var scale = 1000,
+
+    _groupMap = {},
+    _getGroup = function(container, connectorClass) {
+        var id = jsPlumb.getId(container),
+            g = _groupMap[id];
+        if(!g) {
+            g = _node("group", [0,0,scale, scale], {"class":connectorClass});
+            //g.style.position=absolute;
+            //g["coordsize"] = "1000,1000";
+            g.style.backgroundColor="red";
+            _groupMap[id] = g;
+            //jsPlumb.appendElement(g, container);  // todo if this gets reinstated, remember to use the current jsplumb instance.
+            //jsPlumb.CurrentLibrary.getDOMElement(container).appendChild(g);
+            //document.body.appendChild(g);
+        }
+        return g;
+    },
+       _atts = function(o, atts) {
+               for (var i in atts) { 
+                       // IE8 fix: setattribute does not work after an element has been added to the dom!
+                       // http://www.louisremi.com/2009/03/30/changes-in-vml-for-ie8-or-what-feature-can-the-ie-dev-team-break-for-you-today/
+                       //o.setAttribute(i, atts[i]);
+
+                       /*There is an additional problem when accessing VML elements by using get/setAttribute. The simple solution is following:
+
+                       if (document.documentMode==8) {
+                       ele.opacity=1;
+                       } else {
+                       ele.setAttribute(‘opacity’,1);
+                       }
+                       */
+
+                       o[i] = atts[i];
+               }
+       },
+       _node = function(name, d, atts, parent, _jsPlumb, deferToJsPlumbContainer) {
+               atts = atts || {};
+               var o = document.createElement("jsplumb:" + name);
+               if (deferToJsPlumbContainer)
+                       _jsPlumb.appendElement(o, parent);
+               else
+                       jsPlumb.CurrentLibrary.appendElement(o, parent);
+               o.className = (atts["class"] ? atts["class"] + " " : "") + "jsplumb_vml";
+               _pos(o, d);
+               _atts(o, atts);
+               return o;
+       },
+       _pos = function(o,d, zIndex) {
+               o.style.left = d[0] + "px";             
+               o.style.top =  d[1] + "px";
+               o.style.width= d[2] + "px";
+               o.style.height= d[3] + "px";
+               o.style.position = "absolute";
+               if (zIndex)
+                       o.style.zIndex = zIndex;
+       },
+       _conv = jsPlumb.vml.convertValue = function(v) {
+               return Math.floor(v * scale);
+       },      
+       // tests if the given style is "transparent" and then sets the appropriate opacity node to 0 if so,
+       // or 1 if not.  TODO in the future, support variable opacity.
+       _maybeSetOpacity = function(styleToWrite, styleToCheck, type, component) {
+               if ("transparent" === styleToCheck)
+                       component.setOpacity(type, "0.0");
+               else
+                       component.setOpacity(type, "1.0");
+       },
+       _applyStyles = function(node, style, component, _jsPlumb) {
+               var styleToWrite = {};
+               if (style.strokeStyle) {
+                       styleToWrite.stroked = "true";
+                       var strokeColor = jsPlumbUtil.convertStyle(style.strokeStyle, true);
+                       styleToWrite.strokecolor = strokeColor;
+                       _maybeSetOpacity(styleToWrite, strokeColor, "stroke", component);
+                       styleToWrite.strokeweight = style.lineWidth + "px";
+               }
+               else styleToWrite.stroked = "false";
+               
+               if (style.fillStyle) {
+                       styleToWrite.filled = "true";
+                       var fillColor = jsPlumbUtil.convertStyle(style.fillStyle, true);
+                       styleToWrite.fillcolor = fillColor;
+                       _maybeSetOpacity(styleToWrite, fillColor, "fill", component);
+               }
+               else styleToWrite.filled = "false";
+               
+               if(style.dashstyle) {
+                       if (component.strokeNode == null) {
+                               component.strokeNode = _node("stroke", [0,0,0,0], { dashstyle:style.dashstyle }, node, _jsPlumb);                               
+                       }
+                       else
+                               component.strokeNode.dashstyle = style.dashstyle;
+               }                                       
+               else if (style["stroke-dasharray"] && style.lineWidth) {
+                       var sep = style["stroke-dasharray"].indexOf(",") == -1 ? " " : ",",
+                       parts = style["stroke-dasharray"].split(sep),
+                       styleToUse = "";
+                       for(var i = 0; i < parts.length; i++) {
+                               styleToUse += (Math.floor(parts[i] / style.lineWidth) + sep);
+                       }
+                       if (component.strokeNode == null) {
+                               component.strokeNode = _node("stroke", [0,0,0,0], { dashstyle:styleToUse }, node, _jsPlumb);                            
+                       }
+                       else
+                               component.strokeNode.dashstyle = styleToUse;
+               }
+               
+               _atts(node, styleToWrite);
+       },
+       /*
+        * Base class for Vml endpoints and connectors. Extends jsPlumbUIComponent. 
+        */
+       VmlComponent = function() {                             
+               var self = this, renderer = {};
+               jsPlumb.jsPlumbUIComponent.apply(this, arguments);      
+
+               this.opacityNodes = {
+                       "stroke":null,
+                       "fill":null
+               };
+               this.initOpacityNodes = function(vml) {
+                       self.opacityNodes.stroke = _node("stroke", [0,0,1,1], {opacity:"0.0"}, vml, self._jsPlumb.instance);
+                       self.opacityNodes.fill = _node("fill", [0,0,1,1], {opacity:"0.0"}, vml, self._jsPlumb.instance);                                                        
+               };
+               this.setOpacity = function(type, value) {
+                       var node = self.opacityNodes[type];
+                       if (node) node.opacity = "" + value;
+               };
+               var displayElements = [ ];
+               this.getDisplayElements = function() { 
+                       return displayElements; 
+               };
+               
+               this.appendDisplayElement = function(el, doNotAppendToCanvas) {
+                       if (!doNotAppendToCanvas) self.canvas.parentNode.appendChild(el);
+                       displayElements.push(el);
+               };
+       };
+       jsPlumbUtil.extend(VmlComponent, jsPlumb.jsPlumbUIComponent, {
+               cleanup:function() {                    
+                       if (this.bgCanvas) jsPlumbUtil.removeElement(this.bgCanvas);
+                       jsPlumbUtil.removeElement(this.canvas);                                         
+               }
+       });
+
+       /*
+        * Base class for Vml connectors. extends VmlComponent.
+        */
+       var VmlConnector = jsPlumb.ConnectorRenderers.vml = function(params) {          
+               this.strokeNode = null;
+               this.canvas = null;
+               VmlComponent.apply(this, arguments);
+               var clazz = this._jsPlumb.instance.connectorClass + (params.cssClass ? (" " + params.cssClass) : "");
+               this.paint = function(style) {          
+                       if (style !== null) {                   
+
+                               // we need to be at least 1 pixel in each direction, because otherwise coordsize gets set to
+                               // 0 and overlays cannot paint.
+                               this.w = Math.max(this.w, 1);
+                               this.h = Math.max(this.h, 1);
+
+                               var segments = this.getSegments(), p = { "path":"" },
+                    d = [this.x, this.y, this.w, this.h];
+                               
+                               // create path from segments.   
+                               for (var i = 0; i < segments.length; i++) {
+                                       p.path += jsPlumb.Segments.vml.SegmentRenderer.getPath(segments[i]);
+                                       p.path += " ";
+                               }
+
+                //*
+                               if (style.outlineColor) {
+                                       var outlineWidth = style.outlineWidth || 1,
+                                       outlineStrokeWidth = style.lineWidth + (2 * outlineWidth),
+                                       outlineStyle = {
+                                               strokeStyle : jsPlumbUtil.convertStyle(style.outlineColor),
+                                               lineWidth : outlineStrokeWidth
+                                       };
+                                       for (var aa in vmlAttributeMap) outlineStyle[aa] = style[aa];
+                                       
+                                       if (this.bgCanvas == null) {                                            
+                                               p["class"] = clazz;
+                                               p.coordsize = (d[2] * scale) + "," + (d[3] * scale);
+                                               this.bgCanvas = _node("shape", d, p, params.parent, this._jsPlumb.instance, true);                                              
+                                               _pos(this.bgCanvas, d);
+                                               this.appendDisplayElement(this.bgCanvas, true); 
+                                               this.attachListeners(this.bgCanvas, this);                                      
+                                               this.initOpacityNodes(this.bgCanvas, ["stroke"]);               
+                                       }
+                                       else {
+                                               p.coordsize = (d[2] * scale) + "," + (d[3] * scale);
+                                               _pos(this.bgCanvas, d);
+                                               _atts(this.bgCanvas, p);
+                                       }
+                                       
+                                       _applyStyles(this.bgCanvas, outlineStyle, this);
+                               }
+                               //*/
+                               
+                               if (this.canvas == null) {                                                                              
+                                       p["class"] = clazz;
+                                       p.coordsize = (d[2] * scale) + "," + (d[3] * scale);                                    
+                                       this.canvas = _node("shape", d, p, params.parent, this._jsPlumb.instance, true);                                                        
+                    //var group = _getGroup(params.parent);                   // test of append everything to a group
+                    //group.appendChild(self.canvas);                           // sort of works but not exactly;
+                                       //params["_jsPlumb"].appendElement(self.canvas, params.parent);    //before introduction of groups
+
+                                       this.appendDisplayElement(this.canvas, true);                                                                           
+                                       this.attachListeners(this.canvas, this);                                        
+                                       this.initOpacityNodes(this.canvas, ["stroke"]);         
+                               }
+                               else {
+                                       p.coordsize = (d[2] * scale) + "," + (d[3] * scale);
+                                       _pos(this.canvas, d);
+                                       _atts(this.canvas, p);
+                               }
+                               
+                               _applyStyles(this.canvas, style, this, this._jsPlumb.instance);
+                       }
+               };      
+                               
+       };
+       jsPlumbUtil.extend(VmlConnector, VmlComponent, {
+               reattachListeners : function() {
+                       if (this.canvas) this.reattachListenersForElement(this.canvas, this);
+               },
+               setVisible:function(v) {
+                       if (this.canvas) {
+                               this.canvas.style.display = v ? "block" : "none";
+                       }
+                       if (this.bgCanvas) {
+                               this.bgCanvas.style.display = v ? "block" : "none";
+                       }
+               }
+       });     
+       
+       /*
+        * 
+        * Base class for Vml Endpoints. extends VmlComponent.
+        * 
+        */
+       var VmlEndpoint = window.VmlEndpoint = function(params) {
+               VmlComponent.apply(this, arguments);
+               this._jsPlumb.vml = null;//, opacityStrokeNode = null, opacityFillNode = null;
+               this.canvas = document.createElement("div");
+               this.canvas.style.position = "absolute";
+               this._jsPlumb.clazz = this._jsPlumb.instance.endpointClass + (params.cssClass ? (" " + params.cssClass) : "");
+
+               // TODO vml endpoint adds class to VML at constructor time.  but the addClass method adds VML
+               // to the enclosing DIV. what to do?  seems like it would be better to just target the div.
+               // HOWEVER...vml connection has no containing div.  why not? it feels like it should.
+
+               //var group = _getGroup(params.parent);
+        //group.appendChild(self.canvas);
+               params._jsPlumb.appendElement(this.canvas, params.parent);
+
+               this.paint = function(style, anchor) {
+                       var p = { }, vml = this._jsPlumb.vml;                           
+                       
+                       jsPlumbUtil.sizeElement(this.canvas, this.x, this.y, this.w, this.h);
+                       if (this._jsPlumb.vml == null) {
+                               p["class"] = this._jsPlumb.clazz;
+                               vml = this._jsPlumb.vml = this.getVml([0,0, this.w, this.h], p, anchor, this.canvas, this._jsPlumb.instance);                           
+                               this.attachListeners(vml, this);
+
+                               this.appendDisplayElement(vml, true);
+                               this.appendDisplayElement(this.canvas, true);
+                               
+                               this.initOpacityNodes(vml, ["fill"]);                   
+                       }
+                       else {                          
+                               _pos(vml, [0,0, this.w, this.h]);
+                               _atts(vml, p);
+                       }
+                       
+                       _applyStyles(vml, style, this);
+               };              
+       };
+       jsPlumbUtil.extend(VmlEndpoint, VmlComponent, {
+               reattachListeners : function() {
+                       if (this._jsPlumb.vml) this.reattachListenersForElement(this._jsPlumb.vml, this);
+               }
+       });
+       
+// ******************************* vml segments *****************************************************  
+               
+       jsPlumb.Segments.vml = {
+               SegmentRenderer : {             
+                       getPath : function(segment) {
+                               return ({
+                                       "Straight":function(segment) {
+                                               var d = segment.params;
+                                               return "m" + _conv(d.x1) + "," + _conv(d.y1) + " l" + _conv(d.x2) + "," + _conv(d.y2) + " e";
+                                       },
+                                       "Bezier":function(segment) {
+                                               var d = segment.params;
+                                               return "m" + _conv(d.x1) + "," + _conv(d.y1) + 
+                                                       " c" + _conv(d.cp1x) + "," + _conv(d.cp1y) + "," + _conv(d.cp2x) + "," + _conv(d.cp2y) + "," + _conv(d.x2) + "," + _conv(d.y2) + " e";
+                                       },
+                                       "Arc":function(segment) {                                       
+                                               var d = segment.params,
+                                                       xmin = Math.min(d.x1, d.x2),
+                                                       xmax = Math.max(d.x1, d.x2),
+                                                       ymin = Math.min(d.y1, d.y2),
+                                                       ymax = Math.max(d.y1, d.y2),                                                                                                            
+                                                       sf = segment.anticlockwise ? 1 : 0,
+                                                       pathType = (segment.anticlockwise ? "at " : "wa "),
+                                                       makePosString = function() {
+                                                               if (d.loopback)
+                                                                       return "0,0," + _conv(2*d.r) + "," + _conv(2 * d.r);
+
+                                                               var xy = [
+                                                                               null,
+                                                                               [ function() { return [xmin, ymin ];}, function() { return [xmin - d.r, ymin - d.r ];}],
+                                                                               [ function() { return [xmin - d.r, ymin ];}, function() { return [xmin, ymin - d.r ];}],
+                                                                               [ function() { return [xmin - d.r, ymin - d.r ];}, function() { return [xmin, ymin ];}],
+                                                                               [ function() { return [xmin, ymin - d.r ];}, function() { return [xmin - d.r, ymin ];}]
+                                                                       ][segment.segment][sf]();
+
+                                                               return _conv(xy[0]) + "," + _conv(xy[1]) + "," + _conv(xy[0] + (2*d.r)) + "," + _conv(xy[1] + (2*d.r));
+                                                       };
+
+                                               return pathType + " " + makePosString() + "," + _conv(d.x1) + "," + _conv(d.y1) + "," + _conv(d.x2) + "," + _conv(d.y2) + " e";                                                                                         
+                                       }
+                                               
+                               })[segment.type](segment);      
+                       }
+               }
+       };
+       
+// ******************************* /vml segments ***************************************************** 
+
+// ******************************* vml endpoints *****************************************************
+       
+       jsPlumb.Endpoints.vml.Dot = function() {
+               jsPlumb.Endpoints.Dot.apply(this, arguments);
+               VmlEndpoint.apply(this, arguments);
+               this.getVml = function(d, atts, anchor, parent, _jsPlumb) { return _node("oval", d, atts, parent, _jsPlumb); };
+       };
+       jsPlumbUtil.extend(jsPlumb.Endpoints.vml.Dot, VmlEndpoint);
+       
+       jsPlumb.Endpoints.vml.Rectangle = function() {
+               jsPlumb.Endpoints.Rectangle.apply(this, arguments);
+               VmlEndpoint.apply(this, arguments);
+               this.getVml = function(d, atts, anchor, parent, _jsPlumb) { return _node("rect", d, atts, parent, _jsPlumb); };
+       };
+       jsPlumbUtil.extend(jsPlumb.Endpoints.vml.Rectangle, VmlEndpoint);
+       
+       /*
+        * VML Image Endpoint is the same as the default image endpoint.
+        */
+       jsPlumb.Endpoints.vml.Image = jsPlumb.Endpoints.Image;
+       
+       /**
+        * placeholder for Blank endpoint in vml renderer.
+        */
+       jsPlumb.Endpoints.vml.Blank = jsPlumb.Endpoints.Blank;
+       
+// ******************************* /vml endpoints *****************************************************        
+
+// ******************************* vml overlays *****************************************************
+       
+       /**
+        * VML Label renderer. uses the default label renderer (which adds an element to the DOM)
+        */
+       jsPlumb.Overlays.vml.Label  = jsPlumb.Overlays.Label;
+       
+       /**
+        * VML Custom renderer. uses the default Custom renderer (which adds an element to the DOM)
+        */
+       jsPlumb.Overlays.vml.Custom = jsPlumb.Overlays.Custom;
+       
+       /**
+        * Abstract VML arrow superclass
+        */
+       var AbstractVmlArrowOverlay = function(superclass, originalArgs) {
+       superclass.apply(this, originalArgs);
+       VmlComponent.apply(this, originalArgs);
+       var self = this, path = null;
+       self.canvas = null; 
+       self.isAppendedAtTopLevel = true;
+       var getPath = function(d) {             
+               return "m " + _conv(d.hxy.x) + "," + _conv(d.hxy.y) +
+                      " l " + _conv(d.tail[0].x) + "," + _conv(d.tail[0].y) + 
+                      " " + _conv(d.cxy.x) + "," + _conv(d.cxy.y) + 
+                      " " + _conv(d.tail[1].x) + "," + _conv(d.tail[1].y) + 
+                      " x e";
+       };
+       this.paint = function(params, containerExtents) {
+               // only draws for connectors, not endpoints.
+               if (params.component.canvas && containerExtents) {
+                       var p = {}, d = params.d, connector = params.component;
+                               if (params.strokeStyle) {
+                                       p.stroked = "true";
+                                       p.strokecolor = jsPlumbUtil.convertStyle(params.strokeStyle, true);                             
+                               }
+                               if (params.lineWidth) p.strokeweight = params.lineWidth + "px";
+                               if (params.fillStyle) {
+                                       p.filled = "true";
+                                       p.fillcolor = params.fillStyle;
+                               }                       
+
+                               var xmin = Math.min(d.hxy.x, d.tail[0].x, d.tail[1].x, d.cxy.x),
+                                       ymin = Math.min(d.hxy.y, d.tail[0].y, d.tail[1].y, d.cxy.y),
+                                       xmax = Math.max(d.hxy.x, d.tail[0].x, d.tail[1].x, d.cxy.x),
+                                       ymax = Math.max(d.hxy.y, d.tail[0].y, d.tail[1].y, d.cxy.y),
+                                       w = Math.abs(xmax - xmin),
+                                       h = Math.abs(ymax - ymin),
+                                       dim = [xmin, ymin, w, h];
+
+                               // for VML, we create overlays using shapes that have the same dimensions and
+                               // coordsize as their connector - overlays calculate themselves relative to the
+                               // connector (it's how it's been done since the original canvas implementation, because
+                               // for canvas that makes sense).
+                               p.path = getPath(d);
+                               p.coordsize = (connector.w * scale) + "," + (connector.h * scale);                      
+                               
+                               dim[0] = connector.x;
+                               dim[1] = connector.y;
+                               dim[2] = connector.w;
+                               dim[3] = connector.h;
+                               
+                       if (self.canvas == null) {
+                               var overlayClass = connector._jsPlumb.overlayClass || "";
+                               var clazz = originalArgs && (originalArgs.length == 1) ? (originalArgs[0].cssClass || "") : "";
+                               p["class"] = clazz + " " + overlayClass;
+                                       self.canvas = _node("shape", dim, p, connector.canvas.parentNode, connector._jsPlumb.instance, true);                                                           
+                                       connector.appendDisplayElement(self.canvas, true);
+                                       self.attachListeners(self.canvas, connector);
+                                       self.attachListeners(self.canvas, self);
+                               }
+                               else {                          
+                                       _pos(self.canvas, dim);
+                                       _atts(self.canvas, p);
+                               }               
+                       }
+       };
+       
+       this.reattachListeners = function() {
+                       if (self.canvas) self.reattachListenersForElement(self.canvas, self);
+               };
+
+               this.cleanup = function() {
+               if (self.canvas != null) jsPlumb.CurrentLibrary.removeElement(self.canvas);
+       };
+    };
+    jsPlumbUtil.extend(AbstractVmlArrowOverlay, [VmlComponent, jsPlumb.Overlays.AbstractOverlay], {
+       setVisible : function(state) {
+           this.canvas.style.display = state ? "block" : "none";
+       }
+    });
+       
+       jsPlumb.Overlays.vml.Arrow = function() {
+       AbstractVmlArrowOverlay.apply(this, [jsPlumb.Overlays.Arrow, arguments]);       
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.vml.Arrow, [ jsPlumb.Overlays.Arrow, AbstractVmlArrowOverlay ]);
+    
+    jsPlumb.Overlays.vml.PlainArrow = function() {
+       AbstractVmlArrowOverlay.apply(this, [jsPlumb.Overlays.PlainArrow, arguments]);          
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.vml.PlainArrow, [ jsPlumb.Overlays.PlainArrow, AbstractVmlArrowOverlay ]);
+    
+    jsPlumb.Overlays.vml.Diamond = function() {
+       AbstractVmlArrowOverlay.apply(this, [jsPlumb.Overlays.Diamond, arguments]);     
+    };
+    jsPlumbUtil.extend(jsPlumb.Overlays.vml.Diamond, [ jsPlumb.Overlays.Diamond, AbstractVmlArrowOverlay ]);
+    
+// ******************************* /vml overlays *****************************************************    
+    
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/util.js b/portal/static/unbound_reservation_static/src/util.js
new file mode 100644 (file)
index 0000000..a7fd49f
--- /dev/null
@@ -0,0 +1,439 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG or VML.  
+ * 
+ * This file contains the util functions
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+;(function() {
+
+    var _isa = function(a) { return Object.prototype.toString.call(a) === "[object Array]"; },
+        _isnum = function(n) { return Object.prototype.toString.call(n) === "[object Number]"; },
+        _iss = function(s) { return typeof s === "string"; },
+        _isb = function(s) { return typeof s === "boolean"; },
+        _isnull = function(s) { return s == null; },  
+        _iso = function(o) { return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; },
+        _isd = function(o) { return Object.prototype.toString.call(o) === "[object Date]"; },
+        _isf = function(o) { return Object.prototype.toString.call(o) === "[object Function]"; },
+        _ise = function(o) {
+            for (var i in o) { if (o.hasOwnProperty(i)) return false; }
+            return true;
+        },
+        pointHelper = function(p1, p2, fn) {
+            p1 = _isa(p1) ? p1 : [p1.x, p1.y];
+            p2 = _isa(p2) ? p2 : [p2.x, p2.y];    
+            return fn(p1, p2);
+        };
+    
+    jsPlumbUtil = {        
+        isArray : _isa,        
+        isString : _iss,        
+        isBoolean: _isb,        
+        isNull : _isnull,        
+        isObject : _iso,
+        isDate : _isd,
+        isFunction: _isf,
+        isEmpty:_ise,
+        isNumber:_isnum,
+        clone : function(a) {
+            if (_iss(a)) return "" + a;
+            else if (_isb(a)) return !!a;
+            else if (_isd(a)) return new Date(a.getTime());
+            else if (_isf(a)) return a;
+            else if (_isa(a)) {
+                var b = [];
+                for (var i = 0; i < a.length; i++)
+                    b.push(this.clone(a[i]));
+                return b;
+            }
+            else if (_iso(a)) {
+                var c = {};
+                for (var j in a)
+                    c[j] = this.clone(a[j]);
+                return c;              
+            }
+            else return a;
+        },
+        merge : function(a, b) {               
+            var c = this.clone(a);             
+            for (var i in b) {
+                if (c[i] == null || _iss(b[i]) || _isb(b[i]))
+                    c[i] = b[i];
+                else {
+                    if (_isa(b[i])/* && this.isArray(c[i])*/) {
+                        var ar = [];
+                        // if c's object is also an array we can keep its values.
+                        if (_isa(c[i])) ar.push.apply(ar, c[i]);
+                        ar.push.apply(ar, b[i]);
+                        c[i] = ar;
+                    }
+                    else if(_iso(b[i])) {      
+                        // overwite c's value with an object if it is not already one.
+                        if (!_iso(c[i])) 
+                            c[i] = {};
+                        for (var j in b[i])
+                            c[i][j] = b[i][j];
+                    }
+                }
+            }
+            return c;
+        },
+        copyValues:function(names, from, to) {
+            for (var i = 0; i < names.length; i++)
+                to[names[i]] = from[names[i]];
+        },
+        //
+        // chain a list of functions, supplied by [ object, method name, args ], and return on the first
+        // one that returns the failValue. if none return the failValue, return the successValue.
+        //
+        functionChain : function(successValue, failValue, fns) {        
+            for (var i = 0; i < fns.length; i++) {
+                var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);
+                if (o === failValue) {
+                    return o;
+                }
+            }                
+            return successValue;
+        },
+        // take the given model and expand out any parameters.
+        populate : function(model, values) {           
+            // for a string, see if it has parameter matches, and if so, try to make the substitutions.
+            var getValue = function(fromString) {
+                    var matches = fromString.match(/(\${.*?})/g);
+                    if (matches != null) {
+                        for (var i = 0; i < matches.length; i++) {
+                            var val = values[matches[i].substring(2, matches[i].length - 1)];
+                            if (val != null) {
+                                fromString = fromString.replace(matches[i], val);
+                            }
+                        }                                                      
+                    }
+                    return fromString;
+                },             
+                // process one entry.
+                _one = function(d) {
+                    if (d != null) {
+                        if (_iss(d)) {
+                            return getValue(d);
+                        }
+                        else if (_isa(d)) {
+                            var r = [];        
+                            for (var i = 0; i < d.length; i++)
+                                r.push(_one(d[i]));
+                            return r;
+                        }
+                        else if (_iso(d)) {
+                            var s = {};
+                            for (var j in d) {
+                                s[j] = _one(d[j]);
+                            }
+                            return s;
+                        }
+                        else {
+                            return d;
+                        }
+                    }
+                };
+            
+            return _one(model);        
+        },
+        convertStyle : function(s, ignoreAlpha) {
+            // TODO: jsPlumb should support a separate 'opacity' style member.
+            if ("transparent" === s) return s;
+            var o = s,
+                pad = function(n) { return n.length == 1 ? "0" + n : n; },
+                hex = function(k) { return pad(Number(k).toString(16)); },
+                pattern = /(rgb[a]?\()(.*)(\))/;
+            if (s.match(pattern)) {
+                var parts = s.match(pattern)[2].split(",");
+                o = "#" + hex(parts[0]) + hex(parts[1]) + hex(parts[2]);
+                if (!ignoreAlpha && parts.length == 4) 
+                    o = o + hex(parts[3]);
+            }
+            return o;
+        },
+        findWithFunction : function(a, f) {
+            if (a)
+                for (var i = 0; i < a.length; i++) if (f(a[i])) return i;
+            return -1;
+        },
+        clampToGrid : function(x, y, grid, dontClampX, dontClampY) {
+            var _gridClamp = function(n, g) { 
+                var e = n % g, 
+                    f = Math.floor(n / g), 
+                    inc = e >= (g / 2) ? 1 : 0; 
+                return (f + inc) * g; 
+            };
+            return [
+                dontClampX || grid == null ? x : _gridClamp(x, grid[0]),
+                dontClampY || grid == null ? y : _gridClamp(y, grid[1])
+            ];         
+        },
+        indexOf : function(l, v) {
+            return jsPlumbUtil.findWithFunction(l, function(_v) { return _v == v; });  
+        },
+        removeWithFunction : function(a, f) {
+            var idx = jsPlumbUtil.findWithFunction(a, f);
+            if (idx > -1) a.splice(idx, 1);
+            return idx != -1;
+        },
+        remove : function(l, v) {
+            var idx = jsPlumbUtil.indexOf(l, v);       
+            if (idx > -1) l.splice(idx, 1);
+            return idx != -1;
+        },
+        // TODO support insert index
+        addWithFunction : function(list, item, hashFunction) {
+            if (jsPlumbUtil.findWithFunction(list, hashFunction) == -1) list.push(item);
+        },
+        addToList : function(map, key, value, insertAtStart) {
+            var l = map[key];
+            if (l == null) {
+                l = [];
+                map[key] = l;
+            }
+            l[insertAtStart ? "unshift" : "push"](value);
+            return l;
+        },
+        //
+        // extends the given obj (which can be an array) with the given constructor function, prototype functions, and
+        // class members, any of which may be null.
+        //
+        extend : function(child, parent, _protoFn, _protoAtts) {
+            _protoFn = _protoFn || {};
+            _protoAtts = _protoAtts || {};
+            parent = _isa(parent) ? parent : [ parent ];            
+
+            for (var i = 0; i < parent.length; i++) {
+                for (var j in parent[i].prototype) {
+                    if(parent[i].prototype.hasOwnProperty(j)) {
+                        child.prototype[j] = parent[i].prototype[j];
+                    }
+                }
+            }
+
+            var _makeFn = function(name) {
+                return function() {
+                    for (var i = 0; i < parent.length; i++) {
+                        if (parent[i].prototype[name])
+                            parent[i].prototype[name].apply(this, arguments);
+                    }                    
+                    return _protoFn[name].apply(this, arguments);
+                };
+            };
+
+            for (var k in _protoFn) {
+                child.prototype[k] = _makeFn(k);
+            }
+
+            return child;
+        },
+        uuid : function() {
+            return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+                var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
+                return v.toString(16);
+            }));
+        },
+        logEnabled : true,
+        log : function() {
+            if (jsPlumbUtil.logEnabled && typeof console != "undefined") {
+                try {
+                    var msg = arguments[arguments.length - 1];
+                    console.log(msg);
+                }
+                catch (e) {} 
+            }
+        },
+        group : function(g) { if (jsPlumbUtil.logEnabled && typeof console != "undefined") console.group(g); },
+        groupEnd : function(g) { if (jsPlumbUtil.logEnabled && typeof console != "undefined") console.groupEnd(g); },
+        time : function(t) { if (jsPlumbUtil.logEnabled && typeof console != "undefined") console.time(t); },
+        timeEnd : function(t) { if (jsPlumbUtil.logEnabled && typeof console != "undefined") console.timeEnd(t); },
+        
+        /**
+                * helper to remove an element from the DOM.
+                */
+               removeElement : function(element) {
+                       if (element != null && element.parentNode != null) {
+                               element.parentNode.removeChild(element);
+                       }
+               },
+        /**
+                * helper to remove a list of elements from the DOM.
+                */
+               removeElements : function(elements) {
+                       for ( var i = 0; i < elements.length; i++)
+                               jsPlumbUtil.removeElement(elements[i]);
+               },
+        /*
+         * Function: sizeElement 
+         * Helper to size and position an element. You would typically use
+         * this when writing your own Connector or Endpoint implementation.
+         * 
+         * Parameters: 
+         *  x - [int] x position for the element origin 
+         *  y - [int] y position for the element origin 
+         *  w - [int] width of the element 
+         *  h - [int] height of the element
+         *  
+         */
+        sizeElement : function(el, x, y, w, h) {
+            if (el) {
+                el.style.height = h + "px";
+                el.height = h;
+                el.style.width = w + "px";
+                el.width = w;
+                el.style.left = x + "px";
+                el.style.top = y + "px";
+            }
+        },
+        /**
+        * @name jsPlumbUtil.wrap
+        * @desc Wraps one function with another, creating a placeholder for the
+        * wrapped function if it was null. this is used to wrap the various
+        * drag/drop event functions - to allow jsPlumb to be notified of
+        * important lifecycle events without imposing itself on the user's
+        * drag/drop functionality. 
+        * @param {Function} wrappedFunction original function to wrap; may be null.
+        * @param {Function} newFunction function to wrap the original with.
+        * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should 
+        * not be executed if the newFunction returns a value matching 'returnOnThisValue'.
+        * note that this is a simple comparison and only works for primitives right now.
+        */        
+        wrap : function(wrappedFunction, newFunction, returnOnThisValue) {
+            wrappedFunction = wrappedFunction || function() { };
+            newFunction = newFunction || function() { };
+            return function() {
+                var r = null;
+                try {
+                    r = newFunction.apply(this, arguments);
+                } catch (e) {
+                    jsPlumbUtil.log("jsPlumb function failed : " + e);
+                }
+                if (returnOnThisValue == null || (r !== returnOnThisValue)) {
+                    try {
+                        r = wrappedFunction.apply(this, arguments);
+                    } catch (e) {
+                        jsPlumbUtil.log("wrapped function failed : " + e);
+                    }
+                }
+                return r;
+            };
+        }
+    };
+
+    
+    jsPlumbUtil.EventGenerator = function() {
+        var _listeners = {}, eventsSuspended = false;
+        
+        // this is a list of events that should re-throw any errors that occur during their dispatch. as of 1.3.0 this is private to
+        // jsPlumb, but it seems feasible that people might want to manipulate this list.  the thinking is that we don't want event
+        // listeners to bring down jsPlumb - or do we.  i can't make up my mind about this, but i know i want to hear about it if the "ready"
+        // event fails, because then my page has most likely not initialised.  so i have this halfway-house solution.  it will be interesting
+        // to hear what other people think.
+        var eventsToDieOn = [ "ready" ];
+                                        
+        this.bind = function(event, listener, insertAtStart) {
+            jsPlumbUtil.addToList(_listeners, event, listener, insertAtStart);     
+            return this;        
+        };
+                 
+        this.fire = function(event, value, originalEvent) {
+            if (!eventsSuspended && _listeners[event]) {
+                // instead of looping through the array we get a counter and a length, because it is possible
+                // that an event fired from here could cause the object to get cleaned up, which would throw
+                // away the listeners. so after each cycle through the loop we check to ensure we haven't
+                // been nuked.
+                var l = _listeners[event].length, i = 0, _gone = false, ret = null;
+                if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {
+                    while (!_gone && i < l && ret !== false) {                    
+                    
+                        // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this
+                        // method will have the whole call stack available in the debugger.
+                        if (jsPlumbUtil.findWithFunction(eventsToDieOn, function(e) { return e === event; }) != -1) 
+                            _listeners[event][i](value, originalEvent);
+                        else {
+                            // for events we don't want to die on, catch and log.
+                            try {                            
+                                ret = _listeners[event][i](value, originalEvent);
+                            } catch (e) {
+                                jsPlumbUtil.log("jsPlumb: fire failed for event " + event + " : " + e);
+                            }
+                        }
+                        i++;
+                        if (_listeners == null || _listeners[event] == null) _gone = true;                    
+                    }
+                }
+            }
+            return this;
+        };
+        
+        this.unbind = function(event) {
+            if (event)
+                delete _listeners[event];
+            else {
+                _listeners = {};
+            }
+            return this;
+        };
+        
+        this.getListener = function(forEvent) {
+            return _listeners[forEvent];
+        };              
+        this.setSuspendEvents = function(val) {
+            eventsSuspended = val;    
+        };        
+        this.isSuspendEvents = function() {
+            return eventsSuspended;
+        };        
+        this.cleanupListeners = function() {
+            for (var i in _listeners) {
+                _listeners[i].splice(0);
+                delete _listeners[i];
+            }
+        };
+    };
+
+
+    jsPlumbUtil.EventGenerator.prototype = {
+        cleanup:function() {
+            this.cleanupListeners();
+        }
+    };
+
+
+    // thanks MDC
+    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FFunction%2Fbind
+    if (!Function.prototype.bind) {
+      Function.prototype.bind = function (oThis) {
+        if (typeof this !== "function") {
+          // closest thing possible to the ECMAScript 5 internal IsCallable function
+          throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
+        }
+
+        var aArgs = Array.prototype.slice.call(arguments, 1), 
+            fToBind = this, 
+            fNOP = function () {},
+            fBound = function () {
+              return fToBind.apply(this instanceof fNOP && oThis ? this : oThis,
+                                   aArgs.concat(Array.prototype.slice.call(arguments)));
+            };
+
+        fNOP.prototype = this.prototype;
+        fBound.prototype = new fNOP();
+
+        return fBound;
+      };
+    }
+
+})();
\ No newline at end of file
diff --git a/portal/static/unbound_reservation_static/src/yui.jsPlumb.js b/portal/static/unbound_reservation_static/src/yui.jsPlumb.js
new file mode 100644 (file)
index 0000000..2191c2d
--- /dev/null
@@ -0,0 +1,417 @@
+/*
+ * jsPlumb
+ * 
+ * Title:jsPlumb 1.5.5
+ * 
+ * Provides a way to visually connect elements on an HTML page, using either SVG, Canvas
+ * elements, or VML.  
+ * 
+ * This file contains the YUI3 adapter.
+ *
+ * Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org)
+ * 
+ * http://jsplumb.org
+ * http://github.com/sporritt/jsplumb
+ * http://code.google.com/p/jsplumb
+ * 
+ * Dual licensed under the MIT and GPL2 licenses.
+ */
+
+/**
+ * addClass                            adds a class to the given element
+ * animate                             calls the underlying library's animate functionality
+ * appendElement               appends a child element to a parent element.
+ * bind                                        binds some event to an element
+ * dragEvents                  a dictionary of event names
+ * extend                              extend some js object with another.  probably not overly necessary; jsPlumb could just do this internally.
+ * getDragObject               gets the object that is being dragged, by extracting it from the arguments passed to a drag callback
+ * getDragScope                        gets the drag scope for a given element.
+ * getElementObject            turns an id or dom element into an element object of the underlying library's type.
+ * getOffset                   gets an element's offset
+ * getOriginalEvent     gets the original browser event from some wrapper event.
+ * getScrollLeft               gets an element's scroll left.  TODO: is this actually used?  will it be?
+ * getScrollTop                        gets an element's scroll top.  TODO: is this actually used?  will it be?
+ * getSize                             gets an element's size.
+ * getUIPosition               gets the position of some element that is currently being dragged, by extracting it from the arguments passed to a drag callback.
+ * initDraggable               initializes an element to be draggable 
+ * initDroppable               initializes an element to be droppable
+ * isDragSupported             returns whether or not drag is supported for some element.
+ * isDropSupported             returns whether or not drop is supported for some element.
+ * removeClass                 removes a class from a given element.
+ * removeElement               removes some element completely from the DOM.
+ * setDraggable                        sets whether or not some element should be draggable.
+ * setDragScope                        sets the drag scope for a given element.
+ * setOffset                   sets the offset of some element.
+ */
+(function() {
+       
+       if (!Array.prototype.indexOf) {
+               Array.prototype.indexOf = function( v, b, s ) {
+                       for( var i = +b || 0, l = this.length; i < l; i++ ) {
+                               if( this[i]===v || s && this[i]==v ) { return i; }
+                       }
+                       return -1;
+               };
+       }
+       
+       var Y;
+       
+       YUI().use('node', 'dd', 'dd-constrain', 'anim', 'node-event-simulate', function(_Y) {
+               Y = _Y; 
+               Y.on("domready", function() { jsPlumb.init(); });
+       });
+       
+       /**
+        * adds the given value to the given list, with the given scope. creates the scoped list
+        * if necessary.
+        * used by initDraggable and initDroppable.
+        */
+       var _add = function(list, scope, value) {
+               var l = list[scope];
+               if (!l) {
+                       l = [];
+                       list[scope] = l;
+               }
+               l.push(value);
+       },      
+       ddEvents = [ "drag:mouseDown", "drag:afterMouseDown", "drag:mouseup",
+            "drag:align", "drag:removeHandle", "drag:addHandle", "drag:removeInvalid", "drag:addInvalid",
+            "drag:start", "drag:end", "drag:drag", "drag:over", "drag:enter",
+            "drag:exit", "drag:drophit", "drag:dropmiss", "drop:over", "drop:enter", "drop:exit", "drop:hit"                          
+       ],      
+       animEvents = [ "tween" ],       
+       /**
+        * helper function to curry callbacks for some element. 
+        */
+       _wrapper = function(fn) {
+               return function() {
+                       try {
+                               return fn.apply(this, arguments);
+                       }
+                       catch (e) { }
+               };
+       },      
+       /**
+        * extracts options from the given options object, leaving out event handlers.
+        */
+       _getDDOptions = function(options) {
+               var o = {};
+               for (var i in options) if (ddEvents.indexOf(i) == -1) o[i] = options[i];
+               return o;
+       },      
+       /**
+        * attaches all event handlers found in options to the given dragdrop object, and registering
+        * the given el as the element of interest.
+        */
+       _attachListeners = function(dd, options, eventList) {   
+           for (var ev in options) {
+               if (eventList.indexOf(ev) != -1) {
+                       var w = _wrapper(options[ev]);
+                       dd.on(ev, w);
+               }
+           }
+       },
+       _droppables = {},
+       _droppableOptions = {},
+       _draggablesByScope = {},
+       _draggablesById = {},
+       _droppableScopesById = {},
+       _checkHover = function(el, entering) {
+               if (el) {
+                       var id = el.get("id");
+                       if (id) {
+                               var options = _droppableOptions[id];
+                               if (options) {
+                                       if (options.hoverClass) {
+                                               if (entering) el.addClass(options.hoverClass);
+                                               else el.removeClass(options.hoverClass);
+                                       }
+                               }
+                       }
+               }
+       },
+       _lastDragObject = null,
+       _extend = function(o1, o2) {
+               for (var i in o2)
+                       o1[i] = o2[i];
+               return o1;
+       },
+       _getAttribute = function(el, attributeId) {
+               return el.getAttribute(attributeId);
+       },
+       _getElementObject = function(el) {
+               if (el == null) return null;
+               var eee = null;
+        eee = typeof el == 'string' ? Y.one('#' + el) : el._node ? el : Y.one(el);        
+        return eee;
+       };
+       
+       jsPlumb.CurrentLibrary = {
+                       
+               addClass : function(el, clazz) {
+                       jsPlumb.CurrentLibrary.getElementObject(el).addClass(clazz);
+               },      
+               
+               /**
+                * animates the given element.
+                */
+               animate : function(el, properties, options) {
+                       var o = _extend({node:el, to:properties}, options),                     
+                               id = _getAttribute(el, "id");
+                       o.tween = jsPlumbUtil.wrap(properties.tween, function() {
+                               // TODO should use a current instance.
+                               jsPlumb.repaint(id);
+                       });
+                       var a = new Y.Anim(o);
+                       _attachListeners(a, o, animEvents);
+                       a.run();
+               },
+               
+               appendElement : function(child, parent) {
+                       _getElementObject (parent).append(child);                       
+               },
+               
+               /**
+                * event binding wrapper.  
+                */
+               bind : function(el, event, callback) {
+                       var els = jsPlumbUtil.isString(el) || typeof el.length == "undefined" ? [ _getElementObject(el) ] : Y.all(el)._nodes;
+                       for (var i = 0; i < els.length; i++)
+                               Y.one(els[i]).on(event, callback);
+               },
+
+               destroyDraggable : function(el) {
+                       var id = jsPlumb.getId(el),
+                               dd = _draggablesById[id];
+
+                       if (dd) {
+                               dd.destroy();
+                               delete _draggablesById[id];
+                       }
+               },
+
+               destroyDroppable : function(el) {
+                       // TODO
+               },
+                       
+               dragEvents : {
+                       "start":"drag:start", "stop":"drag:end", "drag":"drag:drag", "step":"step",
+                       "over":"drop:enter", "out":"drop:exit", "drop":"drop:hit"
+               },                                                              
+                       
+               extend : _extend,                       
+               
+               getClientXY : function(eventObject) {
+                       return [eventObject.clientX, eventObject.clientY];
+               },
+               
+               /**
+                * takes the args passed to an event function and returns you an object representing that which is being dragged.
+                */
+               getDragObject : function(eventArgs) {
+                       // this is a workaround for the unfortunate fact that in YUI3, the 'drop:exit' event does
+                       // not contain a reference to the drag that just exited.  single-threaded js to the 
+                       // rescue: we'll just keep it for ourselves.
+                       if (eventArgs[0].drag) _lastDragObject = eventArgs[0].drag.el;
+                       return _lastDragObject;
+               },
+               
+               getDragScope : function(el) {
+                       var id = jsPlumb.getId(el),
+                               dd = _draggablesById[id];
+                       return dd.scope;
+               },
+
+               getDropEvent : function(args) {
+                       return args[0];
+               },
+               
+               getDropScope : function(el) {
+                       var id = jsPlumb.getId(el);
+                       return _droppableScopesById[id];
+               },
+               
+               getDOMElement : function(el) {  
+                       if (el == null) return null;            
+                       if (typeof(el) == "string") 
+                               return document.getElementById(el);
+                       else if (el._node) 
+                               return el._node;
+                       else return el;
+               },
+               
+               getElementObject : _getElementObject,
+               
+               getOffset : function(el) {                      
+                       var o = Y.DOM.getXY(el._node);
+                       return {left:o[0], top:o[1]};
+               },
+
+               getOriginalEvent : function(e) {
+                       return e._event;
+               },
+               
+               getPageXY : function(eventObject) {
+                       return [eventObject.pageX, eventObject.pageY];
+               },
+               
+               getParent : function(el) {
+                       return jsPlumb.CurrentLibrary.getElementObject(el).get("parentNode");
+               },
+               
+               getScrollLeft : function(el) {
+                       return 0; 
+               },
+               
+               getScrollTop : function(el) {
+                       return 0;
+               },
+               
+               getSelector : function(context, spec) {
+                       var _convert = function(s) { return s && s ._nodes ? s._nodes : []; };
+            
+            if (arguments.length == 2) {            
+                return _convert(jsPlumb.CurrentLibrary.getElementObject(context).all(spec));
+            }
+            else {
+                            return _convert(Y.all(context));
+            }            
+               },
+               
+               getSize : function(el) {
+                       return [ el._node.offsetWidth, el._node.offsetHeight ];
+               },
+
+        getTagName : function(el) {
+            var e = jsPlumb.CurrentLibrary.getElementObject(el);
+            return e != null && e._node != null ? e._node.tagName : null;
+        },
+               
+               getUIPosition : function(args, zoom) {
+                       zoom = zoom || 1;
+                       var el = args[0].currentTarget.el._node || args[0].currentTarget.el;
+                       var o = Y.DOM.getXY(el);
+                       return {left:o[0] / zoom, top:o[1] / zoom };
+               },              
+               
+               hasClass : function(el, clazz) {
+                       return el.hasClass(clazz);
+               },
+                               
+               initDraggable : function(el, options, isPlumbedComponent, _jsPlumb) {
+                       var _opts = _getDDOptions(options),
+                               id = _jsPlumb.getId(el);
+                       _opts.node = "#" + id;  
+                       options["drag:start"] = jsPlumbUtil.wrap(options["drag:start"], function() {
+                               Y.one(document.body).addClass(_jsPlumb.dragSelectClass);                                
+                       }, false);      
+                       options["drag:end"] = jsPlumbUtil.wrap(options["drag:end"], function() {
+                               Y.one(document.body).removeClass(_jsPlumb.dragSelectClass);
+                       });     
+                       var dd = new Y.DD.Drag(_opts), 
+                containment = options.constrain2node || options.containment;
+
+                       dd.el = el;     
+            
+            if (containment) {
+                dd.plug(Y.Plugin.DDConstrained, {
+                    constrain2node: containment
+                });
+            }
+                       
+                       if (isPlumbedComponent) {
+                               var scope = options.scope || _jsPlumb.Defaults.Scope;
+                               dd.scope = scope;
+                               _add(_draggablesByScope, scope, dd);
+                       }
+                       
+                       _draggablesById[id] = dd;                                               
+                       _attachListeners(dd, options, ddEvents);
+               },
+               
+               initDroppable : function(el, options) {
+                       var _opts = _getDDOptions(options),
+                               id = jsPlumb.getId(el);
+                       _opts.node = "#" + id;                  
+                       var dd = new Y.DD.Drop(_opts);
+                       
+                       _droppableOptions[id] = options;
+                       
+                       options = _extend({}, options);
+                       var scope = options.scope || jsPlumb.Defaults.Scope;                                    
+                       _droppableScopesById[id] = scope;
+                       
+                       options["drop:enter"] = jsPlumbUtil.wrap(options["drop:enter"], function(e) {
+                               if (e.drag.scope !== scope) return true;
+                               _checkHover(el, true);
+                       }, true);
+                       options["drop:exit"] = jsPlumbUtil.wrap(options["drop:exit"], function(e) {
+                               _checkHover(el, false);
+                       });
+                       options["drop:hit"] = jsPlumbUtil.wrap(options["drop:hit"], function(e) {
+                               if (e.drag.scope !== scope) return true;
+                               _checkHover(el, false);
+                       }, true);
+                       
+                       _attachListeners(dd, options, ddEvents);
+               },
+               
+               isAlreadyDraggable : function(el) {
+                       el = _getElementObject(el);
+                       return el.hasClass("yui3-dd-draggable");
+               },
+               
+               isDragSupported : function(el) { return true; },                
+               isDropSupported : function(el) { return true; },                                                                                
+               removeClass : function(el, clazz) { 
+                       jsPlumb.CurrentLibrary.getElementObject(el).removeClass(clazz); 
+               },              
+               removeElement : function(el) { _getElementObject(el).remove(); },               
+
+               setDragFilter : function(el, filter) {
+                       jsPlumb.log("NOT IMPLEMENTED: setDragFilter");
+               },
+               
+               /**
+                * sets the draggable state for the given element
+                */
+               setDraggable : function(el, draggable) {
+                       var id = jsPlumb.getId(el),
+                               dd = _draggablesById[id];
+                       if (dd) dd.set("lock", !draggable);
+               },
+               
+               setDragScope : function(el, scope) {
+                       var id = jsPlumb.getId(el),
+                               dd = _draggablesById[id];
+                       if (dd) dd.scope = scope;
+               },
+               
+               setOffset : function(el, o) {
+                       el = _getElementObject(el);
+                       el.set("top", o.top);
+                       el.set("left", o.left);
+               },
+
+        stopDrag : function() {
+            Y.DD.DDM.stopDrag();
+        },
+               
+               trigger : function(el, event, originalEvent) {
+                       originalEvent.stopPropagation();
+                       _getElementObject(el).simulate(event, {
+                               pageX:originalEvent.pageX, 
+                               pageY:originalEvent.pageY, 
+                               clientX:originalEvent.clientX, 
+                               clientY:originalEvent.clientY
+                       });                     
+               },
+               
+               /**
+                * event unbinding wrapper.  
+                */
+               unbind : function(el, event, callback) {
+                       _getElementObject(el).detach(event, callback);
+               }
+       };                              
+})();
\ No newline at end of file
diff --git a/portal/templates/workflow_b.html b/portal/templates/workflow_b.html
new file mode 100644 (file)
index 0000000..f7835e1
--- /dev/null
@@ -0,0 +1,543 @@
+{% extends "layout-unfold1.html" %}\r
+\r
+{% block head %}\r
+{{ wizard.form.media }}\r
+{% endblock %}\r
+\r
+{% block unfold_main %}\r
+\r
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />\r
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/fed4fire.css" />\r
+<!-- unbound Specific -->\r
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/css/bootstrap.css">\r
+       <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/css/workflow.css">\r
+       \r
+       <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">\r
+       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>\r
+       <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/css/dhtmlxform.css"/>\r
+       <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/css/rmenu_styles.css"/>\r
+<style>\r
+               div.dhxform_item_label_left.button_save div.dhxform_btn_txt {\r
+                       background-image: url(../common/imgs/save.gif);\r
+                       background-repeat: no-repeat;\r
+                       background-position: 0px 3px;\r
+                       padding-left: 22px;\r
+                       margin: 0px 15px 0px 12px;\r
+               }\r
+               div.dhxform_item_label_left.button_cancel div.dhxform_btn_txt {\r
+                       background-image: url(../common/imgs/cancel.gif);\r
+                       background-repeat: no-repeat;\r
+                       background-position: 0px 3px;\r
+                       padding-left: 22px;\r
+                       margin: 0px 15px 0px 12px;\r
+               }\r
+       </style>\r
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/css/dhtmlx.css"/>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/lib/jsBezier-0.6.js"></script>     \r
+    <script src="{{STATIC_URL}}unbound_reservation_static/lib/jsplumb-geom-0.1.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/util.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/dom-adapter.js"></script>        \r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/jsPlumb.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/endpoint.js"></script>                \r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/connection.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/anchors.js"></script>        \r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/defaults.js"></script>\r
+    <script src="{{STATIC_URL}}unbound_reservation_static/src/connectors-bezier.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/connectors-statemachine.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/connectors-flowchart.js"></script>\r
+    <script src="{{STATIC_URL}}unbound_reservation_static/src/connector-editors.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/renderers-svg.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/renderers-canvas.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/renderers-vml.js"></script>\r
+       <script src="{{STATIC_URL}}unbound_reservation_static/src/jquery.jsPlumb.js"></script>\r
+\r
+\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/main.js"></script>\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/bootstrap.min.js"></script>\r
+    <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/createpost.js"></script>\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/script.js"></script>\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/contextmenu/contextMenu.js"></script>\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/contextmenu/contextMenu.min.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/js/contextmenu/contextMenu.css">\r
+\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/menu/jquery.contextMenu.js"></script>\r
+       <script type="text/javascript" src="{{STATIC_URL}}unbound_reservation_static/js/menu/jquery.ui.position.js"></script>\r
+       <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}unbound_reservation_static/js/menu/jquery.contextMenu.css">\r
+       \r
+       <script src="{{STATIC_URL}}unbound_reservation_static/lib/dhtmlx.js"></script>\r
+       \r
+\r
+       <script> \r
+       s=myslice.user().slices;\r
+       console.log(s);\r
+       //console.log(myslice.user.slices);\r
+       $('input').bind('input', function() {\r
+    alert($(this).value);\r
+});\r
+       var myForm, myForm2, formData,str;\r
+var columns = {};\r
+var columns_unsaved = {};\r
+var myAcc;\r
+var myCalendar;\r
+\r
+\r
+document.body.onload = function(){\r
+\r
+     var d = new Date();\r
+               \r
+               myCalendar1 = new dhtmlXCalendarObject(["fromdate"]);\r
+               myCalendar2 = new dhtmlXCalendarObject(["todate"]);\r
+               if (d.getDate()<10) {\r
+               var ndate="0"+(d.getDate()).toString();\r
+               }\r
+               else {\r
+               var ndate=(d.getDate()).toString();\r
+               }\r
+               if (d.getMonth()+1<10) {\r
+               var n=(d.getMonth()+1).toString();\r
+               var nmonth="0"+n;\r
+               } else {\r
+               var nmonth=(d.getMonth()+1).toString();\r
+               }\r
+               var today=d.getFullYear()+"-"+nmonth+"-"+ndate;\r
+               //console.log("today:"+today);\r
+               myCalendar1.setSensitiveRange( today, null);\r
+               myCalendar1.setDateFormat("%D %M %j %H:%i:%s EET %Y");\r
+               myCalendar2.setSensitiveRange(today, null);\r
+               myCalendar2.setDateFormat("%D %M %j %H:%i:%s EET %Y");\r
+               \r
+               d.setDate(d.getDate());\r
+               d.setHours(d.getHours());\r
+               d.setMinutes(d.getMinutes());\r
+               \r
+               document.getElementById("fromdate").value = myCalendar1.getFormatedDate(null,d);\r
+               \r
+               //d.setDate(14);\r
+               //d.setHours(10);\r
+               //d.setMinutes(0);\r
+               document.getElementById("todate").value = myCalendar2.getFormatedDate(null,d);\r
+               \r
+               doOnLoad();\r
+               \r
+  }\r
+\r
+\r
+\r
+       \r
+       function setSens(inputId,mezh){\r
+       var d1 = new Date();\r
+               //if(mezh=="min"){\r
+               //myCalendar1.setSensitiveRange(null,d1.getDate());\r
+                       //\r
+               //}else{\r
+               //myCalendar.setSensitiveRange(null,"2015-04-14");\r
+                       \r
+               //}\r
+       }\r
+       \r
+\r
+               \r
+               function doOnLoad() {\r
+               //myAcc = new dhtmlXAccordion({\r
+               //              parent: "accObj",\r
+               //              items: [\r
+               //                      {id: "a1", text: "General"},\r
+                       //              {id: "a2", text: "ExoGeni"},\r
+                       //              {id: "a3", text: "c"}\r
+                       //      ]\r
+                       //});\r
+                       \r
+                       var sel = document.getElementById('user_slices');\r
+for(var i = 0; i < s.length; i++) {\r
+    var opt = document.createElement('option');\r
+    opt.innerHTML = s[i];\r
+    opt.value = s[i];\r
+    sel.appendChild(opt);\r
+}\r
+               \r
+               \r
+               \r
+                       formData = [\r
+                               \r
+                               \r
+                               {type: "combo", name:"testbed", label: "Select testbed", name: "testbed", options:[\r
+                                       {text: "Netmode",  value: "Netmode", selected: true},\r
+                                       {text: "Nitos",  value: "Nitos"},\r
+                                       {text: "Wilabt", value: "wilabt"}\r
+                                       \r
+                               ]}];\r
+formData1 = [\r
+                               {type: "combo", name:"exogeni", label: "ExoGeni Resource Type", name: "exogeni", options:[\r
+                                       {text: "xo.small", value: "xo.small", selected: true},\r
+                                       {text: "xo.medium", value: "xo.medium"},\r
+                                       {text: "xo.large", value: "xo.large"},\r
+                                       {text: "xo.xlarge", value: "xo.xlarge"},\r
+                                       {text: "exogeni-m4", value: "exogeni-m4"}\r
+                               ]},\r
+                               {type: "combo", name:"wftestbeds", label: "Select testbed", comboType: "checkbox", name: "wftestbeds", options:[\r
+                                       {text: "iMinds WiLab 2", value: "iMinds WiLab 2", selected: true},\r
+                                       {text: "clab", value: "clab"}\r
+                               ]}];\r
+       str = [                 \r
+\r
+    {type: "button", name: "form_button_3", value: "Save changes"}\r
+                       ];\r
+\r
+//renderForm();\r
+               //      myForm = new dhtmlXForm("myForm", formData);\r
+                       \r
+                       //document.getElementsByName("form_button_3").addEventListener('click', getItemsList);\r
+               \r
+                       \r
+               }\r
+\r
+function nodeid(sour,target,id) {\r
+\r
+document.getElementById("elemid").value=id;\r
+//document.disableItem("elemid");\r
+\r
+\r
+}\r
+function renderForm() {\r
+//myForm = myAcc.cells("a1").attachForm();\r
+       //              myForm.loadStruct(formData);\r
+//myForm2 = myAcc.cells("a2").attachForm();\r
+//myForm2.loadStruct(formData1);\r
+myForm = new dhtmlXForm("myForm", formData);\r
+myForm.disableItem("elemid");\r
+    for (var i in str) {\r
+        var element_spec = str[i];\r
+        var form_wrapper = document.getElementById('myForm');\r
+        renderElement(form_wrapper, element_spec);\r
+               \r
+    }\r
+}\r
+\r
+function renderElement(container, spec) {\r
+\r
+  switch (spec.type) {\r
+        case 'fieldset1':\r
+            renderFieldset(container, spec);\r
+            break;\r
+        default:\r
+            renderInputElement(container, spec);\r
+            break;\r
+    }\r
+\r
+}\r
+\r
+function renderInputElement(container, spec) {\r
+    if (spec.label) {\r
+        renderInputLabel(container, spec.label);\r
+    }\r
+    \r
+    var input_element = document.createElement('input');\r
+    \r
+    if (spec.type === 'input') {\r
+        var input_type = 'text';\r
+    } else {\r
+        var input_type = spec.type;\r
+    }\r
+    \r
+    input_element.setAttribute('type', input_type);\r
+    input_element.setAttribute('name', spec.name);\r
+    \r
+    if (spec.value) {\r
+        input_element.setAttribute('value', spec.value);\r
+    }\r
+    \r
+    container.appendChild(input_element);\r
+    \r
+    attachAnyEventHandlers(input_element);\r
+}\r
+\r
+function renderInputLabel(container, labelText) {\r
+    var label =  document.createElement('label');\r
+    var labelText = document.createTextNode(labelText);\r
+    \r
+    container.appendChild(label);\r
+    label.appendChild(labelText);\r
+}\r
+\r
+function renderFieldset(container, spec) {\r
+    var fieldset = document.createElement('fieldset');\r
+    var label = document.createElement('legend');\r
+    var labelText = document.createTextNode(spec.label);\r
+    \r
+    fieldset.setAttribute('name', spec.name);\r
+    \r
+    if (spec.list) {\r
+        for (var j in spec.list) {\r
+            renderElement(fieldset, spec.list[j]);\r
+        }\r
+    }\r
+    \r
+    container.appendChild(fieldset);\r
+    fieldset.appendChild(label);\r
+    label.appendChild(labelText);\r
+}\r
+\r
+function attachAnyEventHandlers(element) {\r
+    switch(element.getAttribute('name')) {\r
+        case 'form_button_1':\r
+            element.addEventListener('click', addFieldset);\r
+            break;\r
+        case 'form_button_2':\r
+            element.addEventListener('click', resetForm);\r
+            break;\r
+        case 'form_button_3':\r
+          //  element.addEventListener('click', getItemsList(document.getElementById('elemid').value));\r
+            break;\r
+        case 'form_button_4':\r
+            element.addEventListener('click', getItemsString);\r
+            break;\r
+    }\r
+}\r
+\r
+function addFieldset() {\r
+    var itemData = {\r
+        type:"fieldset",\r
+        name:"form_fieldset_" + k,\r
+        label:"Fieldset" + k,\r
+        list:[\r
+            {type:"input", name:"form_input_" + k + "_1", label:"Input"},\r
+            {type:"input", name:"form_input_" + k + "_2", label:"Input"}\r
+        ]\r
+    };\r
+    \r
+    str.splice(k, 0, itemData);\r
+    k++;\r
+    \r
+    resetForm();\r
+}\r
+\r
+function removeFieldset() {\r
+    if (k === 1) { // Don't delete buttons\r
+        return;\r
+    }\r
+    \r
+    k--;\r
+    str.splice(k, 1);\r
+    \r
+    resetForm();\r
+}\r
+\r
+function resetForm(k,colid) {\r
+//var elemid=document.getElementByName('elemid').value;\r
+//console.log(columns)\r
+var a=[];\r
+if (colid){\r
+console.log('1'+jsondata);\r
+delete columns[colid];\r
+console.log('2'+jsondata);\r
+}\r
+for(var m in columns) {\r
+    var value = columns[m];\r
+       var test = value.data;\r
+//alert(value.valid_from+" " +value.valid_until + " " + test);\r
+//a[m]="{valid_from:"+value.valid_from+"{," +value.valid_until + " " +value.type;\r
+var myEvent =JSON.stringify(test);\r
+//myEvent=myEvent.substring(2);\r
+myEvent=myEvent.replace("}}","}");\r
+a.push(myEvent);\r
+//console.log("*****************"+myEvent);\r
+//console.log( a.toString() );\r
+\r
+}\r
+var jsondata="{\"resources\":["+a.toString()+"]}";\r
+console.log(jsondata);\r
+document.getElementById("jsondata").value=jsondata;\r
+\r
+var myEvent2 =JSON.stringify(a);\r
+//var myEvent =JSON.stringify(value.data);\r
+//console.log(myEvent2);\r
+var myEvent1 = {"resources":[{"type": "Node"},{"type": "Node"}]};\r
+\r
+  //create_post();\r
+ }\r
+\r
+function emptyForm(id) {\r
+console.log('empty'+id);\r
+delete columns[id];\r
+for(var m in columns) {\r
+    var value = columns[m];\r
+       var test = value.data;\r
+\r
+\r
+}\r
+       \r
+\r
+  \r
+}\r
+function readItemsList(id) {\r
+var value = columns[id];\r
+if (value.domain) {\r
+\r
+var testbed_value = "<li data-action = 'first'><a href='#' class='selector'><span>"+value.domain+"</span></a></li>";\r
+} else {\r
+var testbed_value = "<li data-action = 'first'><a href='#' class='selector'><span>ANY</span></a></li>";\r
+\r
+}\r
+var html_memu="<ul><li class='active'><span>Properties</span></li><li class='has-sub'><a href='#'><span>Testbed</span></a><ul>"+testbed_value+"<li data-action = 'first'><a href='#'><span>ANY</span></a></li><li data-action = 'second' ><a href='#' ><span>Netmode</span></a></li><li data-action = 'third'><a href='#'><span>Nitos</span></a></li><li class='last' data-action = 'forth'><a href='#'><span>Wilabt</span></a></li></ul></li><li class='last'><a href='#'><span>kati allo</span></a></li></ul>";\r
+//     $('#cssmenu').empty().append(html_memu);\r
+       console.log("testbed"+testbed_value);\r
+\r
+}\r
+function getItemsList(id,nodetype,testbed) {\r
+console.log(s);\r
+console.log(s.length);\r
+\r
+if (testbed){\r
+document.getElementById('testbet').value=testbed;\r
+}\r
+    var items = document.querySelectorAll('[type=text]');\r
+  \r
+var key = id;\r
+from=document.getElementById("fromdate").value;\r
+to=document.getElementById("todate").value ;\r
+console.log("nikos"+id+$( "#testbet option:selected" ).text + from+to);\r
+domaintyp=document.getElementById('testbet').value;\r
+if (id){\r
+if (domaintyp){\r
+ columns_unsaved[key] = {\r
+ type:'Node',\r
+ name:id,\r
+ exclusive:nodetype,\r
+ valid_from:from,\r
+               valid_until:to,\r
+                domain:document.getElementById('testbet').value\r
+               }\r
+               } else {\r
+               columns_unsaved[key] = {\r
+ type:'Node',\r
+ name:id,\r
+ exclusive:nodetype,\r
+ valid_from:from,\r
+               valid_until:to\r
+               }\r
+               } \r
+    columns[key] = {\r
+        valid_from:from,\r
+               valid_until:to,\r
+               type:'Node',\r
+        domain:document.getElementById('testbet').value,\r
+        exclusive: nodetype,\r
+               saved:true,\r
+               data: columns_unsaved[key]\r
+    };\r
+\r
+resetForm(columns);\r
+}\r
+}\r
+\r
+function getItemsString() {\r
+var serv_response = jQuery.parseJSON('{{ responsejson }}');\r
+    alert('{{ responsejson }}' + "****" +serv_response );\r
+//test[document.getElementByName('elemid')]=JSON.stringify(formData);\r
+}\r
+       </script>\r
+\r
+<div class="container">\r
+       <div class="row clearfix top-header">\r
+               <div class="col-md-12 column">\r
+                       \r
+                       \r
+               </div>\r
+       </div>\r
+       <div class="row border-editor content-editor">\r
+               <div class="col-md-2 column heigh-editor border-right-editor">\r
+                        <span class="label label-info top-label">Select Node Type</span>\r
+                        <ul class="tool-panel" id="sortable-element">\r
+                               <li attr-type="actor"> <img src="{{STATIC_URL}}unbound_reservation_static/img/workflow/vm_icon.png">Virtual machine</li>\r
+                               <li attr-type="wireless"> <img src="{{STATIC_URL}}unbound_reservation_static/img/workflow/wireless_icon.png">Wireless</li>\r
+                               <!--<li attr-type="openflow"> <img src="{{STATIC_URL}}unbound_reservation_static/img/workflow/open_flow_icon.png">Open Flow</li>-->\r
+                        </ul>\r
+               \r
+\r
+               </div>\r
+               <div class="col-md-7 column heigh-editor">\r
+                        <span class="label label-danger top-label">Slice Editor</span>\r
+                        <div class="css-editor" id="editor"><ul id="menu" style="position: relative; top: 0px; left: 0px;"></ul> <ul class='custom-menu'>\r
+  <li data-action = "first">ANY</li>\r
+  <li data-action = "second">Netmode</li>\r
+  <li data-action = "third">Third thing</li>\r
+</ul>\r
+<div id='cssmenu'>\r
+<ul>\r
+   <li class='active'><span>Properties</span></li>\r
+   <li class='has-sub'><a href='#'><span>Testbed</span></a>\r
+      <ul>\r
+         <li data-action = "first"><a href='#'><span>ANY</span></a></li>\r
+                <!--<li data-action = "second" class='selector'><a href='#' ><span>Netmode</span></a></li>-->\r
+         <li data-action = "second" ><a href='#' ><span>Netmode</span></a></li>\r
+         <li  class='last' data-action = "third"><a href='#'><span>Nitos</span></a></li>\r
+                <!--<li  class='last' data-action = "fifth"><a href='#'><span>PLE</span></a></li> -->\r
+               <!-- <li class='last' data-action = "forth"><a href='#'><span>Wilabt</span></a></li> -->\r
+      </ul>\r
+   </li>\r
+   \r
+  <!--    <li class='last'><a href='#'><span>kati allo</span></a></li> -->\r
+</ul>\r
+</div>\r
+<div id='cssmenu_'>\r
+<ul>\r
+   <li class='active'><span>Properties</span></li>\r
+   <li class='has-sub'><a href='#'><span>Testbed</span></a>\r
+      <ul>\r
+         \r
+                <li  class='last' data-action = "fifth"><a href='#'><span>PLE</span></a></li>\r
+               <!-- <li class='last' data-action = "forth"><a href='#'><span>Wilabt</span></a></li> -->\r
+   </ul>\r
+  </li>\r
+   \r
+ <!--    <li class='last'><a href='#'><span>kati allo</span></a></li> -->\r
+</ul>\r
+</div>\r
+</div>\r
+               </div>\r
+               <div class="col-md-3 column heigh-editor">\r
+                        <span class="label label-danger top-label">Node Properties</span>\r
+\r
+                        <div class="css-editor" id="editor"><br><br><div  align="center"><button type="button" id="b1" name="b1" class="btn btn-warning">Send request</button><br><br><button type="button" id="b2" name="b2" class="btn btn-warning" style="display:none;">Reserve request</button><div id="but"></div></div><br><br>\r
+                       <div style="position:relative;margin-bottom:30px;"><input type="hidden" name="jsondata" id="jsondata" value="">\r
+       <label style="position:absolute;top:5px;left:5px; for="fromdate">from:</label><input style="position:absolute;top:5px;left:45px;width:180px;font-size:12px;text-align:center;"  onclick="setSens('todate','max')" value="" id="fromdate" readonly>\r
+       <br><label  style="position:absolute;top:45px;left:5px; for="todate">to:</label><input style="position:absolute;top:45px;left:45px;width:180px;font-size:12px;text-align:center;" onchange="getItemsList(document.getElementById('elemid').value)" onclick="setSens('fromdate','min')" value="" id="todate" readonly>\r
+       <div style="display: none;><br><label  style="position:absolute;top:85px; for="elemid">NodeId</label><input type="hidden" style="position:absolute;top:85px;left:45px;width:180px;font-size:12px;text-align:center; value="" id="elemid" name="elemid" readonly>\r
+<br><select style="position:absolute;top:160px;width:180px;"  id="testbet" class="form-control input-sm col-md-1" type="hidden">\r
+    <option value="">ANY</option>\r
+       <option value="omf:netmode">Netmode</option>\r
+    <option value="omf:nitos.outdoor">Nitos</option>\r
+    <option value="ple">PLE</option>\r
+    \r
+</select><br></div>\r
+\r
+<label  style="position:absolute;top:130px;left:65px;"> Select Slice</label>\r
+<select style="position:absolute;top:150px;width:180px;" id="user_slices" name="user_slices_list"></select>\r
+<!--<select style="position:absolute;top:150px;width:180px;" id="user_slices" name="user_slices_list" >\r
+\r
+{% for user_slices in slice %}\r
+   <option value="{{user_slices}}"\r
+       {% if user_slices == current_org %}selected="selected"{% endif %}>\r
+       {{user_slices|capfirst}}\r
+   </option>\r
+{% endfor %}\r
+\r
+</select>-->\r
+</div>\r
+               <span></span><br><br>\r
+       <div id="form_wrapper"><table>\r
+               \r
+               <tr>\r
+                       <td valign="top"><div id="myForm" style="height:200px;"></div></td>\r
+                       \r
+               </tr>\r
+       </table></div> </div>\r
+               </div>\r
+       </div>\r
+</div>\r
+\r
+\r
+<!-- END of Reputation Specific -->\r
+\r
+{% endblock %}
\ No newline at end of file
diff --git a/portal/unboundreservationview_b.py b/portal/unboundreservationview_b.py
new file mode 100644 (file)
index 0000000..d591725
--- /dev/null
@@ -0,0 +1,341 @@
+from .                          import forms
+from django.shortcuts           import render, render_to_response
+from django.template            import RequestContext
+from django.template.loader     import render_to_string
+from django.views.generic       import View
+from django.core.mail           import send_mail
+from myslice.configengine       import ConfigEngine
+from unfold.loginrequired       import FreeAccessView
+from ui.topmenu                 import topmenu_items, the_user
+from myslice.theme              import ThemeView
+from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+#from portal.forms               import ReputationForm
+import json, ast
+from pprint                     import pprint
+from manifold.core.query        import Query
+from manifoldapi.manifoldapi    import execute_query,execute_admin_query
+from portal.actions             import is_pi, create_slice, create_pending_slice, clear_user_creds
+from django.utils               import simplejson
+from django.http                import *
+import numpy
+import json
+import logging
+import StringIO
+import pycurl
+from apgl.graph import *
+from apgl.generator.ErdosRenyiGenerator import ErdosRenyiGenerator
+from django.views.decorators.csrf import csrf_exempt
+import time
+import datetime
+import calendar
+# splitting the 2 functions done here
+# GET is for displaying the empty form
+# POST is to process it once filled - or show the form again if anything is missing
+def create_post(request):
+    print(request.user)
+    if request.method == 'POST':
+        post_text = request.POST.get('the_post')
+        response_data = {}
+
+        post = Post(text=post_text, author=request.user)
+        post.save()
+
+        response_data['result'] = 'Create post successful!'
+       
+
+    return HttpResponse(
+           json.dumps(response_data),
+           content_type="application/json"
+           )
+                                               
+
+def response_mimetype(request):
+    
+    
+    if "application/json" in request.META['HTTP_ACCEPT']:
+        return "application/json"
+    else:
+        return "text/plain"
+
+def connected_graph(vert,possib):
+    
+    ################################################
+    # Connected graph calculation 
+    #
+    #    Requirements for ErdosRenyiGenerator python function
+    #
+    #    apt-get install gfortran libopenblas-dev liblapack-dev
+    #    pip install numpy
+    #    pip install scipy
+    #    pip install apgl
+    ################################################## 
+        p = possib
+        vertices= vert
+#graph = SparseGraph(VertexList(vertices, 1))
+#generator = ErdosRenyiGenerator(p, selfEdges=False)
+
+#for i in range(0,10):
+        found = False;
+
+        time_start = time.time()
+        iter_time = 20
+        while not found and time.time()-time_start < iter_time:
+                graph = SparseGraph(VertexList(vertices, 1))
+                generator = ErdosRenyiGenerator(p, selfEdges=False)
+                graph = generator.generate2(graph)
+                #print 'getAllEdges'
+                #print graph.getAllEdges()
+                #print '-----------'
+
+                connected_list=[]
+                #print graph.findConnectedComponents()
+                for list in graph.findConnectedComponents():
+                    if len(list)==vertices:
+                        connected_list=list
+                        break
+                if len(connected_list)==vertices:
+                    links = {}
+                    edge_lst =  graph.getAllEdges()
+                    for item in range(0, len(edge_lst)):
+                        links[item]=str(edge_lst[item][0]), str(edge_lst[item][1])
+                    break
+        if len(connected_list)==vertices:
+            return links
+        else:
+            return ("not_found")
+        #print graph.getAllEdges()
+        #print connected_list
+        return links
+
+
+class UnboundReservationView (FreeAccessView, ThemeView):
+        def my_view(request):
+
+            preset_form = forms.PresetListForm()
+
+            return render_to_response('services.html', {'array': json.dumps(data, cls=SpecialEncoder),'preset_form': preset_form,
+        })
+       def create_post(request):
+           print(request.user) 
+           if request.method == 'POST':
+               print("mlsllslssll,sls*************")
+               post_text = request.POST.get('the_post')
+               response_data = {}
+
+               post = Post(text=post_text, author=request.user)
+               post.save()
+
+               response_data['result'] = 'Create post successful!'
+       
+
+               return HttpResponse(
+               json.dumps(response_data),
+               content_type="application/json"
+                                               )
+           else:
+                return HttpResponse(
+                json.dumps({"nothing to see": "this isn't happening"}),
+                content_type="application/json"
+        )
+    
+        def quiz_guess(request, fact_id):   
+           message = {"fact_type": "", "fact_note": ""}
+           if request.is_ajax():
+               fact = get_object_or_404(Fact, id=fact_id)
+               message['fact_type'] = fact.type
+               message['fact_note'] = fact.note
+            else:
+               message = "You're the lying type, I can just tell."
+               json = simplejson.dumps(message)
+               return HttpResponse(json, mimetype='application/json')
+       def default_env (self):
+           return { 
+                   'MANIFOLD_URL':ConfigEngine().manifold_url(),
+                   }       
+        def post (self, request):
+               env = self.default_env()
+               print(request.user)
+               print(request.POST["b"])
+               
+               body1= request.POST["mitsos"]
+               user_urn= request.POST["name"]
+               user_urn=str(user_urn)
+               print(user_urn)
+               buffer = StringIO.StringIO()
+               json_data=open('/home/coyiotis/test.json').read()
+               data1 = json.loads(json_data)
+               data=json.dumps(body1)
+               data2=str(unicode(data))
+               json_data_1 = json.loads(body1)
+               json_data_1=json.dumps(json_data_1)
+               json_data_1 =str(unicode(json_data_1))
+               #print(data)       
+               print('*******************************nikos')   
+               #print(json_data_1)
+               #print(json_data_1['data'])
+               if request.POST["b"]=="1":
+                   c = pycurl.Curl()
+                   c.setopt(pycurl.URL, 'https://194.177.207.2:8001/mapper/')
+                   c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/json','Accept: application/json'])
+                   c.setopt(pycurl.POST, 1)
+                   c.setopt(pycurl.SSL_VERIFYPEER, False)
+                   c.setopt(pycurl.SSL_VERIFYHOST, False)        
+                   c.setopt(pycurl.POSTFIELDS, body1)
+                   c.setopt(pycurl.WRITEDATA, buffer)
+                   c.perform()
+                   c.close()
+                   global body
+                   body = buffer.getvalue()
+                       # Body is a string in some encoding.
+                       # In Python 2, we can print it without knowing what the encoding is.
+               #print(body)    
+                   env['responsejson'] =  json.dumps(body)
+               
+                   body = body.replace('\n', '')
+               #body = body.replace(' ', '')
+               #print(json.dumps(body))
+                   print(body)
+                #j = json.loads(body)
+               ##print json_string
+               #parent =  j["resource_response"]
+               #for item in parent:
+                 #  print item["name"]
+                 #  print item["type"]
+
+                   global decoded
+                   decoded = json.loads(body)
+               # pretty printing of json-formatted string
+                   print json.dumps(decoded, sort_keys=True, indent=4)
+                   print "JSON parsing example: ", decoded['resource_response']
+               #print len(item_dict['result'][0]['run'])
+               else:
+                   leases_list=[]
+                   slice_params={}
+                   resources=[]
+                   final_params={}
+               
+                   for x in xrange(0, len(decoded['resource_response']['resources'])):
+                       end_time=decoded['resource_response']['resources'][x]['valid_until']
+                       start_time=decoded['resource_response']['resources'][x]['valid_from']
+                   #s = "01/12/2011"
+                       start_time=int(time.mktime(datetime.datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S %Z").timetuple()))
+                       end_time=int(time.mktime(datetime.datetime.strptime(end_time, "%Y-%m-%d %H:%M:%S %Z").timetuple()))
+                       print(start_time)
+                       print(end_time)
+                   #print(calendar.timegm(start_time.utctimetuple()))
+                  
+                       urn=decoded['resource_response']['resources'][x]['urn']
+                       slice_params = {
+                                   'resource'         : urn,
+                                   'start_time'       : start_time,
+                                   'end_time'         : end_time
+                       }
+                       leases_list.append(slice_params)
+                       resources.append(urn)
+                  
+                   print("chrysaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") 
+                   for keys,values in slice_params.items():
+                       print(keys)
+                       print(values)
+                       final_params = {
+                       'resource'        : resources,
+                       'lease'        : leases_list
+                   }    
+                   #final_params=str(final_params)
+               #final_params=[{'resource': resources, 'leases':leases_list}]
+               #print(final_params)
+               
+                   print(user_urn)             
+                   final_params= ast.literal_eval(json.dumps(final_params))
+                   query = Query.update('slice').filter_by('slice_hrn', '==', user_urn).set(final_params).select('slice_hrn')
+               #query = Query.update('myslice:slice').filter_by('slice_hrn', '==', user_urn).set(slice_params).select('slice_hrn')
+                   results = execute_query(request,query)
+                   print("________________________________________________________________________________")
+                   print(results)
+                   print('________________________________________________________________________________')
+                   print(query)
+               return HttpResponse(json.dumps(body), mimetype='application/json')
+               #return render_to_response('workflow.html', env, context_instance=RequestContext(request))
+               #return render(request, 'workflow.html', {"variable_int" : 12})
+       def get (self, request):
+               buffer = StringIO.StringIO()
+               print("mlsllslssll,sls*************3")
+               #message = {"fact_type": "", "fact_note": ""}
+               childs = []
+               
+               
+                               
+                  
+                   
+               if request.is_ajax():
+                   print("mlsllslssll,sls*************4")
+                       #fact = get_object_or_404(Fact, id=fact_id)
+                   #    message['fact_type'] = fact.type
+                   #    message['fact_note'] = fact.note
+               #else:
+               #       message = "You're the lying type, I can just tell."
+               #       json = simplejson.dumps(message)            
+               if request.GET.has_key('node-num2'):
+                        child1=""
+                       child="{\"type\":\"Node\",\"valid_form\":"+request.GET['fromdate']+",\"valid_until\":"+request.GET['todate']+",\"exclusive\": true}"
+                       for index in range(int(request.GET['node-num'])):
+                                           childs.append(child)
+                                           if index>1:
+                                                       child1=child1+",{\"type\":\"Node\",\"valid_form\":"+"\""+request.GET['fromdate']+"\""+",\"valid_until\":"+"\""+request.GET['todate']+"\""+",\"exclusive\":true}"
+                                           if index==0:
+                                                       child1="{\"type\":\"Node\",\"valid_form\":"+"\""+request.GET['fromdate']+"\""+",\"valid_until\":"+"\""+request.GET['todate']+"\""+",\"exclusive\":true}"
+                       
+                       
+                       
+                       response_dict={}
+                       jchilds="{\"resources\":["+child1+"]\"\"}"
+                       #print(request.GET['jsondata'])
+                       c = pycurl.Curl()
+                       c.setopt(pycurl.URL, 'https://194.177.207.2:8001/mapper/')
+                       c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/json','Accept: application/json'])
+                       c.setopt(pycurl.POST, 1)
+                       c.setopt(pycurl.SSL_VERIFYPEER, False)
+                       c.setopt(pycurl.SSL_VERIFYHOST, False)        
+                       c.setopt(pycurl.POSTFIELDS, request.GET['jsondata'])
+                       c.setopt(pycurl.WRITEDATA, buffer)
+                       c.perform()
+                       c.close()
+                                               
+                       body = buffer.getvalue()
+                       
+                       #return HttpResponse(json.dumps(body), mimetype='application/json')
+                       #response_dict = {'1':request.GET['node-
+                       #jnum'], '2':request.GET['node-num2']}
+                       #links = connected_graph(int(request.GET['node-num']),float(request.GET['node-num2'])/100)
+            #===================================================================
+                #for item in range(0,len(links)):
+               #child[item]=links[item]
+            #=====  =============================================================
+                       #print response_dict
+                       jsonchilds=json.dumps(childs)
+                       links=0
+                       json_stuff = simplejson.dumps({'links': links, 'body': body})
+                       print '**********************************BP 1 *********************************'+request.GET['jsondata']
+                       print '**********************************BP 2 *********************************'+body
+                       if links == 'not_found':
+                       #return HttpResponse(simplejson.dumps(['false']), content_type = response_mimetype(self.request))
+                               return HttpResponse(content='false', mimetype=DEFAULT_CONTENT_TYPE)
+                       else:
+                               return HttpResponse(json_stuff, content_type = response_mimetype(self.request))
+               #return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript')
+               #return HttpResponse(json, mimetype='application/json')
+               return self._display (request)
+       
+       def _display (self, request):
+               return render(request, 'workflow_b.html', {
+                'topmenu_items': topmenu_items('Unbound Request', request),
+                'username': the_user (request)
+                })
+        
+
+
+    
index 905858c..b92295e 100644 (file)
@@ -59,6 +59,7 @@ from portal.views                   import PresViewView, pres_view_static, pres_
 from portal.django_passresetview    import password_reset, password_reset_done, password_reset_confirm, password_reset_complete 
 
 from portal.reputationview      import ReputationView
+from portal.unboundreservationview_b import UnboundReservationView
 
 # DEPRECATED #named_register_forms = (
 # DEPRECATED #    ("step1", RegisterUserForm),
@@ -137,7 +138,12 @@ urlpatterns = patterns('',
 
     url(r'^reputation/?$', ReputationView.as_view(), name='reputation'),
     url(r'^reputation/submit_eval/?$', ReputationView.as_view(), name='reputation_submit_eval'),
-    
+    url(r'^unbound_reservation_b/?$', UnboundReservationView.as_view(), name='unbound_reservation_b'),
+    #url(r'^time/$', current_datetime),
+    #url(r'^unbound_reservation/?$', unb.as_view(), name='papa'),
+    #url(r'^unbound_reservation/calculate_links/?$', UnboundReservationView.as_view(), name='unbound_reservation_calculate_links'),
+    #url(r'^unb/calculate_links/?$', unb.as_view(), name='unb_reservation_calculate_links'),
+    url(r'^create_post/?$', UnboundReservationView.as_view(), name='create_post'),   
     
 )
 # (r'^accounts/', include('registration.backends.default.urls')),