function open_image(u,ow,oh)
{
		if (ow < 470) ow = 470;
        if (ow+80 > screen.width)
        {
                xp = 0;
                ww = screen.width;
        }
        else
        {
                ww = ow + 80;
                xp = Math.round((screen.width - ww)/2);
        }
        if (oh+90 > screen.height)
        {
                yp = 0;
                wh = screen.height;
        }
        else
        {
                wh = oh + 120;
                yp = Math.round((screen.height - wh)/2);
        }
        wind = window.open(u, "", 'location=0,status=0,scrollbars=1,menubar=0,resizable=1,width='+ww+',height='+wh);
        wind.moveTo(xp, yp);
        return false;
}

function set_tis()
{
        obj = document.getElementById('image');
        oheight = obj.clientHeight;
        owidth = obj.clientWidth;
        truesize = 0;
}

function resize_image()
{
        wwidth = getww()-50;
        if (wwidth >= owidth)
        {
                document.getElementById('mess').style.display = 'none';
                document.getElementById('imgdiv').style.cursor = 'default';
        }
        else
        {
                document.getElementById('mess').style.display = '';
                document.getElementById('imgdiv').style.cursor = 'pointer';
        }
        if (truesize == 1)
        {
                nwidth = owidth;
                nheight = oheight;
        }
        else
        {
                nwidth = wwidth;
                nheight = Math.round((oheight/owidth)*nwidth);
                if (owidth <= nwidth)
                {
                        nwidth = owidth;
                        nheight = oheight;
                }
        }
        obj = document.getElementById('image');
        obj.style.width = nwidth+'px';
        obj.style.height = nheight+'px';
}

function getww()
{
        b = document.getElementById('bd');
        return b.clientWidth;
}
function set_size()
{
        if (truesize == 1)
        {
                truesize = 0;
        }
        else
        {
                truesize = 1;
        }
        resize_image();
}