// JavaScript Document for Image display

var foto1;
function ShowPhoto(img, alt){
    foto1 = null;
    img = img.replace(/\s/g, '%20');
    img = img.replace(/\+/g, '%20');
	foto1 = new Image();
	foto1.src = (img);
	Controlla(img, alt);
}

function Controlla(img, alt){
  if((foto1.width!=0)&&(foto1.height!=0)) {
	largh=foto1.width+0;
	altez=foto1.height+0;
	viewFoto(img, alt, largh, altez);
  } else {
    funzione="Controlla('"+img+"','"+alt+"')";
    intervallo=setTimeout(funzione,20);
  }
}

function viewFoto(img, alt, largh, altez) {
	stringa="width="+largh+",height="+altez;
	finestra=window.open( img ,"",stringa);
	return;
}

function pausecomp(millis){
    date = new Date();
    var curDate = null;
    do { var curDate = new Date(); } while( curDate-date < millis );
} 