Moved script javascript into separate file