pull js event out to new file