You're completely right on all points. I've changed the script to use the normal DOM methods instead of modifying innerHTML.
The replacement for addOnloadHook is $(document).ready.
addOnloadHook
$(document).ready
Why not use it, then? We never know what is going to bite us next.