htmlBoard-anim-NL: refactoring + adding temporary global variable for checking if animation has stopped