function openpopup(url, name, width, height) {
    // Set up the window attrubutes
    var attributes = "toolbar=0,location=0,scrollbars=1,height=" + height;
    attributes = attributes + ",width=" + width;
    var leftprop, topprop, screenX, screenY, cursorX, cursorY, padAmt;

    // Get the clients screen size
    if (navigator.appName == "Microsoft Internet Explorer") {
        screenY = screen.height;
        screenX = screen.width;
    } else {
        screenY = window.outerHeight;
        screenX = window.outerWidth;
    }

    // Set the x/y position relative to the center of the screen
    leftvar = (screenX - width) / 2;
    rightvar = (screenY - height) / 2;
    if (navigator.appName == "Microsoft Internet Explorer") {
        leftprop = leftvar;
        topprop = rightvar;
    } else {
        leftprop = (leftvar - pageXOffset);
        topprop = (rightvar - pageYOffset);
    }
    attributes = attributes + ",left=" + leftprop;
    attributes = attributes + ",top=" + topprop;

    // Open the window
    window.open(url, name, attributes)
}
