var disable_mask_created=false; var disable_mask_visible=false;         function getScrollY()  {     if (browser == BROWSER_IE)     {         var ieBox=document.compatMode != "CSS1Compat";       var cont=ieBox ? document.body : document.documentElement;    return cont.scrollTop;    }     else      {        return window.pageYOffset;    }  }    function getScrollX()  {     if (browser == BROWSER_IE)     {         var ieBox=document.compatMode != "CSS1Compat";       var cont=ieBox ? document.body : document.documentElement;    return cont.scrollLeft;    }     else      {        return window.pageXOffset;    }  }        function getDocumentHeight()   {              var scrollHeight=(document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;               var h;    if (browser != BROWSER_IE)      h=Math.max(scrollHeight, window.innerHeight);    else      h=Math.max(scrollHeight, document.documentElement.offsetHeight);             return h; }            function getDocumentWidth()   {              var scrollWidth=(document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;    var w;    if (browser != BROWSER_IE)      w=Math.max(scrollWidth, window.innerWidth);    else      w=Math.max(scrollWidth, document.documentElement.offsetWidth);             return w; }      function getViewportHeight()   {   if (browser == BROWSER_GECKO)    return document.documentElement.clientHeight;  else    return document.body.clientHeight; }            function getViewportWidth()  {   if (browser == BROWSER_GECKO)    return document.documentElement.clientWidth;  else    return document.body.clientWidth; }      function getElementHeight(dom_Elem)   {   return dom_Elem.offsetHeight; }    function getElementWidth(dom_Elem)  {   return dom_Elem.offsetWidth; }    function getElementLeft(dom_Elem)  {   if (!dom_Elem)    return -1;    var xPos=dom_Elem.offsetLeft;  tempEl=dom_Elem.offsetParent;  while (tempEl != null)    {    xPos += tempEl.offsetLeft;     tempEl=tempEl.offsetParent;  }     return xPos; }      function getElementTop(dom_Elem)   {   if (!dom_Elem)    return -1;    yPos=dom_Elem.offsetTop;  tempEl=dom_Elem.offsetParent;  while (tempEl != null)   {    yPos += tempEl.offsetTop;     tempEl=tempEl.offsetParent;  }   return yPos; }              function GetDialogX(dlgWidth)  {   var gotWidth;  gotWidth=getViewportWidth();  var xval=getScrollX() + (gotWidth-dlgWidth)/2;    return xval; }    function GetDialogY(dlgHeight)  {   var gotHeight;  gotHeight=getViewportHeight();  var yval=mouseY - (dlgHeight/2);    if (mouseY - scrollY - (dlgHeight/2) < 0 )    yval=scrollY + 10;  if (mouseY - scrollY + (dlgHeight/2) > gotHeight )    yval=scrollY + gotHeight - dlgHeight-10;    return yval; }      function CreateDisableMask()  {   var dm=document.createElement('div');  dm.setAttribute("id", "disable_mask");  dm.style.zIndex=1;  dm.style.position='absolute';  dm.style.top=0;  dm.style.left=0;  dm.style.display='none';     var gotWidth;   var gotHeight;        if (browser == BROWSER_IE)   {    dm.style.height=document.documentElement.clientHeight;         dm.style.width=document.documentElement.clientWidth;        }   else   {          dm.style.height=window.innerHeight;         dm.style.width=document.width || document.body.offsetWidth;  }     if (browser == BROWSER_GECKO)    dm.style.opacity=0.5;  else    dm.style.filter='alpha(opacity=' + 50 + ')';  dm.style.backgroundColor='#aaaaaa';  document.body.insertBefore(dm, document.body.firstChild);      disable_mask_created=true; }    function ResizeMaskScroll()  {   if (!disable_mask_visible)    return;  ShowDisableMask(); }    function ShowDisableMask()  {   if (!disable_mask_created)   {    CreateDisableMask();     if(window.addEventListener)    {     window.addEventListener("scroll", ResizeMaskScroll, false);     window.addEventListener("resize", ResizeMaskScroll, false);    }    else     {     window.attachEvent("onscroll", ResizeMaskScroll);    window.attachEvent("onresize", ResizeMaskScroll);   }     }      var dm=gbi('disable_mask');  var gotWidth=Math.max(document.body.scrollWidth, getDocumentWidth() );  var gotHeight=Math.max(document.body.scrollHeight, getDocumentHeight() );  dm.style.height=gotHeight + "px";  dm.style.width=gotWidth + "px";  dm.style.display="block";  disable_mask_visible=true;   }    function HideDisableMask()  {   disable_mask_visible=false;  var dm=gbi('disable_mask');  dm.style.display="none"; }    