﻿function resizePopup(popupID) {

    var viewportHeight = document.documentElement.clientHeight;
    var popupHeight = (viewportHeight * 0.9);
    var bottom = ((Number)(popupHeight - 160)).toString() + "px";

    var divs = document.getElementsByTagName("div")
    var divs_count = divs.length;

    for (x = 0; x < divs_count; x++) {
        var current = divs[x];
        if (current.id == popupID) {
            current.style.height = bottom;
        }
    }
}