var createWin = ""; function CloseWindow() { if(document.getElementById('bgDiv')!=null) { document.getElementById('bgDiv').parentNode.removeChild(document.getElementById('bgDiv')); } } function CreateDiv() { CloseWindow(); var sWidth,sHeight; // sWidth = document.documentElement.scrollWidth; // sHeight = document.documentElement.scrollTop + ; sWidth = document.body.scrollLeft + window.screen.Width; sHeight = window.screen.Height + document.documentElement.scrollTop; var bgobj = document.createElement("div"); bgobj.setAttribute('id','bgDiv'); bgobj.style.position = "absolute"; bgobj.style.top = "0"; // bgobj.style.pixelTop = document.body.scrollTop; bgobj.style.background = "#666"; bgobj.style.filter = "alpha(opacity = 30)"; bgobj.style.opacity = "0.3"; bgobj.style.left = "0"; bgobj.style.width = sWidth + "px"; bgobj.style.height = sHeight + "px"; bgobj.style.zIndex = "2"; bgobj.style.background = "#91bbff"; document.body.appendChild(bgobj); // window.document.getElementById('bgDiv').parentNode.scroll = "yes"; }