moved all functions to the jquery document finished call
prefixed request animationframe