﻿// JavaScript open popup code
var winPop = null;
function openPop(sURL, sWinName, iWidth, iHeight) {
  var strParams;
  var intWidth = parseInt(iWidth);
  var intHeight = parseInt(iHeight);
  var intMaxWidth = parseInt(screen.availWidth);
  var intMaxHeight = parseInt(screen.availHeight) - 50;
  if (intMaxWidth != null && intMaxWidth < intWidth)
    intWidth = intMaxWidth;
  if (intMaxHeight != null && intMaxHeight < intHeight)
    intHeight = intMaxHeight;
  if (!winPop || winPop.closed) {
    strParams = "dependent=yes,scrollbars=yes,toolbar=no,directories=no,location=no,menubar=no,resizable=yes,status=no,width=" + intWidth + ",height=" + intHeight;
    winPop = open(sURL,sWinName,strParams);
  } else {
    winPop.location = sURL;
    winPop.focus();
  }
}

