function Foto(img){
  foto1= new Image();
  foto1.src=(img);
  ControlThisPic(img);
}
function ControlThisPic(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
	viewFoto(img);
  }
  else{
	funzione="ControlThisPic('"+img+"')";
	intervall=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  wider=foto1.width+20;
  morealtitude=foto1.height+20;
  stringa="width="+wider+",height="+morealtitude;
  finestra=window.open(img,"",stringa);
}

