Call javascript from multiple swf layers

I’m spent…
Anyone have any suggestions on linking to a javascript file from various swf files which get loaded individualy into a layer (flash 5.)

I can call the javascript into the initial layer and it works fine but once I call the animation into the second layer the javascript link does’nt work.

http://www.michael-thomas.com/tech/flash/examples/ex_flashcalljs.html