/*

(kris)janis p. gale
kpg@foureyes.com
07/11/2001

pop-up window function

*/

function popupWindow(popupURL,popupOptionList)
{ var popupWidth = 600;
  var popupHeight = 400;
  var popupScrollbars = "no";
  var popupResizable = "no";
  var popupCentered = "no";
  var popupPosition = "";
  if(popupOptionList)
  { var popupOptions = popupOptionList.split(",");
    var popupIndex = 0;
    if(!isNaN(popupOptions[0]))
    { popupWidth = popupOptions[0];
      popupHeight = popupOptions[1];
      popupIndex = 0;
    }
    while(popupIndex < popupOptions.length)
    { switch(popupOptions[popupIndex])
      { case "scrollbars": popupScrollbars = "yes"; break;
        case "resizable": popupResizable = "yes"; break;
        case "centered": popupCentered = "yes"; break;
      }
      popupIndex++;
    }
  }
  if(popupCentered == "yes")
  { var popupLeft = Math.floor((screen.width - popupWidth) / 2);
    var popupTop = Math.floor((screen.height - popupHeight) / 2);
    popupPosition =
        "screenx=" + popupLeft
      + ",screeny=" + popupTop
      + ",left=" + popupLeft
      + ",top=" + popupTop
      + ",";
  }
  window.open(popupURL
    ,""
    , popupPosition
    + "width=" + popupWidth
    + ",height=" + popupHeight
    + ",hotkeys=no"
    + ",scrollbars=" + popupScrollbars
    + ",resizable=" + popupResizable
    );
}

// alternatively... you could use this code.

function openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

