
function ViewImage(img)
{
	image= new Image();
	image.src=(img);
	Control(img);
}

function Control(img)
{
	if((image.width!=0)&&(image.height!=0))
	{
    	openPopup(img);
	}
  	else
  	{
    	funzione="Control('"+img+"')";
    	intervallo=setTimeout(funzione,20);
	}
}

function openPopup(img)
{
	large=image.width+20;
	altern=image.height+20;
	size="width="+large+",height="+altern;
	finestra=window.open(img,"",size);
}