ONLOAD_STACK = [];

function popupOpen(link, width, height) {
    window.open(link.href, "", "width=" + width + ",height=" + height + ",scrollbars=yes,menubar=no" );
    return false;
}

function goTo(url, override) {
    if (override) {
        window.location.replace(url);
    } else {
        window.location = url;
    }
}

function registerOnLoad(callback) {
    // old browsers doesn't support Array#push
    ONLOAD_STACK[ONLOAD_STACK.length] = callback;
}

function onLoadCallback() {
    var len = ONLOAD_STACK.length;
    for (var i = 0; i < len; i++) {
        ONLOAD_STACK[i]();
    }
}
window.onload = onLoadCallback;
