Moved javascript into new file