Just for relief I tried doing it the Prototype way. Not only was it more readable, logical and shorter, it magically didn't encounter the same bug.
I think it's become time for Prototype to be available throughout the site I work on. I've used it for a few small, targetted applications, and it's wonderful. Time for it to be used everywhere.
First, however, I need to see if I can lazy load it.