function openwin(url, target, w, h, pscroll, presize) {
	if (!url) url = 'about:blank';
	if (!target) target = '_blank';
	if (!w) w = screen.availWidth;
	if (!h) h = screen.availHeight;
	if (typeof(pscroll) == 'undefined') pscroll = false;
	if (typeof(presize) == 'undefined') presize = false;
	var x = Math.round((screen.availWidth - parseInt(w)) / 2);
	var y = Math.round((screen.availHeight - parseInt(h)) / 2);
	var params = Array(
		'width=' + String(w),
		'height=' + String(h),
		'left=' + String(x),
		'top=' + String(y),
		'scrollbars=' + (pscroll ? 'yes' : 'no'),
		'resizable=' + (presize ? 'yes' : 'no'),
		'toolbar=no',
		'location=no',
		'statusbar=no',
		'menubar=no'
	).join(',');
	var win = self.open(url, target, params);
	if (win.focus) win.focus();
	return win;
}
