function toggle_checks(group_name) {
	// if anything in group is checked, all get unchecked
	nothing_is_checked = true;
	if (typeof(window[group_name.length]) == "undefined") { group_name.checked = (group_name.checked?false:true); }
	for (i=0; i<group_name.length; i++) {if(group_name[i].checked==true) { nothing_is_checked=false;break;}}
	for (i=0; i<group_name.length; i++) group_name[i].checked=nothing_is_checked ;
}


function toggle_checks_jqtransform(container_name, id_of_parent, id_of_container_holding_all) {
	// if the parent is checked, all get unchecked
	check_value = document.getElementById(id_of_parent).checked;
	elements_to_check = document.getElementById(id_of_container_holding_all).getElementsByTagName('input');
	 for (var x=0; x<elements_to_check.length; x++) {
        if (elements_to_check[x].type.toUpperCase()=='CHECKBOX' && elements_to_check[x].nodeName != id_of_parent) elements_to_check[x].checked = check_value;
    }
	if (check_value == true) {
		$("." + container_name + " a").addClass('jqTransformChecked');
	} else {
		$("." + container_name + " a").removeClass('jqTransformChecked');
	}
}

function deletion_confirmation(uid) {
	var response = confirm('Deletion is not undoable. Are you sure?');
	if(response == true) {
		window.document.deletion_form.uid.value=uid;
		window.document.deletion_form.submit();
	};
}


