This one is pretty straightforward: Just set a couple of flag switches so you can hide and show a div via using the appendChild
You may use this technique to present pop-up ads, or to solicit subscribers to your ezine, newsletter, or RSS feed. Use if for reminders, warnings, or statistics displaying. You may get survey participants, ask for donations, or use it for political fund raising. You can even inform visitors about some of your other related websites. There is no end to the types of purposes that pop-ups can be used for.
If your pop-up is about thumbnail enlargement, check out What is the easiest way to do thumbnail image enlargement windows?
If you want thumbnail enlargement without clicking, check out Making an Image Enlarge When The Mouse Cursor Is Hovering Over It