Separated out javascript in common between mobile and index