From: Michael Tremer Date: Wed, 28 May 2014 13:26:32 +0000 (+0200) Subject: cacti: Update to 0.8.8b. X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=59dbe8d4249d7dd9e0beb7cc49f4e733aa328878 cacti: Update to 0.8.8b. --- diff --git a/config/cacti/cacti.conf b/config/cacti/cacti.conf index 9c39ef6a0..024449d30 100644 --- a/config/cacti/cacti.conf +++ b/config/cacti/cacti.conf @@ -1,11 +1,16 @@ Listen 1009 - DocumentRoot /usr/share/cacti + Include /etc/httpd/conf/conf.d/php*.conf + + Alias /cacti /usr/share/cacti Options FollowSymLinks AllowOverride None + + RewriteEngine on + RewriteRule ^/$ /cacti/ [R] diff --git a/config/cacti/cacti.logrotate b/config/cacti/cacti.logrotate new file mode 100644 index 000000000..3ff439585 --- /dev/null +++ b/config/cacti/cacti.logrotate @@ -0,0 +1,6 @@ +/var/log/cacti/cacti.log { + missingok + monthly + notifempty + compress +} diff --git a/config/cacti/d.gif b/config/cacti/d.gif new file mode 100644 index 000000000..0e958d387 Binary files /dev/null and b/config/cacti/d.gif differ diff --git a/config/cacti/d.png b/config/cacti/d.png new file mode 100644 index 000000000..8540175a0 Binary files /dev/null and b/config/cacti/d.png differ diff --git a/config/cacti/throbber.gif b/config/cacti/throbber.gif new file mode 100644 index 000000000..5b33f7e54 Binary files /dev/null and b/config/cacti/throbber.gif differ diff --git a/config/rootfiles/packages/cacti b/config/rootfiles/packages/cacti index 2807f77c3..de0e2c773 100644 --- a/config/rootfiles/packages/cacti +++ b/config/rootfiles/packages/cacti @@ -1,5 +1,7 @@ etc/fcron.cyclic/cacti.cron etc/httpd/conf/vhosts.d/cacti.conf +#etc/logrotate.d +etc/logrotate.d/cacti #usr/share/cacti #usr/share/cacti/LICENSE #usr/share/cacti/README @@ -27,6 +29,7 @@ usr/share/cacti/cli/poller_graphs_reapply_names.php usr/share/cacti/cli/poller_output_empty.php usr/share/cacti/cli/poller_reindex_hosts.php usr/share/cacti/cli/rebuild_poller_cache.php +usr/share/cacti/cli/reorder_data_query.php usr/share/cacti/cli/repair_database.php usr/share/cacti/cli/repair_templates.php usr/share/cacti/cli/structure_rra_paths.php @@ -191,12 +194,17 @@ usr/share/cacti/images/cacti_logo.gif usr/share/cacti/images/calendar.gif usr/share/cacti/images/delete_icon.gif usr/share/cacti/images/delete_icon_large.gif +usr/share/cacti/images/disable_icon.png +usr/share/cacti/images/enable_icon.png +usr/share/cacti/images/enable_icon_disabled.png usr/share/cacti/images/favicon.ico usr/share/cacti/images/graph_page_top.gif usr/share/cacti/images/graph_properties.gif usr/share/cacti/images/graph_query.png usr/share/cacti/images/graph_zoom.gif usr/share/cacti/images/hide.gif +usr/share/cacti/images/install_icon.png +usr/share/cacti/images/install_icon_disabled.png usr/share/cacti/images/left_border.gif usr/share/cacti/images/menu_line.gif usr/share/cacti/images/menuarrow.gif @@ -222,6 +230,8 @@ usr/share/cacti/images/tab_mode_tree_down.gif usr/share/cacti/images/tab_settings.gif usr/share/cacti/images/tab_settings_down.gif usr/share/cacti/images/transparent_line.gif +usr/share/cacti/images/uninstall_icon.gif +usr/share/cacti/images/view_none.gif #usr/share/cacti/include usr/share/cacti/include/auth.php usr/share/cacti/include/bottom_footer.php @@ -231,10 +241,28 @@ usr/share/cacti/include/global_arrays.php usr/share/cacti/include/global_constants.php usr/share/cacti/include/global_form.php usr/share/cacti/include/global_settings.php -#usr/share/cacti/include/jscalendar +usr/share/cacti/include/js +usr/share/cacti/include/js/jquery +usr/share/cacti/include/js/jquery/colorpicker.js +usr/share/cacti/include/js/jquery/jquery-ui.js +usr/share/cacti/include/js/jquery/jquery.cookie.js +usr/share/cacti/include/js/jquery/jquery.dd.js +usr/share/cacti/include/js/jquery/jquery.dropdown.js +usr/share/cacti/include/js/jquery/jquery.js +usr/share/cacti/include/js/jquery/jquery.jstree.js +usr/share/cacti/include/js/jquery/jquery.tablednd.js +usr/share/cacti/include/js/jquery/jquery.timepicker.js +usr/share/cacti/include/js/jquery/jquery.zoom.js +usr/share/cacti/include/js/jquery/themes +usr/share/cacti/include/js/jquery/themes/default +usr/share/cacti/include/js/jquery/themes/default/d.gif +usr/share/cacti/include/js/jquery/themes/default/d.png +usr/share/cacti/include/js/jquery/themes/default/style.css +usr/share/cacti/include/js/jquery/themes/default/throbber.gif +usr/share/cacti/include/jscalendar usr/share/cacti/include/jscalendar/calendar-setup.js usr/share/cacti/include/jscalendar/calendar.js -#usr/share/cacti/include/jscalendar/lang +usr/share/cacti/include/jscalendar/lang usr/share/cacti/include/jscalendar/lang/calendar-af.js usr/share/cacti/include/jscalendar/lang/calendar-al.js usr/share/cacti/include/jscalendar/lang/calendar-bg.js @@ -280,20 +308,9 @@ usr/share/cacti/include/jscalendar/lang/calendar-zh.js usr/share/cacti/include/jscalendar/lang/cn_utf8.js usr/share/cacti/include/layout.js usr/share/cacti/include/main.css +usr/share/cacti/include/plugins.php usr/share/cacti/include/top_graph_header.php usr/share/cacti/include/top_header.php -#usr/share/cacti/include/treeview -usr/share/cacti/include/treeview/ftiens4.js -usr/share/cacti/include/treeview/ftiens4_export.js -usr/share/cacti/include/treeview/ftv2blank.gif -usr/share/cacti/include/treeview/ftv2lastnode.gif -usr/share/cacti/include/treeview/ftv2mlastnode.gif -usr/share/cacti/include/treeview/ftv2mnode.gif -usr/share/cacti/include/treeview/ftv2node.gif -usr/share/cacti/include/treeview/ftv2plastnode.gif -usr/share/cacti/include/treeview/ftv2pnode.gif -usr/share/cacti/include/treeview/ftv2vertline.gif -usr/share/cacti/include/treeview/ua.js usr/share/cacti/include/zoom.js usr/share/cacti/index.php #usr/share/cacti/install @@ -318,6 +335,10 @@ usr/share/cacti/install/0_8_7d_to_0_8_7e.php usr/share/cacti/install/0_8_7e_to_0_8_7f.php usr/share/cacti/install/0_8_7f_to_0_8_7g.php usr/share/cacti/install/0_8_7g_to_0_8_7h.php +usr/share/cacti/install/0_8_7h_to_0_8_7i.php +usr/share/cacti/install/0_8_7i_to_0_8_8.php +usr/share/cacti/install/0_8_8_to_0_8_8a.php +usr/share/cacti/install/0_8_8_to_0_8_8b.php usr/share/cacti/install/0_8_to_0_8_1.php usr/share/cacti/install/index.php usr/share/cacti/install/install_finish.gif @@ -338,7 +359,7 @@ usr/share/cacti/lib/adodb/adodb-php4.inc.php usr/share/cacti/lib/adodb/adodb-time.inc.php usr/share/cacti/lib/adodb/adodb-xmlschema.inc.php usr/share/cacti/lib/adodb/adodb.inc.php -#usr/share/cacti/lib/adodb/datadict +usr/share/cacti/lib/adodb/datadict usr/share/cacti/lib/adodb/datadict/datadict-access.inc.php usr/share/cacti/lib/adodb/datadict/datadict-db2.inc.php usr/share/cacti/lib/adodb/datadict/datadict-firebird.inc.php @@ -351,7 +372,7 @@ usr/share/cacti/lib/adodb/datadict/datadict-oci8.inc.php usr/share/cacti/lib/adodb/datadict/datadict-postgres.inc.php usr/share/cacti/lib/adodb/datadict/datadict-sapdb.inc.php usr/share/cacti/lib/adodb/datadict/datadict-sybase.inc.php -#usr/share/cacti/lib/adodb/drivers +usr/share/cacti/lib/adodb/drivers usr/share/cacti/lib/adodb/drivers/adodb-access.inc.php usr/share/cacti/lib/adodb/drivers/adodb-ado.inc.php usr/share/cacti/lib/adodb/drivers/adodb-ado5.inc.php @@ -392,7 +413,7 @@ usr/share/cacti/lib/adodb/drivers/adodb-sqlite.inc.php usr/share/cacti/lib/adodb/drivers/adodb-sqlitepo.inc.php usr/share/cacti/lib/adodb/drivers/adodb-sybase.inc.php usr/share/cacti/lib/adodb/drivers/adodb-vfp.inc.php -#usr/share/cacti/lib/adodb/lang +usr/share/cacti/lib/adodb/lang usr/share/cacti/lib/adodb/lang/adodb-ar.inc.php usr/share/cacti/lib/adodb/lang/adodb-bg.inc.php usr/share/cacti/lib/adodb/lang/adodb-bgutf8.inc.php @@ -437,6 +458,7 @@ usr/share/cacti/lib/html_validate.php usr/share/cacti/lib/import.php usr/share/cacti/lib/ldap.php usr/share/cacti/lib/ping.php +usr/share/cacti/lib/plugins.php usr/share/cacti/lib/poller.php usr/share/cacti/lib/rrd.php usr/share/cacti/lib/snmp.php @@ -450,6 +472,9 @@ usr/share/cacti/lib/variables.php usr/share/cacti/lib/xml.php usr/share/cacti/log usr/share/cacti/logout.php +usr/share/cacti/plugins +usr/share/cacti/plugins.php +usr/share/cacti/plugins/index.php usr/share/cacti/poller.php usr/share/cacti/poller_commands.php usr/share/cacti/poller_export.php diff --git a/lfs/cacti b/lfs/cacti index 8d7885975..f44e7b40e 100644 --- a/lfs/cacti +++ b/lfs/cacti @@ -24,7 +24,7 @@ include Config -VER = 0.8.7h +VER = 0.8.8b THISAPP = cacti-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = cacti -PAK_VER = 4 +PAK_VER = 5 DEPS = "netsnmpd mysql" @@ -44,7 +44,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = 58c9371341f49a190ae11a85118e598d +$(DL_FILE)_MD5 = acb40deae073ca22e5c01a8e3ba389fb install : $(TARGET) @@ -54,7 +54,6 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects)) md5 : $(subst %,%_MD5,$(objects)) - dist: @$(PAK) @@ -78,6 +77,21 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + + cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8a-legal.patch + cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8a-replace_treeview_by_jquery.jstree.patch + cd $(DIR_APP) && patch -p2 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8b-html-injection.patch + cd $(DIR_APP) && patch -p2 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8b-remote-command-execution.patch + cd $(DIR_APP) && patch -p2 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8b-rra-comments.patch + cd $(DIR_APP) && patch -p2 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8b-sanitize-variables.patch + cd $(DIR_APP) && patch -p2 -i $(DIR_SRC)/src/patches/cacti/cacti-0.8.8b-sql-injection-shell-escaping.patch + cp -vf \ + $(DIR_SRC)/config/cacti/d.gif \ + $(DIR_SRC)/config/cacti/d.png \ + $(DIR_SRC)/config/cacti/throbber.gif \ + $(DIR_APP)/include/js/jquery/themes/default/ + cd $(DIR_APP) && rm -rf include/treeview + @rm -rf /var/cacti /usr/share/cacti mkdir -pv /var/cacti /usr/share/cacti @@ -92,6 +106,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) ln -s /var/cacti/log /usr/share/cacti/log ln -s /var/cacti/rra /usr/share/cacti/rra + -mkdir -pv /etc/logrotate.d + install -v -m 644 $(DIR_SRC)/config/cacti/cacti.logrotate /etc/logrotate.d/cacti + chown -R nobody:nobody /var/cacti/rra /var/cacti/log @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/paks/cacti/install.sh b/src/paks/cacti/install.sh index c6b354c86..8268992b9 100644 --- a/src/paks/cacti/install.sh +++ b/src/paks/cacti/install.sh @@ -23,7 +23,4 @@ # . /opt/pakfire/lib/functions.sh extract_files -mysqladmin --user=root -pmysqlfire create cacti -mysql --user=root -pmysqlfire cacti < /usr/share/cacti/cacti.sql -mysql --user=root -pmysqlfire -e "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser';" mysql /etc/init.d/apache restart diff --git a/src/patches/cacti/cacti-0.8.8a-legal.patch b/src/patches/cacti/cacti-0.8.8a-legal.patch new file mode 100644 index 000000000..af092096f --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8a-legal.patch @@ -0,0 +1,8166 @@ +diff -up cacti-0.8.8a/include/js/jquery/colorpicker.js.legal cacti-0.8.8a/include/js/jquery/colorpicker.js +--- cacti-0.8.8a/include/js/jquery/colorpicker.js.legal 2013-01-04 15:44:38.025416061 -0500 ++++ cacti-0.8.8a/include/js/jquery/colorpicker.js 2013-01-04 15:43:12.644377988 -0500 +@@ -0,0 +1,484 @@ ++/** ++ * ++ * Color picker ++ * Author: Stefan Petre www.eyecon.ro ++ * ++ * Dual licensed under the MIT and GPL licenses ++ * ++ */ ++(function ($) { ++ var ColorPicker = function () { ++ var ++ ids = {}, ++ inAction, ++ charMin = 65, ++ visible, ++ tpl = '
', ++ defaults = { ++ eventName: 'click', ++ onShow: function () {}, ++ onBeforeShow: function(){}, ++ onHide: function () {}, ++ onChange: function () {}, ++ onSubmit: function () {}, ++ color: 'ff0000', ++ livePreview: true, ++ flat: false ++ }, ++ fillRGBFields = function (hsb, cal) { ++ var rgb = HSBToRGB(hsb); ++ $(cal).data('colorpicker').fields ++ .eq(1).val(rgb.r).end() ++ .eq(2).val(rgb.g).end() ++ .eq(3).val(rgb.b).end(); ++ }, ++ fillHSBFields = function (hsb, cal) { ++ $(cal).data('colorpicker').fields ++ .eq(4).val(hsb.h).end() ++ .eq(5).val(hsb.s).end() ++ .eq(6).val(hsb.b).end(); ++ }, ++ fillHexFields = function (hsb, cal) { ++ $(cal).data('colorpicker').fields ++ .eq(0).val(HSBToHex(hsb)).end(); ++ }, ++ setSelector = function (hsb, cal) { ++ $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); ++ $(cal).data('colorpicker').selectorIndic.css({ ++ left: parseInt(150 * hsb.s/100, 10), ++ top: parseInt(150 * (100-hsb.b)/100, 10) ++ }); ++ }, ++ setHue = function (hsb, cal) { ++ $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10)); ++ }, ++ setCurrentColor = function (hsb, cal) { ++ $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)); ++ }, ++ setNewColor = function (hsb, cal) { ++ $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)); ++ }, ++ keyDown = function (ev) { ++ var pressedKey = ev.charCode || ev.keyCode || -1; ++ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { ++ return false; ++ } ++ var cal = $(this).parent().parent(); ++ if (cal.data('colorpicker').livePreview === true) { ++ change.apply(this); ++ } ++ }, ++ change = function (ev) { ++ var cal = $(this).parent().parent(), col; ++ if (this.parentNode.className.indexOf('_hex') > 0) { ++ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)); ++ } else if (this.parentNode.className.indexOf('_hsb') > 0) { ++ cal.data('colorpicker').color = col = fixHSB({ ++ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), ++ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), ++ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) ++ }); ++ } else { ++ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ ++ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), ++ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), ++ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) ++ })); ++ } ++ if (ev) { ++ fillRGBFields(col, cal.get(0)); ++ fillHexFields(col, cal.get(0)); ++ fillHSBFields(col, cal.get(0)); ++ } ++ setSelector(col, cal.get(0)); ++ setHue(col, cal.get(0)); ++ setNewColor(col, cal.get(0)); ++ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]); ++ }, ++ blur = function (ev) { ++ var cal = $(this).parent().parent(); ++ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus'); ++ }, ++ focus = function () { ++ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; ++ $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); ++ $(this).parent().addClass('colorpicker_focus'); ++ }, ++ downIncrement = function (ev) { ++ var field = $(this).parent().find('input').focus(); ++ var current = { ++ el: $(this).parent().addClass('colorpicker_slider'), ++ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), ++ y: ev.pageY, ++ field: field, ++ val: parseInt(field.val(), 10), ++ preview: $(this).parent().parent().data('colorpicker').livePreview ++ }; ++ $(document).bind('mouseup', current, upIncrement); ++ $(document).bind('mousemove', current, moveIncrement); ++ }, ++ moveIncrement = function (ev) { ++ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); ++ if (ev.data.preview) { ++ change.apply(ev.data.field.get(0), [true]); ++ } ++ return false; ++ }, ++ upIncrement = function (ev) { ++ change.apply(ev.data.field.get(0), [true]); ++ ev.data.el.removeClass('colorpicker_slider').find('input').focus(); ++ $(document).unbind('mouseup', upIncrement); ++ $(document).unbind('mousemove', moveIncrement); ++ return false; ++ }, ++ downHue = function (ev) { ++ var current = { ++ cal: $(this).parent(), ++ y: $(this).offset().top ++ }; ++ current.preview = current.cal.data('colorpicker').livePreview; ++ $(document).bind('mouseup', current, upHue); ++ $(document).bind('mousemove', current, moveHue); ++ }, ++ moveHue = function (ev) { ++ change.apply( ++ ev.data.cal.data('colorpicker') ++ .fields ++ .eq(4) ++ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10)) ++ .get(0), ++ [ev.data.preview] ++ ); ++ return false; ++ }, ++ upHue = function (ev) { ++ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); ++ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); ++ $(document).unbind('mouseup', upHue); ++ $(document).unbind('mousemove', moveHue); ++ return false; ++ }, ++ downSelector = function (ev) { ++ var current = { ++ cal: $(this).parent(), ++ pos: $(this).offset() ++ }; ++ current.preview = current.cal.data('colorpicker').livePreview; ++ $(document).bind('mouseup', current, upSelector); ++ $(document).bind('mousemove', current, moveSelector); ++ }, ++ moveSelector = function (ev) { ++ change.apply( ++ ev.data.cal.data('colorpicker') ++ .fields ++ .eq(6) ++ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10)) ++ .end() ++ .eq(5) ++ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10)) ++ .get(0), ++ [ev.data.preview] ++ ); ++ return false; ++ }, ++ upSelector = function (ev) { ++ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); ++ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); ++ $(document).unbind('mouseup', upSelector); ++ $(document).unbind('mousemove', moveSelector); ++ return false; ++ }, ++ enterSubmit = function (ev) { ++ $(this).addClass('colorpicker_focus'); ++ }, ++ leaveSubmit = function (ev) { ++ $(this).removeClass('colorpicker_focus'); ++ }, ++ clickSubmit = function (ev) { ++ var cal = $(this).parent(); ++ var col = cal.data('colorpicker').color; ++ cal.data('colorpicker').origColor = col; ++ setCurrentColor(col, cal.get(0)); ++ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el); ++ }, ++ show = function (ev) { ++ var cal = $('#' + $(this).data('colorpickerId')); ++ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); ++ var pos = $(this).offset(); ++ var viewPort = getViewport(); ++ var top = pos.top + this.offsetHeight; ++ var left = pos.left; ++ if (top + 176 > viewPort.t + viewPort.h) { ++ top -= this.offsetHeight + 176; ++ } ++ if (left + 356 > viewPort.l + viewPort.w) { ++ left -= 356; ++ } ++ cal.css({left: left + 'px', top: top + 'px'}); ++ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) { ++ cal.show(); ++ } ++ $(document).bind('mousedown', {cal: cal}, hide); ++ return false; ++ }, ++ hide = function (ev) { ++ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { ++ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) { ++ ev.data.cal.hide(); ++ } ++ $(document).unbind('mousedown', hide); ++ } ++ }, ++ isChildOf = function(parentEl, el, container) { ++ if (parentEl == el) { ++ return true; ++ } ++ if (parentEl.contains) { ++ return parentEl.contains(el); ++ } ++ if ( parentEl.compareDocumentPosition ) { ++ return !!(parentEl.compareDocumentPosition(el) & 16); ++ } ++ var prEl = el.parentNode; ++ while(prEl && prEl != container) { ++ if (prEl == parentEl) ++ return true; ++ prEl = prEl.parentNode; ++ } ++ return false; ++ }, ++ getViewport = function () { ++ var m = document.compatMode == 'CSS1Compat'; ++ return { ++ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), ++ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), ++ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), ++ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight) ++ }; ++ }, ++ fixHSB = function (hsb) { ++ return { ++ h: Math.min(360, Math.max(0, hsb.h)), ++ s: Math.min(100, Math.max(0, hsb.s)), ++ b: Math.min(100, Math.max(0, hsb.b)) ++ }; ++ }, ++ fixRGB = function (rgb) { ++ return { ++ r: Math.min(255, Math.max(0, rgb.r)), ++ g: Math.min(255, Math.max(0, rgb.g)), ++ b: Math.min(255, Math.max(0, rgb.b)) ++ }; ++ }, ++ fixHex = function (hex) { ++ var len = 6 - hex.length; ++ if (len > 0) { ++ var o = []; ++ for (var i=0; i -1) ? hex.substring(1) : hex), 16); ++ return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; ++ }, ++ HexToHSB = function (hex) { ++ return RGBToHSB(HexToRGB(hex)); ++ }, ++ RGBToHSB = function (rgb) { ++ var hsb = { ++ h: 0, ++ s: 0, ++ b: 0 ++ }; ++ var min = Math.min(rgb.r, rgb.g, rgb.b); ++ var max = Math.max(rgb.r, rgb.g, rgb.b); ++ var delta = max - min; ++ hsb.b = max; ++ if (max != 0) { ++ ++ } ++ hsb.s = max != 0 ? 255 * delta / max : 0; ++ if (hsb.s != 0) { ++ if (rgb.r == max) { ++ hsb.h = (rgb.g - rgb.b) / delta; ++ } else if (rgb.g == max) { ++ hsb.h = 2 + (rgb.b - rgb.r) / delta; ++ } else { ++ hsb.h = 4 + (rgb.r - rgb.g) / delta; ++ } ++ } else { ++ hsb.h = -1; ++ } ++ hsb.h *= 60; ++ if (hsb.h < 0) { ++ hsb.h += 360; ++ } ++ hsb.s *= 100/255; ++ hsb.b *= 100/255; ++ return hsb; ++ }, ++ HSBToRGB = function (hsb) { ++ var rgb = {}; ++ var h = Math.round(hsb.h); ++ var s = Math.round(hsb.s*255/100); ++ var v = Math.round(hsb.b*255/100); ++ if(s == 0) { ++ rgb.r = rgb.g = rgb.b = v; ++ } else { ++ var t1 = v; ++ var t2 = (255-s)*v/255; ++ var t3 = (t1-t2)*(h%60)/60; ++ if(h==360) h = 0; ++ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3} ++ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3} ++ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3} ++ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3} ++ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3} ++ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3} ++ else {rgb.r=0; rgb.g=0; rgb.b=0} ++ } ++ return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)}; ++ }, ++ RGBToHex = function (rgb) { ++ var hex = [ ++ rgb.r.toString(16), ++ rgb.g.toString(16), ++ rgb.b.toString(16) ++ ]; ++ $.each(hex, function (nr, val) { ++ if (val.length == 1) { ++ hex[nr] = '0' + val; ++ } ++ }); ++ return hex.join(''); ++ }, ++ HSBToHex = function (hsb) { ++ return RGBToHex(HSBToRGB(hsb)); ++ }, ++ restoreOriginal = function () { ++ var cal = $(this).parent(); ++ var col = cal.data('colorpicker').origColor; ++ cal.data('colorpicker').color = col; ++ fillRGBFields(col, cal.get(0)); ++ fillHexFields(col, cal.get(0)); ++ fillHSBFields(col, cal.get(0)); ++ setSelector(col, cal.get(0)); ++ setHue(col, cal.get(0)); ++ setNewColor(col, cal.get(0)); ++ }; ++ return { ++ init: function (opt) { ++ opt = $.extend({}, defaults, opt||{}); ++ if (typeof opt.color == 'string') { ++ opt.color = HexToHSB(opt.color); ++ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { ++ opt.color = RGBToHSB(opt.color); ++ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { ++ opt.color = fixHSB(opt.color); ++ } else { ++ return this; ++ } ++ return this.each(function () { ++ if (!$(this).data('colorpickerId')) { ++ var options = $.extend({}, opt); ++ options.origColor = opt.color; ++ var id = 'collorpicker_' + parseInt(Math.random() * 1000); ++ $(this).data('colorpickerId', id); ++ var cal = $(tpl).attr('id', id); ++ if (options.flat) { ++ cal.appendTo(this).show(); ++ } else { ++ cal.appendTo(document.body); ++ } ++ options.fields = cal ++ .find('input') ++ .bind('keyup', keyDown) ++ .bind('change', change) ++ .bind('blur', blur) ++ .bind('focus', focus); ++ cal ++ .find('span').bind('mousedown', downIncrement).end() ++ .find('>div.colorpicker_current_color').bind('click', restoreOriginal); ++ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); ++ options.selectorIndic = options.selector.find('div div'); ++ options.el = this; ++ options.hue = cal.find('div.colorpicker_hue div'); ++ cal.find('div.colorpicker_hue').bind('mousedown', downHue); ++ options.newColor = cal.find('div.colorpicker_new_color'); ++ options.currentColor = cal.find('div.colorpicker_current_color'); ++ cal.data('colorpicker', options); ++ cal.find('div.colorpicker_submit') ++ .bind('mouseenter', enterSubmit) ++ .bind('mouseleave', leaveSubmit) ++ .bind('click', clickSubmit); ++ fillRGBFields(options.color, cal.get(0)); ++ fillHSBFields(options.color, cal.get(0)); ++ fillHexFields(options.color, cal.get(0)); ++ setHue(options.color, cal.get(0)); ++ setSelector(options.color, cal.get(0)); ++ setCurrentColor(options.color, cal.get(0)); ++ setNewColor(options.color, cal.get(0)); ++ if (options.flat) { ++ cal.css({ ++ position: 'relative', ++ display: 'block' ++ }); ++ } else { ++ $(this).bind(options.eventName, show); ++ } ++ } ++ }); ++ }, ++ showPicker: function() { ++ return this.each( function () { ++ if ($(this).data('colorpickerId')) { ++ show.apply(this); ++ } ++ }); ++ }, ++ hidePicker: function() { ++ return this.each( function () { ++ if ($(this).data('colorpickerId')) { ++ $('#' + $(this).data('colorpickerId')).hide(); ++ } ++ }); ++ }, ++ setColor: function(col) { ++ if (typeof col == 'string') { ++ col = HexToHSB(col); ++ } else if (col.r != undefined && col.g != undefined && col.b != undefined) { ++ col = RGBToHSB(col); ++ } else if (col.h != undefined && col.s != undefined && col.b != undefined) { ++ col = fixHSB(col); ++ } else { ++ return this; ++ } ++ return this.each(function(){ ++ if ($(this).data('colorpickerId')) { ++ var cal = $('#' + $(this).data('colorpickerId')); ++ cal.data('colorpicker').color = col; ++ cal.data('colorpicker').origColor = col; ++ fillRGBFields(col, cal.get(0)); ++ fillHSBFields(col, cal.get(0)); ++ fillHexFields(col, cal.get(0)); ++ setHue(col, cal.get(0)); ++ setSelector(col, cal.get(0)); ++ setCurrentColor(col, cal.get(0)); ++ setNewColor(col, cal.get(0)); ++ } ++ }); ++ } ++ }; ++ }(); ++ $.fn.extend({ ++ ColorPicker: ColorPicker.init, ++ ColorPickerHide: ColorPicker.hidePicker, ++ ColorPickerShow: ColorPicker.showPicker, ++ ColorPickerSetColor: ColorPicker.setColor ++ }); ++})(jQuery) +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/jquery.cookie.js.legal cacti-0.8.8a/include/js/jquery/jquery.cookie.js +--- cacti-0.8.8a/include/js/jquery/jquery.cookie.js.legal 2013-01-04 15:44:38.027416060 -0500 ++++ cacti-0.8.8a/include/js/jquery/jquery.cookie.js 2013-01-04 15:43:12.644377988 -0500 +@@ -0,0 +1,91 @@ ++/*jslint browser: true */ /*global jQuery: true */ ++ ++/** ++ * jQuery Cookie plugin ++ * ++ * Copyright (c) 2010 Klaus Hartl (stilbuero.de) ++ * Dual licensed under the MIT and GPL licenses: ++ * http://www.opensource.org/licenses/mit-license.php ++ * http://www.gnu.org/licenses/gpl.html ++ * ++ */ ++ ++// TODO JsDoc ++ ++/** ++ * Create a cookie with the given key and value and other optional parameters. ++ * ++ * @example $.cookie('the_cookie', 'the_value'); ++ * @desc Set the value of a cookie. ++ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); ++ * @desc Create a cookie with all available options. ++ * @example $.cookie('the_cookie', 'the_value'); ++ * @desc Create a session cookie. ++ * @example $.cookie('the_cookie', null); ++ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain ++ * used when the cookie was set. ++ * ++ * @param String key The key of the cookie. ++ * @param String value The value of the cookie. ++ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. ++ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. ++ * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. ++ * If set to null or omitted, the cookie will be a session cookie and will not be retained ++ * when the the browser exits. ++ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). ++ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). ++ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will ++ * require a secure protocol (like HTTPS). ++ * @type undefined ++ * ++ * @name $.cookie ++ * @cat Plugins/Cookie ++ * @author Klaus Hartl/klaus.hartl@stilbuero.de ++ */ ++ ++/** ++ * Get the value of a cookie with the given key. ++ * ++ * @example $.cookie('the_cookie'); ++ * @desc Get the value of a cookie. ++ * ++ * @param String key The key of the cookie. ++ * @return The value of the cookie. ++ * @type String ++ * ++ * @name $.cookie ++ * @cat Plugins/Cookie ++ * @author Klaus Hartl/klaus.hartl@stilbuero.de ++ */ ++jQuery.cookie = function (key, value, options) { ++ ++ // key and at least value given, set cookie... ++ if (arguments.length > 1 && String(value) !== "[object Object]") { ++ options = jQuery.extend({}, options); ++ ++ if (value === null || value === undefined) { ++ options.expires = -1; ++ } ++ ++ if (typeof options.expires === 'number') { ++ var days = options.expires, t = options.expires = new Date(); ++ t.setDate(t.getDate() + days); ++ } ++ ++ value = String(value); ++ ++ return (document.cookie = [ ++ encodeURIComponent(key), '=', ++ options.raw ? value : encodeURIComponent(value), ++ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE ++ options.path ? '; path=' + options.path : '', ++ options.domain ? '; domain=' + options.domain : '', ++ options.secure ? '; secure' : '' ++ ].join('')); ++ } ++ ++ // key and possibly options given, get cookie... ++ options = value || {}; ++ var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; ++ return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; ++}; +diff -up cacti-0.8.8a/include/js/jquery/jquery.dd.js.legal cacti-0.8.8a/include/js/jquery/jquery.dd.js +--- cacti-0.8.8a/include/js/jquery/jquery.dd.js.legal 2013-01-04 15:44:38.030416069 -0500 ++++ cacti-0.8.8a/include/js/jquery/jquery.dd.js 2013-01-04 15:43:12.644377988 -0500 +@@ -0,0 +1,11 @@ ++// MSDropDown - jquery.dd.js ++// author: Marghoob Suleman - Search me on google ++// Date: 12th Aug, 2009, {18 Dec, 2010 (2.36)} ++// Version: 2.37.5 {date: 17 June, 2011} ++// Revision: 34 ++// web: www.giftlelo.com | www.marghoobsuleman.com ++/* ++// msDropDown is free jQuery Plugin: you can redistribute it and/or modify ++// it under the terms of the either the MIT License or the Gnu General Public License (GPL) Version 2 ++*/ ++;eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(5($){3 1L="";3 3m=5(p,q){3 r=p;3 s=1a;3 q=$.3n({1d:4c,2q:7,3o:23,1U:6,1M:4d,3p:\'28\',1N:15,3q:\'4e\',2I:\'\',1j:\'\'},q);1a.1V=2r 3r();3 u="";3 v={};v.2J=6;v.2s=15;v.2t=1o;3 x=15;3 y={2K:\'4f\',1O:\'4g\',1H:\'4h\',29:\'4i\',1h:\'4j\',2L:\'4k\',2M:\'4l\',4m:\'4n\',2u:\'4o\',3s:\'4p\'};3 z={28:q.3p,2N:\'2N\',2O:\'2O\',2P:\'2P\',1t:\'1t\',1k:.30,2a:\'2a\',2v:\'2v\',2w:\'2w\',11:\'11\'};3 A={3t:"2x,2Q,2R,1P,2y,2z,1u,1B,2A,1Q,4q,1W,2S",18:"1C,1v,1k,4r"};1a.1R=2r 3r();3 B=$(r).18("1b");4(1w(B)=="14"||B.1c<=0){B="4s"+$.1S.3u++;$(r).2B("1b",B)};3 C=$(r).18("1j");q.1j+=(C==14)?"":C;3 D=$(r).3v();x=($(r).18("1C")>1||$(r).18("1v")==6)?6:15;4(x){q.2q=$(r).18("1C")};3 E={};3 F=0;3 G=15;3 H;3 I={};3 J=5(a){4(1w(I[a])=="14"){I[a]=1p.4t(a)}12 I[a]};3 K=5(a){12 B+y[a]};3 L=5(a){3 b=a;3 c=$(b).18("1j");12 c};3 M=5(a){3 b=$("#"+B+" 2T:11");4(b.1c>1){1D(3 i=0;i \'};3 j=$(a).1q();3 k=$(a).4u();3 l=($(a).18("1k")==6)?"1k":"2W";E[g]={1I:h+j,2b:k,1q:j,1i:a.1i,1b:g};3 m=L(a);4(M(a.1i)==6){e+=\'\';e+=h+\'<1x 1r="\'+z.1t+\'">\'+j+\'\';12 e};3 O=5(t){3 b=t.3E();4(b.1c==0)12-1;3 a="";1D(3 i 2c E){3 c=E[i].1q.3E();4(c.3F(0,b.1c)==b){a+="#"+E[i].1b+", "}};12(a=="")?-1:a};3 P=5(){3 f=D;4(f.1c==0)12"";3 g="";3 h=K("2L");3 i=K("2M");f.2X(5(c){3 d=f[c];4(d.4v=="4w"){g+="<1y 1r=\'4x\'>";g+="<1x 1j=\'3G-4y:4z;3G-1j:4A; 4B:4C;\'>"+$(d).18("4D")+"";3 e=$(d).3v();e.2X(5(a){3 b=e[a];g+=N(b,c,a,"2U")});g+=""}19{g+=N(d,c,"","")}});12 g};3 Q=5(){3 a=K("1O");3 b=K("1h");3 c=q.1j;1Y="";1Y+=\'<1y 1b="\'+b+\'" 1r="\'+z.2P+\'"\';4(!x){1Y+=(c!="")?\' 1j="\'+c+\'"\':\'\'}19{1Y+=(c!="")?\' 1j="2C-1m:4E 4F #4G;1s:2d;1n:2Y;\'+c+\'"\':\'\'};1Y+=\'>\';12 1Y};3 R=5(){3 a=K("1H");3 b=K("2u");3 c=K("29");3 d=K("3s");3 e="";3 f="";4(J(B).1E.1c>0){e=$("#"+B+" 2T:11").1q();f=$("#"+B+" 2T:11").18("1X")};f=(f.1c==0||f==14||q.1U==15||q.1N!=15)?"":\'<3x 3y="\'+f+\'" 3z="3A" /> \';3 g=\'<1y 1b="\'+a+\'" 1r="\'+z.2N+\'"\';g+=\'>\';g+=\'<1x 1b="\'+b+\'" 1r="\'+z.2O+\'"><1x 1r="\'+z.1t+\'" 1b="\'+c+\'">\'+f+\'<1x 1r="\'+z.1t+\'">\'+e+\'\';12 g};3 S=5(){3 c=K("1h");$("#"+c+" a.2W").1J("1P");$("#"+c+" a.2W").1e("1P",5(a){a.1Z();V(1a);21();4(!x){$("#"+c).1J("1B");X(15);3 b=(q.1U==15)?$(1a).1q():$(1a).1I();1T(b);s.2e()}})};3 T=5(){3 d=15;3 e=K("1O");3 f=K("1H");3 g=K("29");3 h=K("1h");3 i=K("2u");3 j=$("#"+B).2Z();j=j+2;3 k=q.1j;4($("#"+e).1c>0){$("#"+e).2D();d=6};3 l=\'<1y 1b="\'+e+\'" 1r="\'+z.28+\'"\';l+=(k!="")?\' 1j="\'+k+\'"\':\'\';l+=\'>\';l+=R();l+=Q();l+=P();l+="";l+="";4(d==6){3 m=K("2K");$("#"+m).31(l)}19{$("#"+B).31(l)};4(x){3 f=K("1H");$("#"+f).2f()};$("#"+e).9("2Z",j+"1z");$("#"+h).9("2Z",(j-2)+"1z");4(D.1c>q.2q){3 n=2g($("#"+h+" a:3H").9("2h-3I"))+2g($("#"+h+" a:3H").9("2h-1m"));3 o=((q.3o)*q.2q)-n;$("#"+h).9("1d",o+"1z")}19 4(x){3 o=$("#"+B).1d();$("#"+h).9("1d",o+"1z")};4(d==15){3J();W(B)};4($("#"+B).18("1k")==6){$("#"+e).9("2E",z.1k)};Z();$("#"+f).1e("1B",5(a){32(1)});$("#"+f).1e("1Q",5(a){32(0)});S();$("#"+h+" a.1k").9("2E",z.1k);4(x){$("#"+h).1e("1B",5(c){4(!v.2s){v.2s=6;$(1p).1e("1W",5(a){3 b=a.3K;v.2t=b;4(b==39||b==40){a.1Z();a.2i();33();21()};4(b==37||b==38){a.1Z();a.2i();34();21()}})}})};$("#"+h).1e("1Q",5(a){X(15);$(1p).1J("1W");v.2s=15;v.2t=1o});$("#"+f).1e("1P",5(b){X(15);4($("#"+h+":2j").1c==1){$("#"+h).1J("1B")}19{$("#"+h).1e("1B",5(a){X(6)});s.3L()}});$("#"+f).1e("1Q",5(a){X(15)});4(q.1U&&q.1N!=15){2k()}};3 U=5(a){1D(3 i 2c E){4(E[i].1i==a){12 E[i]}};12-1};3 V=5(a){3 b=K("1h");4($("#"+b+" a."+z.11).1c==1){u=$("#"+b+" a."+z.11).1q()};4(!x){$("#"+b+" a."+z.11).1K(z.11)};3 c=$("#"+b+" a."+z.11).18("1b");4(c!=14){3 d=(v.22==14||v.22==1o)?E[c].1i:v.22};4(a&&!x){$(a).1F(z.11)};4(x){3 e=v.2t;4($("#"+B).18("1v")==6){4(e==17){v.22=E[$(a).18("1b")].1i;$(a).4H(z.11)}19 4(e==16){$("#"+b+" a."+z.11).1K(z.11);$(a).1F(z.11);3 f=$(a).18("1b");3 g=E[f].1i;1D(3 i=35.4I(d,g);i<=35.4J(d,g);i++){$("#"+U(i).1b).1F(z.11)}}19{$("#"+b+" a."+z.11).1K(z.11);$(a).1F(z.11);v.22=E[$(a).18("1b")].1i}}19{$("#"+b+" a."+z.11).1K(z.11);$(a).1F(z.11);v.22=E[$(a).18("1b")].1i}}};3 W=5(a){3 b=a;J(b).4K=5(e){$("#"+b).1S(q)}};3 X=5(a){v.2J=a};3 Y=5(){12 v.2J};3 Z=5(){3 b=K("1O");3 c=A.3t.4L(",");1D(3 d=0;d");$("#"+B).4N($("#"+a))};3 1T=5(a){3 b=K("29");$("#"+b).1I(a)};3 3a=5(w){3 a=w;3 b=K("1h");3 c=$("#"+b+" a:2j");3 d=c.1c;3 e=$("#"+b+" a:2j").1i($("#"+b+" a.11:2j"));3 f;2F(a){1f"3b":4(e0){e--;f=c[e]};1g};4(1w(f)=="14"){12 15};$("#"+b+" a."+z.11).1K(z.11);$(f).1F(z.11);3 g=f.1b;4(!x){3 h=(q.1U==15)?E[g].1q:$("#"+g).1I();1T(h);2k(E[g].1i)};4(a=="3b"){4(2g(($("#"+g).1n().1m+$("#"+g).1d()))>=2g($("#"+b).1d())){$("#"+b).2l(($("#"+b).2l())+$("#"+g).1d()+$("#"+g).1d())}}19{4(2g(($("#"+g).1n().1m+$("#"+g).1d()))<=0){$("#"+b).2l(($("#"+b).2l()-$("#"+b).1d())-$("#"+g).1d())}}};3 33=5(){3a("3b")};3 34=5(){3a("3P")};3 2k=5(i){4(q.1N!=15){3 a=K("29");3 b=(1w(i)=="14")?J(B).1l:i;3 c=J(B).1E[b].3w;4(c.1c>0){3 d=K("1h");3 e=$("#"+d+" a."+c).18("1b");3 f=$("#"+e).9("2m-4O");3 g=$("#"+e).9("2m-1n");3 h=$("#"+e).9("2h-3Q");4(f!=14){$("#"+a).2n("."+z.1t).2B(\'1j\',"2m:"+f)};4(g!=14){$("#"+a).2n("."+z.1t).9(\'2m-1n\',g)};4(h!=14){$("#"+a).2n("."+z.1t).9(\'2h-3Q\',h)};$("#"+a).2n("."+z.1t).9(\'2m-3R\',\'4P-3R\');$("#"+a).2n("."+z.1t).9(\'2h-3I\',\'4Q\')}}};3 21=5(){3 a=K("1h");3 b=$("#"+a+" a."+z.11);4(b.1c==1){3 c=$("#"+a+" a."+z.11).1q();3 d=$("#"+a+" a."+z.11).18("1b");4(d!=14){3 e=E[d].2b;J(B).1l=E[d].1i};4(q.1U&&q.1N!=15)2k()}19 4(b.1c>1){1D(3 i=0;i46){f+=4W.4X(b)};3 c=O(f);4(c!=-1){$("#"+e).9({1d:\'4Y\'});$("#"+e+" a").2f();$(c).25();3 d=2G();$("#"+e).9(d.9);$("#"+e).9({1s:\'2d\'})}19{$("#"+e+" a").25();$("#"+e).9({1d:H+\'1z\'})};1g};4(24("1W")==6){J(B).4Z()}});$(1p).1e("2S",5(a){4($("#"+B).18("45")!=14){J(B).45()}});$(1p).1e("1u",5(a){4(Y()==15){s.2e()}});3 g=2G();$("#"+e).9(g.9);4(g.3d==6){$("#"+e).9({1s:\'2d\'});$("#"+e).1F(g.2C);3e()}19{$("#"+e)[g.3Z]("3g",5(){$("#"+e).1F(g.2C);3e()})};4(e!=1L){1L=e}}};1a.2e=5(){3 b=K("1h");3 c=$("#"+K("1H")).1n().1m;3 d=2G();G=15;4(d.3d==6){$("#"+b).50({1d:0,1m:c},5(){$("#"+b).9({1d:H+\'1z\',1s:\'2o\'});3f()})}19{$("#"+b).43("3g",5(a){3f();$("#"+b).9({1M:\'0\'});$("#"+b).9({1d:H+\'1z\'})})};2k();$(1p).1J("1W");$(1p).1J("2S");$(1p).1J("1u")};1a.1l=5(i){4(1w(i)=="14"){12 s.26("1l")}19{s.1A("1l",i)}};1a.51=5(a){4(1w(a)=="14"||a==6){$("."+z.2a).52("1j")}19{$("."+z.2a).2B("1j","1d:3M;3N:3O;1n:36")}};1a.1A=5(a,b,c){4(a==14||b==14)47{48:"1A 53 54?"};s.1V[a]=b;4(c!=6){2F(a){1f"1l":3W(a,b);1g;1f"1k":s.1k(b,6);1g;1f"1v":J(B)[a]=b;x=($(r).18("1C")>0||$(r).18("1v")==6)?6:15;4(x){3 d=$("#"+B).1d();3 f=K("1h");$("#"+f).9("1d",d+"1z");3 g=K("1H");$("#"+g).2f();3 f=K("1h");$("#"+f).9({1s:\'2d\',1n:\'2Y\'});S()};1g;1f"1C":J(B)[a]=b;4(b==0){J(B).1v=15};x=($(r).18("1C")>0||$(r).18("1v")==6)?6:15;4(b==0){3 g=K("1H");$("#"+g).25();3 f=K("1h");$("#"+f).9({1s:\'2o\',1n:\'36\'});3 h="";4(J(B).1l>=0){3 i=U(J(B).1l);h=i.1I;V($("#"+i.1b))};1T(h)}19{3 g=K("1H");$("#"+g).2f();3 f=K("1h");$("#"+f).9({1s:\'2d\',1n:\'2Y\'})};1g;44:55{J(B)[a]=b}56(e){};1g}}};1a.26=5(a,b){4(a==14&&b==14){12 s.1V};4(a!=14&&b==14){12(s.1V[a]!=14)?s.1V[a]:1o};4(a!=14&&b!=14){12 J(B)[a]}};1a.2j=5(a){3 b=K("1O");4(a==6){$("#"+b).25()}19 4(a==15){$("#"+b).2f()}19{12 $("#"+b).9("1s")}};1a.57=5(a,b){3 c=a;3 d=c.1q;3 e=(c.2b==14||c.2b==1o)?d:c.2b;3 f=(c["1X"]==14||c["1X"]==1o)?\'\':c["1X"];3 i=(b==14||b==1o)?J(B).1E.1c:b;J(B).1E[i]=2r 58(d,e);4(f!=\'\')J(B).1E[i]["1X"]=f;3 g=U(i);4(g!=-1){3 h=N(J(B).1E[i],i,"","");$("#"+g.1b).1I(h)}19{3 h=N(J(B).1E[i],i,"","");3 j=K("1h");$("#"+j).59(h);S()}};1a.2D=5(i){J(B).2D(i);4((U(i))!=-1){$("#"+U(i).1b).2D();3X(i,\'d\')};4(J(B).1c==0){1T("")}19{3 a=U(J(B).1l).1I;1T(a)};s.1A("1l",J(B).1l)};1a.1k=5(a,b){J(B).1k=a;3 c=K("1O");4(a==6){$("#"+c).9("2E",z.1k);s.2e()}19 4(a==15){$("#"+c).9("2E",1)};4(b!=6){s.1A("1k",a)}};1a.3h=5(){12(J(B).3h==14)?1o:J(B).3h};1a.3i=5(){4(2p.1c==1){12 J(B).3i(2p[0])}19 4(2p.1c==2){12 J(B).3i(2p[0],2p[1])}19{47{48:"5a 1i 5b 5c!"}}};1a.49=5(a){12 J(B).49(a)};1a.1v=5(a){4(1w(a)=="14"){12 s.26("1v")}19{s.1A("1v",a)}};1a.1C=5(a){4(1w(a)=="14"){12 s.26("1C")}19{s.1A("1C",a)}};1a.5d=5(a,b){s.1R[a]=b};1a.5e=5(a){2H(s.1R[a])(s)};3 4a=5(){s.1A("3j",$.1S.3j);s.1A("3k",$.1S.3k)};3 4b=5(){T();3V();4a();4(q.2I!=\'\'){2H(q.2I)(s)}};4b()};$.1S={3j:2.37,3k:"5f 5g",3u:20,5h:5(a,b){12 $(a).1S(b).3c("28")}};$.3l.3n({1S:5(b){12 1a.2X(5(){3 a=2r 3m(1a,b);$(1a).3c(\'28\',a)})}});4(1w($.3l.18)==\'14\'){$.3l.18=5(w){12 $(1a).2B(w)}}})(5i);',62,329,'|||var|if|function|true|||css||||||||||||||||||||||||||||||||||||||||||||||||||||||selected|return||undefined|false|||prop|else|this|id|length|height|bind|case|break|postChildID|index|style|disabled|selectedIndex|top|position|null|document|text|class|display|ddTitleText|mouseup|multiple|typeof|span|div|px|set|mouseover|size|for|options|addClass|trigger|postTitleID|html|unbind|removeClass|bs|zIndex|useSprite|postID|click|mouseout|onActions|msDropDown|bv|showIcon|ddProp|keydown|title|sDiv|preventDefault||bA|oldIndex||bB|show|get||dd|postTitleTextID|ddOutOfVision|value|in|block|close|hide|parseInt|padding|stopPropagation|visible|bz|scrollTop|background|find|none|arguments|visibleRows|new|keyboardAction|currentKey|postArrowID|borderTop|noBorderTop|focus|dblclick|mousedown|mousemove|attr|border|remove|opacity|switch|bH|eval|onInit|insideWindow|postElementHolder|postAID|postOPTAID|ddTitle|arrow|ddChild|blur|change|keyup|option|opt|_|enabled|each|relative|width||after|bD|bx|by|Math|absolute||||bw|next|data|opp|bI|bJ|fast|form|item|version|author|fn|bt|extend|rowHeight|mainCSS|animStyle|Object|postInputhidden|actions|counter|children|className|img|src|align|absmiddle|href|javascript|void|toLowerCase|substr|font|first|bottom|bu|keyCode|open|0px|overflow|hidden|previous|left|repeat|bC|trim|backgroundPosition|bE|bF|bG|window|ani||onOpen|onClose|slideUp|default|onkeyup||throw|message|namedItem|bK|bL|120|9999|slideDown|_msddHolder|_msdd|_title|_titletext|_child|_msa|_msopta|postInputID|_msinput|_arrow|_inp|keypress|tabindex|msdrpdd|getElementById|val|nodeName|OPTGROUP|opta|weight|bold|italic|clear|both|label|1px|solid|c3c3c3|toggleClass|min|max|refresh|split|mouseenter|appendTo|image|no|2px|on|events|100|delete|floor|String|fromCharCode|auto|onkeydown|animate|debug|removeAttr|to|what|try|catch|add|Option|append|An|is|required|addMyEvent|fireEvent|Marghoob|Suleman|create|jQuery'.split('|'),0,{})) +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/jquery.dropdown.js.legal cacti-0.8.8a/include/js/jquery/jquery.dropdown.js +--- cacti-0.8.8a/include/js/jquery/jquery.dropdown.js.legal 2013-01-04 15:44:38.032416068 -0500 ++++ cacti-0.8.8a/include/js/jquery/jquery.dropdown.js 2013-01-04 15:43:12.644377988 -0500 +@@ -0,0 +1,227 @@ ++/* ++ +-------------------------------------------------------------------------+ ++ | Copyright (C) 2004-2013 The Cacti Group | ++ | | ++ | This program 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 2 | ++ | 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. | ++ +-------------------------------------------------------------------------+ ++ | Cacti: The Complete RRDTool-based Graphing Solution | ++ +-------------------------------------------------------------------------+ ++ | This code is designed, written, and maintained by the Cacti Group. See | ++ | about.php and/or the AUTHORS file for specific developer information. | ++ +-------------------------------------------------------------------------+ ++ | http://www.cacti.net/ | ++ +-------------------------------------------------------------------------+ ++*/ ++ ++(function($){ ++ $.fn.DropDownMenu = function(options) { ++ ++ var defaults = { ++ title: false, ++ subtitle: false, ++ name: 'myName', ++ maxHeight: 300, ++ width: 'auto', ++ timeout: 500, ++ auto_close: 10000, ++ html: '
empty
', ++ offsetX: 0, ++ offsetY: 0, ++ simultaneous: false, ++ textAlign: 'left' ++ }; ++ ++ var timerref = null; ++ var menu = null; ++ var menuHeight = 0; ++ var options = $.extend(defaults, options); ++ var contentHeight = 0; ++ ++ /* do nothing if requested menu is still loaded */ ++ if($('#' + options.name).is(":visible")) { return; } ++ ++ /* remove all open menus from DOM if they should not stay in front at the same time */ ++ var oldMenus = $(".cacti_dd_menu"); ++ if(options.simultaneous == false) { ++ oldMenus.css({'overflow-y':'hidden'}).slideUp('200'); ++ oldMenus.queue(function () { ++ oldMenus.remove(); ++ oldMenus.dequeue(); ++ }); ++ } ++ ++ return this.each(function() { ++ obj = $(this); ++ newMenu = _init_menu(obj); ++ _open_menu(newMenu); ++ }); ++ ++ function _init_menu(initiator){ ++ /* create the main menu structure */ ++ $("").appendTo("body"); ++ ++ /* define references to the menu and its different sections */ ++ menu = $('#' + options.name); ++ menu_head = $('#' + options.name + '_title'); ++ menu_content = $('#' + options.name + '_content'); ++ menu_back = $('#' + options.name + '_back'); ++ menu_subhead = $('#' + options.name + '_subtitle'); ++ menu_html = $('#' + options.name + '_html'); ++ ++ /* while div container "myName_html" holds the raw data ... */ ++ menu_html.append(options.html); ++ i=1; ++ menu_html.find("h6:has(div)").each(function() { ++ var subMenu = $(this); ++ var subMenuClass = options.name + '_' + i; ++ var subMenuTitle = subMenu.find('a:first').html(); ++ subMenu.addClass(subMenuClass); ++ $('.'+subMenuClass).die().live("click", function(){ _switch_layer( subMenuClass); } ); ++ subMenu.children("div").hide(); ++ subMenu.find('a:first').html('' + subMenuTitle + ''); ++ i++; ++ }); ++ ++ /* ... "myName_content" will have the visible menu data */ ++ menu_content.append(menu_html.html()); ++ ++ /* if necessary show title, subtitle ... */ ++ if(options.title !== false) { menu_head.show(); } ++ if(options.subtitle !== false) { menu_subhead.show(); } ++ ++ /* make content visible */ ++ menu_content.show(); ++ ++ /* reduce height to a minimum for best fit */ ++ menuHeight = (menu.outerHeight() > options.maxHeight) ? options.maxHeight : menu.outerHeight(); ++ ++ /* set the width to a fixed value */ ++ if(!isNaN(parseInt(options.width))) { ++ menu.css({ ++ 'min-width' : options.width + 'px', ++ 'max-width' : options.width + 'px' ++ }); ++ menu.width(options.width); ++ }else { ++ // use real width plus 15 percent ++ var width = menu.outerWidth(true)*1.15; ++ menu.css({ ++ 'min-width' : width + 'px', ++ 'max-width' : width + 'px' ++ }); ++ menu.width(width); ++ } ++ ++ /* default position of the menu container */ ++ menu.css({ ++ // x-position in relation to the initiator ++ 'left' : initiator.offset().left + options.offsetX + 'px', ++ // y-position in relation to the initiator ++ 'top' : initiator.offset().top + initiator.height() + options.offsetY + 'px' ++ }); ++ ++ /* change the orientation from right to left if width exceeds the windows size */ ++ if((initiator.offset().left + initiator.width() + options.offsetX + menu.outerWidth(true)) > $(window).width()) { ++ menu.css({'left' : (initiator.offset().left + initiator.width() - menu.outerWidth(true)) + 'px'}); ++ } ++ ++ menu.css({'height':0, 'text-align':options.textAlign}); ++ menu.bind('mouseover', _cancel_timer); ++ menu.bind('mouseout', _set_timer); ++ return menu; ++ } ++ ++ ++ function _switch_layer(subMenuClass){ ++ if(subMenuClass == null) { ++ var content = menu_html; ++ menu_back.empty().hide(); ++ menu_content.height(contentHeight); ++ }else { ++ var content = menu_html.find('.' + subMenuClass + ' div:first'); ++ menu_back.show(); ++ } ++ ++ parentClass = menu_html.find('.' + subMenuClass).parents('h6').attr('class'); ++ ++ menu_back.empty().append( menu_html.find('.' + subMenuClass + ' a:first').html() ); ++ menu_back.find('span:last').removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s'); ++ menu_back.unbind('click').click( function() { _switch_layer( parentClass); }); ++ ++ menu_content.empty().append(content.html()); ++ ++ /* re-calculate content height */ ++ if(subMenuClass != null) { ++ menu_head_height = menu_head.is(":visible") ? menu_head.outerHeight() : 0; ++ menu_back_height = menu_back.is(":visible") ? menu_back.outerHeight() : 0; ++ menu_subhead_height = menu_subhead.is(":visible") ? menu_subhead.outerHeight() : 0; ++ ++ menu_content.height(menuHeight - menu_head_height - menu_back_height - menu_subhead_height); ++ } ++ ++ /* return false to suppress unwanted click events*/ ++ return false; ++ } ++ ++ function _set_timer(timer){ ++ timer = ( typeof(timer) != 'number' ) ? options.timeout : timer; ++ timerref = window.setTimeout( _close_menu, timer); ++ } ++ ++ function _cancel_timer() { ++ if(timerref) { ++ window.clearTimeout(timerref); ++ timerref = null; ++ } ++ } ++ ++ function _close_menu(){ ++ menu = $('#' + options.name); ++ menu.slideUp(menuHeight*3); ++ menu.queue(function () { ++ menu.remove(); ++ menu.dequeue(); ++ }); ++ } ++ ++ function _open_menu(obj){ ++ //wait until oldMenu is completey closed before opening a new one ++ var wait = setInterval(function() { ++ if( !oldMenus.is(":animated") ) { ++ clearInterval(wait); ++ obj.show().animate({height: menuHeight}, menuHeight*3); ++ ++ //setup contentHeight; ++ menu_head_height = menu_head.is(":visible") ? menu_head.outerHeight() : 0; ++ menu_back_height = menu_back.is(":visible") ? menu_back.outerHeight() : 0; ++ menu_subhead_height = menu_subhead.is(":visible") ? menu_subhead.outerHeight() : 0; ++ ++ menu_content.height(menuHeight - menu_head_height - menu_back_height - menu_subhead_height); ++ ++ contentHeight = $('#' + options.name + '_content').height(); ++ $('#' + options.name + '_content').css({'overflow-y':'auto'}); ++ ++ obj.find('h6').eq(0).focus(); ++ if(options.auto_close !== false) { ++ _set_timer(options.auto_close); ++ } ++ } ++ }, 200); ++ } ++ ++ }; ++})(jQuery); +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/jquery.js.legal cacti-0.8.8a/include/js/jquery/jquery.js +--- cacti-0.8.8a/include/js/jquery/jquery.js.legal 2013-01-04 15:44:38.035416071 -0500 ++++ cacti-0.8.8a/include/js/jquery/jquery.js 2013-01-04 15:43:12.644377988 -0500 +@@ -0,0 +1,4 @@ ++/*! jQuery v1.7.1 jquery.com | jquery.org/license */ ++(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; ++f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() ++{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/jquery.jstree.js.legal cacti-0.8.8a/include/js/jquery/jquery.jstree.js +--- cacti-0.8.8a/include/js/jquery/jquery.jstree.js.legal 2013-01-04 15:44:38.036416073 -0500 ++++ cacti-0.8.8a/include/js/jquery/jquery.jstree.js 2013-01-04 15:43:12.645377988 -0500 +@@ -0,0 +1,4551 @@ ++/* ++ * jsTree 1.0-rc3 ++ * http://jstree.com/ ++ * ++ * Copyright (c) 2010 Ivan Bozhanov (vakata.com) ++ * ++ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License ++ * http://www.opensource.org/licenses/mit-license.php ++ * http://www.gnu.org/licenses/gpl.html ++ * ++ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $ ++ * $Revision: 236 $ ++ */ ++ ++/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */ ++/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/ ++ ++"use strict"; ++ ++// top wrapper to prevent multiple inclusion (is this OK?) ++(function () { if(jQuery && jQuery.jstree) { return; } ++ var is_ie6 = false, is_ie7 = false, is_ff2 = false; ++ ++/* ++ * jsTree core ++ */ ++(function ($) { ++ // Common functions not related to jsTree ++ // decided to move them to a `vakata` "namespace" ++ $.vakata = {}; ++ // CSS related functions ++ $.vakata.css = { ++ get_css : function(rule_name, delete_flag, sheet) { ++ rule_name = rule_name.toLowerCase(); ++ var css_rules = sheet.cssRules || sheet.rules, ++ j = 0; ++ do { ++ if(css_rules.length && j > css_rules.length + 5) { return false; } ++ if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) { ++ if(delete_flag === true) { ++ if(sheet.removeRule) { sheet.removeRule(j); } ++ if(sheet.deleteRule) { sheet.deleteRule(j); } ++ return true; ++ } ++ else { return css_rules[j]; } ++ } ++ } ++ while (css_rules[++j]); ++ return false; ++ }, ++ add_css : function(rule_name, sheet) { ++ if($.jstree.css.get_css(rule_name, false, sheet)) { return false; } ++ if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); } ++ return $.vakata.css.get_css(rule_name); ++ }, ++ remove_css : function(rule_name, sheet) { ++ return $.vakata.css.get_css(rule_name, true, sheet); ++ }, ++ add_sheet : function(opts) { ++ var tmp = false, is_new = true; ++ if(opts.str) { ++ if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; } ++ if(tmp) { is_new = false; } ++ else { ++ tmp = document.createElement("style"); ++ tmp.setAttribute('type',"text/css"); ++ if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); } ++ } ++ if(tmp.styleSheet) { ++ if(is_new) { ++ document.getElementsByTagName("head")[0].appendChild(tmp); ++ tmp.styleSheet.cssText = opts.str; ++ } ++ else { ++ tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str; ++ } ++ } ++ else { ++ tmp.appendChild(document.createTextNode(opts.str)); ++ document.getElementsByTagName("head")[0].appendChild(tmp); ++ } ++ return tmp.sheet || tmp.styleSheet; ++ } ++ if(opts.url) { ++ if(document.createStyleSheet) { ++ try { tmp = document.createStyleSheet(opts.url); } catch (e) { } ++ } ++ else { ++ tmp = document.createElement('link'); ++ tmp.rel = 'stylesheet'; ++ tmp.type = 'text/css'; ++ tmp.media = "all"; ++ tmp.href = opts.url; ++ document.getElementsByTagName("head")[0].appendChild(tmp); ++ return tmp.styleSheet; ++ } ++ } ++ } ++ }; ++ ++ // private variables ++ var instances = [], // instance array (used by $.jstree.reference/create/focused) ++ focused_instance = -1, // the index in the instance array of the currently focused instance ++ plugins = {}, // list of included plugins ++ prepared_move = {}; // for the move_node function ++ ++ // jQuery plugin wrapper (thanks to jquery UI widget function) ++ $.fn.jstree = function (settings) { ++ var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node") ++ args = Array.prototype.slice.call(arguments, 1), ++ returnValue = this; ++ ++ // if a method call execute the method on all selected instances ++ if(isMethodCall) { ++ if(settings.substring(0, 1) == '_') { return returnValue; } ++ this.each(function() { ++ var instance = instances[$.data(this, "jstree_instance_id")], ++ methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance; ++ if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; } ++ }); ++ } ++ else { ++ this.each(function() { ++ // extend settings and allow for multiple hashes and $.data ++ var instance_id = $.data(this, "jstree_instance_id"), ++ a = [], ++ b = settings ? $.extend({}, true, settings) : {}, ++ c = $(this), ++ s = false, ++ t = []; ++ a = a.concat(args); ++ if(c.data("jstree")) { a.push(c.data("jstree")); } ++ b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b; ++ ++ // if an instance already exists, destroy it first ++ if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); } ++ // push a new empty object to the instances array ++ instance_id = parseInt(instances.push({}),10) - 1; ++ // store the jstree instance id to the container element ++ $.data(this, "jstree_instance_id", instance_id); ++ // clean up all plugins ++ b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice(); ++ b.plugins.unshift("core"); ++ // only unique plugins ++ b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","); ++ ++ // extend defaults with passed data ++ s = $.extend(true, {}, $.jstree.defaults, b); ++ s.plugins = b.plugins; ++ $.each(plugins, function (i, val) { ++ if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; } ++ else { t.push(i); } ++ }); ++ s.plugins = t; ++ ++ // push the new object to the instances array (at the same time set the default classes to the container) and init ++ instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s); ++ // init all activated plugins for this instance ++ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; }); ++ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } }); ++ // initialize the instance ++ setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0); ++ }); ++ } ++ // return the jquery selection (or if it was a method call that returned a value - the returned value) ++ return returnValue; ++ }; ++ // object to store exposed functions and objects ++ $.jstree = { ++ defaults : { ++ plugins : [] ++ }, ++ _focused : function () { return instances[focused_instance] || null; }, ++ _reference : function (needle) { ++ // get by instance id ++ if(instances[needle]) { return instances[needle]; } ++ // get by DOM (if still no luck - return null ++ var o = $(needle); ++ if(!o.length && typeof needle === "string") { o = $("#" + needle); } ++ if(!o.length) { return null; } ++ return instances[o.closest(".jstree").data("jstree_instance_id")] || null; ++ }, ++ _instance : function (index, container, settings) { ++ // for plugins to store data in ++ this.data = { core : {} }; ++ this.get_settings = function () { return $.extend(true, {}, settings); }; ++ this._get_settings = function () { return settings; }; ++ this.get_index = function () { return index; }; ++ this.get_container = function () { return container; }; ++ this.get_container_ul = function () { return container.children("ul:eq(0)"); }; ++ this._set_settings = function (s) { ++ settings = $.extend(true, {}, settings, s); ++ }; ++ }, ++ _fn : { }, ++ plugin : function (pname, pdata) { ++ pdata = $.extend({}, { ++ __init : $.noop, ++ __destroy : $.noop, ++ _fn : {}, ++ defaults : false ++ }, pdata); ++ plugins[pname] = pdata; ++ ++ $.jstree.defaults[pname] = pdata.defaults; ++ $.each(pdata._fn, function (i, val) { ++ val.plugin = pname; ++ val.old = $.jstree._fn[i]; ++ $.jstree._fn[i] = function () { ++ var rslt, ++ func = val, ++ args = Array.prototype.slice.call(arguments), ++ evnt = new $.Event("before.jstree"), ++ rlbk = false; ++ ++ if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; } ++ ++ // Check if function belongs to the included plugins of this instance ++ do { ++ if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; } ++ func = func.old; ++ } while(func); ++ if(!func) { return; } ++ ++ // context and function to trigger events, then finally call the function ++ if(i.indexOf("_") === 0) { ++ rslt = func.apply(this, args); ++ } ++ else { ++ rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin }); ++ if(rslt === false) { return; } ++ if(typeof rslt !== "undefined") { args = rslt; } ++ ++ rslt = func.apply( ++ $.extend({}, this, { ++ __callback : function (data) { ++ this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk }); ++ }, ++ __rollback : function () { ++ rlbk = this.get_rollback(); ++ return rlbk; ++ }, ++ __call_old : function (replace_arguments) { ++ return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) ); ++ } ++ }), args); ++ } ++ ++ // return the result ++ return rslt; ++ }; ++ $.jstree._fn[i].old = val.old; ++ $.jstree._fn[i].plugin = pname; ++ }); ++ }, ++ rollback : function (rb) { ++ if(rb) { ++ if(!$.isArray(rb)) { rb = [ rb ]; } ++ $.each(rb, function (i, val) { ++ instances[val.i].set_rollback(val.h, val.d); ++ }); ++ } ++ } ++ }; ++ // set the prototype for all instances ++ $.jstree._fn = $.jstree._instance.prototype = {}; ++ ++ // load the css when DOM is ready ++ $(function() { ++ // code is copied from jQuery ($.browser is deprecated + there is a bug in IE) ++ var u = navigator.userAgent.toLowerCase(), ++ v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], ++ css_string = '' + ++ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' + ++ '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' + ++ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' + ++ '.jstree > ul > li { margin-left:0px; } ' + ++ '.jstree-rtl > ul > li { margin-right:0px; } ' + ++ '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' + ++ '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' + ++ '.jstree a:focus { outline: none; } ' + ++ '.jstree a > ins { height:16px; width:16px; } ' + ++ '.jstree a > .jstree-icon { margin-right:3px; } ' + ++ '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' + ++ 'li.jstree-open > ul { display:block; } ' + ++ 'li.jstree-closed > ul { display:none; } '; ++ // Correct IE 6 (does not support the > CSS selector) ++ if(/msie/.test(u) && parseInt(v, 10) == 6) { ++ is_ie6 = true; ++ ++ // fix image flicker and lack of caching ++ try { ++ document.execCommand("BackgroundImageCache", false, true); ++ } catch (err) { } ++ ++ css_string += '' + ++ '.jstree li { height:18px; margin-left:0; margin-right:0; } ' + ++ '.jstree li li { margin-left:18px; } ' + ++ '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' + ++ 'li.jstree-open ul { display:block; } ' + ++ 'li.jstree-closed ul { display:none !important; } ' + ++ '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' + ++ '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' + ++ '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } '; ++ } ++ // Correct IE 7 (shifts anchor nodes onhover) ++ if(/msie/.test(u) && parseInt(v, 10) == 7) { ++ is_ie7 = true; ++ css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } '; ++ } ++ // correct ff2 lack of display:inline-block ++ if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) { ++ is_ff2 = true; ++ css_string += '' + ++ '.jstree ins { display:-moz-inline-box; } ' + ++ '.jstree li { line-height:12px; } ' + // WHY?? ++ '.jstree a { display:-moz-inline-box; } ' + ++ '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } '; ++ /* this shouldn't be here as it is theme specific */ ++ } ++ // the default stylesheet ++ $.vakata.css.add_sheet({ str : css_string, title : "jstree" }); ++ }); ++ ++ // core functions (open, close, create, update, delete) ++ $.jstree.plugin("core", { ++ __init : function () { ++ this.data.core.locked = false; ++ this.data.core.to_open = this.get_settings().core.initially_open; ++ this.data.core.to_load = this.get_settings().core.initially_load; ++ }, ++ defaults : { ++ html_titles : false, ++ animation : 500, ++ initially_open : [], ++ initially_load : [], ++ open_parents : true, ++ notify_plugins : true, ++ rtl : false, ++ load_open : false, ++ strings : { ++ loading : "Loading ...", ++ new_node : "New node", ++ multiple_selection : "Multiple selection" ++ } ++ }, ++ _fn : { ++ init : function () { ++ this.set_focus(); ++ if(this._get_settings().core.rtl) { ++ this.get_container().addClass("jstree-rtl").css("direction", "rtl"); ++ } ++ this.get_container().html(""); ++ this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18; ++ ++ this.get_container() ++ .delegate("li > ins", "click.jstree", $.proxy(function (event) { ++ var trgt = $(event.target); ++ // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); } ++ this.toggle_node(trgt); ++ }, this)) ++ .bind("mousedown.jstree", $.proxy(function () { ++ this.set_focus(); // This used to be setTimeout(set_focus,0) - why? ++ }, this)) ++ .bind("dblclick.jstree", function (event) { ++ var sel; ++ if(document.selection && document.selection.empty) { document.selection.empty(); } ++ else { ++ if(window.getSelection) { ++ sel = window.getSelection(); ++ try { ++ sel.removeAllRanges(); ++ sel.collapse(); ++ } catch (err) { } ++ } ++ } ++ }); ++ if(this._get_settings().core.notify_plugins) { ++ this.get_container() ++ .bind("load_node.jstree", $.proxy(function (e, data) { ++ var o = this._get_node(data.rslt.obj), ++ t = this; ++ if(o === -1) { o = this.get_container_ul(); } ++ if(!o.length) { return; } ++ o.find("li").each(function () { ++ var th = $(this); ++ if(th.data("jstree")) { ++ $.each(th.data("jstree"), function (plugin, values) { ++ if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) { ++ t["_" + plugin + "_notify"].call(t, th, values); ++ } ++ }); ++ } ++ }); ++ }, this)); ++ } ++ if(this._get_settings().core.load_open) { ++ this.get_container() ++ .bind("load_node.jstree", $.proxy(function (e, data) { ++ var o = this._get_node(data.rslt.obj), ++ t = this; ++ if(o === -1) { o = this.get_container_ul(); } ++ if(!o.length) { return; } ++ o.find("li.jstree-open:not(:has(ul))").each(function () { ++ t.load_node(this, $.noop, $.noop); ++ }); ++ }, this)); ++ } ++ this.__callback(); ++ this.load_node(-1, function () { this.loaded(); this.reload_nodes(); }); ++ }, ++ destroy : function () { ++ var i, ++ n = this.get_index(), ++ s = this._get_settings(), ++ _this = this; ++ ++ $.each(s.plugins, function (i, val) { ++ try { plugins[val].__destroy.apply(_this); } catch(err) { } ++ }); ++ this.__callback(); ++ // set focus to another instance if this one is focused ++ if(this.is_focused()) { ++ for(i in instances) { ++ if(instances.hasOwnProperty(i) && i != n) { ++ instances[i].set_focus(); ++ break; ++ } ++ } ++ } ++ // if no other instance found ++ if(n === focused_instance) { focused_instance = -1; } ++ // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events ++ this.get_container() ++ .unbind(".jstree") ++ .undelegate(".jstree") ++ .removeData("jstree_instance_id") ++ .find("[class^='jstree']") ++ .andSelf() ++ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); ++ $(document) ++ .unbind(".jstree-" + n) ++ .undelegate(".jstree-" + n); ++ // remove the actual data ++ instances[n] = null; ++ delete instances[n]; ++ }, ++ ++ _core_notify : function (n, data) { ++ if(data.opened) { ++ this.open_node(n, false, true); ++ } ++ }, ++ ++ lock : function () { ++ this.data.core.locked = true; ++ this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7"); ++ this.__callback({}); ++ }, ++ unlock : function () { ++ this.data.core.locked = false; ++ this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1"); ++ this.__callback({}); ++ }, ++ is_locked : function () { return this.data.core.locked; }, ++ save_opened : function () { ++ var _this = this; ++ this.data.core.to_open = []; ++ this.get_container_ul().find("li.jstree-open").each(function () { ++ if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } ++ }); ++ this.__callback(_this.data.core.to_open); ++ }, ++ save_loaded : function () { }, ++ reload_nodes : function (is_callback) { ++ var _this = this, ++ done = true, ++ current = [], ++ remaining = []; ++ if(!is_callback) { ++ this.data.core.reopen = false; ++ this.data.core.refreshing = true; ++ this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); ++ this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); ++ if(this.data.core.to_open.length) { ++ this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open); ++ } ++ } ++ if(this.data.core.to_load.length) { ++ $.each(this.data.core.to_load, function (i, val) { ++ if(val == "#") { return true; } ++ if($(val).length) { current.push(val); } ++ else { remaining.push(val); } ++ }); ++ if(current.length) { ++ this.data.core.to_load = remaining; ++ $.each(current, function (i, val) { ++ if(!_this._is_loaded(val)) { ++ _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); }); ++ done = false; ++ } ++ }); ++ } ++ } ++ if(this.data.core.to_open.length) { ++ $.each(this.data.core.to_open, function (i, val) { ++ _this.open_node(val, false, true); ++ }); ++ } ++ if(done) { ++ // TODO: find a more elegant approach to syncronizing returning requests ++ if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); } ++ this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50); ++ this.data.core.refreshing = false; ++ this.reopen(); ++ } ++ }, ++ reopen : function () { ++ var _this = this; ++ if(this.data.core.to_open.length) { ++ $.each(this.data.core.to_open, function (i, val) { ++ _this.open_node(val, false, true); ++ }); ++ } ++ this.__callback({}); ++ }, ++ refresh : function (obj) { ++ var _this = this; ++ this.save_opened(); ++ if(!obj) { obj = -1; } ++ obj = this._get_node(obj); ++ if(!obj) { obj = -1; } ++ if(obj !== -1) { obj.children("UL").remove(); } ++ else { this.get_container_ul().empty(); } ++ this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); }); ++ }, ++ // Dummy function to fire after the first load (so that there is a jstree.loaded event) ++ loaded : function () { ++ this.__callback(); ++ }, ++ // deal with focus ++ set_focus : function () { ++ if(this.is_focused()) { return; } ++ var f = $.jstree._focused(); ++ if(f) { f.unset_focus(); } ++ ++ this.get_container().addClass("jstree-focused"); ++ focused_instance = this.get_index(); ++ this.__callback(); ++ }, ++ is_focused : function () { ++ return focused_instance == this.get_index(); ++ }, ++ unset_focus : function () { ++ if(this.is_focused()) { ++ this.get_container().removeClass("jstree-focused"); ++ focused_instance = -1; ++ } ++ this.__callback(); ++ }, ++ ++ // traverse ++ _get_node : function (obj) { ++ var $obj = $(obj, this.get_container()); ++ if($obj.is(".jstree") || obj == -1) { return -1; } ++ $obj = $obj.closest("li", this.get_container()); ++ return $obj.length ? $obj : false; ++ }, ++ _get_next : function (obj, strict) { ++ obj = this._get_node(obj); ++ if(obj === -1) { return this.get_container().find("> ul > li:first-child"); } ++ if(!obj.length) { return false; } ++ if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; } ++ ++ if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); } ++ else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); } ++ else { return obj.parentsUntil(".jstree","li").next("li").eq(0); } ++ }, ++ _get_prev : function (obj, strict) { ++ obj = this._get_node(obj); ++ if(obj === -1) { return this.get_container().find("> ul > li:last-child"); } ++ if(!obj.length) { return false; } ++ if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; } ++ ++ if(obj.prev("li").length) { ++ obj = obj.prev("li").eq(0); ++ while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); } ++ return obj; ++ } ++ else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; } ++ }, ++ _get_parent : function (obj) { ++ obj = this._get_node(obj); ++ if(obj == -1 || !obj.length) { return false; } ++ var o = obj.parentsUntil(".jstree", "li:eq(0)"); ++ return o.length ? o : -1; ++ }, ++ _get_children : function (obj) { ++ obj = this._get_node(obj); ++ if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); } ++ if(!obj.length) { return false; } ++ return obj.children("ul:eq(0)").children("li"); ++ }, ++ get_path : function (obj, id_mode) { ++ var p = [], ++ _this = this; ++ obj = this._get_node(obj); ++ if(obj === -1 || !obj || !obj.length) { return false; } ++ obj.parentsUntil(".jstree", "li").each(function () { ++ p.push( id_mode ? this.id : _this.get_text(this) ); ++ }); ++ p.reverse(); ++ p.push( id_mode ? obj.attr("id") : this.get_text(obj) ); ++ return p; ++ }, ++ ++ // string functions ++ _get_string : function (key) { ++ return this._get_settings().core.strings[key] || key; ++ }, ++ ++ is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); }, ++ is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); }, ++ is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); }, ++ correct_state : function (obj) { ++ obj = this._get_node(obj); ++ if(!obj || obj === -1) { return false; } ++ obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove(); ++ this.__callback({ "obj" : obj }); ++ }, ++ // open/close ++ open_node : function (obj, callback, skip_animation) { ++ obj = this._get_node(obj); ++ if(!obj.length) { return false; } ++ if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; } ++ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, ++ t = this; ++ if(!this._is_loaded(obj)) { ++ obj.children("a").addClass("jstree-loading"); ++ this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback); ++ } ++ else { ++ if(this._get_settings().core.open_parents) { ++ obj.parentsUntil(".jstree",".jstree-closed").each(function () { ++ t.open_node(this, false, true); ++ }); ++ } ++ if(s) { obj.children("ul").css("display","none"); } ++ obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"); ++ if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); } ++ else { t.after_open(obj); } ++ this.__callback({ "obj" : obj }); ++ if(callback) { callback.call(); } ++ } ++ }, ++ after_open : function (obj) { this.__callback({ "obj" : obj }); }, ++ close_node : function (obj, skip_animation) { ++ obj = this._get_node(obj); ++ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, ++ t = this; ++ if(!obj.length || !obj.hasClass("jstree-open")) { return false; } ++ if(s) { obj.children("ul").attr("style","display:block !important"); } ++ obj.removeClass("jstree-open").addClass("jstree-closed"); ++ if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); } ++ else { t.after_close(obj); } ++ this.__callback({ "obj" : obj }); ++ }, ++ after_close : function (obj) { this.__callback({ "obj" : obj }); }, ++ toggle_node : function (obj) { ++ obj = this._get_node(obj); ++ if(obj.hasClass("jstree-closed")) { return this.open_node(obj); } ++ if(obj.hasClass("jstree-open")) { return this.close_node(obj); } ++ }, ++ open_all : function (obj, do_animation, original_obj) { ++ obj = obj ? this._get_node(obj) : -1; ++ if(!obj || obj === -1) { obj = this.get_container_ul(); } ++ if(original_obj) { ++ obj = obj.find("li.jstree-closed"); ++ } ++ else { ++ original_obj = obj; ++ if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); } ++ else { obj = obj.find("li.jstree-closed"); } ++ } ++ var _this = this; ++ obj.each(function () { ++ var __this = this; ++ if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); } ++ else { _this.open_node(this, false, !do_animation); } ++ }); ++ // so that callback is fired AFTER all nodes are open ++ if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); } ++ }, ++ close_all : function (obj, do_animation) { ++ var _this = this; ++ obj = obj ? this._get_node(obj) : this.get_container(); ++ if(!obj || obj === -1) { obj = this.get_container_ul(); } ++ obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); }); ++ this.__callback({ "obj" : obj }); ++ }, ++ clean_node : function (obj) { ++ obj = obj && obj != -1 ? $(obj) : this.get_container_ul(); ++ obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li"); ++ obj.removeClass("jstree-last") ++ .filter("li:last-child").addClass("jstree-last").end() ++ .filter(":has(li)") ++ .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"); ++ obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(); ++ this.__callback({ "obj" : obj }); ++ }, ++ // rollback ++ get_rollback : function () { ++ this.__callback(); ++ return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data }; ++ }, ++ set_rollback : function (html, data) { ++ this.get_container().empty().append(html); ++ this.data = data; ++ this.__callback(); ++ }, ++ // Dummy functions to be overwritten by any datastore plugin included ++ load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); }, ++ _is_loaded : function (obj) { return true; }, ++ ++ // Basic operations: create ++ create_node : function (obj, position, js, callback, is_loaded) { ++ obj = this._get_node(obj); ++ position = typeof position === "undefined" ? "last" : position; ++ var d = $("
  • "), ++ s = this._get_settings().core, ++ tmp; ++ ++ if(obj !== -1 && !obj.length) { return false; } ++ if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; } ++ ++ this.__rollback(); ++ ++ if(typeof js === "string") { js = { "data" : js }; } ++ if(!js) { js = {}; } ++ if(js.attr) { d.attr(js.attr); } ++ if(js.metadata) { d.data(js.metadata); } ++ if(js.state) { d.addClass("jstree-" + js.state); } ++ if(!js.data) { js.data = this._get_string("new_node"); } ++ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); } ++ $.each(js.data, function (i, m) { ++ tmp = $(""); ++ if($.isFunction(m)) { m = m.call(this, js); } ++ if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); } ++ else { ++ if(!m.attr) { m.attr = {}; } ++ if(!m.attr.href) { m.attr.href = '#'; } ++ tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title); ++ if(m.language) { tmp.addClass(m.language); } ++ } ++ tmp.prepend(" "); ++ if(!m.icon && js.icon) { m.icon = js.icon; } ++ if(m.icon) { ++ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); } ++ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); } ++ } ++ d.append(tmp); ++ }); ++ d.prepend(" "); ++ if(obj === -1) { ++ obj = this.get_container(); ++ if(position === "before") { position = "first"; } ++ if(position === "after") { position = "last"; } ++ } ++ switch(position) { ++ case "before": obj.before(d); tmp = this._get_parent(obj); break; ++ case "after" : obj.after(d); tmp = this._get_parent(obj); break; ++ case "inside": ++ case "first" : ++ if(!obj.children("ul").length) { obj.append("
  • '; ++ ++ for (var h = o.hourMin; h <= hourMax; h += o.hourGrid) { ++ hourGridSize++; ++ var tmph = (o.ampm && h > 12) ? h-12 : h; ++ if (tmph < 10) tmph = '0' + tmph; ++ if (o.ampm) { ++ if (h == 0) tmph = 12 +'a'; ++ else if (h < 12) tmph += 'a'; ++ else tmph += 'p'; ++ } ++ html += ''; ++ } ++ ++ html += '
    ' + tmph + '
    ' + ++ ''; ++ } else html += '
    '; ++ ++ html += '
    ' + o.minuteText + '
    '; ++ ++ if (o.showMinute && o.minuteGrid > 0) { ++ html += '
    ' + ++ '
    ' + ++ '
    '; ++ ++ for (var m = o.minuteMin; m <= minMax; m += o.minuteGrid) { ++ minuteGridSize++; ++ html += ''; ++ } ++ ++ html += '
    ' + ((m < 10) ? '0' : '') + m + '
    ' + ++ '
    '; ++ } else html += '
    '; ++ ++ html += '
    ' + o.secondText + '
    '; ++ ++ if (o.showSecond && o.secondGrid > 0) { ++ html += '
    ' + ++ '
    ' + ++ '
    '; ++ ++ for (var s = o.secondMin; s <= secMax; s += o.secondGrid) { ++ secondGridSize++; ++ html += ''; ++ } ++ ++ html += '
    ' + ((s < 10) ? '0' : '') + s + '
    ' + ++ '
    '; ++ } else html += '
    '; ++ ++ html += '
    ' + o.timezoneText + '
    '; ++ html += '
    '; ++ ++ html += ''; ++ $tp = $(html); ++ ++ // if we only want time picker... ++ if (o.timeOnly === true) { ++ $tp.prepend( ++ '
    ' + ++ '
    ' + o.timeOnlyTitle + '
    ' + ++ '
    '); ++ $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); ++ } ++ ++ this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({ ++ orientation: "horizontal", ++ value: this.hour, ++ min: o.hourMin, ++ max: hourMax, ++ step: o.stepHour, ++ slide: function(event, ui) { ++ tp_inst.hour_slider.slider( "option", "value", ui.value); ++ tp_inst._onTimeChange(); ++ } ++ }); ++ ++ // Updated by Peter Medeiros: ++ // - Pass in Event and UI instance into slide function ++ this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({ ++ orientation: "horizontal", ++ value: this.minute, ++ min: o.minuteMin, ++ max: minMax, ++ step: o.stepMinute, ++ slide: function(event, ui) { ++ // update the global minute slider instance value with the current slider value ++ tp_inst.minute_slider.slider( "option", "value", ui.value); ++ tp_inst._onTimeChange(); ++ } ++ }); ++ ++ this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({ ++ orientation: "horizontal", ++ value: this.second, ++ min: o.secondMin, ++ max: secMax, ++ step: o.stepSecond, ++ slide: function(event, ui) { ++ tp_inst.second_slider.slider( "option", "value", ui.value); ++ tp_inst._onTimeChange(); ++ } ++ }); ++ ++ ++ this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).append('').find("select"); ++ $.fn.append.apply(this.timezone_select, ++ $.map(o.timezoneList, function(val, idx) { ++ return $("
    ").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=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 a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* ++ * jQuery UI Dialog 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Dialog ++ * ++ * Depends: ++ * jquery.ui.core.js ++ * jquery.ui.widget.js ++ * jquery.ui.button.js ++ * jquery.ui.draggable.js ++ * jquery.ui.mouse.js ++ * jquery.ui.position.js ++ * jquery.ui.resizable.js ++ */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{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",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},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.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
    ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
    ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/* ++ * jQuery UI Tabs 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Tabs ++ * ++ * Depends: ++ * jquery.ui.core.js ++ * jquery.ui.widget.js ++ */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});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(a){extendRemove(this._defaults,a||{});return 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(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
    ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),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(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},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(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
    '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
    ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
    '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
    '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
    "+(j?""+(g[0]>0&&N==g[1]-1?'
    ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""), ++a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
    ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
    ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* ++ * jQuery UI Progressbar 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Progressbar ++ * ++ * Depends: ++ * jquery.ui.core.js ++ * jquery.ui.widget.js ++ */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
    ").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(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* ++ * jQuery UI Effects 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Effects/ ++ */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* ++ * jQuery UI Effects Fade 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Effects/Fade ++ * ++ * Depends: ++ * jquery.effects.core.js ++ */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* ++ * jQuery UI Effects Fold 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Effects/Fold ++ * ++ * Depends: ++ * jquery.effects.core.js ++ */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* ++ * jQuery UI Effects Highlight 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Effects/Highlight ++ * ++ * Depends: ++ * jquery.effects.core.js ++ */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* ++ * jQuery UI Effects Pulsate 1.8.18 ++ * ++ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) ++ * Dual licensed under the MIT or GPL Version 2 licenses. ++ * http://jquery.org/license ++ * ++ * http://docs.jquery.com/UI/Effects/Pulsate ++ * ++ * Depends: ++ * jquery.effects.core.js ++ */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/jquery.zoom.js.legal cacti-0.8.8a/include/js/jquery/jquery.zoom.js +--- cacti-0.8.8a/include/js/jquery/jquery.zoom.js.legal 2013-01-04 15:44:38.045416081 -0500 ++++ cacti-0.8.8a/include/js/jquery/jquery.zoom.js 2013-01-04 15:43:12.646377987 -0500 +@@ -0,0 +1,866 @@ ++/* ++ +-------------------------------------------------------------------------+ ++ | Copyright (C) 2004-2013 The Cacti Group | ++ | | ++ | This program 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 2 | ++ | 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. | ++ +-------------------------------------------------------------------------+ ++ | Cacti: The Complete RRDTool-based Graphing Solution | ++ +-------------------------------------------------------------------------+ ++ | This code is designed, written, and maintained by the Cacti Group. See | ++ | about.php and/or the AUTHORS file for specific developer information. | ++ +-------------------------------------------------------------------------+ ++ | http://www.cacti.net/ | ++ +-------------------------------------------------------------------------+ ++*/ ++ ++/* requirements: ++ jQuery 1.7.x or above ++ jQuery UI 1.8.x or above ++ jQuery cookie plugin ++*/ ++ ++(function($){ ++ $.fn.zoom = function(options) { ++ ++ /* +++++++++++++++++++++++ Global Variables +++++++++++++++++++++++++ */ ++ ++ // default values of the different options being offered ++ var defaults = { ++ inputfieldStartTime : '', // ID of the input field that contains the start date ++ inputfieldEndTime : '', // ID of the input field that contains the end date ++ submitButton : 'button_refresh_x', // ID of the submit button ++ cookieName : 'cacti_zoom' // default name required for session cookie ++ }; ++ ++ // define global variables / objects here ++ var zoom = { ++ // "initiator" is the element that initiates Zoom ++ initiator: $(this), ++ // "image" means the image tag and its properties ++ image: { top:0, left:0, width:0, height:0 }, ++ // "graph" stands for the rrdgraph itself excluding legend, graph title etc. ++ graph: { timespan:0, secondsPerPixel:0 }, ++ // "box" describes the area in front of the graph whithin jQueryZoom will allow interaction ++ box: { top:0, left:0, right:0, width:0, height:0 }, ++ // "markers" are selectors useable within the advanced mode ++ marker: { 1 : { placed:false }, 2 : { placed:false} }, ++ // "custom" holds the local configuration done by the user ++ custom: {}, ++ // "options" contains the start input parameters ++ options: $.extend(defaults, options), ++ // "attributes" holds all values that will describe the selected area ++ attr: { activeElement:'', start:'none', end:'none', action:'left2right', location: window.location.href.split("?") } ++ }; ++ ++ ++ /* ++++++++++++++++++++++++ Initialization ++++++++++++++++++++++++++ */ ++ ++ // use a cookie to support local settings ++ zoom.custom = $.cookie(zoom.options.cookieName) ? unserialize( $.cookie(zoom.options.cookieName) ) : {}; ++ if(zoom.custom.zoomMode == undefined) zoom.custom.zoomMode = 'quick'; ++ if(zoom.custom.zoomOutPositioning == undefined) zoom.custom.zoomOutPositioning = 'center'; ++ if(zoom.custom.zoomOutFactor == undefined) zoom.custom.zoomOutFactor = '2'; ++ if(zoom.custom.zoomMarkers == undefined) zoom.custom.zoomMarkers = true; ++ if(zoom.custom.zoomTimestamps == undefined) zoom.custom.zoomTimestamps = 'auto'; ++ if(zoom.custom.zoom3rdMouseButton == undefined) zoom.custom.zoom3rdMouseButton = false; ++ ++ // create or update a session cookie ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom), {expires: null} ); ++ ++ // support jQuery's concatination ++ return this.each(function() { zoom_init( $(this) ); }); ++ ++ ++ /* ++++++++++++++++++++ Universal Functions +++++++++++++++++++++++++ */ ++ ++ /** ++ * checks if an image has been already loaded or if the link is broken ++ **/ ++ function isReady(image){ ++ if(typeof image[0].naturalWidth !== undefined && image[0].naturalWidth == 0) { ++ return false; ++ } ++ // support older versions of IE(6-8) ++ if(!image[0].complete) { ++ return false; ++ } ++ return true; ++ } ++ ++ /** ++ * splits off the parameters of a given url ++ **/ ++ function getUrlVars(url) { ++ var parameters = [], name, value; ++ ++ urlBaseAndParameters = url.split("?"); ++ urlBase = urlBaseAndParameters[0]; ++ urlParameters = urlBaseAndParameters[1].split("&"); ++ parameters["urlBase"] = urlBase; ++ ++ for(var i=0; i 9) ? date.getDate() : '0' + date.getDate(); ++ var hours = (date.getHours() > 9) ? date.getHours() : '0' + date.getHours(); ++ var minutes = (date.getMinutes() > 9) ? date.getMinutes() : '0' + date.getMinutes(); ++ var seconds = (date.getSeconds() > 9) ? date.getSeconds() : '0' + date.getSeconds(); ++ ++ var formattedTime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; ++ return formattedTime; ++ } ++ ++ ++ /* +++++++++++++++++++++++ Core Functions +++++++++++++++++++++++++++ */ ++ ++ /* init zoom */ ++ function zoom_init(image) { ++ var $this = image; ++ $this.mouseenter( ++ function(){ ++ if(zoom.attr.activeElement == '') { ++ zoom.attr.activeElement = $(this).attr('id'); ++ zoomFunction_init($this); ++ // focusing another image will trigger a reset of Zoom ++ }else if(zoom.attr.activeElement != $(this).attr('id')) { ++ zoom.attr.activeElement = $(this).attr('id'); ++ zoomFunction_init($this); ++ } ++ } ++ ); ++ } ++ ++ function zoomFunction_init(image) { ++ var $this = image; ++ // exit if image has not been already loaded or if image is not available ++ if(isReady($this)) { ++ // update zoom.image object with the attributes of this image ++ zoom.image.width = parseInt($this.width()); ++ zoom.image.height = parseInt($this.height()); ++ zoom.image.top = parseInt($this.offset().top); ++ zoom.image.left = parseInt($this.offset().left); ++ }else { ++ return; ++ } ++ ++ // get all graph parameters and merge results with zoom.graph object ++ $.extend(zoom.graph, getUrlVars( $this.attr("src") )); ++ zoom.graph.timespan = zoom.graph.end - zoom.graph.start; ++ zoom.graph.secondsPerPixel = zoom.graph.timespan/zoom.graph.width; ++ ++ if((zoom.graph.title_font_size <= 0) || (zoom.graph.title_font_size == "")) { ++ zoom.graph.title_font_size = 10; ++ } ++ ++ if(zoom.graph.nolegend != undefined) { ++ zoom.graph.title_font_size *= .70; ++ } ++ ++ // update all zoom box attributes. Unfortunately we have to use that best fit way ++ // to support RRDtool 1.2 and below. With RRDtool 1.3 or higher there would be a ++ // much more elegant solution available. (see RRDdtool graph option "graphv") ++ zoom.box.width = zoom.graph.width; ++ zoom.box.height = zoom.graph.height; ++ ++ if(zoom.graph.title_font_size == null) { ++ zoom.box.top = 32 - 1; ++ }else { ++ //default multiplier ++ var multiplier = 2.4; ++ // array of "best fit" multipliers ++ multipliers = new Array("-5", "-2", "0", "1.7", "1.6", "1.7", "1.8", "1.9", "2", "2", "2.1", "2.1", "2.2", "2.2", "2.3", "2.3", "2.3", "2.3", "2.3"); ++ if(multipliers[Math.round(zoom.graph.title_font_size)] != null) { ++ multiplier = multipliers[Math.round(zoom.graph.title_font_size)]; ++ } ++ zoom.box.top = zoom.image.top + parseInt(Math.abs(zoom.graph.title_font_size) * multiplier) + 15; ++ } ++ ++ zoom.box.bottom = zoom.box.top + zoom.box.height; ++ zoom.box.right = zoom.image.left + zoom.image.width - 30; ++ zoom.box.left = zoom.box.right - zoom.graph.width; ++ ++ // add all additional HTML elements to the DOM if necessary and register ++ // the individual events needed. Once added we will only reset ++ // and reposition these elements. ++ ++ // add the "zoomBox" ++ if($("#zoom-box").length == 0) { ++ // Please note: IE does not fire hover or click behaviors on completely transparent elements. ++ // Use a background color and set opacity to 1% as a workaround.(see CSS file) ++ $("
    ").appendTo("body"); ++ } ++ ++ // add the "zoomSelectedArea" ++ if($("#zoom-area").length == 0) { ++ $("
    ").appendTo("body"); ++ } ++ ++ // add two markers for the advanced mode ++ if($("#zoom-marker-1").length == 0) { ++ $('
    ').appendTo("body"); ++ $('
    ').appendTo("body"); ++ $('
    -
    ').appendTo('body'); ++ } ++ if($("#zoom-marker-2").length == 0) { ++ $('
    ').appendTo("body"); ++ $('
    ').appendTo("body"); ++ $('
    -
    ').appendTo('body'); ++ } ++ zoom.marker[1].placed = false; ++ zoom.marker[2].placed = false; ++ ++ // add the context (right click) menu ++ if($("#zoom-menu").length == 0) { ++ $('
    ' ++ + '
    ' ++ + '
    ' ++ + 'Zoom In' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + 'Zoom Out (2x)' ++ + '
    ' ++ + '2x' ++ + '4x' ++ + '8x' ++ + '16x' ++ + '32x' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    Zoom Mode' ++ + '
    ' ++ + 'Quick' ++ + 'Advanced' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    Settings' ++ + '
    ' ++ + '
    Markers' ++ + '
    ' ++ + 'Enabled' ++ + 'Disabled' ++ + '
    ' ++ + '
    ' ++ + '
    Timestamps' ++ + '
    ' ++ + 'Always On' ++ + 'Auto' ++ + 'Always Off' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    Zoom Out Factor' ++ + '
    ' ++ + '2x' ++ + '4x' ++ + '8x' ++ + '16x' ++ + '32x' ++ + '
    ' ++ + '
    ' ++ + '
    Zoom Out Positioning' ++ + '
    ' ++ + 'Begin with' ++ + 'Center' ++ + 'End with' ++ + '
    ' ++ + '
    ' ++ + '
    3rd Mouse Button' ++ + '
    ' ++ + 'Zoom in' ++ + 'Zoom out' ++ + 'Disabled' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    ' ++ + '
    Close' ++ + '
    ').appendTo('body'); ++ } ++ zoomElemtents_reset() ++ zoomContextMenu_init(); ++ zoomAction_init(image); ++ } ++ ++ /** ++ * resets all elements of Zoom ++ **/ ++ function zoomElemtents_reset() { ++ zoom.marker = { 1 : { placed:false }, 2 : { placed:false} }; ++ $('div[id^="zoom-"]').not('#zoom-menu').each( function () { ++ $(this).removeAttr('style'); ++ }); ++ $("#zoom-box").off(); ++ $("#zoom-box").css({ cursor:'crosshair', width:zoom.box.width + 'px', height:zoom.box.height + 'px', top:zoom.box.top+'px', left:zoom.box.left+'px' }); ++ $("#zoom-box").bind('contextmenu', function(e) { zoomContextMenu_show(e); return false;} ); ++ $("#zoom-area").off().css({ top:zoom.box.top+'px', height:zoom.box.height+'px' }); ++ $(".zoom-area-excluded").off(); ++ $(".zoom-area-excluded").bind('contextmenu', function(e) { zoomContextMenu_show(e); return false;} ); ++ $(".zoom-area-excluded").bind('click', function(e) { zoomContextMenu_hide(); return false;} ); ++ $(".zoom-marker-arrow-up").css({ top:(zoom.box.height-6) + 'px' }); ++ $(".zoom-marker-tooltip-value").disableSelection(); ++ } ++ ++ /* ++ * registers all the different mouse click event handler ++ */ ++ function zoomAction_init(image) { ++ ++ if(zoom.custom.zoomMode == 'quick') { ++ $("#zoom-box").off("mousedown").on("mousedown", function(e) { ++ switch(e.which) { ++ /* clicking the left mouse button will initiates a zoom-in */ ++ case 1: ++ zoomContextMenu_hide(); ++ // reset the zoom area ++ zoom.attr.start = e.pageX; ++ if(zoom.custom.zoomMode != 'quick') { ++ $("#zoom-marker-1").css({ height:zoom.box.height+'px', top:zoom.box.top+'px', left:zoom.attr.start+'px', display:'block' }); ++ $("#zoom-marker-tooltip-1").css({ top:zoom.box.top+'px', left:zoom.attr.start+'px'}); ++ } ++ $("#zoom-box").css({ cursor:'e-resize' }); ++ $("#zoom-area").css({ width:'0px', left:zoom.attr.start+'px' }); ++ break; ++ } ++ }); ++ ++ /* register the mouse up event */ ++ $("#zoom-area").off("mouseup").on("mouseup", function(e) { ++ switch(e.which) { ++ /* leaving the left mouse button will execute a zoom in */ ++ case 1: ++ if(zoom.custom.zoomMode == 'quick' && zoom.attr.start != 'none') { ++ zoomAction_zoom_in(); ++ } ++ break; ++ } ++ }); ++ ++ /* stretch the zoom area in that direction the user moved the mouse pointer */ ++ $("#zoom-box").mousemove( function(e) { zoomAction_draw(e) } ); ++ ++ /* stretch the zoom area in that direction the user moved the mouse pointer. ++ That is required to get it working faultlessly with Opera, IE and Chrome */ ++ $("#zoom-area").mousemove( function(e) { zoomAction_draw(e); } ); ++ ++ /* moving the mouse pointer quickly will avoid that the mousemove event has enough time to actualize the zoom area */ ++ $("#zoom-box").mouseout( function(e) { zoomAction_draw(e) } ); ++ ++ }else{ ++ /* welcome to the advanced mode ;) */ ++ $("#zoom-box").off("mousedown").on("mousedown", function(e) { ++ switch(e.which) { ++ case 1: ++ /* hide context menu if open */ ++ zoomContextMenu_hide(); ++ ++ /* find out which marker has to be added */ ++ if(zoom.marker[1].placed && zoom.marker[2].placed) { ++ zoomAction_zoom_in(); ++ return; ++ }else { ++ var marker = zoom.marker[1].placed ? 2 : 1; ++ var secondmarker = (marker == 1) ? 2 : 1; ++ } ++ ++ /* select marker */ ++ var $this = $("#zoom-marker-" + marker); ++ ++ /* place the marker and make it visible */ ++ $this.css({ height:zoom.box.height+'px', top:zoom.box.top+'px', left:e.pageX+'px', display:'block' }); ++ zoom.marker[marker].placed = true; ++ zoom.marker[marker].left = e.pageX; ++ ++ /* place the marker's tooltip, update its value and make it visible if necessary (Setting: "Always On") */ ++ zoom.marker[marker].unixtime = parseInt(parseInt(zoom.graph.start) + (e.pageX + 1 - zoom.box.left)*zoom.graph.secondsPerPixel); ++ $("#zoom-marker-tooltip-value-" + marker).html( ++ unixTime2Date(zoom.marker[marker].unixtime).replace(" ", "
    ") ++ ); ++ zoom.marker[marker].width = $("#zoom-marker-tooltip-" + marker).width(); ++ ++ $("#zoom-marker-tooltip-" + marker).css({ ++ top: ( (marker == 1) ? zoom.box.top+3 : zoom.box.bottom-30 )+'px', ++ left:( (marker == 1) ? e.pageX - zoom.marker[marker].width : e.pageX )+'px'} ++ ); ++ ++ if(zoom.custom.zoomTimestamps === true) { ++ $("#zoom-marker-tooltip-" + marker).fadeIn(500); ++ } ++ ++ if(e.pageX == $("#zoom-marker-tooltip-" + marker).position().left) { ++ $("#zoom-marker-tooltip-" + marker + "-arrow-right").css({ visibility:'hidden'}); ++ }else { ++ $("#zoom-marker-tooltip-" + marker + "-arrow-left").css({ visibility:'hidden'}); ++ } ++ ++ /* make the excluded areas visible directly in that moment both markers are set */ ++ if(zoom.marker[1].placed && zoom.marker[2].placed) { ++ zoom.marker.distance = zoom.marker[1].left - zoom.marker[2].left; ++ ++ $("#zoom-excluded-area-1").css({ ++ height:zoom.box.height+'px', ++ top:zoom.box.top+'px', ++ left: (zoom.marker.distance > 0) ? zoom.marker[1].left : zoom.box.left, ++ width: (zoom.marker.distance > 0) ? zoom.box.right - zoom.marker[1].left : zoom.marker[1].left - zoom.box.left, ++ display:'block' ++ }); ++ ++ $("#zoom-excluded-area-2").css({ ++ height:zoom.box.height+'px', ++ top:zoom.box.top+'px', ++ left: (zoom.marker.distance < 0) ? zoom.marker[2].left : zoom.box.left, ++ width: (zoom.marker.distance < 0) ? zoom.box.right - zoom.marker[2].left : zoom.marker[2].left - zoom.box.left, ++ display:'block' ++ }); ++ ++ /* reposition both tooltips */ ++ $("#zoom-marker-tooltip-1").css({ left: $("#zoom-marker-1").position().left - ( (zoom.marker.distance > 0) ? 0 : $("#zoom-marker-tooltip-1").width() ) + 'px' }); ++ $("#zoom-marker-tooltip-1-arrow-left").css({ visibility: (($("#zoom-marker-tooltip-1").position().left < $("#zoom-marker-1").position().left ) ? 'hidden' : 'visible') }); ++ $("#zoom-marker-tooltip-1-arrow-right").css({ visibility: (($("#zoom-marker-tooltip-1").position().left < $("#zoom-marker-1").position().left ) ? 'visible' : 'hidden') }); ++ ++ $("#zoom-marker-tooltip-2").css({ left: $("#zoom-marker-2").position().left - ( (zoom.marker.distance < 0) ? 0 : $("#zoom-marker-tooltip-2").width() ) + 'px' }); ++ $("#zoom-marker-tooltip-2-arrow-left").css({ visibility: (($("#zoom-marker-tooltip-2").position().left < $("#zoom-marker-2").position().left ) ? 'hidden' : 'visible') }); ++ $("#zoom-marker-tooltip-2-arrow-right").css({ visibility: (($("#zoom-marker-tooltip-2").position().left < $("#zoom-marker-2").position().left ) ? 'visible' : 'hidden') }); ++ } ++ ++ /* make the marker draggable */ ++ $this.draggable({ ++ containment:[ zoom.box.left-1, 0 , zoom.box.left+parseInt(zoom.box.width), 0 ], ++ axis: "x", ++ start: ++ function(event, ui) { ++ if(zoom.custom.zoomTimestamps == "auto") { ++ $(".zoom-marker-tooltip").fadeIn(500); ++ } ++ }, ++ drag: ++ function(event, ui) { ++ ++ zoom.marker[marker].left = ui.position["left"]; ++ ++ /* update the timestamp shown in tooltip */ ++ zoom.marker[marker].unixtime = parseInt(parseInt(zoom.graph.start) + (zoom.marker[marker].left + 1 - zoom.box.left)*zoom.graph.secondsPerPixel); ++ $("#zoom-marker-tooltip-value-" + marker).html( ++ unixTime2Date(zoom.marker[marker].unixtime).replace(" ", "
    ") ++ ); ++ ++ zoom.marker[marker].width = $("#zoom-marker-tooltip-" + marker).width(); ++ ++ /* update the execludedArea if both markers have been placed */ ++ if(zoom.marker[1].placed && zoom.marker[2].placed) { ++ zoom.marker.distance = zoom.marker[marker].left - zoom.marker[secondmarker].left; ++ ++ if( zoom.marker.distance > 0 ) { ++ zoom.marker[marker].excludeArea = 'right'; ++ zoom.marker[secondmarker].excludeArea = 'left'; ++ }else { ++ zoom.marker[marker].excludeArea = 'left'; ++ zoom.marker[secondmarker].excludeArea = 'right'; ++ } ++ ++ /* in that case we have to update the tooltip of both marker */ ++ $("#zoom-excluded-area-" + marker).css({ left: (zoom.marker.distance > 0) ? zoom.marker[marker].left : zoom.box.left, width: (zoom.marker.distance > 0) ? zoom.box.right - zoom.marker[marker].left : zoom.marker[marker].left - zoom.box.left}); ++ $("#zoom-marker-tooltip-" + marker).css({ left: zoom.marker[marker].left + ( (zoom.marker[marker].excludeArea == 'right') ? (0) : (-zoom.marker[marker].width) ) }); ++ $("#zoom-marker-tooltip-" + marker + "-arrow-left").css({ visibility: ( zoom.marker[marker].excludeArea == 'left' ? 'hidden' : 'visible') }); ++ $("#zoom-marker-tooltip-" + marker + "-arrow-right").css({ visibility: ( zoom.marker[marker].excludeArea == 'left' ? 'visible' : 'hidden') }); ++ ++ $("#zoom-excluded-area-" + secondmarker).css({ left: (zoom.marker.distance > 0) ? zoom.box.left : zoom.marker[secondmarker].left, width: (zoom.marker.distance > 0) ? zoom.marker[secondmarker].left - zoom.box.left : zoom.box.right - zoom.marker[secondmarker].left}); ++ $("#zoom-marker-tooltip-" + secondmarker ).css({ left: zoom.marker[secondmarker].left + ( (zoom.marker[secondmarker].excludeArea == 'right') ? (0) : (-zoom.marker[secondmarker].width) ) }); ++ $("#zoom-marker-tooltip-" + secondmarker + "-arrow-left").css({ visibility: ( zoom.marker[secondmarker].excludeArea == 'left' ? 'hidden' : 'visible') }); ++ $("#zoom-marker-tooltip-" + secondmarker + "-arrow-right").css({ visibility: ( zoom.marker[secondmarker].excludeArea == 'left' ? 'visible' : 'hidden') }); ++ ++ }else { ++ /* let the tooltip follow its marker */ ++ $("#zoom-marker-tooltip-" + marker).css({ left: zoom.marker[marker].left -zoom.marker[marker].width }); ++ } ++ ++ }, ++ stop: ++ function(event,ui) { ++ /* hide all tooltip if we are in auto mode */ ++ if(zoom.custom.zoomTimestamps == "auto") { ++ $(".zoom-marker-tooltip").fadeOut(1000); ++ } ++ } ++ ++ }); ++ ++ break; ++ case 2: ++ if(zoom.custom.zoom3rdMouseButton != false) { ++ /* hide context menu if open */ ++ zoomContextMenu_hide(); ++ if(zoom.custom.zoom3rdMouseButton == "zoom_in") { ++ zoomAction_zoom_in(); ++ }else { ++ zoomAction_zoom_out( zoom.custom.zoomOutFactor ); ++ } ++ } ++ break; ++ } ++ return false; ++ ++ }); ++ ++ } ++ } ++ ++ ++ /* ++ * executes a dynamic zoom in ++ */ ++ function zoomAction_zoom_in(){ ++ ++ /* hide context menu if open */ ++ zoomContextMenu_hide(); ++ ++ if(zoom.custom.zoomMode == 'quick') { ++ ++ var newGraphStartTime = (zoom.attr.action == 'left2right') ? parseInt(parseInt(zoom.graph.start) + (zoom.attr.start - zoom.box.left)*zoom.graph.secondsPerPixel) ++ : parseInt(parseInt(zoom.graph.start) + (zoom.attr.end - zoom.box.left)*zoom.graph.secondsPerPixel); ++ var newGraphEndTime = (zoom.attr.action == 'left2right') ? parseInt(newGraphStartTime + (zoom.attr.end-zoom.attr.start)*zoom.graph.secondsPerPixel) ++ : parseInt(newGraphStartTime + (zoom.attr.start-zoom.attr.end)*zoom.graph.secondsPerPixel); ++ ++ /* If the user only clicked on a graph then equal end and start date to ensure that we do not propergate NaNs */ ++ if(isNaN(newGraphStartTime) & isNaN(newGraphEndTime)) { ++ return; ++ }else if(isNaN(newGraphStartTime) & !isNaN(newGraphEndTime)) { ++ newGraphStartTime = newGraphEndTime; ++ }else if(!isNaN(newGraphStartTime) & isNaN(newGraphEndTime)){ ++ newGraphEndTime = newGraphStartTime; ++ } ++ }else { ++ /* advanced mode has other requirements */ ++ /* first of, do nothing if not both marker have been positioned */ ++ if(!zoom.marker[1].placed | !zoom.marker[2].placed) { ++ alert("NOTE: In advanced mode both markers have to be positioned first to define the period of time you want to zoom in."); ++ return; ++ }else { ++ var newGraphStartTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 2 : 1 )].unixtime; ++ var newGraphEndTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 1 : 2 )].unixtime; ++ } ++ } ++ ++ if(zoom.options.inputfieldStartTime != '' & zoom.options.inputfieldEndTime != ''){ ++ /* execute zoom within "tree view" or the "preview view" */ ++ $('#' + zoom.options.inputfieldStartTime).val(unixTime2Date(newGraphStartTime)); ++ $('#' + zoom.options.inputfieldEndTime).val(unixTime2Date(newGraphEndTime)); ++ ++ $("input[name='" + zoom.options.submitButton + "']").trigger('click'); ++ return false; ++ }else { ++ /* graph view is alread in zoom status */ ++ open(zoom.attr.location[0] + "?action=" + zoom.graph.action + "&local_graph_id=" + zoom.graph.local_graph_id + "&rra_id=" + zoom.graph.rra_id + "&view_type=" + zoom.graph.view_type + "&graph_start=" + newGraphStartTime + "&graph_end=" + newGraphEndTime + "&graph_height=" + zoom.graph.height + "&graph_width=" + zoom.graph.width + "&title_font_size=" + zoom.graph.title_font_size, "_self"); ++ } ++ ++ } ++ ++ ++ ++ ++ /* ++ * executes a static zoom out (as right click event) ++ */ ++ function zoomAction_zoom_out(multiplier){ ++ ++ multiplier--; ++ /* avoid that we can not zoom out anymore if start and end date will be equal */ ++ if(zoom.graph.timespan == 0) { ++ zoom.graph.timespan = 1; ++ } ++ ++ if(zoom.custom.zoomMode == 'quick' || !zoom.marker[1].placed || !zoom.marker[2].placed ) { ++ if(zoom.custom.zoomOutPositioning == 'begin') { ++ var newGraphStartTime = parseInt(zoom.graph.start); ++ var newGraphEndTime = parseInt(parseInt(zoom.graph.end) + (multiplier * zoom.graph.timespan)); ++ }else if(zoom.custom.zoomOutPositioning == 'end') { ++ var newGraphStartTime = parseInt(parseInt(zoom.graph.start) - (multiplier * zoom.graph.timespan)); ++ var newGraphEndTime = parseInt(zoom.graph.end); ++ }else { ++ // define the new start and end time, so that the selected area will be centered per default ++ var newGraphStartTime = parseInt(parseInt(zoom.graph.start) - (0.5 * multiplier * zoom.graph.timespan)); ++ var newGraphEndTime = parseInt(parseInt(zoom.graph.end) + (0.5 * multiplier * zoom.graph.timespan)); ++ } ++ }else { ++ var newGraphStartTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 2 : 1 )].unixtime; ++ var newGraphEndTime = zoom.marker[((zoom.marker[1].unixtime > zoom.marker[2].unixtime)? 1 : 2 )].unixtime; ++ var selectedTimeSpan = newGraphEndTime - newGraphStartTime; ++ ++ if(zoom.custom.zoomOutPositioning == 'begin') { ++ newGraphEndTime = newGraphEndTime + multiplier * selectedTimeSpan; ++ }else if(zoom.custom.zoomOutPositioning == 'end') { ++ newGraphStartTime = newGraphStartTime - multiplier * selectedTimeSpan; ++ }else { ++ newGraphStartTime = newGraphStartTime - 0.5 * multiplier * selectedTimeSpan; ++ newGraphEndTime = newGraphEndTime + 0.5 * multiplier * selectedTimeSpan; ++ } ++ } ++ ++ if(zoom.options.inputfieldStartTime != '' & zoom.options.inputfieldEndTime != ''){ ++ $('#' + zoom.options.inputfieldStartTime).val(unixTime2Date(newGraphStartTime)); ++ $('#' + zoom.options.inputfieldEndTime).val(unixTime2Date(newGraphEndTime)); ++ $('#' + zoom.options.inputfieldStartTime).closest("form").submit(); ++ }else { ++ open(zoom.attr.location[0] + "?action=" + zoom.graph.action + "&local_graph_id=" + zoom.graph.local_graph_id + "&rra_id=" + zoom.graph.rra_id + "&view_type=" + zoom.graph.view_type + "&graph_start=" + newGraphStartTime + "&graph_end=" + newGraphEndTime + "&graph_height=" + zoom.graph.height + "&graph_width=" + zoom.graph.width + "&title_font_size=" + zoom.graph.title_font_size, "_self"); ++ } ++ } ++ ++ ++ /* ++ * updates the css parameters of the zoom area to reflect user's interaction ++ */ ++ function zoomAction_draw(event) { ++ ++ if(zoom.attr.start == 'none') { return; } ++ ++ /* mouse has been moved from right to left */ ++ if((event.pageX-zoom.attr.start)<0) { ++ zoom.attr.action = 'right2left'; ++ zoom.attr.end = (event.pageX < zoom.box.left) ? zoom.box.left : event.pageX; ++ $("#zoom-area").css({ background:'red', left:(zoom.attr.end+1)+'px', width:Math.abs(zoom.attr.start-zoom.attr.end-1)+'px' }); ++ /* mouse has been moved from left to right*/ ++ }else { ++ zoom.attr.action = 'left2right'; ++ zoom.attr.end = (event.pageX > zoom.box.right) ? zoom.box.right : event.pageX; ++ $("#zoom-area").css({ background:'red', left:zoom.attr.start+'px', width:Math.abs(zoom.attr.end-zoom.attr.start-1)+'px' }); ++ } ++ /* move second marker if necessary */ ++ if(zoom.custom.zoomMode != 'quick') { ++ $("#zoom-marker-2").css({ left:(zoom.attr.end+1)+'px' }); ++ $("#zoom-marker-tooltip-2").css({ top:zoom.box.top+'px', left:(zoom.attr.end-5)+'px' }); ++ } ++ } ++ ++ /** ++ * ++ * @access public ++ * @return void ++ **/ ++ function zoomContextMenu_init(){ ++ ++ /* sync menu with cookie parameters */ ++ $(".zoomContextMenuAction__set_zoomMode__" + zoom.custom.zoomMode).addClass("ui-state-highlight"); ++ $(".zoomContextMenuAction__set_zoomMarkers__" + ((zoom.custom.zoomMarkers === true) ? "on" : "off") ).addClass("ui-state-highlight"); ++ $(".zoomContextMenuAction__set_zoomTimestamps__" + ((zoom.custom.zoomTimestamps == 'auto') ? "auto" : ((zoom.custom.zoomTimestamps) ? "on" : "off" ))).addClass("ui-state-highlight"); ++ $(".zoomContextMenuAction__set_zoomOutFactor__" + zoom.custom.zoomOutFactor).addClass("ui-state-highlight"); ++ $(".zoomContextMenuAction__set_zoomOutPositioning__" + zoom.custom.zoomOutPositioning).addClass("ui-state-highlight"); ++ $(".zoomContextMenuAction__set_zoom3rdMouseButton__" + ((zoom.custom.zoom3rdMouseButton === false) ? "off" : zoom.custom.zoom3rdMouseButton) ).addClass("ui-state-highlight"); ++ ++ if(zoom.custom.zoomMode == "quick") { ++ $("#zoom-menu > .advanced_mode").hide(); ++ }else { ++ $(".zoomContextMenuAction__zoom_out").text("Zoom Out (" + zoom.custom.zoomOutFactor + "x)"); ++ } ++ ++ /* init click on events */ ++ $('[class*=zoomContextMenuAction__]').off().on('click', function() { ++ var zoomContextMenuAction = false; ++ var zoomContextMenuActionValue = false; ++ var classList = $(this).attr('class').trim().split(/\s+/); ++ ++ $.each( classList, function(index, item){ ++ if( item.search("zoomContextMenuAction__") != -1) { ++ zoomContextMenuActionList = item.replace("zoomContextMenuAction__", "").split("__"); ++ zoomContextMenuAction = zoomContextMenuActionList[0]; ++ if(zoomContextMenuActionList[1] == 'undefined' || zoomContextMenuActionList[1] == 'off') { ++ zoomContextMenuActionValue = false; ++ }else if(zoomContextMenuActionList[1] == 'on') { ++ zoomContextMenuActionValue = true; ++ }else { ++ zoomContextMenuActionValue = zoomContextMenuActionList[1]; ++ } ++ return( false ); ++ } ++ }); ++ ++ if( zoomContextMenuAction ) { ++ if( zoomContextMenuAction.substring(0,8) == "set_zoom") { ++ zoomContextMenuAction_set( zoomContextMenuAction.replace("set_zoom", "").toLowerCase(), zoomContextMenuActionValue); ++ }else { ++ zoomContextMenuAction_do( zoomContextMenuAction, zoomContextMenuActionValue); ++ } ++ } ++ }); ++ ++ /* init hover events */ ++ $(".first_li , .sec_li, .inner_li span").hover( ++ function () { ++ $(this).css({backgroundColor : '#E0EDFE' , cursor : 'pointer'}); ++ if ( $(this).children().size() >0 ) ++ if(zoom.custom.zoomMode == "quick") { ++ $(this).children('.inner_li:not(.advanced_mode)').show(); ++ }else { ++ $(this).children('.inner_li').show(); ++ } ++ }, ++ function () { ++ $(this).css('background-color' , '#fff' ); ++ $(this).children('.inner_li').hide(); ++ } ++ ); ++ }; ++ ++ /** ++ * ++ * @access public ++ * @return void ++ **/ ++ function zoomContextMenuAction_set(object, value){ ++ switch(object) { ++ case "mode": ++ if( zoom.custom.zoomMode != value) { ++ zoom.custom.zoomMode = value; ++ $('[class*=zoomContextMenuAction__set_zoomMode__]').toggleClass("ui-state-highlight"); ++ ++ if(value == "quick") { ++ // reset menu ++ $("#zoom-menu > .advanced_mode").hide(); ++ $(".zoomContextMenuAction__zoom_out").text("Zoom Out (2x)"); ++ ++ zoom.custom.zoomMode = 'quick'; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ }else { ++ // switch to advanced mode ++ $("#zoom-menu > .advanced_mode").show(); ++ $(".zoomContextMenuAction__zoom_out").text("Zoom Out (" + + zoom.custom.zoomOutFactor + "x)"); ++ ++ zoom.custom.zoomMode = 'advanced'; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ } ++ zoomElemtents_reset(); ++ zoomAction_init(zoom.initiator); ++ ++ } ++ break; ++ case "markers": ++ if( zoom.custom.zoomMarkers != value) { ++ zoom.custom.zoomMarkers = value; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ $('[class*=zoomContextMenuAction__set_zoomMarkers__]').toggleClass('ui-state-highlight'); ++ } ++ break; ++ case "timestamps": ++ if( zoom.custom.zoomTimestamps != value) { ++ zoom.custom.zoomTimestamps = value; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ $('[class*=zoomContextMenuAction__set_zoomTimestamps__]').removeClass('ui-state-highlight'); ++ $('.zoomContextMenuAction__set_zoomTimestamps__' + ((zoom.custom.zoomTimestamps == 'auto') ? "auto" : ((zoom.custom.zoomTimestamps) ? "on" : "off" ))).addClass('ui-state-highlight'); ++ ++ /* make them visible only for mode "Always On" */ ++ if(zoom.custom.zoomTimestamps === true) { ++ $('.zoom-marker-tooltip').fadeIn(500); ++ }else { ++ $('.zoom-marker-tooltip').fadeOut(500); ++ } ++ } ++ break; ++ case "outfactor": ++ if( zoom.custom.zoomOutFactor != value) { ++ zoom.custom.zoomOutFactor = value; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ $('[class*=zoomContextMenuAction__set_zoomOutFactor__]').removeClass('ui-state-highlight'); ++ $('.zoomContextMenuAction__set_zoomOutFactor__' + value).addClass('ui-state-highlight'); ++ $('.zoomContextMenuAction__zoom_out').text('Zoom Out (' + value + 'x)'); ++ } ++ break; ++ case "outpositioning": ++ if( zoom.custom.zoomOutPositioning != value) { ++ zoom.custom.zoomOutPositioning = value; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ $('[class*=zoomContextMenuAction__set_zoomOutPositioning__]').removeClass('ui-state-highlight'); ++ $('.zoomContextMenuAction__set_zoomOutPositioning__' + value).addClass('ui-state-highlight'); ++ } ++ break; ++ case "3rdmousebutton": ++ if( zoom.custom.zoom3rdMouseButton != value) { ++ zoom.custom.zoom3rdMouseButton = value; ++ $.cookie( zoom.options.cookieName, serialize(zoom.custom)); ++ $('[class*=zoomContextMenuAction__set_zoom3rdMouseButton__]').removeClass('ui-state-highlight'); ++ $('.zoomContextMenuAction__set_zoom3rdMouseButton__' + ((value === false) ? "off" : value)).addClass('ui-state-highlight'); ++ } ++ break; ++ } ++ } ++ ++ function zoomContextMenuAction_do(action, value){ ++ switch(action) { ++ case "close": ++ zoomContextMenu_hide(); ++ break; ++ case "zoom_out": ++ if(value == undefined) { ++ value = (zoom.custom.zoomMode != "quick") ? zoom.custom.zoomOutFactor : 2; ++ } ++ zoomAction_zoom_out(value); ++ break; ++ case "zoom_in": ++ zoomAction_zoom_in(); ++ break; ++ } ++ } ++ ++ function zoomContextMenu_show(e){ ++ $("#zoom-menu").css({ left: e.pageX, top: e.pageY, zIndex: '101' }).show(); ++ }; ++ ++ function zoomContextMenu_hide(){ ++ $('#zoom-menu').hide(); ++ } ++ ++ }; ++ ++})(jQuery); +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/themes/default/d.gif.legal cacti-0.8.8a/include/js/jquery/themes/default/d.gif +Binary files cacti-0.8.8a/include/js/jquery/themes/default/d.gif.legal and cacti-0.8.8a/include/js/jquery/themes/default/d.gif differ +diff -up cacti-0.8.8a/include/js/jquery/themes/default/d.png.legal cacti-0.8.8a/include/js/jquery/themes/default/d.png +Binary files cacti-0.8.8a/include/js/jquery/themes/default/d.png.legal and cacti-0.8.8a/include/js/jquery/themes/default/d.png differ +diff -up cacti-0.8.8a/include/js/jquery/themes/default/style.css.legal cacti-0.8.8a/include/js/jquery/themes/default/style.css +--- cacti-0.8.8a/include/js/jquery/themes/default/style.css.legal 2013-01-04 15:44:49.350420872 -0500 ++++ cacti-0.8.8a/include/js/jquery/themes/default/style.css 2013-01-04 15:44:08.391403304 -0500 +@@ -0,0 +1,74 @@ ++/* ++ * jsTree default theme 1.0 ++ * Supported features: dots/no-dots, icons/no-icons, focused, loading ++ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search ++ */ ++ ++.jstree-default li, ++.jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; } ++.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; } ++.jstree-default li.jstree-last { background:transparent; } ++.jstree-default .jstree-open > ins { background-position:-72px 0; } ++.jstree-default .jstree-closed > ins { background-position:-54px 0; } ++.jstree-default .jstree-leaf > ins { background-position:-36px 0; } ++ ++.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; } ++.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; } ++.jstree-default a .jstree-icon { background-position:-56px -19px; } ++.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; } ++ ++.jstree-default.jstree-focused { background:#ffffee; } ++ ++.jstree-default .jstree-no-dots li, ++.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; } ++.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; } ++.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; } ++ ++.jstree-default .jstree-no-icons a .jstree-icon { display:none; } ++ ++.jstree-default .jstree-search { font-style:italic; } ++ ++.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; } ++.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; } ++.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; } ++.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; } ++.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; } ++.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; } ++.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; } ++.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } ++ ++#vakata-dragged.jstree-default ins { background:transparent !important; } ++#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } ++#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } ++#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } ++ ++.jstree-default a.jstree-search { color:aqua; } ++.jstree-default .jstree-locked a { color:silver; cursor:default; } ++ ++#vakata-contextmenu.jstree-default-context, ++#vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; } ++#vakata-contextmenu.jstree-default-context li { } ++#vakata-contextmenu.jstree-default-context a { color:black; } ++#vakata-contextmenu.jstree-default-context a:hover, ++#vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; } ++#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a, ++#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; } ++#vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; } ++#vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; } ++ ++/* IE6 BEGIN */ ++.jstree-default li, ++.jstree-default ins, ++#vakata-dragged.jstree-default .jstree-invalid, ++#vakata-dragged.jstree-default .jstree-ok, ++#jstree-marker.jstree-default { _background-image:url("d.gif"); } ++.jstree-default .jstree-open ins { _background-position:-72px 0; } ++.jstree-default .jstree-closed ins { _background-position:-54px 0; } ++.jstree-default .jstree-leaf ins { _background-position:-36px 0; } ++.jstree-default a ins.jstree-icon { _background-position:-56px -19px; } ++#vakata-contextmenu.jstree-default-context ins { _display:none; } ++#vakata-contextmenu.jstree-default-context li { _zoom:1; } ++.jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; } ++.jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; } ++.jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; } ++/* IE6 END */ +\ No newline at end of file +diff -up cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif.legal cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif +Binary files cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif.legal and cacti-0.8.8a/include/js/jquery/themes/default/throbber.gif differ diff --git a/src/patches/cacti/cacti-0.8.8a-replace_treeview_by_jquery.jstree.patch b/src/patches/cacti/cacti-0.8.8a-replace_treeview_by_jquery.jstree.patch new file mode 100644 index 000000000..b0b54febc --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8a-replace_treeview_by_jquery.jstree.patch @@ -0,0 +1,607 @@ +Description: treeview has a license issue, cacti upstream is going to replace it + with functionality from jquery.jstree. + . + This patch implements the changes needed for an upstream layout where the + necessary code is in cacti/include/js/jquery/ but the code in that path is + not included in this patch. + . + The necessary jquery scripts and theme info can come from cacti upstream and from + debian packages (libjs-jquery and libjs-jquery-cookie) The version used when + creating this patch can be found here: + http://svn.cacti.net/viewvc/cacti/branches/0.8.9/include/js/jquery/jquery.js?pathrev=7324 + http://svn.cacti.net/viewvc/cacti/branches/0.8.9/include/js/jquery/jquery.jstree.js?pathrev=7324 + http://svn.cacti.net/viewvc/cacti/branches/main/include/js/jquery/themes/default/?pathrev=7324 + http://anonscm.debian.org/gitweb/?p=pkg-javascript/jquery-goodies.git;a=blob;f=cookie/jquery.cookie.js;hb=c50e1a2d599cb48893e8d77470e71e83e44dfdb5 + . + This patch does NOT implement the changes needed for the Debian package of + cacti. + . + This patch was updated with the patch from Jan Zalesak in + http://bugs.debian.org/702690 which was further improved to also cover + lib/graph_export.php and to keep tag alignment consistent. +Bug: http://bugs.cacti.net/view.php?id=2228 +Bug-Debian: http://bugs.debian.org/679980 +Author: Paul Gevers +Date: Sun, 31 Mar 2013 11:59:05 +0200 + +--- a/include/top_graph_header.php ++++ b/include/top_graph_header.php +@@ -84,8 +84,9 @@ + + + +- +- ++ ++ ++ + + + +@@ -178,7 +179,6 @@ + +
    + +- + + + \n"); +- fwrite($fp,"\n"); + fwrite($fp,"\n"); + fwrite($fp,"\n"); + } +@@ -1383,16 +1374,7 @@ + include_once($config["library_path"] . "/tree.php"); + include_once($config["library_path"] . "/data_query.php"); + +- fwrite($fp, "\n"); ++ fwrite($fp, "
    \n"); ++ fwrite($fp, "\n"); ++ + } + + /* get_graph_tree_array_export - returns a list of graph trees taking permissions into account if +@@ -1478,8 +1485,7 @@ + $dhtml_tree = array(); + $dhtml_tree[0] = $start; + $dhtml_tree[1] = read_graph_config_option("expand_hosts"); +- $dhtml_tree[2] = "foldersTree = gFld(\"\", \"\")\n"; +- $i = 2; ++ $i = 1; + + $tree_list = get_graph_tree_array_export(); + +@@ -1499,7 +1505,6 @@ + if (((read_config_option("export_tree_isolation") == "on") && ($tree_id == $tree["id"])) || + (read_config_option("export_tree_isolation") == "off")) { + +- $i++; + + $hier_sql = "SELECT DISTINCT + graph_tree_items.id, +@@ -1522,19 +1527,53 @@ + $dhtml_tree_id = 0; + + if (sizeof($hierarchy) > 0) { ++ $last_tier = 1; ++ $openli = false; ++ $lasthost = false; ++ $opentree = false; + foreach ($hierarchy as $leaf) { + if ($dhtml_tree_id <> $tree["id"]) { +- $dhtml_tree[$i] = "ou0 = insFld(foldersTree, gFld(\"" . get_tree_name($tree["id"]) . "\", \"" . clean_up_export_name(get_tree_name($tree["id"])) . "_leaf.html\"))\n"; ++ if ($opentree) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\n\t\t\n\t\n"; ++ } ++ $i++; ++ $clean_id = clean_up_export_name(get_tree_name($tree["id"])); ++ $dhtml_tree[$i] = "\t
      \n\t\t
    • " . get_tree_name($tree["id"]) . "\n\t\t\t
        \n"; ++ $opentree = true; + } + $dhtml_tree_id = $tree["id"]; + +- $i++; + $tier = tree_tier($leaf["order_key"]); + + if ($leaf["host_id"] > 0) { //It's a host +- $dhtml_tree[$i] = "ou" . ($tier) . " = insFld(ou" . ($tier-1) . ", gFld(\"Host: " . $leaf["hostname"] . "\", \"" . clean_up_export_name($leaf["hostname"] . "_" . $leaf["id"]) . ".html\"))\n"; ++ if ($tier > $last_tier) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
          \n"; ++ } elseif ($tier < $last_tier) { ++ if (!$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\n"; ++ } ++ for ($x = $tier; $x < $last_tier; $x++) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
        \n\t\t\t\t\n"; ++ $openli = false; ++ } ++ } elseif ($openli && !$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\n"; ++ $openli = false; ++ } ++ $last_tier = $tier; ++ $lasthost = true; ++ $i++; ++ $clean_id = clean_up_export_name($leaf["hostname"] . "_" . $leaf["id"]); ++ $dhtml_tree[$i] = "\t\t\t\t
      • Host: " . htmlspecialchars($leaf["hostname"]) . "\n"; + + if (read_config_option("export_tree_expand_hosts") == "on") { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t
          \n"; + if ($leaf["host_grouping_type"] == HOST_GROUPING_GRAPH_TEMPLATE) { + $graph_templates = db_fetch_assoc("SELECT + graph_templates.id, +@@ -1552,7 +1591,8 @@ + if (sizeof($graph_templates) > 0) { + foreach ($graph_templates as $graph_template) { + $i++; +- $dhtml_tree[$i] = "ou" . ($tier+1) . " = insFld(ou" . ($tier) . ", gFld(\" " . $graph_template["name"] . "\", \"" . clean_up_export_name($leaf["hostname"] . "_gt_" . $leaf["id"]) . "_" . $graph_template["id"] . ".html\"))\n"; ++ $clean_id = clean_up_export_name($leaf["hostname"] . "_gt_" . $leaf["id"] . "_" . $graph_template["id"]); ++ $dhtml_tree[$i] = "\t\t\t\t\t\t
        • " . htmlspecialchars($graph_template["name"]) . "
        • \n"; + } + } + }else if ($leaf["host_grouping_type"] == HOST_GROUPING_DATA_QUERY_INDEX) { +@@ -1567,36 +1607,77 @@ + + array_push($data_queries, array( + "id" => "0", +- "name" => "Graph Template Based" ++ "name" => "Non Query Based" + )); + + if (sizeof($data_queries) > 0) { +- foreach ($data_queries as $data_query) { +- $i++; +- +- $dhtml_tree[$i] = "ou" . ($tier+1) . " = insFld(ou" . ($tier) . ", gFld(\" " . $data_query["name"] . "\", \"" . clean_up_export_name($leaf["hostname"] . "_dq_" . $leaf["title"] . "_" . $leaf["id"]) . "_" . $data_query["id"] . ".html\"))\n"; ++ foreach ($data_queries as $data_query) { ++ $i++; ++ $clean_id = clean_up_export_name($leaf["hostname"] . "_dq_" . $leaf["title"] . "_" . $leaf["id"] . "_" . $data_query["id"]); ++ $dhtml_tree[$i] = "\t\t\t\t\t\t
        • " . htmlspecialchars($data_query["name"]) . "\n"; + +- /* fetch a list of field names that are sorted by the preferred sort field */ +- $sort_field_data = get_formatted_data_query_indexes($leaf["host_id"], $data_query["id"]); ++ /* fetch a list of field names that are sorted by the preferred sort field */ ++ $sort_field_data = get_formatted_data_query_indexes($leaf["host_id"], $data_query["id"]); + +- if ($data_query["id"] > 0) { +- while (list($snmp_index, $sort_field_value) = each($sort_field_data)) { ++ if ($data_query["id"] > 0) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\t
            \n"; ++ while (list($snmp_index, $sort_field_value) = each($sort_field_data)) { ++ $i++; ++ $clean_id = clean_up_export_name($leaf["hostname"] . "_dqi_" . $leaf["id"] . "_" . $data_query["id"] . "_" . $snmp_index); ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\t\t
          • " . htmlspecialchars($sort_field_value) . "
          • \n"; ++ } + $i++; +- $dhtml_tree[$i] = "ou" . ($tier+2) . " = insFld(ou" . ($tier+1) . ", gFld(\" " . $sort_field_value . "\", \"" . clean_up_export_name($leaf["hostname"] . "_dqi_" . $leaf["title"] . "_" . $leaf["id"]) . "_" . $data_query["id"] . "_" . $snmp_index . ".html\"))\n"; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\t
          \n"; + } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t
        • \n"; + } + } +- } + } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t
        \n"; + } +- }else { +- $dhtml_tree[$i] = "ou" . ($tier) . " = insFld(ou" . ($tier-1) . ", gFld(\"" . $leaf["title"] . "\", \"" . clean_up_export_name(get_tree_name($tree["id"]) . "_" . $leaf["title"] . "_" . $leaf["id"]) . "_leaf.html\"))\n"; ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t
      • \n"; ++ }else { //It's not a host ++ if ($tier > $last_tier) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
          \n"; ++ } elseif ($tier < $last_tier) { ++ if (!$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\n"; ++ } ++ for ($x = $tier; $x < $last_tier; $x++) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t
        \n\t\t\t\t\n"; ++ $openli = false; ++ } ++ } elseif ($openli && !$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\n"; ++ $openli = false; ++ } ++ $last_tier = $tier; ++ $i++; ++ $clean_id = clean_up_export_name(get_tree_name($tree["id"]) . "_" . $leaf["title"] . "_" . $leaf["id"]); ++ $dhtml_tree[$i] = "\t\t\t\t
      • " . htmlspecialchars($leaf["title"]) . "\n"; ++ $openli = true; ++ $lasthost = false; + } + } ++ for ($x = $last_tier; $x > 1; $x--) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t
      \n\t\t\t\t
    • \n"; ++ } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
    \n\t\t\n\t\n"; + }else{ + if ($dhtml_tree_id <> $tree["id"]) { +- $dhtml_tree[$i] = "ou0 = insFld(foldersTree, gFld(\"" . get_tree_name($tree["id"]) . "\", \"" . clean_up_export_name(get_tree_name($tree["id"])) . "_leaf.html\"))\n"; + $i++; ++ $clean_id = clean_up_export_name(get_tree_name($tree["id"])); ++ $dhtml_tree[$i] = "\t"; + } + } + } +@@ -1612,10 +1693,10 @@ + $dir - the export directory where graphs will either be staged or located. + */ + function create_export_directory_structure($cacti_root_path, $dir) { +- /* create the treeview sub-directory */ +- if (!is_dir("$dir/treeview")) { +- if (!mkdir("$dir/treeview", 0755)) { +- export_fatal("Create directory '" . $dir . "/treeview' failed. Can not continue"); ++ /* create the jquery sub-directory */ ++ if (!is_dir("$dir/js")) { ++ if (!mkdir("$dir/js", 0755)) { ++ export_fatal("Create directory '" . $dir . "/js' failed. Can not continue"); + } + } + +@@ -1626,8 +1707,6 @@ + } + } + +- $treeview_dir = $dir . "/treeview"; +- + /* css */ + copy("$cacti_root_path/include/main.css", "$dir/main.css"); + +@@ -1639,18 +1718,15 @@ + copy("$cacti_root_path/images/shadow_gray.gif", "$dir/shadow_gray.gif"); + + /* java scripts for the tree */ +- copy("$cacti_root_path/include/treeview/ftiens4_export.js", "$treeview_dir/ftiens4.js"); +- copy("$cacti_root_path/include/treeview/ua.js", "$treeview_dir/ua.js"); +- +- /* images for the tree */ +- copy("$cacti_root_path/include/treeview/ftv2blank.gif", "$treeview_dir/ftv2blank.gif"); +- copy("$cacti_root_path/include/treeview/ftv2lastnode.gif", "$treeview_dir/ftv2lastnode.gif"); +- copy("$cacti_root_path/include/treeview/ftv2mlastnode.gif", "$treeview_dir/ftv2mlastnode.gif"); +- copy("$cacti_root_path/include/treeview/ftv2mnode.gif", "$treeview_dir/ftv2mnode.gif"); +- copy("$cacti_root_path/include/treeview/ftv2node.gif", "$treeview_dir/ftv2node.gif"); +- copy("$cacti_root_path/include/treeview/ftv2plastnode.gif", "$treeview_dir/ftv2plastnode.gif"); +- copy("$cacti_root_path/include/treeview/ftv2pnode.gif", "$treeview_dir/ftv2pnode.gif"); +- copy("$cacti_root_path/include/treeview/ftv2vertline.gif", "$treeview_dir/ftv2vertline.gif"); ++ copy("$cacti_root_path/include/js/jquery/jquery.js", "$dir/js/jquery.js"); ++ copy("$cacti_root_path/include/js/jquery/jquery.jstree.js", "$dir/js/jquery.jstree.js"); ++ copy("$cacti_root_path/include/js/jquery/jquery.cookie.js", "$dir/js/jquery.cookie.js"); ++ ++ /* theme info for java scripts */ ++ copy("$cacti_root_path/include/js/jquery/themes/default/style.css", "$dir/js/style.css"); ++ copy("$cacti_root_path/include/js/jquery/themes/default/d.png", "$dir/js/d.png"); ++ copy("$cacti_root_path/include/js/jquery/themes/default/d.gif", "$dir/js/d.gif"); ++ copy("$cacti_root_path/include/js/jquery/themes/default/throbber.gif", "$dir/js/throbber.gif"); + } + + function get_host_description($host_id) { +@@ -1738,8 +1814,9 @@ + + + +- +- ++ ++ ++ + + + +--- a/lib/html_tree.php ++++ b/lib/html_tree.php +@@ -495,17 +495,9 @@ + include_once($config["library_path"] . "/data_query.php"); + + ?> +- ++ + \n"; ++ $i = 2; + + $tree_list = get_graph_tree_array(); + +@@ -567,7 +583,6 @@ + + if (sizeof($tree_list) > 0) { + foreach ($tree_list as $tree) { +- $i++; + $hierarchy = db_fetch_assoc("select + graph_tree_items.id, + graph_tree_items.title, +@@ -583,21 +598,45 @@ + and graph_tree_items.local_graph_id = 0 + order by graph_tree_items.order_key"); + +- $dhtml_tree[$i] = "ou0 = insFld(foldersTree, gFld(\"" . htmlspecialchars($tree["name"]) . "\", \"" . htmlspecialchars("graph_view.php?action=tree&tree_id=" . $tree["id"]) . "\"))\n"; + $i++; +- $dhtml_tree[$i] = "ou0.xID = \"tree_" . $tree["id"] . "\"\n"; ++ $dhtml_tree[$i] = "\t
      \n\t\t
    • " . htmlspecialchars($tree["name"]) . "\n"; + + if (sizeof($hierarchy) > 0) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
        \n"; ++ $last_tier = 1; ++ $openli = false; ++ $lasthost = false; + foreach ($hierarchy as $leaf) { +- $i++; + $tier = tree_tier($leaf["order_key"]); + +- if ($leaf["host_id"] > 0) { +- $dhtml_tree[$i] = "ou" . ($tier) . " = insFld(ou" . abs(($tier-1)) . ", gFld(\"" . "Host: " . htmlspecialchars($leaf["hostname"]) . "\", \"" . htmlspecialchars("graph_view.php?action=tree&tree_id=" . $tree["id"] . "&leaf_id=" . $leaf["id"]) . "\"))\n"; ++ if ($leaf["host_id"] > 0) { //It's a host ++ if ($tier > $last_tier) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
          \n"; ++ } elseif ($tier < $last_tier) { ++ if (!$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\n"; ++ } ++ for ($x = $tier; $x < $last_tier; $x++) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
        \n\t\t\t\t\n"; ++ $openli = false; ++ } ++ } elseif ($openli && !$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\n"; ++ $openli = false; ++ } ++ $last_tier = $tier; ++ $lasthost = true; + $i++; +- $dhtml_tree[$i] = "ou" . ($tier) . ".xID = \"tree_" . $tree["id"] . "_leaf_" . $leaf["id"] . "\"\n"; ++ $dhtml_tree[$i] = "\t\t\t\t
      • Host: " . htmlspecialchars($leaf["hostname"]) . "\n"; + + if (read_graph_config_option("expand_hosts") == "on") { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t
          \n"; + if ($leaf["host_grouping_type"] == HOST_GROUPING_GRAPH_TEMPLATE) { + $graph_templates = db_fetch_assoc("select + graph_templates.id, +@@ -612,9 +651,7 @@ + if (sizeof($graph_templates) > 0) { + foreach ($graph_templates as $graph_template) { + $i++; +- $dhtml_tree[$i] = "ou" . ($tier+1) . " = insFld(ou" . ($tier) . ", gFld(\" " . htmlspecialchars($graph_template["name"]) . "\", \"graph_view.php?action=tree&tree_id=" . $tree["id"] . "&leaf_id=" . $leaf["id"] . "&host_group_data=graph_template:" . $graph_template["id"] . "\"))\n"; +- $i++; +- $dhtml_tree[$i] = "ou" . ($tier+1) . ".xID = \"tree_" . $tree["id"] . "_leaf_" . $leaf["id"] . "_hgd_gt_" . $graph_template["id"] . "\"\n"; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t
        • " . htmlspecialchars($graph_template["name"]) . "
        • \n"; + } + } + }else if ($leaf["host_grouping_type"] == HOST_GROUPING_DATA_QUERY_INDEX) { +@@ -645,33 +682,71 @@ + if ((($data_query["id"] == 0) && ($non_template_graphs > 0)) || + (($data_query["id"] > 0) && (sizeof($sort_field_data) > 0))) { + $i++; +- $dhtml_tree[$i] = "ou" . ($tier+1) . " = insFld(ou" . ($tier) . ", gFld(\" " . htmlspecialchars($data_query["name"]) . "\", \"" . htmlspecialchars("graph_view.php?action=tree&tree_id=" . $tree["id"] . "&leaf_id=" . $leaf["id"] . "&host_group_data=data_query:" . $data_query["id"]) . "\"))\n"; +- $i++; +- $dhtml_tree[$i] = "ou" . ($tier+1) . ".xID = \"tree_" . $tree["id"] . "_leaf_" . $leaf["id"] . "_hgd_dq_" . $data_query["id"] . "\"\n"; +- ++ $dhtml_tree[$i] = "\t\t\t\t\t\t
        • " . htmlspecialchars($data_query["name"]) . "\n"; + if ($data_query["id"] > 0) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\t
            \n"; + while (list($snmp_index, $sort_field_value) = each($sort_field_data)) { + $i++; +- $dhtml_tree[$i] = "ou" . ($tier+2) . " = insFld(ou" . ($tier+1) . ", gFld(\" " . htmlspecialchars($sort_field_value) . "\", \"" . htmlspecialchars("graph_view.php?action=tree&tree_id=" . $tree["id"] . "&leaf_id=" . $leaf["id"] . "&host_group_data=data_query_index:" . $data_query["id"] . ":" . urlencode($snmp_index)) . "\"))\n"; +- $i++; +- $dhtml_tree[$i] = "ou" . ($tier+2) . ".xID = \"tree_" . $tree["id"] . "_leaf_" . $leaf["id"] . "_hgd_dqi" . $data_query["id"] . "_" . urlencode($snmp_index) . "\"\n"; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\t\t
          • " . htmlspecialchars($sort_field_value) . "
          • \n"; + } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\t
          \n"; ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t
        • \n"; + } + } + } + } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t\t\n"; ++ } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t
        \n"; ++ } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t
      • \n"; ++ }else{ //It's not a host ++ if ($tier > $last_tier) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
          \n"; ++ } elseif ($tier < $last_tier) { ++ if (!$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\n"; + } ++ for ($x = $tier; $x < $last_tier; $x++) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t
        \n\t\t\t\t\n"; ++ $openli = false; ++ } ++ } elseif ($openli && !$lasthost) { ++ $i++; ++ $dhtml_tree[$i] = "\n"; ++ $openli = false; + } +- }else{ +- $dhtml_tree[$i] = "ou" . ($tier) . " = insFld(ou" . abs(($tier-1)) . ", gFld(\"" . htmlspecialchars($leaf["title"]) . "\", \"" . htmlspecialchars("graph_view.php?action=tree&tree_id=" . $tree["id"] . "&leaf_id=" . $leaf["id"]) . "\"))\n"; ++ $last_tier = $tier; + $i++; +- $dhtml_tree[$i] = "ou" . ($tier) . ".xID = \"tree_" . $tree["id"] . "_leaf_" . $leaf["id"] . "\"\n"; ++ $dhtml_tree[$i] = "\t\t\t\t
      • " . htmlspecialchars($leaf["title"]) . "\n"; ++ $openli = true; ++ $lasthost = false; + } + } ++ for ($x = $last_tier; $x > 1; $x--) { ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t\t\t
      \n\t\t\t\t
    • \n"; ++ } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\t
    \n"; + } ++ $i++; ++ $dhtml_tree[$i] = "\t\t\n\t\n"; + } + } + ++ $i++; ++ $dhtml_tree[$i] = "\n"; ++ + return $dhtml_tree; + } + +@@ -758,14 +833,6 @@ + } + } + +- print ""; +- + /* ================= input validation ================= */ + input_validate_input_number(get_request_var_post("graphs")); + input_validate_input_number(get_request_var_post("page")); diff --git a/src/patches/cacti/cacti-0.8.8b-html-injection.patch b/src/patches/cacti/cacti-0.8.8b-html-injection.patch new file mode 100644 index 000000000..1326dffb7 --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8b-html-injection.patch @@ -0,0 +1,19 @@ +------------------------------------------------------------------------ +r7443 | rony | 2014-03-30 18:43:28 -0500 (Sun, 30 Mar 2014) | 2 lines + +bug#0002431: CVE-2014-2326 Unspecified HTML Injection Vulnerability + +------------------------------------------------------------------------ +Index: branches/0.8.8/cdef.php +=================================================================== +--- branches/0.8.8/cdef.php (revision 7442) ++++ branches/0.8.8/cdef.php (revision 7443) +@@ -431,7 +431,7 @@ + ">Item # + + + + + + +
    +- : ++ : + + ">Move Down diff --git a/src/patches/cacti/cacti-0.8.8b-remote-command-execution.patch b/src/patches/cacti/cacti-0.8.8b-remote-command-execution.patch new file mode 100644 index 000000000..c357a06d7 --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8b-remote-command-execution.patch @@ -0,0 +1,28 @@ +------------------------------------------------------------------------ +r7442 | rony | 2014-03-30 18:41:56 -0500 (Sun, 30 Mar 2014) | 2 lines + +bug#0002433: CVE-2014-2328 Unspecified Remote Command Execution Vulnerability + +------------------------------------------------------------------------ +Index: branches/0.8.8/lib/graph_export.php +=================================================================== +--- branches/0.8.8/lib/graph_export.php (revision 7441) ++++ branches/0.8.8/lib/graph_export.php (revision 7442) +@@ -339,7 +339,7 @@ + chdir($stExportDir); + + /* set the initial command structure */ +- $stExecute = 'ncftpput -R -V -r 1 -u '.$aFtpExport['username'].' -p '.$aFtpExport['password']; ++ $stExecute = 'ncftpput -R -V -r 1 -u ' . cacti_escapeshellarg($aFtpExport['username']) . ' -p ' . cacti_escapeshellarg($aFtpExport['password']); + + /* if the user requested passive mode, use it */ + if ($aFtpExport['passive']) { +@@ -347,7 +347,7 @@ + } + + /* setup the port, server, remote directory and all files */ +- $stExecute .= ' -P ' . $aFtpExport['port'] . ' ' . $aFtpExport['server'] . ' ' . $aFtpExport['remotedir'] . "."; ++ $stExecute .= ' -P ' . cacti_escapeshellarg($aFtpExport['port']) . ' ' . cacti_escapeshellarg($aFtpExport['server']) . ' ' . cacti_escapeshellarg($aFtpExport['remotedir']) . "."; + + /* run the command */ + $iExecuteReturns = 0; diff --git a/src/patches/cacti/cacti-0.8.8b-rra-comments.patch b/src/patches/cacti/cacti-0.8.8b-rra-comments.patch new file mode 100644 index 000000000..c5becfe77 --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8b-rra-comments.patch @@ -0,0 +1,42 @@ +------------------------------------------------------------------------ +r7418 | gandalf | 2013-08-13 13:32:49 -0600 (Tue, 13 Aug 2013) | 1 line + +fix COMMENT handling, even in case COMMENT is empty, with or without HR and with variable substitution +------------------------------------------------------------------------ +Index: branches/0.8.8/lib/rrd.php +=================================================================== +--- branches/0.8.8/lib/rrd.php (revision 7417) ++++ branches/0.8.8/lib/rrd.php (revision 7418) +@@ -1343,20 +1343,20 @@ + $need_rrd_nl = TRUE; + + if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") { ++ # perform variable substitution first (in case this will yield an empty results or brings command injection problems) ++ $comment_arg = rrd_substitute_host_query_data($graph_variables["text_format"][$graph_item_id], $graph, $graph_item); ++ # next, compute the argument of the COMMENT statement and perform injection counter measures ++ if (trim($comment_arg) == '') { # an empty COMMENT must be treated with care ++ $comment_arg = cacti_escapeshellarg(' ' . $hardreturn[$graph_item_id]); ++ } else { ++ $comment_arg = cacti_escapeshellarg($comment_arg . $hardreturn[$graph_item_id]); ++ } ++ ++ # create rrdtool specific command line + if (read_config_option("rrdtool_version") != "rrd-1.0.x") { +- $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id])) . " "; +- if (trim($comment_string) == 'COMMENT:"\n"') { +- $txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work +- } else if (trim($comment_string) != "COMMENT:\"\"") { +- $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item); +- } ++ $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", $comment_arg) . " "; + }else { +- $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id]) . " "; +- if (trim($comment_string) == 'COMMENT:"\n"') { +- $txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work +- } else if (trim($comment_string) != "COMMENT:\"\"") { +- $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item); +- } ++ $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . $comment_arg . " "; + } + }elseif (($graph_item_types{$graph_item["graph_type_id"]} == "GPRINT") && (!isset($graph_data_array["graph_nolegend"]))) { + $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */ diff --git a/src/patches/cacti/cacti-0.8.8b-sanitize-variables.patch b/src/patches/cacti/cacti-0.8.8b-sanitize-variables.patch new file mode 100644 index 000000000..37ded2ec0 --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8b-sanitize-variables.patch @@ -0,0 +1,155 @@ +------------------------------------------------------------------------ +r7420 | cigamit | 2013-08-17 21:41:24 -0600 (Sat, 17 Aug 2013) | 1 line + +Bug #0002383 : Sanitize the step and id variables +------------------------------------------------------------------------ +Index: branches/0.8.8/host.php +=================================================================== +--- branches/0.8.8/host.php (revision 7419) ++++ branches/0.8.8/host.php (revision 7420) +@@ -149,6 +149,9 @@ + if ($_POST["snmp_version"] == 3 && ($_POST["snmp_password"] != $_POST["snmp_password_confirm"])) { + raise_message(4); + }else{ ++ input_validate_input_number(get_request_var_post("id")); ++ input_validate_input_number(get_request_var_post("host_template_id")); ++ + $host_id = api_device_save($_POST["id"], $_POST["host_template_id"], $_POST["description"], + trim($_POST["hostname"]), $_POST["snmp_community"], $_POST["snmp_version"], + $_POST["snmp_username"], $_POST["snmp_password"], +Index: branches/0.8.8/lib/api_device.php +=================================================================== +--- branches/0.8.8/lib/api_device.php (revision 7419) ++++ branches/0.8.8/lib/api_device.php (revision 7420) +@@ -107,7 +107,7 @@ + $_host_template_id = db_fetch_cell("select host_template_id from host where id=$id"); + } + +- $save["id"] = $id; ++ $save["id"] = form_input_validate($id, "id", "^[0-9]+$", false, 3); + $save["host_template_id"] = form_input_validate($host_template_id, "host_template_id", "^[0-9]+$", false, 3); + $save["description"] = form_input_validate($description, "description", "", false, 3); + $save["hostname"] = form_input_validate(trim($hostname), "hostname", "", false, 3); +Index: branches/0.8.8/install/index.php +=================================================================== +--- branches/0.8.8/install/index.php (revision 7419) ++++ branches/0.8.8/install/index.php (revision 7420) +@@ -310,27 +310,28 @@ + } + + /* pre-processing that needs to be done for each step */ +-if (empty($_REQUEST["step"])) { +- $_REQUEST["step"] = 1; +-}else{ +- if ($_REQUEST["step"] == "1") { +- $_REQUEST["step"] = "2"; +- }elseif (($_REQUEST["step"] == "2") && ($_REQUEST["install_type"] == "1")) { +- $_REQUEST["step"] = "3"; +- }elseif (($_REQUEST["step"] == "2") && ($_REQUEST["install_type"] == "3")) { +- $_REQUEST["step"] = "8"; +- }elseif (($_REQUEST["step"] == "8") && ($old_version_index <= array_search("0.8.5a", $cacti_versions))) { +- $_REQUEST["step"] = "9"; +- }elseif ($_REQUEST["step"] == "8") { +- $_REQUEST["step"] = "3"; +- }elseif ($_REQUEST["step"] == "9") { +- $_REQUEST["step"] = "3"; +- }elseif ($_REQUEST["step"] == "3") { +- $_REQUEST["step"] = "4"; ++if (isset($_REQUEST["step"]) && $_REQUEST["step"] > 0) { ++ $step = intval($_REQUEST["step"]); ++ if ($step == "1") { ++ $step = "2"; ++ } elseif (($step == "2") && ($_REQUEST["install_type"] == "1")) { ++ $step = "3"; ++ } elseif (($step == "2") && ($_REQUEST["install_type"] == "3")) { ++ $step = "8"; ++ } elseif (($step == "8") && ($old_version_index <= array_search("0.8.5a", $cacti_versions))) { ++ $step = "9"; ++ } elseif ($step == "8") { ++ $step = "3"; ++ } elseif ($step == "9") { ++ $step = "3"; ++ } elseif ($step == "3") { ++ $step = "4"; + } ++} else { ++ $step = 1; + } + +-if ($_REQUEST["step"] == "4") { ++if ($step == "4") { + include_once("../lib/data_query.php"); + include_once("../lib/utility.php"); + +@@ -366,7 +367,7 @@ + + header ("Location: ../index.php"); + exit; +-}elseif (($_REQUEST["step"] == "8") && ($_REQUEST["install_type"] == "3")) { ++}elseif (($step == "8") && ($_REQUEST["install_type"] == "3")) { + /* if the version is not found, die */ + if (!is_int($old_version_index)) { + print "

    Error

    +@@ -505,7 +506,7 @@ +
    +- ++ + +

    Thanks for taking the time to download and install cacti, the complete graphing + solution for your network. Before you can start making cool graphs, there are a few +@@ -530,7 +531,7 @@ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details.

    + +- ++ + +

    Please select the type of installation

    + +@@ -551,7 +552,7 @@ + print "Server Operating System Type: " . $config["cacti_server_os"] . "
    "; ?> +

    + +- ++ + +

    Make sure all of these values are correct before continuing.

    + + +- ++ + +

    Upgrade results:

    + +@@ -659,7 +660,7 @@ + print $upgrade_results; + ?> + +- ++ + +

    Important Upgrade Notice

    + +@@ -673,7 +674,7 @@ + + + +-

    finishnext.gif" alt="FinishNext">

    ++

    finishnext.gif" alt="FinishNext">

    +
    +@@ -681,7 +682,7 @@ + + + +-"> ++ + + + diff --git a/src/patches/cacti/cacti-0.8.8b-sql-injection-shell-escaping.patch b/src/patches/cacti/cacti-0.8.8b-sql-injection-shell-escaping.patch new file mode 100644 index 000000000..cb72d7971 --- /dev/null +++ b/src/patches/cacti/cacti-0.8.8b-sql-injection-shell-escaping.patch @@ -0,0 +1,117 @@ +------------------------------------------------------------------------ +r7439 | rony | 2014-03-30 17:52:10 -0500 (Sun, 30 Mar 2014) | 5 lines + +bug#0002405: SQL injection in graph_xport.php + + - Fixed form input validation problems + - Fixed rrd export and graph shell escape issues + +------------------------------------------------------------------------ +Index: branches/0.8.8/graph_xport.php +=================================================================== +--- branches/0.8.8/graph_xport.php (revision 7438) ++++ branches/0.8.8/graph_xport.php (revision 7439) +@@ -47,43 +47,48 @@ + + $graph_data_array = array(); + ++/* ================= input validation ================= */ ++input_validate_input_number(get_request_var("local_graph_id")); ++input_validate_input_number(get_request_var("rra_id")); ++/* ==================================================== */ ++ + /* override: graph start time (unix time) */ +-if (!empty($_GET["graph_start"]) && $_GET["graph_start"] < 1600000000) { +- $graph_data_array["graph_start"] = $_GET["graph_start"]; ++if (!empty($_GET["graph_start"]) && is_numeric($_GET["graph_start"] && $_GET["graph_start"] < 1600000000)) { ++ $graph_data_array["graph_start"] = get_request_var("graph_start"); + } + + /* override: graph end time (unix time) */ +-if (!empty($_GET["graph_end"]) && $_GET["graph_end"] < 1600000000) { +- $graph_data_array["graph_end"] = $_GET["graph_end"]; ++if (!empty($_GET["graph_end"]) && is_numeric($_GET["graph_end"]) && $_GET["graph_end"] < 1600000000) { ++ $graph_data_array["graph_end"] = get_request_var("graph_end"); + } + + /* override: graph height (in pixels) */ +-if (!empty($_GET["graph_height"]) && $_GET["graph_height"] < 3000) { +- $graph_data_array["graph_height"] = $_GET["graph_height"]; ++if (!empty($_GET["graph_height"]) && is_numeric($_GET["graph_height"]) && $_GET["graph_height"] < 3000) { ++ $graph_data_array["graph_height"] = get_request_var("graph_height"); + } + + /* override: graph width (in pixels) */ +-if (!empty($_GET["graph_width"]) && $_GET["graph_width"] < 3000) { +- $graph_data_array["graph_width"] = $_GET["graph_width"]; ++if (!empty($_GET["graph_width"]) && is_numeric($_GET["graph_width"]) && $_GET["graph_width"] < 3000) { ++ $graph_data_array["graph_width"] = get_request_var("graph_width"); + } + + /* override: skip drawing the legend? */ + if (!empty($_GET["graph_nolegend"])) { +- $graph_data_array["graph_nolegend"] = $_GET["graph_nolegend"]; ++ $graph_data_array["graph_nolegend"] = get_request_var("graph_nolegend"); + } + + /* print RRDTool graph source? */ + if (!empty($_GET["show_source"])) { +- $graph_data_array["print_source"] = $_GET["show_source"]; ++ $graph_data_array["print_source"] = get_request_var("show_source"); + } + +-$graph_info = db_fetch_row("SELECT * FROM graph_templates_graph WHERE local_graph_id='" . $_REQUEST["local_graph_id"] . "'"); ++$graph_info = db_fetch_row("SELECT * FROM graph_templates_graph WHERE local_graph_id='" . get_request_var("local_graph_id") . "'"); + + /* for bandwidth, NThPercentile */ + $xport_meta = array(); + + /* Get graph export */ +-$xport_array = @rrdtool_function_xport($_GET["local_graph_id"], $_GET["rra_id"], $graph_data_array, $xport_meta); ++$xport_array = @rrdtool_function_xport($_GET["local_graph_id"], get_request_var("rra_id"), $graph_data_array, $xport_meta); + + /* Make graph title the suggested file name */ + if (is_array($xport_array["meta"])) { +Index: branches/0.8.8/lib/rrd.php +=================================================================== +--- branches/0.8.8/lib/rrd.php (revision 7438) ++++ branches/0.8.8/lib/rrd.php (revision 7439) +@@ -865,13 +865,13 @@ + /* basic graph options */ + $graph_opts .= + "--imgformat=" . $image_types{$graph["image_format_id"]} . RRD_NL . +- "--start=$graph_start" . RRD_NL . +- "--end=$graph_end" . RRD_NL . ++ "--start=" . cacti_escapeshellarg($graph_start) . RRD_NL . ++ "--end=" . cacti_escapeshellarg($graph_end) . RRD_NL . + "--title=" . cacti_escapeshellarg($graph["title_cache"]) . RRD_NL . + "$rigid" . +- "--base=" . $graph["base_value"] . RRD_NL . +- "--height=$graph_height" . RRD_NL . +- "--width=$graph_width" . RRD_NL . ++ "--base=" . cacti_escapeshellarg($graph["base_value"]) . RRD_NL . ++ "--height=" . cacti_escapeshellarg($graph_height) . RRD_NL . ++ "--width=" . cacti_escapeshellarg($graph_width) . RRD_NL . + "$scale" . + "$unit_value" . + "$unit_exponent_value" . +@@ -1606,8 +1606,8 @@ + + /* basic export options */ + $xport_opts = +- "--start=$xport_start" . RRD_NL . +- "--end=$xport_end" . RRD_NL . ++ "--start=" . cacti_escapeshellarg($xport_start) . RRD_NL . ++ "--end=" . cacti_escapeshellarg($xport_end) . RRD_NL . + "--maxrows=10000" . RRD_NL; + + $xport_defs = ""; +@@ -1997,7 +1997,7 @@ + $stacked_columns["col" . $j] = ($graph_item_types{$xport_item["graph_type_id"]} == "STACK") ? 1 : 0; + $j++; + +- $txt_xport_items .= "XPORT:" . $data_source_name . ":" . str_replace(":", "", cacti_escapeshellarg($legend_name)) ; ++ $txt_xport_items .= "XPORT:" . cacti_escapeshellarg($data_source_name) . ":" . str_replace(":", "", cacti_escapeshellarg($legend_name)) ; + }else{ + $need_rrd_nl = FALSE; + }