
function popupImage( imageURL, width, height  )
{
  var settings = 'scrollbars=yes,resizable=yes,height='+height+',width='+width;
  var generator=window.open('','name',settings);
  generator.document.write('<html><head><title>View Image</title>');
  //generator.document.write('<style type="text/css"> body { margin: 0px; padding: 0px; } </style>');
  generator.document.write('</head><body>');
  generator.document.write('<p><a href="javascript:self.close()">- close window -</a></p>');  
  generator.document.write('<p align="center"><img src="'+imageURL+'"></p>');
  generator.document.write('<p><a href="javascript:self.close()">- close window -</a></p>'); 
  generator.document.write('</body></html>');
  generator.document.close();
}

function getWinCenter( popupWidth, popupHeight )
{
    winpos = new Array(2);
    scrheight = screen.height;
    scrwidth = screen.width;
    wintop = (scrheight - popupHeight-100) / 2;
    winleft = (scrwidth - popupWidth) / 2;
    winpos[0] = wintop;
    winpos[1] = winleft;
    return winpos;
}