void animationMode() throws ScriptException {
		float startDelay = 1, endDelay = 1;
		if (statementLength < 3 || statementLength > 5)
			badArgumentCount();
		int animationMode = 0;
		switch (statement[2].tok) {
		case Token.loop:
			++animationMode;
			break;
		case Token.identifier:
			String cmd = (String) statement[2].value;
			if (cmd.equalsIgnoreCase("once")) {
				startDelay = endDelay = 0;
				break;
			}
			if (cmd.equalsIgnoreCase("palindrome")) {
				animationMode = 2;
				break;
			}
			unrecognizedSubcommand(cmd);
		}
		if (statementLength >= 4) {
			startDelay = endDelay = floatParameter(3);
			if (statementLength == 5)
				endDelay = floatParameter(4);
		}
		viewer.setAnimationReplayMode(animationMode, startDelay, endDelay);
	}