Okay, let me break this down for you...
You came here asking for help and posted code of which there is only one function named "newpm". Then we helped you, and your code showed that you would be calling a function called "popupBox" after a specific time. We didn't see such a function, so we told you to make sure it's actually defined (as in you have "function popupBox() { }" somewhere in your code).
So if you want to pop-up a box saying "You have X unread messages, read now?" with an "OK" and "Cancel" button, then just call "newpm" again, not "popupBox". Otherwise, define your function popupBox.
I don't know how else to explain it.....
Either use:
function newpm() {
var answer = confirm ("You have a new PM, please click OK to go to your PM Inbox.")
if (answer)
window.location='usercp.php?uid=<? echo $CURUSER["uid"]; ?>&do=pm&action=list'
else
setTimeout('popupBox()', 600000);
}
function popupBox() {
alert('You have some unread messages!');
}
Or:
function newpm() {
var answer = confirm ("You have a new PM, please click OK to go to your PM Inbox.")
if (answer)
window.location='usercp.php?uid=<? echo $CURUSER["uid"]; ?>&do=pm&action=list'
else
setTimeout('newpm()', 600000);
}