//¸¡¶¯´°¿ÚÐ§¹û
var ShadeDiv = {
 objid : null,
 Shade : document.createElement('div'),
 ShadeID : 'Shade',
 width : 600,
 height : 300,

 Position : function(){
  if (!ShadeDiv.objid){
   ShadeDiv.objid = null;
   return;
  }
  var de = document.documentElement;
  var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
  var ch = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
  if (self.pageYOffset) {
   var st = self.pageYOffset;
  } else if (document.documentElement && document.documentElement.scrollTop){  // Explorer 6 Strict
   var st = document.documentElement.scrollTop;
  } else if (document.body) {// all other Explorers
   var st = document.body.scrollTop;
  }
  if (window.innerHeight && window.scrollMaxY) { 
   var sh = window.innerHeight + window.scrollMaxY;
  } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
   var sh = document.body.scrollHeight;
  } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
   var sh = document.body.offsetHeight;
  }
  ShadeDiv.Shade.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=60,finishOpacity=100,style=0)';
  ShadeDiv.Shade.style.height = (sh > ch ? sh : ch) + 'px';
  ShadeDiv.Shade.style.width = w + 'px';
  var pos = [], pw;
  pw = ShadeDiv.width;
  pos[0] = (w-pw)/2-40;
  pos[1] = (ch-(ShadeDiv.height || 300))/3 -100+st;
  //window.status="ch:"+ch+"st:"+st+"post[1]:"+pos[1]+"ShadeDiv.clientHeight"+ShadeDiv.objid.clientHeight;
  if (navigator.product && navigator.product == 'Gecko'){
   pw -= 40;
  }
  //ShadeDiv.objid.style.width = ShadeDiv.width + 'px';
  //ShadeDiv.objid.style.height = ShadeDiv.height + 'px';
  ShadeDiv.objid.style.left = pos[0] + 'px';
  ShadeDiv.objid.style.top = pos[1] + 'px';
  ShadeDiv.Shade.style.display = 'block';
  ShadeDiv.objid.style.display = 'block';
 },
 Show : function(id,w,h){
  ShadeDiv.height = parseInt(h);
  ShadeDiv.width = parseInt(w);
  ShadeDiv.Shade.id = ShadeDiv.ShadeID;
  ShadeDiv.objid = document.getElementById(id);
  document.body.insertBefore(ShadeDiv.Shade,null);
  ShadeDiv.Position();
 },
 Close : function(){
  if (ShadeDiv.objid==null){
   return;
  }
  ShadeDiv.Confirmed();
 },

 Confirmed : function() {
  ShadeDiv.objid.style.display = 'none';
  ShadeDiv.Shade.style.display = 'none';
  document.body.removeChild(ShadeDiv.Shade);
 }
}
