Is there a sleep function in JavaScript that will stop the code execution? I would like the JS execution to delay/pause/sleep for a specified period of time during the execution of a link object's onclick event. I need this period of time in order to record Web Analytic's data.

Steps I need are

1) execute onclick event handler of a link
2) execute JS assigned to onclick event of link object
3) execute web analytics functions to record data
4) delay JS execution to allow for web analytics data to be recorded
5) return to normal link execution