Code
<!--
// image src
var trailsrc = "http://armkayf.do.am/js95573248.gif";
var nDots = 7;
var Xbpos = 0;
var Ybpos = 0;
// fixed time step, no relation to real time
var DELTAT = .01;
// size of one spring in pixels
var SEGLEN = 10;
// spring constant, stiffness of springs
var SPRINGK = 10;
// all the physics is bogus, just picked stuff to make it look okay
var MASS = 1;
// Positive XGRAVITY pulls right, negative pulls left
// Positive YGRAVITY pulls down, negative up
var XGRAVITY = 0;
var YGRAVITY = 50;
// RESISTANCE determines a slowing force proportional to velocity
var RESISTANCE = 10;
// stopping criterea to prevent endless jittering
// doesn't work when sitting on bottom since floor
// doesn't push back so acceleration always as big
// as gravity
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
// BOUNCE is percent of velocity retained when
// bouncing off a wall
var BOUNCE = 0.75;
var ff=(document.getElementById&&!document.all);
var ns=(document.layers);
var ie=(document.all);
// always on for now, could be played with to
// let dots fall to botton, get thrown, etc.
var followmouse = true;
var dots = new Array();
function init()
{
var i = 0;
for (i = 0; i < nDots; i++) {
dots[i] = new dot(i);
}
// set their positions
for (i = 0; i < nDots; i++) {
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
setTimeout("startanimate()", 10);
}
function dot(i)
{
this.X = Xbpos;
this.Y = Ybpos;
this.dx = 0;
this.dy = 0;
if (ns){
document.write("Elastic Trail (mouse trail effect)");
} else if (ie||ff) {
if (i == 0) {
document.write("