stateful jquery plugin