/**
 * Funktionen zur Popupverwaltung
 *
 * @author     Tobias Kivelip <tobi@kivelip.net>
 * @copyright  Copyright (c) 2008, Tobias Kivelip
 * @version    1.0
 */
/**
 * Zentriertes Popup
 */
function popup(url, width, height, scrollbars) {

    // Defaultwerte, falls keine übergeben wurden
    if (width == undefined) {
        width = 800;
    }
    if (height == undefined) {
        height = 600;
    }
    if (scrollbars == undefined) {
    	scrollbars = "no";
    }

    // 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);

	var browser = navigator.userAgent.toLowerCase();

	if(browser.indexOf("msie") != -1)
	{
		fenster=window.open(url, "_blank", "width=520,height=500,status=yes,scrollbars=yes,resizable=yes");
		fenster.focus();
	}
	else
	{
    	popupwindow = window.open(url, "_blank","scrollbars=" + scrollbars + ",toolbar=yes,location=no,directories=no,status=no,menubar=no,width=" + width + ",height=" + height + ",left=" + x_size + ",top=" + y_size);
		popupwindow.focus();
	}



}
