What should I put in its place?
I've seen many tutorials like this one: (add in http)://www.w3schools.com/js/js_functions.asp
They all use 'function'.
Also, for the setTimeout() call, it doesn"t give me any error, and I've seen it here:
(add in http)://stackoverflow.com/questions/14226803/javascript-wait-5-seconds-before-executing-next-line