function PrevFoto(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){
	if(navigator.userAgent.indexOf("Firefox")!=-1){
		largh=foto1.width+15;
		altez=foto1.height+15;
		stringa="width="+largh+",height="+altez;
		finestra=window.open(img,"",stringa);
	}else{
		largh=foto1.width+20;
		altez=foto1.height+30;
		stringa="width="+largh+",height="+altez;
		finestra=window.open(img,"",stringa);
	}

		
}