﻿function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;
}

function cancelIt(){
    document.getElementById("sign_div_to").style.display = 'none';
    document.getElementById("cover_div").style.display = 'none';
    document.body.style.overflow = '';
}

function popCoverDiv(){
    with(document.getElementById("cover_div").style) {
     position = 'absolute';
     background = '#000000';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 98;
     if (isIE()) {
      filter = "Alpha(Opacity=60)";
     } else {
      opacity = 0.6;
     }
     display = '';
    }
}

function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
   }
   return bodySize;
}
 
function popError(er_id){
   var DivWidth = 250;
   var sign_in_flow = '<div style="padding-top:1px; padding-bottom:8px" ><table border="0" cellspacing="0" cellpadding="0" width="248"><tr bgcolor="#eeeeee"><td width="75" height="24" style="padding-left:12px;"><strong>系统信息</strong></td><td align="right" style="padding-right:8px;"><img src="/images/cannel02.gif" style="cursor:pointer" onclick="cancelIt();"></td></tr><tr><td colspan="2" height="8"></td></tr><tr align="left"><td height="50" colspan="2" style="padding-left:24px;">' + er_id + '</td></tr><tr><td colspan="2" align="center"><input type=image src="/images/confirm01.gif" border="0" onclick="cancelIt();return false;" style="cursor:pointer" id="confirmcancel"></td></tr><tr><td colspan="2" height="5"></td></tr></table></div>';
  
    with (document.getElementById("sign_div_to").style) {
     align = "center";
     position = 'absolute';
     left = (document.documentElement.clientWidth - DivWidth)/2 + 'px';
     top = (document.documentElement.clientHeight - 300)/2 + 'px';
     width = DivWidth + 'px';
     zIndex = 99;
     background = '#FFFFFF';
     border = '#66CCFF solid 1px';
    }
    document.getElementById("sign_div_to").innerHTML = sign_in_flow;
    document.getElementById("sign_div_to").style.display = '';
}

function popSignFlow(er_id) {
   popCoverDiv();
   popError(er_id);
   document.body.style.overflow = "hidden";
   document.getElementById('confirmcancel').focus();
}
