A website I am currently working on opens up pop-up windows to show a larger view of the product. A while ago I saw a website that did the same thing, only when the user clicked back onto the main window (not the pop-up) the pop-up closed itself. So as soon as the user was done with the pop-up and began navigating the rest of the site, to window would just close itself. How would I do this?

Thanks,
Michael