function popitup(url, name, size)
{
	var w;
	var h;
	if (size == 1) {
		// large forms (device, users, templates etc.)
		w = 750;
		h = 750;
	} else if (size == 2) {
		// small forms (devtypes, depts, rooms)
		w = 380;
		h = 350;
	} else if (size == 3) {
		// medium forms (ips)
		w = 450;
		h = 450;
	} else if (size == 4) {
		// medium forms (ips)
		w = 600;
		h = 600;
	} else if (size == 8) {
		// print page
		w = 840;
		h = 600;
	} else if (size == 9) {
		// delete page
		w = 360;
		h = 280;
	} else {
		// default window size if none of the above are given
		w = 800;
		h = 600;
	}
	if (window.parent.name != '' && window.parent.name == name)
	{
		name = name + "1";
	}
	var newwindow=window.open(url,name,'scrollbars=yes,width='+w+',height='+h+',toolbar=no,directories=no,location=yes,status=yes,menubar=yes,links=no,resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function calcLeft( popW ) {
	return Math.round(( screen.width - popW ) / 2);
}

function calcTop( popH ) {
	return Math.round(( screen.height - popH ) / 2);
}