Require Confirmation before executing Javascript function

Wrote a handy script today that consumes a function and returns a version of that function which will prompt the user to confirm before actually executing it. I chose to do this at the function definition level instead of the UI level because I needed to make absolutely certain that the function could not be called without proper confirmation. 

function blowUpTheWorld(){ ... }

var safelyBlowUpTheWorld = requireConfirmation({

// assign the confirm and cancel actions
fn : blowUpTheWorld(),
cancel_fn : function(){alert('CANCELLED');

// set some of the UI stuff on the alert
headerText : 'WARNING',
promptText : 'this action is extremely dangerous',
confirmText: 'BLOW IT UP',
cancelText : 'not today...'

})


// Now just bind this to the relevant UI buttons
$("#bigRedButton").bind('click', safelyBlowUpTheWorld);
Test it out

You can get the source here.