Erm, I kind of meant the php code, the js is not really necessary to solve the problem, If you have a problem the the javascript, please post it in the javascript section (and remeber to use [CODE] tags!)
--
The problem with new windows and sessions is that different web browsers treat windows differently, when a new tab is open in browser X no new session is generated, however when a new window is opened in browser X, a new session is generated. In browser Y, all new windows open in tabs, thus keeping the session, however when a new window is opened via JS (what your doing) it immediately blocks it and requires a refresh of the page thus tampering with what the script belives as an open window. This varies on a browser to browser basis. (IE Quirk, no sessions are stored if there is a query string with abnormal characters like underscores)
--
Now Cookies would not require php, and it could be managed 100% though javascript, but if the window is ever closed, it would mess up the entire flow.
--
To get the php session to work, despite my rant about it, copy all the code in the previous posts (with the fixed <a> tags!) to the opening page, then in the popup page:
PHP Code:
<?
session_start
();
$_SESSION['popup']=true;
?>
dub dub dub js player stuff
Once the opening page is reloaded, you should be able to use an if statement on that to decide what content to show.