JavaScript
alert
is a bad idea. It's fine, at best, as a temporary tool used during development process, but hardly flexible enough and good looking enough for the code of production quality. This is good if you want something rudimentary.
Perhaps the best idea would be some facility collectively known as "modal pop-up"; one of the most popular implementation is
jQuery Dialog, but there are much more other implementations; many of them are 3rd-party jQuery UI plug-ins, featuring many effects, like transitional, and, notably, dimming. There are similar "models" in other JavaScript libraries. Basically, such products emulate modal behavior, in certain specific sense of this word, on the same Web page, which is a big benefit: there are no pop-up windows, nothing in the browser blocks such behavior.
Please read my article on the topic:
Modal Popup From Scratch.
Not only I offer my own fully-functional product, but I also explain the conceptions, how it works, and explain the rationale behind all kinds of such "pop-ups", so you can decide what to use by yourself, or develop your own.
See also:
Modal popup.
—SA