var boxDisplay = { dialogId: null, parms: {}, initialize: function(content,args) { this.parms=args || {}; this.parms.className=args.className || "alert"; this.parms.width= args.width || 300; if(!(this.dialogId=args.dialogId)) { var t = new Date(); this.dialogId = 'dialog_' + t.getTime(); } // compute height this.parms.height = calcWinSize(content, this.parms.width,0)+5; this.parms.resizable = false; this.parms.boxDisplay=this.parms.boxDisplay==undefined ? true : this.parms.boxDisplay; this.parms.minimizable = false; this.parms.maximizable = false; this.parms.closable = args.closable !=null ? args.closable : false; this.parms.top = args.top!=null ? args.top : (pageHeight()/2 - this.parms.height/2); this.parms.left=args.left || (pageWidth()/2 - this.parms.width/2); this.parms.destroyOnClose=true; var win = new modalWindow(this.dialogId, this.parms); win.getContent().innerHTML = content; win.setDestroyOnClose(); win.show(true); win.cancelCallback = args.cancelFunc; win.okCallback = args.okFunc; if(args.timeOutInt) setTimeout("boxDisplay._timeOut()",args.timeOutInt*1000); win.toFront(); return win; }, Alert: function(content,args) { var dcontent = "
\ "; args.top=null; args.closable=null; this.initialize(dcontent,args) }, Confirm: function(content, args) { args.top=null; args.closable=null; var okLabel = args.okLabel || "Yes"; var cancelLabel = args.cancelLabel || "No"; var dcontent = " \ "; this.initialize(dcontent,args); }, Info: function(content, args) { var className = args.className || "dialog"; var dcontent = " "; args.ok = null; args.className=className; args.cancel = null; args.closable=true; args.timeOutInt = args.timeOutInt || 15; this.initialize(dcontent,args); }, _okCallBack: function() { var win = modalWindowsStack.focusedWindow; if(!win.okCallback || win.okCallback(win)) { // Remove onclick on button $$("#" + win.getWinId()+" input").each(function(element) {element.onclick=null;}) win._winHide(); } return false; }, _cancelCallBack: function() { var win = modalWindowsStack.focusedWindow; // Remove onclick on button $$("#" + win.getWinId()+" input").each(function(element) {element.onclick=null}) win._winHide(); if(win.cancelCallback) win.cancelCallback(win); }, _timeOut: function() { var win = modalWindowsStack.getWindow(this.dialogId); if(win) { $$("#" + this.dialogId+" input").each(function(element) {element.onclick=null}) win._winHide(); } }, loadFiles: function(path,theme) { var themes = path ? path+"/themes/" : "css/themes/"; var theme = theme || "default.css"; var cssFiles = new Array(themes+"alert.css",themes+theme); var script = new Array("",""); script[0] = path ? path+"/logic/javascript/prototype.js" : "logic/javascript/prototype.js"; script[1] = path ? path+"/logic/javascript/modalWindowClass.js" : "logic/javascript/modalWindowClass.js"; var head = document.getElementsByTagName("head"); var links = document.getElementsByTagName("link"); // Check to see if the css file is already loaded for(var i=0;i