CheckConfirmDialog(const PRUnichar *szMessage, const PRUnichar *szCheckMessage,
CheckConfirmDialog(JSContext* cx, const PRUnichar *szMessage, const PRUnichar *szCheckMessage,
CheckConfirmDialog(const PRUnichar *szMessage, const PRUnichar *szCheckMessage,                   PRBool *checkValue) {    nsresult res;      NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &res);    if (NS_FAILED(res)) {        *checkValue = 0;        return PR_FALSE;    }        PRInt32 buttonPressed = 1; /* in case user exits dialog by clicking X */    nsAutoString yes, no, titleline;    if (NS_FAILED(res = Localize("Yes", yes)))        return PR_FALSE;    if (NS_FAILED(res = Localize("No", no)))        return PR_FALSE;    if (NS_FAILED(res = Localize("Titleline", titleline)))        return PR_FALSE;        res = dialog->UniversalDialog(        nsnull, /* title message */        titleline.GetUnicode(), /* title text in top line of window */        szMessage, /* this is the main message */        szCheckMessage, /* This is the checkbox message */        yes.GetUnicode(), /* first button text */        no.GetUnicode(), /* second button text */        nsnull, /* third button text */        nsnull, /* fourth button text */        nsnull, /* first edit field label */        nsnull, /* second edit field label */        nsnull, /* first edit field initial and final value */        nsnull, /* second edit field initial and final value */        nsnull,  /* icon: question mark by default */        checkValue, /* initial and final value of checkbox */        2, /* number of buttons */        0, /* number of edit fields */        0, /* is first edit field a password field */        &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);}