When you call showModalDialog() you need to pass “self”, without the quotes, as the second argument.
You can then access the parent(opener) with:
var opener = window.dialogArguments;
You can then access any function declared in parent window with:
opener.myFunction();