/* neat-dialog => neat-dialog-pane neat-dialog-bg */ function NeatDialog(sHTML, sTitle){ window.neatDialog = null; this.elt = null; if(document.createElement && document.getElementById){ var pane = document.createElement("div"); pane.id = "neat-dialog-pane"; var basePath="common/neatdialog/images/"; if (sTitle) sHTML= ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+sTitle+'
 '+sHTML+' 
 
'; pane.innerHTML = sHTML; var bg = document.createElement("div"); bg.id = "nd-bdg"; bg.id = "neat-dialog-bg"; var nd = document.createElement("div"); nd.id = "neat-dialog"; nd.appendChild(bg); nd.appendChild(pane); //adjust positioning if body has a margin if (document.body.offsetLeft>0) nd.style.marginLeft = document.body.offsetLeft+"px"; document.body.appendChild(nd); var scArr=getPageScroll() var siArr=getPageSize() //197x119 var tmp=$("ndpane-body").offsetWidth+6 pane.style.width=(tmp<197?197:tmp)+"px" pane.style.top=scArr[1]+(siArr[3]-pane.offsetHeight)/2+"px" bg.style.height=siArr[1]+"px" $("ndpane-cancel").onclick = function(){ window.neatDialog.close(); }; this.elt = nd; window.neatDialog = this; } } NeatDialog.prototype.close = function(){ if (this.elt){ this.elt.style.display = "none"; this.elt.parentNode.removeChild(this.elt); } window.neatDialog = null; }