/**
 * Funktionen zur Popupverwaltung
 *
 * @author     Tobias Kivelip <tobi@kivelip.net>
 * @copyright  Copyright (c) 2008, Tobias Kivelip
 * @version    1.0
 */  
/**
 * Zentriertes Popup
 */                 
function centeredPopup(url, width, height)
{
    // Defaultwerte, falls keine übergeben wurden
    if (width == undefined) {
        width = 450;
    }
    if (height == undefined) {
        height = 600;
    }
    
    // Position auf der X-Achse berechnen
    var x_size = window.screen.width;
    x_size = x_size - width;
    x_size = x_size / 2;
    x_size = Math.round(x_size);

    // Position auf der Y-Achse berechnen
    var y_size = window.screen.height;
    y_size = y_size - height;
    y_size = y_size / 2;
    // 5% höher als die mitte
    y_size -= height * 0.05;
    y_size = Math.round(y_size);

    popupwindow = window.open(url, url,"scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,width=" + width + ",height=" + height + ",left=" + x_size + ",top=" + y_size);
    popupwindow.focus();
    return false; 
    
}