Javascript Spriter implementation