

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->


function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  //Controlla(img);
  viewFoto(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=600;
altez=600; 

 <!--  largh=foto1.width+20; -->
 <!-- altez=foto1.height+20; -->
   stringa="width="+largh+",height="+altez;
 // stringa="width=600, height=600";
 // finestra=window.open(img,"",stringa);
   finestra=window.open(img,"",stringa);



if(foto1.width+100 > foto1.height){
	finestra.document.write("<table width='600' height='200' border='0' cellpadding='0' cellspacing='1'><tr><td align='center' valign='top'bgcolor='#66CCFF'>")
	finestra.document.write(jj);
	finestra.document.write("</td></tr><tr><td align='center' valign='top' >");
	finestra.document.write("<IMG SRC=");
	finestra.document.write(img);
	finestra.document.write("  BORDER='0'></td></tr></table>");

	}else{
	finestra.document.write("<table width='600' height='200' border='0' cellpadding='0' cellspacing='1'><tr><td width='411' align='left' valign='top'>")
	finestra.document.write("<IMG SRC=");
	finestra.document.write(img);
	finestra.document.write("  BORDER='0'></td><td align='left' valign='top' bgcolor='#66CCFF'>");
	finestra.document.write(jj);
	finestra.document.write("</td></tr></table>");



	}
   
 
}


