Added cross browser fix

added implementation of requestAnimFrame