Ajax弹出窗口

I would like to create an Ajax pop up window that will show when a user clicks a link or image. I would like to pass any values desired from the popup window to the parent window, or to any other page ( if a link within popup window navigates to a new page). Also, how do I decide if a link will load within the popup window or parent window? I will use php pages for this. What code will I use to implement this?

you could use jQueryUI http://www.jqueryui.com

You could use one of the many lightboxes that can be found online, some good ones include Fancybox, shadowbox and Lightbox evolution

As for loading within the popup or the parent window, you can just use target="_parent" and target="_self" for this.