Simulate a Modal Dialogue Box v2

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 has two parts - the first part is contained in the parent page, the second in the child page. This version can be used with a popup form to keep the form window to the front, as it does not remove focus from the form fields - and so allows text entry. There is an alternative solution to this problem here.