if(!window.JSFX) JSFX=new Object();
if(!JSFX.createLayer)
{/*** Include Library Code ***/
JSFX.objNo=0;
JSFX.getObjId = function(){return "JSFX_obj" + JSFX.objNo++;};
JSFX.getCurrentObjId = function(){return "JSFX_obj" + (JSFX.objNo - 1);};
JSFX.createLayer = function(theHtml) {
var el = document.createElement("div");
el.id = JSFX.getObjId();
el.style.position = 'absolute';
el.style.zIndex = '150';
el.style.left = '0px';
el.style.top = '0px';
document.getElementById('ione').appendChild(el);
el.innerHTML = theHtml;
return el;
}
JSFX.fxLayer = function(theHtml) {
if(theHtml == null) return;
this.el = JSFX.createLayer(theHtml);
}
var proto = JSFX.fxLayer.prototype
proto.moveTo = function(x,y){this.el.style.left = x;this.el.style.top=y;}
proto.setBgColor = function(color) { this.el.style.backgroundColor = color; }
proto.clip = function(x1,y1, x2,y2){ this.el.style.clip="rect("+y1+" "+x2+" "+y2+" "+x1+")"; }
gX=function(){return 500;};
gY=function(){return 120;};
/*** Example extend class ***/
JSFX.fxLayer2 = function(theHtml)
{
this.superC = JSFX.fxLayer;
this.superC(theHtml + "C");
}
JSFX.fxLayer2.prototype = new JSFX.fxLayer;
}/*** End Library Code ***/
/*************************************************/
/*** Class Firework extends FxLayer ***/
JSFX.Firework = function(fwImages, xpos, ypos) {
window[ this.id = JSFX.getObjId() ] = this;
this.imgId = "i" + this.id;
this.fwImages = fwImages;
this.numImages = fwImages.length;
this.superC = JSFX.fxLayer;
//this.superC("
");
this.superC("
");
this.img = document.images[this.imgId];
this.step = 0;
this.timerId = -1;
this.x = xpos;
this.y = ypos;
this.dx = 0;
this.dy = 0;
this.ay = 0.2;
this.state = "OFF";
}
JSFX.Firework.prototype = new JSFX.fxLayer;
JSFX.Firework.prototype.getMaxDy = function()
{
var ydiff = gY() - 130;
var dy = 1;
var dist = 0;
var ay = this.ay;
while(dist .95)
// {
// this.x = 0+ (gX()-100)*Math.random();
// this.y = 0+ (gY()-100)*Math.random();
// this.moveTo(this.x, this.y);
this.state = "EXPLODE";
// }
this.setFrame();
}
else if(this.state == "EXPLODE")
{
this.step++;
if(this.step < this.numImages) {
this.setFrame();
} else {
this.state="OFFLINE";
}
}
}
/*** END Class Firework***/
/*** Class FireworkDisplay extends Object ***/
JSFX.FireworkDisplay = function(n, fwImages, numImages, xpos, ypos)
{
window[ this.id = JSFX.getObjId() ] = this;
this.timerId = -1;
this.fireworks = new Array();
this.imgArray = new Array();
this.loadCount=0;
this.loadImages(fwImages, numImages);
for(var i=0 ; i