﻿function popCoverDiv()
{
   if (G("cover_div"))
    {
      G("cover_div").style.display = '';
     }
   else 
   {
    var coverDiv = GC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style)
     {
         position = 'absolute';
         background = '#CCCCCC';
         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;
         }
      }
   }
}

function G(id){
    return document.getElementById(id);
}
function GC(t){
   return document.createElement(t);
}

function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
    bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
    bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
   }
   return bodySize;
} 

function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;
} 
