var isPopped;
var theCommandString="launchPop(thisURL,winName,'width='+wide+',height='+high+',')";
var winName = "popwin";
var x_xx = 0;
var y_yy = 0;
var theWidth;
var theHeight;

function measure() {
theWidth=screen.availWidth-8;
theHeight=screen.availHeight-28;
}

function openWin(thisURL,wide,high) {
eval(theCommandString);
}

function launchPop(theURL,thisWinName,theseFeatures) {
if (isPopped) {closePops()}
var feature;
feature = theseFeatures += "left=" + x_xx + ",top=" + y_yy + ",screenX=" + x_xx + ",screenY=" + y_yy + ",scrollbars=yes,location=no,menubar=no,directories=no,toolbar=no,resizable=yes,status=no";
newBrowser = window.open(theURL,thisWinName,feature);
isPopped=true;
}

function closePops(){
if (isPopped) {
    isOpen=(newBrowser.closed) ? false:true;
    if (isOpen) {
        newBrowser.close();
        }
    }
}

measure();
