﻿function windowOpen(url, features, width, height) {

	var centerWidth = (window.screen.width - width) / 2;
	var centerHeight = (window.screen.height - height) / 2;
	var windowFeatures = 'width =' + width + ', height=' + height + ', left=' + centerWidth + ', top=' + centerHeight;

	if (features.toString().length > 0) {
		features = features + ',' + windowFeatures;
	}
	else {
		features = windowFeatures;
	}

	var newWindow = window.open(url, 'newWindow', features, true);
	newWindow.focus();
}

