This is a fun one I found today - using getElementById() in IE7 to find a dom element on the page, if you are getting some interesting errors then one possibility is that you have two elements with the same id - or the same name attribute it seems.
The first thing to check really - have a look through the source code for another dom element of the same id. The generated source code if your page is dynamically creating some dom elements.
can be returned when attempting to retrieve:
Another useful tip I found which made debugging this dom quirk a little easier was this one liner command for emptying the temporary files on IE7:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
This saved me a lot of mouse clicks!