This is a continuation, or a new version for my last post about window.showModalDialog().
The new version was implemented as a jQuery function to which you can pass options which you like.
This version was made because:
1) The impossibility of previous version to retain dialogArguments during postback;
2) The impossibility of previous version to close the dialog when the target page is inside several iframe tags;
3) The impossibility of previous version to retain window.returnValue during postback;
4) It will be possible now to fire a postback of the page or to fire a postback of a element (with targetElementId) right after the dialog was closed and the callback function finished to execute;
5) Theoretically this popup library can be used to open another popup inside an existing one (Note: I haven't tried this yet).
However, previous version of my showModalDialog can satisfy someone's requirements and it will be no need to complicate his life with the new version.