This document demonstrates how to script across the 'object' element to an embedded SVG document and it's scripts in a cross-browser way. View the document's (heavily commented) source to see how.
To test JavaScript access from the HTML document to the SVG document click here. To test JavaScript access from the HTML document to the SVG document's "window" click here (accessing the SVG document's "window" allows you to access variables and functions defined in scripts in the SVG document).