JS: Passing parameters to a function called with setTimeout