nsnull, szCheckMessage, checkValue, &buttonPressed);
nsnull, nsnull, nsnull, szCheckMessage, checkValue, &buttonPressed);
CheckConfirmDialog(JSContext* cx, const PRUnichar *szMessage, const PRUnichar *szCheckMessage,                   PRBool *checkValue) {    nsresult res;    //-- Get a prompter for the current window.    nsCOMPtr<nsIPrompt> prompter;    nsCOMPtr<nsIScriptContext> scriptContext = (nsIScriptContext*)JS_GetContextPrivate(cx);    if (scriptContext)    {        nsCOMPtr<nsIScriptGlobalObject> globalObject(dont_AddRef(scriptContext->GetGlobalObject()));        NS_ASSERTION(globalObject, "script context has no global object");        nsCOMPtr<nsIDOMWindowInternal> domWin = do_QueryInterface(globalObject);        if (domWin)            domWin->GetPrompter(getter_AddRefs(prompter));    }    if (!prompter)    {        //-- Couldn't get prompter from the current window, so get the prompt service.        nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));        if (wwatch)          wwatch->GetNewPrompter(0, getter_AddRefs(prompter));    }    if (!prompter)    {        *checkValue = 0;        return PR_FALSE;    }        PRInt32 buttonPressed = 1; /* in case user exits dialog by clicking X */    nsAutoString dialogTitle;    if (NS_FAILED(res = Localize("Titleline", dialogTitle)))        return PR_FALSE;        res = prompter->ConfirmEx(dialogTitle.GetUnicode(), szMessage,                              (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) +                              (nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1),                              nsnull, szCheckMessage, checkValue, &buttonPressed);        if (NS_FAILED(res)) {        *checkValue = 0;    }    if (*checkValue != 0 && *checkValue != 1) {        *checkValue = 0; /* this should never happen but it is happening!!! */    }    return (buttonPressed == 0);}