Forum Moderators: open
Don't be hypnotized by Dreamweaver's language to describe a "layer". There is really only a <div></div> element, not a <layer></layer>. So either use <div> or just position the <img> tag itself, which is what it looks like you set out to do anyway.
So what is this visible javascript all about?
Perhaps that is the problem - are you displaying the text of a script inside a form element of some kind, like a textarea? That might make for trouble. As far as I know you cannot place anything "on top of" a form element, just as you can't get "on top of" a flash object.