Hi,
the problem is caused by the following line:
var form = (arguments[1]) ? this.findForm(arguments[1]) : dojo.query('form')[0];
where a not existing method is called. By changing this to
var form = (arguments[1]) ? XSP.findForm(arguments[1]) : dojo.query('form')[0];
the function works as designed.
Sven