﻿// JavaScript Document
//获取页面的高度和宽度等参数，返回一个数组

var xScroll, yScroll,pageWidth,pageHeight,windowWidth,windowHeight; 
function getPageSize(){  

  if (window.innerHeight && window.scrollMaxY) {  
    xScroll = document.body.scrollWidth;
    yScroll = window.innerHeight + window.scrollMaxY;
  } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
  } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
  }

  if (self.innerHeight) {  // all except Explorer
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
  } else if (document.body) { // other Explorers
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
  }  
  // for small pages with total height less then height of the viewport
  if(yScroll < windowHeight){
    pageHeight = windowHeight;
  } else { 
    pageHeight = yScroll;
  }

  if(xScroll < windowWidth){  
    pageWidth = windowWidth;
  } else {
    pageWidth = xScroll;
  }
} 
function ShowBox(id,top,left)
{
getPageSize();
var left = pageWidth/2-100;
var top = pageHeight/2-70;
//alert(left+"eeeeeee"+top);
var str = "<div id=\""+id+"\" style=\"	position:absolute;color:#ffffff;left:"+left+"px;top:"+top+"px;width:200px;height:50px;z-index:999;background-color: #006699;border:1px solid #333333;filter: Alpha(Opacity=60);text-align:center\"><br><img src='/images/loading.gif'><br>数据处理中...<br></div>";
document.write(str);
}
function ShowMsg(str)
{
getPageSize();
var left = pageWidth/2;
var top = pageHeight/2;
var str2 = "<div id=\"msg\" style=\"position:absolute;color:#ffffff;left:"+left+"px;top:"+top+"px;width:400px;height:150px;z-index:999;background-color: #eeeeee;border:1px solid #999999;filter:DropShadow(Color=\"#000000\",Positive=\"1\");\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr bgcolor=#9a9389><td height=\"25\" style=\"color:#ffffff;align:left;border-left:1px solid #eeeeee;border-top:1px solid #eeeeee\" align=left width=380>&nbsp;<b>系统提示</b></td><td width=20 style=\"border-right:1px solid #cccccc;border-top:1px solid #eeeeee;color:#ffffff;cursor:pointer;\" onclick=\"msg.style.display='none'\">×</td></tr><tr><td height=\"100\" colspan=\"2\" align=left valign=top style=\"padding:10px;line-height:180%;color;#ffffff\">";
str2=str2+str;
str2=str2+"</td></tr></table></div>";
document.write(str2);
}