// not mine...
function popUpWindow(strImageTitle, strImagePath, winWidth, winHeight)
{
  var popUpWin=0;
  var centerWidth = (screen.width/2) - (winWidth/2); 
  var centerHeight = (screen.height/2) - (winHeight/2);
  centerWidth = Math.round(centerWidth);
  centerHeight = Math.round(centerHeight);
  
  if(popUpWin){
    if(!popUpWin.closed){
      popUpWin.close();
    };
  };
  popUpWin=open("", "",'directories=no,location=no,menubar=no,resizable=no,scrollbars=no,toolbar=no,width=' + parseInt(winWidth) + ',height=' + parseInt(winHeight) + ',left=' + parseInt(centerWidth) + ',top=' + parseInt(centerHeight));
  popUpWin.document.title = strImageTitle;
  popUpWin.document.open();
  popUpWin.document.writeln('<html><head><title>' + strImageTitle + "</title></head>");
  popUpWin.document.writeln('<body style="padding: 0px; margin: 0px;">');
  popUpWin.document.writeln("<img src='" + strImagePath + "' width='" + winWidth + "' height='" + winHeight + "' border='0' alt=''>");
  popUpWin.document.writeln('</body></html>');
  popUpWin.document.close();
  popUpWin.focus();
};




function apriPopupCentrale(nome, titolo, lar, alt, feat){
  var wdt = screen.width;
  var hgt = screen.height;
  var x = Math.round( (wdt / 2) - (lar / 2) );
  var y = Math.round( (hgt / 2) - (alt / 2) );
  window.open(nome, titolo, 'width=' + lar + ',height=' + alt + ',left=' + x + ',screenX=' + x + ',top=' + 150 + ',screenY=' + 150 + ',' + feat);
}
