function openPopup(url, winname, width, height, scrollbar) {
    var screenX = screen.width;
    var screenY = screen.height;

    var popupWidth  = width;
    var popupHeight = height;

    var popupLeft = parseInt((screenX - popupWidth)  / 2);
    var popupTop  = parseInt((screenY - popupHeight) / 2);

    window.open(url,"centeredPopup", "width=" + width +", height=" + height + ", top=" + popupTop + ", left=" + popupLeft + ",scrollbars = " +scrollbar);
}
