function _Prompt(name){ this.name = name; this.divprompt='function'; this.prompt=null; this.cover = null; this.zIndex='5'; 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.CallFromPrompt =new Function (); this.Display = function(msg,btn,field){ var winsize= this.GetScreenSize(); if (this.prompt==null){ this.prompt = document.getElementById(this.divprompt); if (this.prompt ==null){ this.CreatePrompt(); } } if (this.cover ==null){ this.cover=this.CreateElement('DIV');//document.createElement("DIV"); this.cover.id='cover'; //var d=document.getElementsByTagName("BODY")[0];; //d.appendChild(this.cover); } this.cover.style.position='absolute'; this.cover.style.left='0px'; this.cover.style.top='0px'; this.cover.style.opacity=0.5; this.cover.style.filter='alpha(opacity=50)'; this.cover.style.backgroundColor='#808080'; this.cover.style.width=winsize[0]+'px'; this.cover.style.height=winsize[1]+'px'; this.cover.style.dispplay='block'; this.cover.style.visible='visible'; this.prompt.style.width=winsize[0]+'px'; this.prompt.style.height=winsize[1]+'px'; this.prompt.style.display='block'; this.prompt.style.visible='visible'; this.prompt.style.zIndex=this.zIndex; this.prompt.style.opacity=0.95; this.prompt.style.filter="alpha(opacity=95)"; this.prompt.name=field; this.Show(msg,btn,field); } this.Show = function(msg,btn,field){ var captionstyle = 'font-family: '+this.font+';font-style: normal;font-size: '+this.fontsize+';font-weight: 400;color: #FFFFFF;background-color: #330099;'; var html = ''; html = '
'; html = html + '
'; //html = html + ''; html = html +this.FormatMessage(msg); html = html + this.FormatButton(btn); html = html + '
OSP Portal
'; this.prompt.innerHTML = html; } this.Click = function(index,name){ if (this.prompt !=null){ this.cover.style.width='0px'; this.cover.style.height='0px'; this.cover.style.display='none'; this.cover.style.visible='hidden'; this.prompt.style.width='0px'; this.prompt.style.height='0px'; this.prompt.style.display='none'; this.prompt.style.visible='hidden'; this.prompt.innerHTML=''; this.CallFromPrompt(this.prompt.name,index,name); this.prompt.name=''; } } 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.prompt!=null){ this.cover.style.width='1px'; this.cover.style.height='1px'; this.prompt.style.width='1px'; this.prompt.style.height='1px'; var winsize= this.GetScreenSize(); this.cover.style.width=winsize[0]+'px'; this.cover.style.height=winsize[1]+'px'; this.prompt.style.width=winsize[0]+'px'; this.prompt.style.height=winsize[1]+'px'; } } this.CreatePrompt = function(){ /* var d = document.getElementsByTagName("BODY")[0]; var div = document.createElement("DIV"); d.appendChild(div); */ var div =this.CreateElement('DIV'); div.style.width = '0px'; div.style.height = '0px'; div.style.position = 'absolute'; div.style.left = '0px'; div.style.top = '0px'; div.style.display = 'none'; this.prompt= div; } this.CreateElement = function(ename){ var d = document.getElementsByTagName("BODY")[0]; var div = document.createElement(ename); d.appendChild(div); return div; } 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; } }