JavaScript with Arrays - Dialog Functions for User Interaction