function popupPicture(pictureURL, width, height, justPicture) {
  if (justPicture) {
    var frame = window.open('', '', 'width='+width+',height='+height+',scrollbars=0,location=0,menubar=0,resizable=1');
    frame.document.write(
      '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '
      +'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n'
      +'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'
      +'  <head>\n'
      +'    <title>SPGM: '+pictureURL+'</title>'
      +'    <style type="text/css">body {margin: 0px}</style>\n'
      +'    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n'
      +'  </head>\n'
      +'  <body>\n'
      +'    <div style="margin: 0px;">\n'
      +'      <img src="'+pictureURL+'" onClick=window.close() alt="'+pictureURL+'" />\n'
      +'    </div>\n'
      +'  </body>\n'
      +'</html>'
    );
  } else {
    window.open(pictureURL, '', 'width='+width+',height='+height+',scrollbars=1,location=0,menubar=0,resizable=1');
  }
}