/* Product Name: dhtmlxSuite Version: 4.0.3 Edition: Professional License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com Copyright UAB Dinamenta http://www.dhtmlx.com */ if(!window.dhtmlx) window.dhtmlx = {}; (function(){ var _dhx_msg_cfg = null; function callback(config, result){ var usercall = config.callback; modality(false); config.box.parentNode.removeChild(config.box); _dhx_msg_cfg = config.box = null; if (usercall) usercall(result); } function modal_key(e){ if (_dhx_msg_cfg){ e = e||event; var code = e.which||event.keyCode; if (dhtmlx.message.keyboard){ if (code == 13 || code == 32) callback(_dhx_msg_cfg, true); if (code == 27) callback(_dhx_msg_cfg, false); } if (e.preventDefault) e.preventDefault(); return !(e.cancelBubble = true); } } if (document.attachEvent) document.attachEvent("onkeydown", modal_key); else document.addEventListener("keydown", modal_key, true); function modality(mode){ if(!modality.cover){ modality.cover = document.createElement("DIV"); //necessary for IE only modality.cover.onkeydown = modal_key; modality.cover.className = "dhx_modal_cover"; document.body.appendChild(modality.cover); } var height = document.body.scrollHeight; modality.cover.style.display = mode?"inline-block":"none"; } function button(text, result){ return "
"+text+"
"; } function info(text){ if (!t.area){ t.area = document.createElement("DIV"); t.area.className = "dhtmlx_message_area"; t.area.style[t.position]="5px"; document.body.appendChild(t.area); } t.hide(text.id); var message = document.createElement("DIV"); message.innerHTML = "
"+text.text+"
"; message.className = "dhtmlx-info dhtmlx-" + text.type; message.onclick = function(){ t.hide(text.id); text = null; }; if (t.position == "bottom" && t.area.firstChild) t.area.insertBefore(message,t.area.firstChild); else t.area.appendChild(message); if (text.expire > 0) t.timers[text.id]=window.setTimeout(function(){ t.hide(text.id); }, text.expire); t.pull[text.id] = message; message = null; return text.id; } function _boxStructure(config, ok, cancel){ var box = document.createElement("DIV"); box.className = " dhtmlx_modal_box dhtmlx-"+config.type; box.setAttribute("dhxbox", 1); var inner = ''; if (config.width) box.style.width = config.width; if (config.height) box.style.height = config.height; if (config.title) inner+='
'+config.title+'
'; inner+='
'+(config.content?'':config.text)+'
'; if (ok) inner += button(config.ok || "OK", true); if (cancel) inner += button(config.cancel || "Cancel", false); if (config.buttons){ for (var i=0; i