function resize_image()
{
        wwidth = $(window).width()-50;
		wheight = $(window).height() - 250;

        if (wwidth >= owidth && wheight >= oheight)
        {
                document.getElementById('mess').style.display = 'none';
                document.getElementById('image').style.cursor = 'default';
        }
        else
        {
                document.getElementById('mess').style.display = '';
                document.getElementById('image').style.cursor = 'pointer';
        }
		nwidth = owidth;
		nheight = oheight;
        if (truesize == 0)
		{
				if (wwidth < owidth && owidth >= oheight)
				{
						nwidth = wwidth;
						nheight = Math.round((oheight/owidth)*nwidth);
				}
				if (wheight < oheight && oheight > owidth || nheight > wheight)
				{

						nheight = wheight;
						nwidth = Math.round((owidth/oheight)*nheight);
				}
		}
        obj = document.getElementById('image');
        obj.style.width = nwidth+'px';
        obj.style.height = nheight+'px';
}
function set_size()
{
        truesize = truesize == 1? 0:1;
        resize_image();
}
