
function popup_win(PageUrl, PageParas, WinName, WinFeatures, WinWidth, WinHeight, WinAlign, WinValign) {
	if (window.screen) {
		if (WinAlign != '' && WinWidth != '') {
			WinFeatures += (WinFeatures != '') ? ',' : '';
			switch (WinAlign) {
				case 'left':
					WinFeatures += 'left=0';
					WinFeatures += 'screenX=0';
				case 'center':
					WinFeatures += 'left=' + ((screen.availWidth - WinWidth - 10) / 2);
					WinFeatures += 'screenX=' + ((screen.availWidth - WinWidth - 10) / 2);
				case 'right':
					WinFeatures += 'left=' + (screen.availWidth - WinWidth - 10);
					WinFeatures += 'screenX=' + (screen.availWidth - WinWidth - 10);
			}
		}
		if (WinValign != '' && WinHeight != '') {
			WinFeatures += (WinFeatures != '') ? ',' : '';
			switch (WinValign) {
				case 'top':
					WinFeatures += 'top=0';
					WinFeatures += 'screenY=0';
				case 'middle':
					WinFeatures += 'top=' + ((screen.availHeight - WinHeight - 30) / 2);
					WinFeatures += 'screenY=' + ((screen.availHeight - WinHeight - 30) / 2);
				case 'bottom':
					WinFeatures += 'top=' + (screen.availHeight - WinHeight - 30);
					WinFeatures += 'screenY=' + (screen.availHeight - WinHeight - 30);
			}
		}
	}
	WinFeatures += (WinFeatures != '') ? ',' : '' + 'width=' + WinWidth + ',height=' + WinHeight;
	PageUrl = (PageParas != '') ? PageUrl + '?' + PageParas.replace(/, */g, '&') : PageUrl;
	window.open(PageUrl, WinName, WinFeatures + 'width=' + WinWidth + ',height=' + WinHeight).focus();
}