Using this API is not a good idea, not even because it has poor browser compatibility, but because this is the feature removed from Web standards:
Window.showModalDialog() — Web APIs.
In my article, I explained more reasonable alternatives you may have and some rationale behind:
Modal Popup From Scratch.
I explained how to do things from scratch, but the most usual approach is using jQuery UI with jQuery plug-ins, 3rd-party ones (collectively known under the name "modal popup") of jQuery UI
Dialog
:
Dialog | jQuery UI,
Modal Popup.
—SA