var popUp=0;
function popUpWindow(URLStr, width,height)
{
swidth = screen.width
sheight = screen.height
posLeft = (swidth - width)/2; 
posDown = (sheight - height)/2; 
  if(popUp)
  {
    if(!popUp.closed) popUp.close();
  }
  WinPop = open(URLStr, 'popUp', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+posLeft+', top='+posDown);
}

// usage:
// <a href="javascript:popUpWindow('filename',width,height)"> this is the link
// include this in head of doc:
// <script  language="javascript1.4" type="text/javascript" src="../popup.js"></-script> 