I'd have to look a bit deeper, but initially,
don't call it layer since it tuurns up as a reserved
word and browsers get confused easily.
Beyond that, you're looking at some fun since the control between EI and NS are very different but you'll need something like this...
Note that I've called the layer "layer0".
If you have more problems, we can cover them point by point here, but I'd recommend a good book and an informative web site. (I like O'Reillys Javascript book)
Dave.
(and I'm no expert, I'm stealing from a solution someone wrote for me ages back

)
[This message has been edited by David O'Meara (edited October 29, 2001).]