moving embedded JS into file