convert readyState to int
event names as constants