function selectAll(thisButton) { 
    var allInput = $$("input");
//
//   while going through all the input fields,
//   only select those fields on the form where the button was clicked
//   by checking that the form name of the element == the form name of the button clicked
//
//   for radio and checkboxes you have to check the "checked" property to see
//   if it was selected before formastting the post variables
//
    for (var i=0;i<allInput.length;i++) {
		if (allInput[i].type == "checkbox"
						&&
			allInput[i].id != thisButton.id) {
			if(allInput[i].form.name == thisButton.form.name) {  
                if (thisButton.checked == 1) {
                    allInput[i].checked = 1;
                }
                else {
                    allInput[i].checked = 0;
                }
            }
        }
    }
}    

