added cross browser support for the animateFrame