var popWin = null
var winCount = 0
var winName = "popWin"

function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){

  var d_winLeft = 20;
  var d_winTop = 20;

  winName = "popWin" + winCount++ ;

  closePopWin();

  if (openPopWin.arguments.length >= 4)
    winFeatures = "toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=auto," + winFeatures;
  else
    winFeatures = "toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=auto";

  if (openPopWin.arguments.length == 6)
    winFeatures += getLocation(winWidth, winHeight, winLeft, winTop);
  else
    winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop);

  winFeatures = ",toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes";

  // alert("width=" + winWidth + ",height=" + winHeight + winFeatures);

  popWin = window.open(winURL, winName, "width=" + winWidth + ",height=" + winHeight + winFeatures);
}

function closePopWin(){
  if (navigator.appName != "Microsoft Internet Explorer" ||
                           parseInt(navigator.appVersion) >=4)
    if(popWin != null) if(!popWin.closed) popWin.close()
}

function getLocation(winWidth, winHeight, winLeft, winTop){
  return ""
}

