var objWin = null;
 
function openWin(theURL,winName,features) {
  if (objWin && !isMac && objWin.open) objWin.close();
  objWin = window.open('',winName,features);
  if (objWin.focus) objWin.focus();
  if (theURL) objWin.document.location.replace(theURL);
  return false;
}

function popImage(pic,title) {
  var wid = 420, hei = 520;
  var left = (screen.availWidth-wid)/2;
  var top = (screen.availHeight-hei)/2;
 
  return openWin(pic, 'mypopupwindow','width='+wid+',height='+hei+',top='+top+',screenY='+top+',left='+left+',screenX='+left);}  // JavaScript Document