function new_window_open(url,windowname,width,height,location,menubar,status,scrollbars,resizable,toolbar) {
	
	windowname	= windowname	|| "new";
	
	width		= width		|| "700";
	height		= height	|| "500";
	
	location	= location	|| "no";
	menubar		= menubar	|| "yes";
	status		= status	|| "yes";
	scrollbars	= scrollbars	|| "no";
	resizable	= resizable	|| "yes";
	toolbar		= toolbar	|| "no";
	
	features="location="+location;
	features+=", menubar="+menubar;
	features+=", status="+status;
	features+=", scrollbars="+scrollbars;
	features+=", resizable="+resizable;
	features+=", toolbar="+toolbar;
	
	if (width) {
		if (window.screen.width > width)
			features+=", left="+(window.screen.width-width)/2;
		else width=window.screen.width;
		features+=", width="+width;
	}
	if (height) {
		if (window.screen.height > height)
			features+=", top="+(window.screen.height-height)/2;
		else height=window.screen.height;
		features+=", height="+height;
	}
	
	var winname = window.open(url,windowname,features);
	winname.focus();
}
function childwindow_to_parentwindow(url,windowname) {
	
	windowname	= windowname	|| "new";
	
	if ( !window.opener || window.opener.closed ) {
		window.open( url, '_blank' );
	} else {
		window.opener.location.href = url;
		window.opener.focus();
		window.close();
	}
}

