// opens a new window with parameters
var win = null;
function NewWindow(thepageurl,thename,w,h,l,t,toolbar,location,directories,statusbar,resize,menubar,scroll,copyhistory)
	{
	LeftPosition = l;
	TopPosition = t;
	if (l == 'center')
		{
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		}
	if (t == 'center')
		{
		TopPosition = (screen.height) ? (screen.height-h)/4 : 0;
		}
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+',status='+statusbar+',toolbar='+toolbar+',location='+location+',directories='+directories+',menubar='+menubar+',copyhistory='+copyhistory;
	win = window.open(thepageurl,thename,settings);
	if(win.window.focus){win.window.focus();}
	}