function resizephoto(img){
  foto1= new Image();
  foto1.src=(img);
  controler(img);
}
function controler(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="controler('"+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);
}
function affplan(page)
{
  newWindow=open(page,"plan",",width=633,height=396,status=yes,menubar=yes,scrollbars=yes,resizable=yes,left=0,top=0");
  newWindow.focus() ;
}