I know some about javascript, but not much with ajax.

This is what I need done. I have a link wraped with php code, I want to use a javascript onclick event with it but I don't want to make a new link on the page nor do I want to integrate the onlick event by wrapping the link with javascript. It would be to much work for me to take a part and reprogram the php link on the page since it's saturated with other server side code.

What I want to know and do is some how code a hidden program on the same page that knows when the php link has been clicked and if it has been clicked the code would pop up a second tab url to another page when the browser is loading the php link.

Basically a pop up. I don't know how to do this without using

<a href="#" onClick="window.open('http://link1.com'); window.open('http://link2.com');">link text</a>
Since the php link url will not be placed in the href="#". Can ajax be able to know when a separate link has been clicked and onload create a pop up to a separate page?

Thanks a million boys/girls