
function AutoSizeWindow(img) {
  foto1= new Image();
  foto1.src=(img);
  Control(img);
}
function Control(img) {
  if((foto1.width!=0)&&(foto1.height!=0)) {
    viewFoto(img);
  }
  else{
    again="Control('"+img+"')";
    interval=setTimeout(again,20);
  }
}
function viewFoto(img){
  width=foto1.width+20;
  height=foto1.height+20;
  properties="width="+width+",height="+height;
  fenster=window.open(img,"",properties);
}
