You didn't include the function, but you should use SP.UI to open the dialog which goes something like this:
function openDialog()
{
var options = {
title: 'title',
width: 500,
height: 500,
url: '[link to page]',
dialogReturnValueCallback: myCallbackFunction
};
var dialogRef = SP.UI.ModalDialog.showModalDialog(options);
}
function myCallbackFunction()
{
}
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com