/**
 * String JV_GLOBAL_DEFAULT_CHECKBOX_VALUE
 *
 * Is the default value for unselected checkboxes.
 **/
var JV_GLOBAL_DEFAULT_CHECKBOX_VALUE = "-";

/**
 * function js_bugfix_checkbox_problem()
 *
 * Iterates through all checkboxes inside the current formular
 * "objRef". If a checkbox is unselected, the algorithm will
 * give it the value "JV_GLOBAL_DEFAULT_CHECKBOX_VALUE" and will
 * check it in any case.
 *
 * How to use: simply add the code snippet
 *
 *          onsubmit="js_bugfix_checkbox_problem(this);"
 *
 * into the <form>-tag you wish to adjust.
 *
 * @access public
 * @return void
 **/
function js_bugfix_checkbox_problem(objRef) {
	if (objRef) {
		for (var i = 0; i < objRef.length; ++i) {
			if (objRef.elements[i].type == 'checkbox') {
				if (!objRef.elements[i].checked) {
					objRef.elements[i].value = JV_GLOBAL_DEFAULT_CHECKBOX_VALUE;
					objRef.elements[i].checked = true;
				}
			}
		}
	}
}
