Although there is no way to disable to close (x) button directly, it can be achieved by a function in IE4+.
In the onload event of the window you call a function which has this text in it:
this.window.onbeforeunload=beforeUnload; //functionality for [x] closing the window
Because it is JScript, don't put the function bracets after the 'beforeUnload' call.
You also have to make a function called "beforeUnload" where you do your check like so:
function beforeUnload() {
return "Are you sure you want to quit?";
}
Now an alert with this text is shown. When you press OK, the window will close, otherwise it will remain opened.