function popupWindow(mypage, myname, w, h, scroll, menubar, tools, resize) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 10;

	// SET DEFAULTS
	if (mypage == '') return;
	if (myname == '') myname = '_blank';
	if (w == '') w = 400;
	if (h == '') h = 400;
	if (scroll == '') scroll = 'no';
	if (menubar == '') menubar = 'no';
	if (tools == '') tools = 'no';
	if (resize == '') resize = 'no';

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes,directories=no,toolbar='+tools+',status=yes,menubar='+menubar+',scrollbars=yes,resizable='+resize+',copyhistory=no';
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
 
