function windowWidth() {
    if (window.innerWidth)
        return window.innerWidth;
    else if (document.all)
        return document.body.clientWidth;
    return 0;
}

function windowHeight() {
    if (window.innerHeight)
        return window.innerHeight;
    else if (document.all)
        return document.body.clientHeight;
    return 0;
}

function showImage(img, alt) {

    var obj = document.getElementById('image');
    var	big = new Image();

    big.src = img.src

    s = '<table width="' + big.width + '" height="' + big.height + '" style="background:url(' + big.src + ');" cellspacing="0" cellpadding="6">';
    s = s + '<td align="right" valign="top">';
    s = s + '<img src="close.gif" width="16" height="16" border="0" alt="Zamknij" style="cursor:pointer;" onClick="hideImage();">';
    s = s + '</td></tr><tr>';
	s = s + '<td align="left" valign="bottom">';
    s = s + '<p style="font-size:14px; font-weight:bold; color:000000;">' + alt + '</p></td></tr>';

    obj.innerHTML = s;

    obj.style.top = document.body.scrollTop + parseInt((windowHeight() - big.height) / 2) + 'px';
    obj.style.left = document.body.scrollLeft + parseInt((windowWidth() - big.width) / 2) + 'px';

    obj.style.display = 'block';

}

function hideImage() {

    var obj = document.getElementById('image');
    obj.style.display = obj.style.display = 'none';

}
