var current = '';
var newwin;

function openPositionedWindow(url, name, width, height, x, y, scrollbars, status, openerName) {
	var properties = 'toolbar' + ',width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ',scrollbars=' + scrollbars + ((status) ? ',status' : '');
	var reference = window.open(url, name, properties);
	if (openerName) self.name = openerName;
	return reference;
}

function openWindow(url, name, width, height, scrollbars) {

	var x = (screen.availWidth - width) / 2;
	var y = (screen.availHeight - height) / 2;

	newwin = openPositionedWindow(url, name, width, height, x, y, scrollbars, '', '');
	newwin.focus();
}

function openPositionedWindowPlain(url, name, width, height, x, y, scrollbars, status, openerName) {
	var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ',scrollbars=' + scrollbars + ((status) ? ',status' : '');
	var reference = window.open(url, name, properties);
	if (openerName) self.name = openerName;
	return reference;
}

function openWindowPlain(url, name, width, height, scrollbars) {

	var x = (screen.availWidth - width) / 2;
	var y = (screen.availHeight - height) / 2;

	newwin = openPositionedWindowPlain(url, name, width, height, x, y, scrollbars, '', '');
	newwin.focus();
}
