function openImage(type,id,w,h)
{
	var sottrattore = 150;
	var www = w;
	var hhh = h;
	if(w >= (screen.width - sottrattore))
	{
		w = parseInt(screen.width - sottrattore);
		h = parseInt(hhh*w/www);
	}
	var ww = w;
	var hh = h;
	if(h >= (screen.height - sottrattore))
	{
		h = parseInt(screen.height - sottrattore);
		w = parseInt(ww*h/hh);
	}
	var page = "figura.asp?str=" + type + "_" + id + "_" + w + "_" + h;
	window.open(page,"","width="+(w+20)+",height="+(h+20)+",directories=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");
}
