My advice is to use some cross browser library.
I prefer Prototype others might say jQery or
whatever else libs hang around out there.
These libraries really take the pain out of
cross browser compatibility.
Sorry forgot the link to my favorite:
http://www.prototypejs.org/
Cheers
Manfred