var ALERT_TITLE="";var ALERT_BUTTON_TEXT="Ок";var ALERT_BUTTON_Yes="";var ALERT_BUTTON_No="";if(document.getElementById){window.alert=function(txt,callback){return createCustomAlert(txt,false,callback);}}if(document.getElementById){window.confirm=function(txt,callback){return createCustomAlert(txt,true,callback);}}function createCustomAlert(txt,work_mode,callback){d=document;work_mode=work_mode||false;callback=callback||false;if(d.getElementById("modalContainer"))return;mObj=d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));mObj.id="modalContainer";mObj.style.height=d.documentElement.clientHeight+"px";alertObj=mObj.appendChild(d.createElement("div"));alertObj.id="alertBox";if(d.all&&!window.opera)alertObj.style.top=document.documentElement.scrollTop+"px";alertObj.style.left=(d.documentElement.scrollWidth-alertObj.offsetWidth)/2+"px";alertObj.style.visiblity="visible";h1=alertObj.appendChild(d.createElement("h1"));h1.appendChild(d.createTextNode(ALERT_TITLE));msg=alertObj.appendChild(d.createElement("p"));msg.innerHTML=txt;if(work_mode){btn=alertObj.appendChild(d.createElement("a"));btn.id="YesBtn";btn.appendChild(d.createTextNode(ALERT_BUTTON_Yes));btn.href="#";btn.focus();btn.onclick=function(){removeCustomAlert();if(callback)callback();return true;} btn2=alertObj.appendChild(d.createElement("b"));btn2.id="NoBtn";btn2.appendChild(d.createTextNode(ALERT_BUTTON_No));btn2.href="#";btn2.onclick=function(){removeCustomAlert();return false;}}else{btn=alertObj.appendChild(d.createElement("a"));btn.id="closeBtn";btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));btn.href="#";btn.focus();btn.onclick=function(){removeCustomAlert();if(callback)callback();return false;}}alertObj.style.display="block";}function removeCustomAlert(){document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));}