dynamic panels API

1. getStates
2. getState
3. setState
4. new flags: FL_W, FL_THIS