﻿function DisablePage() 
{
    var width;
    var height;

    if (window.innerHeight && window.scrollMaxY) { // Firefox 
        width = window.innerWidth + window.scrollMaxX;
        height = window.innerHeight + window.scrollMaxY;
    }
    else if (document.body.scrollHeight > document.body.offsetHeight) // all but Explorer Mac
    {
        width = document.body.scrollWidth;
        height = document.body.scrollHeight;
    }
    else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
        width = document.body.offsetWidth + document.body.offsetLeft;
        height = document.body.offsetHeight + document.body.offsetTop;
    }
        
    var disabler = document.createElement("div");
    disabler.id = "disabler";    
    disabler.style.cssText = "position:absolute; z-index: 5; top:0; left: 0; width: " + width + "px; height: " + height + "px; background-color: #fff; opacity:0.1; filter:alpha(opacity=10)";

    document.getElementsByTagName("body")[0].appendChild(disabler); 
}

function EnablePage()
{
    var disabler = document.getElementById("disabler");
    
    if (disabler != null || disabler != undefined)
        disabler.parentNode.removeChild(disabler); 
}
