


c0          = new config();
c0.prefix   = "y_tails0";
c0.image0       = "images/fdl1.red.gif";
c0.image0width  ="19";
c0.image0height ="18";
c0.image1       = "";
c0.image1width  ="19";
c0.image1height ="18";
c0.imageCount = 7;
c0.positionX  = 2;
c0.positionY  = 3.75;
c0.posbump    = 0;
c0.oldx       = new Array();
c0.oldy       = new Array();
c0.updateDelay = 3;
c0.updateDelay = 15 * c0.updateDelay;
c0.uid        = 0;
for (i=c0.imageCount - 1;i>=0; i--) {
 writeImage(c0.image0, c0.prefix + i, 0, -c0.image0height);
 setVisible(c0.prefix + i, 0);
}
writeImage(c0.image1, c0.prefix + "top", 0, -c0.image1height);
setVisible(c0.prefix + "top", 0);
for (i=0;i<c0.imageCount;i++) {
 c0.oldx[i] = -c0.image0height;
 c0.oldy[i] = 0;
}
// get destination around cursor for both images
c0.offset0x = -c0.image0width + c0.image0width * ((c0.positionX - 1)/2) + (c0.positionX - 2) * c0.posbump;
c0.offset1x = -c0.image1width + c0.image1width * ((c0.positionX - 1)/2) + (c0.positionX - 2) * c0.posbump;
c0.offset0y = -c0.image0height + c0.image0height * ((c0.positionY - 1)/2) + (c0.positionY - 2) * c0.posbump;
c0.offset1y = -c0.image1height + c0.image1height * ((c0.positionY - 1)/2) + (c0.positionY - 2) * c0.posbump;
function updateTail(c) {
 if (cursorX + c.offset0x == getLayerX(c.prefix + (c.imageCount - 1)) && cursorY + c.offset0y == getLayerY(c.prefix + (c.imageCount - 1))) {
  for (i=c.imageCount-1;i>=0;i--) {  setVisible(c.prefix + i, 0); }
  if (c.image1 != "") {
   moveLayer(c.prefix + "top", cursorX + c.offset1x, cursorY + c.offset1y);
   setVisible(c.prefix + "top", 1);
  }
 } else {
  setVisible(c.prefix + "top", 0);
  for (i=c.imageCount-1;i>0;i--) {
   c.oldx[i] = c.oldx[i-1];
   c.oldy[i] = c.oldy[i-1];
  }
  c.oldx[0] = cursorX + c.offset0x;
  c.oldy[0] = cursorY + c.offset0y;
  for (i=0;i<c.imageCount;i++) {
   setVisible(c.prefix + i, 1);
   moveLayer(c.prefix + i, c.oldx[i], c.oldy[i]);
  }
 }
 setTimeout("updateTail(c" + c.uid + ")", c.updateDelay);
}
captureXY();
if (c0.image0) { updateTail(c0); }

