function popup(url, name, width, height, extra) {
    var _c = '', _w = null;

    function _v(v, d) {
        if (typeof(extra) == 'undefined') return d;
        if (typeof(extra[v]) == 'undefined') return d;
        return extra[v];
    }

    function _a(v, d) {
        d = _v(v, d);

        if (d == null || d == '') return _c;
        if (_c.length != 0) _c = _c + ',';
        return _c + v  + '=' + d;
    }

    _c = _a('width', width);
    _c = _a('height', height);

    var _p = {'top': 100, 'left': 100};
    if (_v('center', true)) {
        _p.top = (screen.height / 2) - (_v('height', height) / 2);
        _p.left = (screen.width / 2) - (_v('width', width) / 2);
    }
    _c = _a('top', _p.top);
    _c = _a('left', _p.left);
    _c = _a('screenY', _p.top);
    _c = _a('screenX', _p.left);

    _c = _a('menubar', null);
    _c = _a('status', null);
    _c = _a('toolbar', null);
    _c = _a('scrollbars', null);
    _c = _a('resizable', null);
    _c = _a('directories', null);
    _c = _a('location', null);

    _w = window.open(url, name, _c);
    if ( _v('focus', true) ) _w.focus();
}
