﻿function alertBox_Hide(){var a=new alertBox();a.hide();return false}function alertBox_Create(){var a=new alertBox();a.create();return false}function alertBox(n){var o="ok";var p=document.getElementById("ctl00_hdnAlert").value;var q="";var r="alertBox_Hide();";var s="alertBox_Hide();";var t="alertBox_Hide();";var u="alertBox_Hide();";var v=navigator.appName;var w=(v=="Microsoft Internet Explorer")?true:false;var x=parseInt(navigator.appVersion);var y=(n==null)?document.getElementsByTagName("body")[0]:n;var z=(w)?"className":"class";var A;var B="background:#333;opacity:0.2;-moz-opacity:0.2;filter:alpha(opacity=20);z-index:99998";var C="display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:99999;";var D="display:block;width:600px;height:auto;background:#fff;";var E="width:auto;text-align:left;background:#93CDDE;padding:5px 20px;font-size:20px;";var F="display:block;width:100%;height:auto;background:url(/templates/default/_images/login_gradient.gif) repeat-x scroll 0% 0%;";var G="width:auto;margin:0 20px;padding:10px 0;text-align:left;";var H="width:auto;margin:auto;padding:0 20px 10px 20px;text-align:center;";this.create=function(){if(document.getElementById("alert-background")!=null){return}if(document.getElementById("alert-table")!=null){return}var a=document.createElement("div");if(w){a.style.cssText=(C+B)}else{a.setAttribute("style",(C+B))}a.setAttribute("id","alert-background");y.appendChild(a);var b=document.createElement("div");if(w){b.style.cssText=C}else{b.setAttribute("style",C)}b.setAttribute("id","alert-table");y.appendChild(b);var c=document.createElement("table");var d=document.createElement("thead");var e=document.createElement("tfoot");var f=document.createElement("tbody");var g=document.createElement("tr");var h=document.createElement("td");c.setAttribute("height","100%");c.setAttribute("width","100%");e.style.height=d.style.height="0px";h.setAttribute("align","center");c.appendChild(d);c.appendChild(e);c.appendChild(f);f.appendChild(g);g.appendChild(h);b.appendChild(c);var i=document.createElement("div");if(w){i.style.cssText=D}else{i.setAttribute("style",D)}i.setAttribute("id","alert-window");h.appendChild(i);var j=document.createElement("p");if(w){j.style.cssText=E}else{j.setAttribute("style",E)}j.setAttribute(z,"content-title title-size content-white font-family-a");j.setAttribute("id","alert-title");i.appendChild(j);var k=document.createElement("div");if(w){k.style.cssText=F}else{k.setAttribute("style",F)}k.setAttribute("id","alert-message-con");i.appendChild(k);var l=document.createElement("p");if(w){l.style.cssText=G}else{l.setAttribute("style",G)}l.setAttribute(z,"body-size content-gray font-family-a");l.setAttribute("id","alert-message");k.appendChild(l);var m=document.createElement("div");if(w){m.style.cssText=H}else{m.setAttribute("style",H)}m.setAttribute("id","alert-btn-container");k.appendChild(m)};this.show=function(){var a=document.getElementById("alert-background");var b=document.getElementById("alert-table");var c=document.getElementById("alert-window");var d=document.getElementById("alert-title");var e=document.getElementById("alert-message");if(w==true&&x<7.0){var f=document.getElementsByTagName("html")[0];A=f.style.overflow;f.style.overflow="hidden";var g="display:none;position:absolute;"+"top:expression(document.documentElement.scrollTop + 'px');"+"left:expression(document.documentElement.scrollLeft + 'px');"+"width:expression(document.documentElement.clientWidth + 'px');"+"height:expression(document.documentElement.clientHeight + 'px');";a.style.cssText=(B+g);b.style.cssText=g}this.removeChildNodes(d);try{this.removeChildNodes(e)}catch(ex){e.innerHTML=""}var h=document.createTextNode(this.alertTitle());d.setAttribute("title",this.alertTitle());d.appendChild(h);e.innerHTML=this.alertMessage();if(this.alertType()=="OK"||this.alertType()==""){c.style.border="4px solid #1c9dba"}else{c.style.border="4px solid #EF9064"}this.removeElement("alert-btn-ok","alert-btn-container");this.removeElement("alert-btn-yes","alert-btn-container");this.removeElement("alert-btn-no","alert-btn-container");this.removeElement("alert-btn-cancel","alert-btn-container");var i=document.getElementById("alert-btn-container");var j="alert-btn-yes";if(this.alertType()=="OK"){j="alert-btn-ok";this.createButton(i,document.getElementById("ctl00_hdnOK").value,"alert-btn-ok",this.okFunction())}else if(this.alertType()=="YES_NO"){this.createButton(i,document.getElementById("ctl00_hdnYes").value,"alert-btn-yes",this.yesFunction());this.createButton(i,document.getElementById("ctl00_hdnNo").value,"alert-btn-no",this.noFunction())}else if(this.alertType()=="YES_NO_CANCEL"){this.createButton(i,document.getElementById("ctl00_hdnYes").value,"alert-btn-yes",this.yesFunction());this.createButton(i,document.getElementById("ctl00_hdnNo").value,"alert-btn-no",this.noFunction());this.createButton(i,document.getElementById("ctl00_hdnCancel").value,"alert-btn-cancel",this.cancelFunction())}a.style.display=b.style.display="block"};this.removeChildNodes=function(a){while(a.hasChildNodes()){a.removeChild(a.lastChild)}};this.hide=function(){var a=document.getElementById("alert-background");var b=document.getElementById("alert-table");var c=document.getElementById("alert-window");a.style.display=b.style.display=c.style.display="";var d=a.parentNode;d.removeChild(a);var e=b.parentNode;e.removeChild(b);var f=c.parentNode;f.removeChild(c);if(w&&x<7.0){if(A==null){A=""}document.getElementsByTagName("html")[0].style.overflow=A;var g="background:#00f;opacity:0.2;-moz-opacity:0.2;filter:alpha(opacity=20);";var h="display:none;position:fixed;top:0;left:0;width:100%;height:100%;";document.getElementById("alert-background").style.cssText=(g+h);document.getElementById("alert-table").style.cssText=h}return false};this.removeElement=function(a,b){if(document.getElementById(a)==null){return}if(w){document.getElementById(a).removeNode(true)}else{var c=document.getElementById(b);var d=c.childNodes.length;for(var i=0;i<d;i++){try{if(c.childNodes[i].id==a){c.removeChild(c.childNodes[i])}}catch(ex){}}}};this.createButton=function(a,b,c,d){var e=document.createElement("button");var f="margin:0 10px 0 10px;";e.setAttribute(z,"btn_normal");e.setAttribute("id",c);if(w){e.style.cssText=f;e.onclick=function(){eval(d+";alertBox_Hide();")}}else{e.setAttribute("style",f);e.setAttribute("onclick",d+";alertBox_Hide();")}var g=document.createTextNode(b);e.appendChild(g);a.appendChild(e);return e};this.alertType=function(a){if(a==null){return o.toUpperCase()}o=a};this.alertTitle=function(a){if(a==null){return p}p=a};this.alertMessage=function(a){if(a==null){return q}q=a};this.okFunction=function(a){if(a==null){return r}r=a};this.yesFunction=function(a){if(a==null){return s}s=a};this.noFunction=function(a){if(a==null){return t}t=a};this.cancelFunction=function(a){if(a==null){return u}u=a};if(w){window.onload="alertBox_Create();"}else{this.create()}}