Html board anim nl

I know this global variable is vary bad, but I needed I quick way to make the main logic wait for the moving animation to finish. Any ideas how to do it better? :)