﻿ function CLASS_Msg_FORM(path,action,title,message,w,h)
 {
     this.doc = window.top.document;
     this.Div;
     this.Div = this.doc.getElementById("ModlForm");
     this.DivSub = this.doc.getElementById("SubModlForm");
     this.TableForm;
     this.FullURL = path;
     this.action = action;
     this.bOK = false;
     this.width = this.doc.body.scrollWidth;
     this.height = this.doc.body.scrollHeight;
     	
     this.title = title;
     this.message = message;
     this.w = w;
     this.h = h;
 }
 
 CLASS_Msg_FORM.prototype.ShowDig = function()
 {     
 
     var me  = this; 
     if(this.Div == null)
     {
         this.Div = this.doc.createElement(this.GetBGDivHTML());
         this.DivSub = this.doc.createElement(this.GetDivHTML());
         this.DivSub.innerHTML = this.GetTableHTML("请输入用户名和密码!"); 
         this.doc.body.appendChild(this.Div);
         this.doc.body.appendChild(this.DivSub);
     }
     
     this.doc.body.onscroll = function(){
         me.DivSub.style.top = me.doc.body.scrollTop + me.h / 2;
         me.DivSub.style.left = me.width / 2 - me.w / 2;
     }
     
     /* 设置位置 */
     this.Div.style.width = this.width;
     this.Div.style.height = this.height;
     this.DivSub.style.top = this.doc.body.scrollTop + this.h / 2;
     this.DivSub.style.left = this.width / 2 - this.w / 2;
     this.DivSub.style.width = this.w;
     this.DivSub.style.height = this.h;
     
     
     this.Display();
     
     /* 设置事件 */
     var btCommand = this.doc.getElementById("btSysClose");  
     btCommand.onclick = function(){  
        me.Hide();
     }  
     
 }

 CLASS_Msg_FORM.prototype.Display = function()
 {
     this.Div.style.display = "inline"; 
     this.DivSub.style.display = "inline";
 }
 CLASS_Msg_FORM.prototype.Hide = function()
 {
     this.Div.style.display = "none"; 
     this.DivSub.style.display = "none";
 }
 
 CLASS_Msg_FORM.prototype.GetBGDivHTML = function()
 {
     var rtn = "<div id='ModlForm' style='filter:alpha(opacity=30);BACKGROUND-COLOR:#000000;display:inline;Top:0px;Left:0px;position:absolute;z-index:10000;border:1px solid #9999ff;' align='center'>";
     return rtn;
 }
 CLASS_Msg_FORM.prototype.GetDivHTML = function()
 {
     var rtn = "<div id='SubModlForm' style='filter:alpha(opacity=100);BACKGROUND-COLOR:#9ec9ec;display:inline;Top:0px;Left:0px;width:250px;position:absolute;z-index:10001;' align='center'>";
     return rtn;
 }
 CLASS_Msg_FORM.prototype.GetTableHTML = function(caption)
 {
 
      var h = this.h;
      var w = this.w;
      
      var str = "<DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR: #c9d3f3'>"  
        str += "<TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#cfdef4 border=0>"  
        str += "<TR>"  
        str += "<TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24></TD>"  
        str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px' vAlign=center width='" + (w - 30 - 50) + "'>" + this.title + "</TD>"  
        str += "<TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' vAlign=center align=right width=50>"  
        str += "<SPAN title=关闭 style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px' id='btSysClose' >关闭</SPAN></TD>"  
        str += "</TR>"  
        str += "<TR>"  
        str += "<TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + (h-28) + ">"  
        str += "<DIV style='BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'>" + "" + ""  //this.title
        str += "<DIV style='WORD-BREAK: break-all' align=left><A href='javascript:void(0)' hidefocus=false id='btCommand'><FONT color=#ff0000>" + this.message + "</FONT></A></DIV>"  
        
        str += "</DIV>"  
        str += "</TD>"  
        str += "</TR>"  
        str += "</TABLE>"  
        str += "</DIV>"  
     return str;
     
 }
