Ideas:
1) How does the root script know which element it is? Pass the window object in the same argument list.
2) Use the trappable events system to call the (for example) onClick event of the element.
3) Otherwise, you have to make the call from the element itself.
Wanna post pseudocode? I work in client-side JS a lot (with frames), you can email me if you want: ts under_score eliot at pacbell.net