function Show(img){
foto= new Image();
foto.src=(img);
Ctrl(img);
}
function Ctrl(img){
if((foto.width!=0)&&(foto.height!=0)){
viewFoto(img);
}
else{
funzione="Ctrl('"+img+"')";
intervallo=setTimeout(funzione,100);
}
}
function viewFoto(img){
largh=foto.width+20;
altez=foto.height+25;
LeftPosition = (screen.width) ? (screen.width-largh)/2 : 0; 
TopPosition = (screen.height) ? (screen.height-altez)/2 : 0; 
param="width="+largh+",height="+altez+',top='+TopPosition+',left='+LeftPosition;
finestra=window.open(img,"",param);
}