var myTWin = window.myTWin;

function popupGalleryWindow(link,winName,width,height)
{
  var retValue=true;
  if (myTWin!=null && !myTWin.closed)
  {
    myTWin.focus();
    myTWin.location.href=link.href;
  }
  else
  {
    myTWin=window.open(link.href,winName, "toolbar=0, status=0, menubar=0, scrollbars=0, resizable=0, width="+width+", height="+height);
    if (myTWin==null || typeof(myTWin)=="undefined")
      retValue=false;
    else
    {
      link.target=winName;
      myTWin.focus();
    }
  }
  return retValue;
}
