Move autofocus code to shared javascript