function Popup(url, name, options) {
	if ( name == null ) name = 'Popup';
	if ( options == null ) options = 'resizable=yes,scrollbars=1,menubar=0,status=0';
	var win = open( url, name, options);
	win.focus();
}

function Fit(id, what) {
	if ( opener != null && document.getElementById ) {
		element = document.getElementById(id);
		new_w = Math.min(element.offsetWidth, screen.width - 30);
		new_h = Math.min(element.offsetHeight, screen.height - 100);

		if ( window.innerWidth ) {
			act_w = window.innerWidth;
			act_h = window.innerHeight;
		}
		else {
			act_w = document.body.clientWidth;
			act_h = document.body.clientHeight;
		}

		if (what == null || what == 'wh' || what == 'hw') {
			dw = new_w - act_w;
			dh = new_h - act_h;
		} else if (what == 'w') {
			dw = new_w - act_w;
			dh = 0;
		} else if (what == 'h') {
			dw = 0;
			dh = new_h - act_h;
		} else {
			alert('Parameter "what" hat unbekannten Wert: '+what);
		}

		window.resizeBy(dw, dh);
		w = new_w;
		h = new_h;
	}
}

