function fit_window(){
  pictureWidth = objGet('pic').width;
  pictureHeight = objGet('pic').height;
  window.resizeTo(pictureWidth+60, pictureHeight+96);  
}

function objGet(id){
   if(Boolean(document.getElementById))
      return document.getElementById(id);
   else if(Boolean(document.all))
      return eval('document.all.'+id);
   else
      return eval('document.'+id);
}

function openImage(file){
  url = '/photo.php?file='+file;
  win = window.open(url, 'image', 'resizable=1,top=20,left=20,menubar=0,scrollbars=1,width=' + 300 + ',height=' + 220 );
  win.focus();
}

