jquery func has states, takes boolean