+function nexst(after)
+{
+ if (after != undefined) {
+ this._after = after;
+ }
+}
+
+nexst.next = function(st)
+{
+ if (st === null || st === undefined)
+ st = new nexst();
+ st._step++;
+
+ return st;
+};
+
+nexst.prev = function(st)
+{
+ st._step--;
+}
+
+nexst.reprise = function ()
+{
+ var thiz, args_in, args = [];
+
+ if (arguments.length > 1) {
+ thiz = arguments[0];
+ args_in = arguments[1];
+ }
+ else {
+ thiz = null;
+ args_in = arguments[0];
+ }
+
+ for (var i = 0 ; i < args_in.length ; i++) {
+ args[i] = args_in[i];
+ }
+ return args_in.callee.apply(thiz, args);
+};
+
+nexst.prototype = {
+ _step: 0, // current step for the async multistep command
+ _data: null, // data returned at the end of the async command
+ _subst: null, // substatus for nested async command
+ _after: null, // callback (as 'arguments' object) to run at the end
+ // of last step
+
+ step_set: function(step) {
+ this._step = step;
+ },
+
+ step_get: function() {
+ return this._step;
+ },
+
+ data_set: function(data) {
+ this._data = data;
+ },
+
+ data_get: function() {
+ return this._data;
+ },
+
+ subst_set: function(subst) {
+ this._subst = subst;
+ },
+
+ subst_get: function() {
+ return this._subst;
+ },
+
+ after_set: function(after) {
+ this._after = after;
+ },
+
+ after_get: function() {
+ return this._after;
+ },
+
+ done_set: function() {
+ this.done = true;
+ },
+
+ done_get: function() {
+ return (this.done);
+ }
+};