Created JavaScript file to control the views.