Confirm dialog

Confirm dialog

I'm trying to build a confirm dialog box.
If found a nice plugin ( http://abeautifulsite.net/notebook/87) but the behavior is not like a normal confirm dialog box. You have to add a callback function to react on the ok/cancel buttons.

Is it possible the simulate this behavior so I can have a function like this:

function showConfirmation(title, text){
    //this displays a jQuery Dialog form and  returns true/false
   return myjQueryConfirm(title, text);
}


I tried this with the plugin

function showConfirmation(title, text){
   var res;
   jConfirm(title, text, function (r) { res = r;});
   return res;
}

But after the jConfirm is executed, the function proceeds and immediately returns res which is not defined.

Is there something I don't see or is it just not possible?