﻿function previewDiv(id) {
    if (window.innerHeight) {
        theHeight = window.innerHeight;
        theWidth = window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        theHeight = document.documentElement.clientHeight;
        theWidth = document.documentElement.clientWidth;
    } else if (document.body) {
        theHeight = document.body.clientHeight;
        theWidth = document.body.clientWidth;
    }

    var tid = "pd" + id;

    var eDiv = document.createElement("DIV");
    eDiv.id = tid;
    eDiv.style.width = "800px";
    eDiv.style.height = "600px";
    eDiv.style.position = "absolute";
    eDiv.style.zIndex = 99999;
    eDiv.style.backgroundColor = "red";
    eDiv.style.left = "10px";
    eDiv.style.top = "20px";
    eDiv.className = ""
    eDiv.innerHTML = "<a href\"#\" onclick=\"rpreviewDiv(pd" + id + ")\">Zamknij</a>";
    return eDiv;
}

function rpreviewDiv(id) {
    document.body.removeChild(id);
}
