Refactor 'to top' functions (E_TOO_MUCH_JQUERY)