// pop up a window with the specified page
function popUp(page, width, height, fullFeatured, newWin) {
	features = "";
	// defaults - 90% of width and height
	if (!width) {
		if (document.body.clientWidth)
			width = document.body.clientWidth * 0.9;
		else if(window.outerWidth)
			width = window.outerWidth * 0.9;
		else if (document.compatMode && document.compatMode == "CSS1Compat")
			width = document.body.parentNode.clientWidth * 0.9;
		else width = 800;
	}
	if (!height) {
		if (document.body.clientHeight)
			height = document.body.clientHeight * 0.9;
		else if(window.outerHeight)
			height = window.outerHeight * 0.9;
		else if (document.compatMode && document.compatMode == "CSS1Compat")
			height = document.body.parentNode.clientHeight * 0.9;
		else height = 600;
	}
	if (!page) return;
	x = (screen.availWidth - width) / 2;
	y = (screen.availHeight - height) / 2;
	if (fullFeatured)
		features = ",scrollbars,resizable,menubar,toolbar,location";
	else
		features = ",scrollbars,resizable";
	
	var winName = "popUp_1";
	if (newWin)
		winName = "popUp_" + (parseInt(window.name.substr(window.name.indexOf("_") + 1)) + 1);

	window.open(page, winName, "height=" + height + ",width=" + width + ",left=" + x + ",top=" + y + features);
}