void zoom(boolean isZoomTo) throws ScriptException {
		// zoom
		if (statementLength == 1) {
			if (isZoomTo)
				viewer.moveTo(1, null, new Point3f(0, 0, 0), 0, viewer.getZoomPercentFloat() * 2f, 0, 0, 0);
			else viewer.setBooleanProperty("zoomEnabled", true);
			return;
		}
		// zoom on|off
		if (!isZoomTo)
			switch (statement[1].tok) {
			case Token.on:
				viewer.setBooleanProperty("zoomEnabled", true);
				return;
			case Token.off:
				viewer.setBooleanProperty("zoomEnabled", false);
				return;
			}
		float time = (isZoomTo ? 1f : 0f);
		float zoom = viewer.getZoomPercentFloat();
		float factor = 0;
		float radius = viewer.getRotationRadius();
		Point3f center = null;
		Point3f currentCenter = viewer.getRotationCenter();
		int i = 1;
		// zoomTo time-sec
		if (isFloatParameter(i) && isZoomTo)
			time = floatParameter(i++);
		// zoom {x y z} or (atomno=3)
		int ptCenter = 0;
		if (isAtomCenterOrCoordinateNext(i)) {
			ptCenter = i;
			center = atomCenterOrCoordinateParameter(i);
			i = pcLastExpressionInstruction + 1;
		}

		boolean isSameAtom = (center != null && currentCenter.distance(center) < 0.1);

		// zoom/zoomTo percent|-factor|+factor|*factor|/factor
		if (isFloatParameter(i))
			factor = floatParameter(i++);
		if (factor < 0)
			factor += zoom;
		if (factor == 0) {
			factor = zoom;
			if (isFloatParameter(i + 1)) {
				float value = floatParameter(i + 1);
				switch (statement[i].tok) {
				case Token.slash:
					factor /= value;
					break;
				case Token.asterisk:
					factor *= value;
					break;
				case Token.plus:
					factor += value;
					break;
				default:
					evalError(GT._("Invalid {0} command", "ZOOM"));
				}
			}
			else if (isZoomTo) {
				// no factor -- check for no center (zoom out) or same center (zoom in)
				if (center == null)
					factor /= 2;
				else if (isSameAtom)
					factor *= 2;
			}
		}
		float xTrans = 0;
		float yTrans = 0;
		float max = viewer.getMaxZoomPercent();
		if (factor < 5 || factor > max)
			numberOutOfRange(5, max);
		if (!viewer.isWindowCentered()) {
			// do a smooth zoom only if not windowCentered
			if (center != null)
				viewer.setCenterBitSet(expression(statement, ptCenter), false);
			center = viewer.getRotationCenter();
			xTrans = viewer.getTranslationXPercent();
			yTrans = viewer.getTranslationYPercent();
		}
		viewer.moveTo(time, center, new Point3f(0, 0, 0), Float.NaN, factor, xTrans, yTrans, radius);
	}