help show dialog return true false

help show dialog return true false

some of my page content  I cannot change as its generated    by the server ,
for example
my server generates this code

  1. <a href="#" id="deleteLink54" onclick="if(!confirm('Are you sure you want to delete?')) return false;var wcall=wicketAjaxGet('?x=z12gKfTAS1nMK-rWQvvTcgIWpk3l8d8hmfKCNYTSVUiA-t2d2o9eau0xd1*zS*exbWtaUKv-pe7zMozBPBI0FGcDSyZ3O7FJeZ6y1k0FlgEsF6MvnfsXPXOWplSlW9LK',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('deleteLink54') != null;}.bind(this));return !wcall;">Delete</a>
all I can change in the above code is   
  1. if(!confirm('Are you sure you want to delete?')) return false;


here   the confirm   creates javascript  alert  and I want   to replace this with jquery dialog, but I am not able to write a function whihc shows  a jquery dialog and after its closed  return true or false
here is my jquery dialog function

  1. function fnComfirm(title, content) {
  2. $("#confirm-dialog span").html(content);
  3. $("#confirm-dialog").dialog({
  4. title: title,
  5. resizable: false,
  6. height: 200,
  7. width: 486,
  8. modal: true,
  9. buttons: {
  10. "OK": function() {
  11. $( this ).dialog("close");
  12. callback(true);
  13. },
  14. Cancel: function() {
  15. $( this ).dialog("close");
  16. callback(false);
  17. }
  18. }
  19. });
  20. }
  21. function callback(value){
  22. console.log(value);
  23. return value;
  24. }
please advice me how to have the dialog return true  or false .