Check out some of the answers to this question - I think it might apply to yours:
how to run click function after default behaviour of a element
I think you're running into an inconsistency in the browser implementation of the onclick
function. Some choose to toggle the checkbox before the event is fired and some after.