Create elemstate.js