Simulate a Modal Dialogue Box

This script simulates a modal dialogue box, i.e. the popup window remains on top until closed. A modal dialogue box can be opened with a specific function in Internet Explorer, but this is specific IE code and so it is not cross-browser compatible.The method given here is cross-browser compatible.

The code that simulates the modal dialogue is actually contained with the popup window page - not the parent page. This version cannot be used with a popup window containing a form, as the form fields cannot gain focus. There is an alternative solution to this problem here.