checkin javascript