﻿// JScript File

function ShowControl(id) {
    var e = document.getElementById(id);
    if (e.style.display == 'block')
        e.style.display = 'none';
    else
        e.style.display = 'block';

}

var baseText = null;

function showPopup(w, h) {
    var popUp = document.getElementById("popupcontent");
    popUp.style.top = "200px"; popUp.style.left = "200px";
    popUp.style.width = w + "px"; popUp.style.height = h + "px";

    if (baseText == null)
        baseText = popUp.innerHTML;

    popUp.innerHTML = baseText + "<div id=\"statusbar\"><button onclick=\"hidePopup();\">Close window<button></div>";
    var sbar = document.getElementById("statusbar"); sbar.style.marginTop = (parseInt(h) - 40) + "px"; popUp.style.visibility = "visible";
}

function hidePopup() { var popUp = document.getElementById("popupcontent"); popUp.style.visibility = "hidden"; }



var popupWindow = null;

function openCenteredWindow(url, width, height) {
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    var top = parseInt((screen.availHeight / 2) - (height / 2));

    var v_Bars = 'directories=no, location=no, menubar=no, status=no,titlebar=no,toolbar=no';

    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable=yes, scrollbars=yes,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    popupWindow = window.open(url, "subWind", v_Bars + ',' + windowFeatures);
    if (window.focus) { popupWindow.focus() }

}

function parent_disable() {
    if (popupWindow && !popupWindow.closed)
        popupWindow.focus();
}



