Get context of overlay (get parent page information)
Unfortunately the PHP that's rendering the child page knows nothing about the parent page over which it's going to be placed. You could write an AJAX callback that checks window.location and reports back to the server, but that would have to run after the page was fully rendered.