function _DialogueEx(name,timer){ this.refresh=true; this.fixWidth=0; this.fixHeight=0; this.isopen = false; this.name = name; this.timer = timer; this.doc=document; this.dialogueID='dialogueEx'; this.dialogue=null; this.coverID='coverEx'; this.coverdlg = null; this.coverID='coverEx'; this.cover=null; this.winWidth=300; this.winHeight=200; this.winLeft = 0; this.winTop = 0; this.scrollTop=0; this.scrollLeft=0; this.scrollWidth=0; this.scrollHeight=0; this.contentWidth=0; this.contentHeight=0; this.background= '#FFFFF0'; this.foreground= '#0000FF'; this.bordercolor= '#535353';//'#9400D3'; this.borderradius= '7px'; this.framebordercolor = '#D2691E'; this.font='Verdana,arial,MS Sans Serif'; this.fontsize='12pt'; this.windowstyle = 'font-family: '+this.font+';font-style: normal;font-size: '+this.fontsize+';font-weight: 400;color: '+this.foreground+';background: '+this.background; this.CallFromDialogue =new Function (); this.Display = function(url,field){ if (this.dialogue==null){ this.dialogue = document.getElementById(this.dialogueID); if (this.dialogue ==null){ this.CreateDialogue(); } } this.DisplayDialogue(); this.dialogue.name=field; this.Show(url,field); this.isopen=true; if (this.isopen == true && this.timer !=null){ this.timer.Pause(); } } this.DisplayDialogue = function(){ this.GetCoordinate(); var wtop=this.winTop,wleft=this.winLeft,wwidth=this.winWidth,wheight=this.winHeight,ctop=this.winTop,cleft=this.winLeft,cwidth=this.winWith,cheight=this.winHeight; ctop=0,cleft=0,cwidth=this.contentWidth,cheight=this.contentHeight; wtop=this.scrollTop,wleft=this.scrollLeft,wwidth=this.scrollWidth,wheight=this.scrollHeight; this.cover.style.zIndex='9'; this.cover.style.position='absolute'; this.cover.style.display='block'; this.cover.style.top='0px'; this.cover.style.left='0px'; this.cover.style.width=cwidth+'px'; this.cover.style.height=cheight+'px'; this.coverdlg.style.zIndex='10'; this.coverdlg.style.position='absolute'; this.coverdlg.style.top=wtop+'px'; this.coverdlg.style.left=wleft+'px'; this.coverdlg.style.width=Math.max(this.fixWidth,wwidth)+'px'; this.coverdlg.style.height=Math.max(this.fixHeight,wheight)+'px'; this.coverdlg.style.opacity=1.0; this.coverdlg.style.filter='alpha(opacity=0)'; this.coverdlg.style.backgroundColor='#808080'; this.coverdlg.style.dispplay='block'; this.dialogue.style.width="100%"; this.dialogue.style.height="100%"; } this.Show = function(url,field){ this.dialogue.src = url; } this.Click = function(index,name){ if (this.dialogue !=null){ this.coverdlg.style.width='0px'; this.coverdlg.style.height='0px'; this.coverdlg.style.display='none'; this.coverdlg.style.visible='hidden'; this.dialogue.style.width='0px'; this.dialogue.style.height='0px'; this.dialogue.style.display='none'; this.dialogue.style.visible='hidden'; this.dialogue.innerHTML=''; this.dialogue.name=''; this.cover.style.width='0px'; this.cover.style.height='0px'; this.cover.style.display='none'; this.CallFromDialogue(this.dialogue.name,index,name); } } this.Close = function (){ if (this.coverdlg !=null){ this.coverdlg.display='none'; this.coverdlg.style.width='0px'; this.coverdlg.style.height='0px'; } if (this.dialogue != null){ this.dialogue.style.width='0px'; this.dialogue.style.height='0px'; this.dialogue.src=''; } if (this.cover !=null){ this.cover.style.width='0px'; this.cover.style.height='0px'; this.cover.style.display='none'; } if (this.isopen == true && this.timer !=null){ this.timer.Resume(); } this.isopen=false; this.refresh=true; this.fixWidth=0; this.fixHeight=0; } this.FormatMessage= function(msg){ var html = ''; if (msg.length){ var rowwidth=0; for (var i=0;i'; html = html +l; } html = html +''; } return html; } this.FormatButton = function (btn){ var html = ''; if (btn.length){ html = ''; for (var i=0;i'; html = html + l; } html = html +'
'; } return html; } this.Align= function(){ if(this.dialogue!=null && this.isopen==true){ this.DisplayDialogue(); } } this.CreateDialogue = function(){ var frm =this.CreateElement('IFRAME'); frm.style.width = '0px'; frm.style.height = '0px'; frm.style.left = '0px'; frm.style.top = '0px'; frm.marginWidth = 0; frm.marginHeight = 0; frm.hspace = 0; frm.frameBorder = 0; frm.scrolling = 'no'; this.dialogue= frm; if (this.coverdlg ==null){ this.coverdlg=this.CreateElement('DIV'); this.coverdlg.id=this.coverdlgID; } this.coverdlg.appendChild(frm); this.CreateCover(); } this.CreateCover = function(){ if (this.cover==null){ this.cover=this.doc.getElementById(this.coverID); if (this.cover==null){ this.cover=this.CreateElement('DIV'); this.cover.id=this.coverID; } } this.cover.style.width = '0px'; this.cover.style.height = '0px'; this.cover.style.position = 'absolute'; this.cover.style.left = '0px'; this.cover.style.top = '0px'; this.cover.style.display = 'none'; this.cover.style.filter='alpha(opacity=50)'; this.cover.style.backgroundColor='#808080'; } this.SetRefresh = function(w,h,refr){ if (refr==false){ this.fixWidth=w; this.fixHeight=h; this.refresh=refr; }else{ this.fixWith=0; this.fixHeight=0; this.refresh=refr; } this.Align(); if (refr==false){ if (window.self != window.top && window.parent.DialogueEx != null && window.parent.DialogueEx.isopen==true){ window.parent.DialogueEx.SetRefresh(w,h,refr); } } } this.CreateElement = function(ename){ var d = document.getElementsByTagName("BODY")[0]; var div = document.createElement(ename); d.appendChild(div); return div; } this.GetCoordinate = function (){ var winW,winH; var winArr = new Array(); winArr=this.GetWindowSize(); winW=winArr[0]; winH=winArr[1]; var coord = this.GetPosition(this.id); this.winLeft = coord.x this.winTop = coord.y;//+this.id.offsetHeight+5; this.winWidth = Math.min(winW-this.winLeft,this.winWidth); this.winHeight = Math.min(Math.max(winH-this.winTop,this.winHeight),this.winHeight); this.contentWidth = winW; this.contentHeight= winH; this.GetScrollViewRect(); } this.GetScrollViewRect = function(){ this.scrollTop=window.pageYOffset; this.scrollLeft=window.pageXOffset; this.scrollWidth=window.innerWidth; this.scrollHeight=window.innerHeight; var oh=window.outerHeight; var ow=window.outerWidth; if (ow!=this.scrollWidth){ this.scrollWidth=this.scrollWidth-20; } if (oh!=this.scrollHeight){ this.scrollHeight=this.scrollHeight-20; } } this.GetWindowSize = function(){ var winW,winH; var B = document.body,H = document.documentElement; if(document.height !== undefined) { winW = document.width winH = document.height // For webkit browsers } else { winW = Math.max( B.scrollWidth, B.offsetWidth,H.clientWidth, H.scrollWidth, H.offsetWidth ); winH = Math.max( B.scrollHeight, B.offsetHeight,H.clientHeight, H.scrollHeight, H.offsetHeight ); } var winArr = new Array(winW,winH); return winArr; } this.GetScreenSize = function(){ var winsize = new Array(); var winW = 630, winH = 460; var B = document.body,H = document.documentElement; if(document.height !== undefined) { winW = document.width winH = document.height // For webkit browsers } else { winW = Math.max( B.scrollWidth, B.offsetWidth,H.clientWidth, H.scrollWidth, H.offsetWidth ); winH = Math.max( B.scrollHeight, B.offsetHeight,H.clientHeight, H.scrollHeight, H.offsetHeight ); } winsize[0]=winW; winsize[1]=winH; winsize[2]= winsize[0]; winsize[3] = winsize[1]; if (window.innerWidth && window.innerHeight) { winsize[2]= window.innerWidth; winsize[3] = window.innerHeight; } return winsize; } this.GetPosition = function(element){ var ret = new Point(); if (element!=null){ for(; element && element != document.body; ret.translate(element.offsetLeft, element.offsetTop), element = element.offsetParent ); } return ret; } this.GetValue = function (fname){ var value=''; var fld = this.ihelper.contentWindow.document.getElementsByName(fname); if (fld.length>0){ value = fld[0].value; } return value; } } function Point(x,y){ this.x = x || 0; this.y = y || 0; this.toString = function(){ return '('+this.x+', '+this.y+')'; }; this.translate = function(dx, dy){ this.x += dx || 0; this.y += dy || 0; }; this.getX = function(){ return this.x; } this.getY = function(){ return this.y; } this.equals = function(anotherpoint){ return anotherpoint.x == this.x && anotherpoint.y == this.y; }; }