function showPopup(sUrl)
{
    if(oPopup = document.getElementById('div_popup'))
    {
        oPopup.innerHTML = "<img id='img_popup' class='img_popup' src='"+sUrl+"' onClick='javascript:closePopup();' onLoad='javascript:centerPopup();' />";
    }
}

function closePopup()
{
    if(oPopup = document.getElementById('div_popup'))
    {
        oPopup.innerHTML = "";
        oPopup.style.display = 'none'; 
    }    
}
function centerPopup()
{
    if(oPopup = document.getElementById('div_popup'))
    {
        oPopup.style.display = '';
        if(oImage = document.getElementById('img_popup'))
        {
            iWidth = oImage.clientWidth;
            iHeight = oImage.clientHeight;
            
            if (navigator.appName=="Netscape")
            {
                wWidth = window.innerWidth;
                wHeight = window.innerHeight;
            }
            if (navigator.appName.indexOf("Microsoft")!=-1) 
            {
                wWidth = document.body.offsetWidth;
                wHeight = document.body.offsetHeight;
            }
            
            oPopup.style.top = (wHeight - iHeight) / 2;
            oPopup.style.left = (wWidth - iWidth) / 2;
        }
    }
}