Slide puzzle (HTML5 and javascript)