function PopupImage(url, larg, haut, codepopup, codepos) {
  // Affichage en fonction des options
  haut = haut + 20;
  options = "toolbar=no, directories=no, menubar=no, status=no, location=no, width=" + larg + ", height=" + haut; 
  switch (codepopup) {
  case 0 :
    options += ", scrollbars=no, resizable=no";
    break;
  case 1 :
    options += ", scrollbars=no, resizable=no";
    break;
  case 2 :
    options += ", scrollbars=yes, resizable=yes";
    break;
  }
  vertical = 30;
  horizontal = 10;
  switch (codepos) {
    case 1 :
      ptop = Math.round((screen.availHeight - haut - vertical)/2);
      pleft = Math.round((screen.availWidth - larg - horizontal)/2);
      options += ", top=" + ptop + ", left=" + pleft; 
      break;
    case 2 :
      options += ", top=0, left=0"; 
      break;
    case 3 :
      pleft = screen.availWidth - larg - horizontal;
      options += ", top=0, left=" + pleft; 
      break;
    case 4 :
      ptop = screen.availHeight - haut - vertical;
      options += ", top=" + ptop + ", left=0"; 
      break;
    case 5 :
      ptop = screen.availHeight - haut - vertical;
      pleft = screen.availWidth - larg - horizontal;
      options += ", top=" + ptop + ", left=" + pleft; 
      break;
    default :
    case 0 :
      break;
  }

  fen=open("", "", options);
  fen.document.write("<html><head><title>Photo</title></head><body marginwidth='0' marginheight='0' topmargin='0' leftmargin='0'><img src='"+url+"'>");
  fen.document.write("<br><center><a href='javascript:window.close()'>Close this window</a></center></body></html>");
} 
