What happens if you use setTimeout() to call a function one second after that event? If the user clicked ok, the page would unload before the time was up, right?
window.onbeforeunload = function()
{
var bUnsavedFields = FormUtil.checkModifiedFields("formToCheck");
if(bUnsavedFields)
{
window.event.returnValue = "You have unsaved work";
}
[b]setTimeout("myFunctionA();",1000);[/b]
}