/**
 * Toggles the check state of a group of boxes
 *
 * Checkboxes must have an id attribute in the form cb0, cb1...
 * @param The number of box to 'check'
 * @param An alternative field name
 */
 
function check_state(state) {
	var ins = document.getElementsByTagName( 'input' );
	for( i in ins ) {
		var input = ins[i];
		if ( input.type == 'checkbox' ) input.checked = state; }
	}
 