
function popWindow(url, widthNumber, heightNumber, showTopBar) {
	day = new Date()
	id = day.getTime()
	
	// If the requested height is less than the height of the user's screen, then change it to fit
	if (heightNumber > screen.availHeight) {
		heightNumber = screen.availHeight
	}
	// If the requested width is less than the width of the user's screen, then change it to fit
	if (widthNumber > screen.availWidth) {
		widthNumber = screen.availWidth
	}
	
	
	topNumber = (screen.availHeight - heightNumber) / 2
	leftNumber = (screen.availWidth - widthNumber) / 2
	
	openCommandString = 
			"page" + id + " = window.open" 
			+ "('" + url + "'"
			+ ",'" + id + "'" 
			+ ",'" + "width=" + widthNumber 
			+ "," + "height=" + heightNumber 
			+ "," + "left=" + leftNumber 
			+ "," + "top=" + topNumber
	
	if (showTopBar) {
		openCommandString += 
			+ "," + "toolbar=yes" 
			+ "," + "scrollbars=yes" 
			+ "," + "location=yes" 
			+ "," + "statusbar=yes"
			+ "," + "menubar=yes"
			+ "," + "resizable=yes" 
			+ "')"
	} else {
		openCommandString += 
			"," + "toolbar=no" 
			+ "," + "scrollbars=yes" 
			+ "," + "location=no" 
			+ "," + "statusbar=no"
			+ "," + "menubar=no"
			+ "," + "resizable=yes" 
			+ "')"
	}
	
	eval(openCommandString)
}
