function BusyBox(id, instanceVarName, imageCount, imageName, imageExt, imageDelay) {
    this.id = id;
    this.ImageCount = imageCount;
    this.CurrentFrame = 0;
    this.ImageWidth = 0;
    this.ImageHeight = 0;
    this.ImageName = imageName;
    this.ImageExt = imageExt;
    this.ImageDelay = imageDelay;
    this.Enabled = true;
    this.instanceVarName = instanceVarName;
}

BusyBox.prototype.CacheImages = function () { this.Images = new Array(this.ImageCount); for (var i = 0; i < this.ImageCount; i++) { this.Images[i] = new Image; this.Images[i].src = this.ImageName + i + this.ImageExt; } };
BusyBox.prototype.Animate = function () { document.getElementById("animation").src = this.Images[this.CurrentFrame].src; this.CurrentFrame = (this.CurrentFrame + 1) % this.ImageCount; this.timeout_id = setTimeout(this.instanceVarName + ".Animate();", this.ImageDelay); };
BusyBox.prototype.StopAnimate = function () { this.timeout_id = null; };
BusyBox.prototype.Hide = function () { div = document.getElementById(this.id); div.style.display = "none"; };
BusyBox.prototype.Show = function () { if (this.Enabled) { if (document.getElementById("head")) { document.getElementById("head").style.display = "none"; } if (document.getElementById("mmenu")) { document.getElementById("mmenu").style.display = "none"; } if (document.getElementById("mfooter")) { document.getElementById("mfooter").style.display = "none"; } if (document.getElementById("footer")) { document.getElementById("footer").style.display = "none"; } if (document.getElementById("footlogos")) { document.getElementById("footlogos").style.display = "none"; } if (document.getElementById("content")) { document.getElementById("content").style.display = "none"; } div = document.getElementById(this.id); div = document.getElementById(this.id); div.style.display = "block"; } };
busyBox = new BusyBox("BusyBoxDiv", "busyBox", 4, "/main/eBooking/inc/gears_ani_", ".gif", 125);