﻿//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
function ShowKennisTest() {
	showPopup('kennistest/index.html');
	}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
function showPopup(url, width, height) {
	var mask = document.getElementById("popupmask");
	var frame = document.getElementById("popupframe");
	if (mask && frame) {
		var frameLeft = (window.screen.availWidth - 760) / 2;
		var frameTop = (window.screen.availHeight - 500) / 2 - 100;
		
		if (width) {
			frame.style.width = width + "px";
			frameLeft = (760 - width) / 2;
			if (frameLeft < 100) frameLeft = 100;
			frame.style.left = frameLeft;
			}
		if (height) {
			frame.style.height = height + "px";
			frameTop = (500 - height) / 2;
			if (frameTop < 100) frameTop = 100;
			frame.style.top = frameTop;
			}
		mask.style.display = "block";
		frame.style.display = "block";
		document.getElementsByTagName("BODY")[0].style.overflow = "hidden";
		}
	}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
function resizeFlexContainer(maximize) {
    var popup = getElement("popupframe");
    if (isEmpty(popup) == false) {
        if ((maximize + "") == "true") {
            popup.style.top = "0px";
            popup.style.left = "0px";
            popup.style.width = "100%";
            popup.style.height = "100%";
            }
        else {
            var bodyWidth = document.body.scrollWidth;
            var marginLeft = parseInt((bodyWidth - 760) / 2);
            popup.style.top = "141px";
            popup.style.left = marginLeft + "px";
            popup.style.width = "864px";
            popup.style.height = "520px";
            }
        }
    }
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
function hidePopup() {
	document.getElementsByTagName("BODY")[0].scroll = "";
	document.getElementsByTagName("BODY")[0].style.overflow = "";
	var mask = document.getElementById("popupmask");
	var frame = document.getElementById("popupframe");

	if (mask && frame) {
		mask.style.display = "none";
		frame.style.display = "none";
		}
	}
