function CaricaFoto(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;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}

/****************************************************
     AUTHOR: WWW.CGISCRIPT.NET, LLC
     URL: http://www.cgiscript.net
     Use the code for FREE but leave this message intact.
     Download your FREE CGI/Perl Scripts today!
     ( http://www.cgiscript.net/scripts.htm )
****************************************************/
var win=null;

function NewWindow(mypage,myname,w,h,pos,infocus){
	if(pos=="random"){
		myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		myleft=(screen.width)?(screen.width-w)/2:100;
		mytop=(screen.height)?(screen.height-h)/2:100;
	}
	else if((pos!='center' && pos!="random") || pos==null){
		myleft=0;mytop=20
	}
	settings = "width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft +
			   ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";
	win=window.open(mypage,myname,settings);
	win.focus();
}

/*
spe=1600;
na=document.all.tags("blink");
swi=1;
bringBackBlinky();

function bringBackBlinky() {
	if (swi == 1) {
		sho="visible";
		swi=0;
	}else {
		sho="hidden";
		swi=1;
	}
	for(i=0;i<na.length;i++) {
		na[i].style.visibility=sho;
	}
	setTimeout("bringBackBlinky()", spe);
}*/