| 8790 | return box; |
| 8791 | } |
| 8792 | function _createBox(config, ok, cancel) { |
| 8793 | var box = config.tagName ? config : _boxStructure(config, ok, cancel); |
| 8794 | if (!config.hidden) |
| 8795 | modality(true); |
| 8796 | document.body.appendChild(box); |
| 8797 | var x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2)); |
| 8798 | var y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2)); |
| 8799 | if (config.position == "top") |
| 8800 | box.style.top = "-3px"; |
| 8801 | else |
| 8802 | box.style.top = y + "px"; |
| 8803 | box.style.left = x + "px"; |
| 8804 | scheduler2.event(box, "keydown", modal_key); |
| 8805 | modalBox.focus(box); |
| 8806 | if (config.hidden) |
| 8807 | modalBox.hide(box); |
| 8808 | scheduler2.callEvent("onMessagePopup", [box]); |
| 8809 | return box; |
| 8810 | } |
| 8811 | function alertPopup(config) { |
| 8812 | return _createBox(config, true, false); |
| 8813 | } |