<script type="text/javascript">
	jQuery(document).ready(function() {
		// create jQuery buttonset object when VisibilityBox is switched on
		jQuery('#visible_priority').one('click', function() {
			jQuery('#priority_div').buttonset();
		});
	});

	function addPopupValues(list) {
		if (!isset('object', list)) {
			return false;
		}

		if (list.object == 'deptrigger') {
			for (var i = 0; i < list.values.length; i++) {
				create_var('triggersForm', 'new_dependency[' + i + ']', list.values[i].triggerid, false);
			}

			create_var('triggersForm', 'add_dependency', 1, true);
		}
	}

	function removeDependency(triggerid) {
		jQuery('#dependency_' + triggerid).remove();
		jQuery('#dependencies_' + triggerid).remove();
	}
</script>
