////////////////////////////////////////////////////// // SliderClass ////////////////////////////////////////////////////// function steperClass(){ this.timerID = undefined; this.timeItems = new Array(); this.name = ""; } steperClass.prototype.addItem=function(newItem){ this.timeItems.push(newItem) } steperClass.prototype.clear=function(){ clearTimeout(this.timerID); this.timeItems.length = 0; } steperClass.prototype.start=function(){ this.tick(); } steperClass.prototype.tick=function(){ var again = false; for (var i = 0; i < this.timeItems.length; i++) { if (this.timeItems[i].timeTick()) again = true; } if(again == true){ this.timerID = setTimeout(this.name + ".tick()", 6); } }; ////////////////////////////////////////////////////// // faderClass ////////////////////////////////////////////////////// function faderClass(){ this.ele = undefined; this.startOpacity = 0; this.endOpacity = 0; this.Opacity = 0; this.steps = 0; this.curStep = 0; this.seconds = 0; this.atEndOfProcess = ""; this.name = undefined; } faderClass.prototype.init=function(){ this.curStep = 0; } faderClass.prototype.elementID=function(eleName){ this.ele = document.getElementById(eleName); } faderClass.prototype.setOpacity=function(Opacity){ this.ele.style.opacity = (Opacity / 100); this.ele.style.MozOpacity = (Opacity / 100); this.ele.style.KhtmlOpacity = (Opacity / 100); this.ele.style.filter = "alpha(opacity=" + Opacity + ")"; } faderClass.prototype.timeTick=function(){ var again = false; if (this.curStep < this.steps){ this.curStep++; this.Opacity = Math.round((((this.curStep / this.steps)*(this.endOpacity - this.startOpacity)) + this.startOpacity)* 100); this.setOpacity(this.Opacity) again = true; }else{ if(this.atEndOfProcess != ""){ var fCall = this.atEndOfProcess this.atEndOfProcess = ""; eval(fCall); } again = false; } return again; }; //////////////////////////////////////////////////////