function showPopup(current) {
    document.getElementById("overlay").style.display = "block";
    var h = document.getElementById("wrap").clientHeight;
    if (h <= document.getElementsByTagName("body")[0].clientHeight) {
        h = document.getElementsByTagName("body")[0].clientHeight;
    }
    var where = current.href;
    where = where.substring(where.lastIndexOf("#") + 1, where.length);
    
    document.getElementById("overlay").style.height = h + "px";
    document.getElementById(where).style.display = "block";
    return false;
}

function closePopup(current) {
    document.getElementById("overlay").style.display = "none";
    current.parentNode.parentNode.style.display = "none";
    return false;
}
