moved javascript into a separate resource