Generates a state machine with the value you pass in parameter. You can define states, transitions to these states, pass parameters to the actions, and execute the actions in a given context. This code was test driven developed with JsTestDriver, the TestCase is attached.
Downsized with the help of UglifyJS on marijn's website : http://marijnhaverbeke.nl/uglifyjs
The example of the state machine comes from http://www.objectmentor.com/resources/articles/umlfsm.pdf
v1: only 85 bytes but the actions were ran in the global scope
v2: 128 bytes and the actions can be executed in a given context
v3: 126 bytes with careful reuse of an already declared var -c- in the event function
v4: 125 bytes by using the assignment c=b[a][c] directly to determine whether or not the event exists
v5: 106 bytes by removing unecessary code! What feature should I add now?