void animation() throws ScriptException {
		if (statementLength < 2)
			subcommandExpected();
		int tok = statement[1].tok;
		boolean animate = false;
		switch (tok) {
		case Token.on:
			animate = true;
		case Token.off:
			viewer.setAnimationOn(animate);
			break;
		case Token.frame:
			frame(2, false);
			break;
		case Token.mode:
			animationMode();
			break;
		case Token.direction:
			animationDirection();
			break;
		case Token.identifier:
			String str = (String) statement[1].value;
			if (str.equalsIgnoreCase("fps")) {
				checkLength3();
				viewer.setIntProperty("animationFps", intParameter(2));
				break;
			}
		default:
			frameControl(statement[1], true);
		}
	}