Code type module improvements:
[openemr.git] / library / topdialog.js
blobcba824c9204190ff57440c44c6a4bb3bcb3173e6
1 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 var modaldialog = null;
10 // called from onfocus handler of various documents:
11 function imfocused() {
12  if (modaldialog) {
13   if (modaldialog.closed) {
14    modaldialog = null;
15   } else {
16    if (window.focus) modaldialog.focus();
17   }
18  }
21 // call this from the top-level frameset's or body's onunload
22 function imclosing() {
23  if (modaldialog && ! modaldialog.closed) modaldialog.close();
24  modaldialog = null;