﻿function PopUp(URL,width,height,toolbar) {
<!---Define variables--->
var features;
var x;
var y;
var id;
<!---Set width, height of window (if not already set)--->
if (!width) {width = 500;}
if (!height) {height = 500;}
<!---Set whether toolbar is on or off--->
if (!toolbar) {toolbar = 0;}
else {toolbar = 1;}
if (window.screen) {
  <!---Screen object available. Put window in middle of screen--->
  x = (screen.availWidth - width) * 0.5;
  y = (screen.availHeight - height) * 0.5; }
else {
  <!---Screen object unavailable. Put window in certain position--->
  x = 50; y = 50; }
<!---Set window features and open window--->
features = "height=" + height
features = features + "," + "width=" + width
features = features + "," + "resizable=0"
features = features + "," + "scrollbars=1"
features = features + "," + "screenX=" + x
features = features + "," + "screenY=" + y
features = features + "," + "left=" + x
features = features + "," + "top=" + y
features = features + "," + "toolbar=" + toolbar
id = open(URL,"popup",features);
}


