// JavaScript Document
function openFoto(img) {
	foto1= new Image();
	foto1.src=(img);
	Controlla(img);
}

function Controlla(img) {
	if ((foto1.width!=0)&&(foto1.height!=0)) {
		ViewFoto(img);
	} else {
		funzione="Controlla('"+img+"')";
		intervallo=setTimeout(funzione,20);
	}
}

function ViewFoto(img) {
	largh=foto1.width+20;
	altez=foto1.height+20;
	yPos = ((screen.height / 2) - (parseInt(altez) / 2));
	xPos = ((screen.width / 2) - (parseInt(largh) / 2));
	stringa="width="+largh+",height="+altez+",top="+yPos+",left="+ xPos;
	finestra=window.open(img,"",stringa);
}
