This isn't a problem at all, if I understand you properly.
The onLoad event of the main page opens a new window for the context menu. You can pass variables to PHP in the onLoad event as GET variables (in the URL).
A PHP script generates the context menu based on the value of the GET variables passed to the page.
If the user clicks something in the main window that should modify the context window, just refresh the context window with new GET variables.
Take care,
Nik
http://www.bigaction.org/