One implementation of a JS timer script.