I have a javascript routine that is performing actions on a group of checkboxes, but the final action I want to set the clicked checkbox to checked or unchecked based on if
You should be evaluating against the checked property of the checkbox element.
for (i=0; i