
// This function replaces target="_blank".  Usage:
//	<a href="targetpage.htm" onclick="OpenNewWindow(this);return false;">click here for new window</a>
function OpenNewWindow(url,target,features) {
	if (arguments.length < 3) {
		features = '';
	}
	if (arguments.length < 2) {
		target = '';
	}
	if (target == '') {
		// Extract url file name, without the path and without the dot-suffix, from the end of the url
		target = url.toString().split('/').pop().split('.')[0];
	}
	switch (features) {
		case 'horImage':
			features = 'height=500,menubar,resizable,scrollbars,status,toolbar,width=700;';
			break;
		case 'vertImage':
			features = 'height=800,menubar,resizable,scrollbars,status,toolbar,width=500;';
			break;
		case 'slide':
			features = 'height=450,resizable,scrollbars,status,width=550;';
			break;
		default:
			break;
	}
	var newWindow = window.open(url,target,features);
	newWindow.focus();
}

