function OpenWindow(img, width, height) {
  ws=screen.width;
  hs=screen.height;
  var top=(hs/2-height/2);
  var left=(ws/2-width/2);
  if( ws < width ){ top=0; }
  if( hs < height ){ left= 0;}
  newwindow2 = window.open(img, "Image", "top="+ top +",left="+ left +", toolbar=no,scrollbars=no,resizable=no,width="+width+",height="+height);
  var tmp = newwindow2.document;
  tmp.title = "popup";
 }

