You can use my JS library
http://www.cristianizzo.com/DEV/Qpass/index.php?r=JS&v=modal
here an example
Modal Standard
//content
You can pass a callback function or extend the modal pushing an other content
Modal Fn
//Content
function fnTest(){
alert('execute new function');
}
function fnName(){
alert('execute new function');
}