modal window can return a value to parent window's calling function, so based on its value you can either change parent window variables or call any function. It is only possible when your child modal window is closing.
here it is how.
// parent window JS
retval= window.showModalDialog( "mynewpage.jsp", myArguments, "dialogHeight: 100px; dialogWidth: 400px; edge: Raised; center: Yes; resizable: Yes; status:Yes ; scroll:Yes;"); resetTimer(retval);
// in child window JS i.e. mynewpage.jsp
function closeMe() { window.returnValue="60"; window.close(); }