But the rest is basically an explicit - and browser neutral - version of what Spice posted. The flaw in the original is that IE dynamically changes the document object that the for loop sees whilst it is iterating over it. This voliates how closures are supposed to work and is IMO the kind of thing that accounts for many of the JS/DOM bugs in IE.
Wade.