I should also mention that you can reach the getPage() function from inside any iframe or object:
<html>
<body>
<a href="" onclick="location.href='javascript: window.parent.getPage(1);'">get me from foo.html to bar.html</a>
</body>
</html>
All this may seem trivial to you, but it wasn't to me a few days ago. In my struggle to get out of the iframe/object, I turned to php. Cheers.