Since you are using Javascript to change the box color in the first place, I would recommend asking the Javascript community how to use Javascript to change it back.
Also, won't what you posted change the color of the whole table row (not just the checkbox)? I see that the answer is yes.
Anyway, I just googled a bit - I suppose you could have done that yourself - and found this at
http://www.ozzu.com/ftopic22858.html:
Then, to make it all work, you would write the checkboxes this way:
The Javascript folks might be able to give you a better answer.