Interesting game!
The problem is that you are passing in undefined variable - hitfx, for example, when you call action(). You can pass strings to action('hitfx', 'attack', and so on. ) instead and let javascript decide what to do with the string.
update: Just found out the variables are not defined...yet, you can't get elements by id before they are loaded. Move you Javascript file to the end of the body, the game will run.