When you call showModalDialog you do this:
var oReturnValue = showModalDialog(....);
Within showModalDialog, assuming your textboxes have IDs of "txtForename" and "txtSurname":
function terminate()
{
var o = new Object();
o.forename = document.getElementById("txtForename").value;
o.surname = document.getElementById("txtSurname").value;
window.returnValue = o;
}
Ram