﻿// JScript File
function inactivateWindow(clear, classname) {
    var d = document.getElementById("divBack");  // re use element currently on page

    if (clear)
        d.className = "TransparencyEffect_clear";
    else if (classname)
        d.className = classname;
    else
        d.className = "TransparencyEffect";
    
    var winW;
    var winH;
    
   // var winH = getPageHeight();
   // 
   // if (window.innerWidth) {
   //     winW = window.innerWidth;
   //     //winH = window.outerHeight;
   // }
   // else if (document.all) {
   //     winW = document.body.clientWidth;
   //     //winH = document.body.clientHeight;
   // }
   // else {
   //     //alert("trouble");
   // }

    // Firefox
    //d.outerWidth = screen.availWidth + "px";
    //d.outerHeight = screen.availHeight + "px";

    winW = screen.availWidth;
    winH = screen.availHeight;
    
    d.style.width = winW + "px";
    //d.style.height = winH + 100 + "px";
    d.style.height = getDocHeight() + "px";
    
    
    d.style.display = "block";

    self.scrollTo(0, 0);
}

function inactivatePanel(clear, id) {
    var d = document.getElementById("panel");
    var e = document.getElementById(id);
    var p = getElementPosition(id); // /js/common.js
    var W;
    var H;
      
    d.className = clear != null && clear == true ? "TransparencyEffect_clear" : "TransparencyEffectPanel";
    W = e.offsetWidth;
    H = e.offsetHeight;

    d.style.width = W + "px";
    d.style.height = H + "px";
    d.style.top = p.top + "px";
    d.style.left = p.left + "px";
    d.style.display = "block";
}

function floatWindow(id) {
    var f = document.getElementById(id);
    f.className = "FloatEffect";
    f.style.display = "block";
}

function floatWindowM(id) {
    var f = document.getElementById(id);
    f.className = "FloatEffectM";
    f.style.display = "block";
}

function resetWindow(floatId, parentId) {
    if (floatId != null && floatId != "") { document.getElementById(floatId).style.display = "none"; }
    if (parentId !=null && parentId != "") { document.getElementById(parentId).style.display = "none"; }
}

function getPageHeight() { return document.getElementById("MasterTable").offsetHeight; }

