/**
 * Displays a centered popup window
 *
 * @param {String} path URL or path to display
 * @param {Number} width Popup window's width
 * @param {Number} height Popup window's height
 * @param {Boolean} fixed If set to true, the window will neither have a
                          statusbar or scrollbars nor will it be resizable,
                          otherwise both will be available
 * @author CB
 * @version 2006-09-09
 */
function popup(path, width, height, fixed) {

	if (!height || !width) {
		// Width and/or height missing, set window width to
		// default value and set fixed to false
		width = 350;
		height = 250;
		fixed = false;
	}

	if (screen.availWidth) {
		position = 'left=' + (Math.floor(screen.availWidth / 2 - width / 2)) +
		           ',top=' + (Math.floor(screen.availHeight / 2 - height / 2));
	}
	else if (window.screenX) {
		position = 'screenX=' + (window.screenX + 50) + ',screenY=' + (window.screenY + 50);
	}
	else {
		position = 'left=120,top=120';
	}

	if (fixed) {
		attrs = 'status=no,resizable=no,scrollbars=no';
	}
	else {
		attrs = 'status=yes,resizable=yes,scrollbars=yes';
	}

	pp = window.open(path, 'Popup', 'width=' + width + ',height=' + height +
	                 ',' + position + attrs);

	pp.focus();

} // function popup(path, width, height, fixed)


