Oh, I was wary of doing so since it says 'DO NOT EDIT THIS DOCUMENT'. That was a bit of a scary noice! Having your explicit permission, I'm sure I can find it in me to perform a C-x h C-M-\ and maybe even add some sanity... 
Code:
/******** - IMPORTANT LABEL - ********/
/* Title: Jasoop Toolbox (c) */
/* Name: jasoop.js */
/* Copyright: 2008 Arthur C. Watkins */
/* Noice: This label is to exist in */
/* this document in order for this */
/* document to be legal. */
/* DO NOT EDIT THIS DOCUMENT */
/******** - IMPORTANT LABEL - ********/
// Start Jasoop Toolbox
function Animation(elementName) {
this.animateX = [];
this.animateY = [];
this.animateInt = [];
this.llCounter = 0;
this.animationCounter = 0;
this.element = document.getElementById(elementName);
}
Animation.prototype = function() {
return {
pxWidth: function(w) {
this.element.style.width = w + "px";
},
pxHeight: function(h) {
this.element.style.height = h + "px";
},
backgroundColor: function(bgcol) {
this.element.style.backgroundcolor = bg;
},
textColor: function(txtcol) {
this.element.style.color = txtcol;
},
moveTo: function(x, y) {
this.element.style.position = "absolute";
this.element.style.left = x;
this.element.style.top = y;
},
add: function(x, y, n) {
this.animateX[this.llCounter] = x;
this.animateY[this.llCounter] = y;
this.animateInt[this.llCounter] = n;
this.llCounter++;
},
animate: function() {
if (this.animationCounter < this.llCounter) {
this.element.style.position = "absolute";
this.element.style.left = this.animateX[this.animationCounter];
this.element.style.top = this.animateY[this.animationCounter];
this.animationCounter++;
setTimeout(function() { animationClass.animate(); }, this.animateInt[this.animationCounter]);
} else if (this.animationCounter >= this.llCounter) {
for (i = 0; i <= this.animationCounter; i++) {
this.animateX[i] = 0;
this.animateY[i] = 0;
this.animateInt[i] = 0;
}
this.llCounter = 0;
this.animationCounter = 0;
}
},
reset: function() {
for (var i = 0; i <= this.animationCounter; ++i) {
this.animateX[i] = 0;
this.animateY[i] = 0;
this.animateInt[i] = 0;
}
this.llCounter = 0;
this.animationCounter = 0;
}
};
}();
// End Jasoop Toolbox
Note that I've just restructured and fixed it, rather than performed any serious modification... parallel arrays are rarely a good idea, and you have a lot of redundant functions (if it's only one statement, it doesn't need to be a function [unless it's a really complicated one that you want labelled]; if it's never used, it doesn't need to be a function). It can be greatly simplified:
Code:
/******** - IMPORTANT LABEL - ********/
/* Title: Jasoop Toolbox (c) */
/* Name: jasoop.js */
/* Copyright: 2008 Arthur C. Watkins */
/* Noice: This label is to exist in */
/* this document in order for this */
/* document to be legal. */
/* DO NOT EDIT THIS DOCUMENT */
/******** - IMPORTANT LABEL - ********/
// Start Jasoop Toolbox
var Animation = function() {
function Animation(elementName) {
this.steps = [];
this.animationCounter = 0;
this.style = document.getElementById(elementName).style;
}
Animation.prototype = {
moveTo: function(x, y) {
this.style.position = "absolute";
this.style.left = x + "px";
this.style.top = y + "px";
},
applyStep: function(step) {
this.moveTo(step.x, step.y);
step.callback(this, step);
setTimeout((function(me) { return function() { me.animate(); }; })(this),
step.pause);
},
add: function(x, y, pause, callback) {
this.steps[this.steps.length] = new Step(x, y, pause, callback);
},
animate: function() {
if (this.steps.length)
this.applyStep(steps.shift());
},
reset: function() {
this.steps = [];
}
};
function Step(x, y, pause, callback) {
this.x = x;
this.y = y;
this.pause = pause;
this.callback = callback || noop;
}
function noop() {}
return Animation;
}();
// End Jasoop Toolbox
Other problems found on more detailed examination: 'int' is a reserved word, and the styles you set do not have units.
Bookmarks