The important thing to keep track of is whether a given click is the "first" or not. This means you'd have to keep track of clients so that you can identify repeat custom. This can be handled by session variables. When the page loads, check for the session variable. If it's not there, then this is the first load. If it is, then this is a subsequent load.
If this is the first load, write the javascript popup code. On subsequent loads, don't write the popup code.
You will need to use either session_destroy() or $_SESSION['reload']=null (or whatever you called the session variable) if you want the popup code to be put back for the same user at a later time in the session. I don't know whether you'll be wanting to do this, though.