function popNamedWindow(url, width, height, toolbar, name) {
  var win = null;
  if (toolbar == true) {
    win = window.open(url, "detailwindow", "width=" + width + ",height=" + height + ",resizable,scrollbars,toolbar,menubar", true);
  } else {
    win = window.open(url, "detailwindow", "width=" + width + ",height=" + height + ",resizable,scrollbars", true);
  }
  if (win != null) {
    win.resizeTo(width, height);
    
    return true;
  } else {
    alert(
      "This link opens in another window, however, your browser is configured to block pop-up windows.  " +
      "To view the contents of this link, please configure your browser to allow pop-up windows for this website."
    );
    return false;
  }
}

function popDetail(url, toolbar) {
  return popNamedWindow(url, 400, 600, toolbar, "wdnrgap_detail");
}

function popInfo(url, toolbar) {
  return popNamedWindow(url, 300, 500, toolbar, "wdnrgap_info");
}

function popNew(url, width, height, toolbar) {
  return popNamedWindow(url, width, height, toolbar, "_blank");
}