Firstly, vBulletin now uses the YUI library, so you should execute AJAX commands like so:
Code:
YAHOO.util.Connect.asyncRequest('POST', scriptpath + '?do=ajax', {
success: this.handle_ajax_response,
failure: this.handle_ajax_error,
timeout: vB_Default_Timeout,
scope: this
}, SESSIONURL + 'securitytoken=' + SECURITYTOKEN + '&foo=' + foo);
Now your problem. The variable "statusdiv" is not in scope (i.e. does not exist), when you want it to be. Just place this variable into your second function.