An efficient javascript sprite animation framework