function alphaAPI(C,A,D,B,F,E,G){this.element=typeof (C)=="object"?C:document.getElementById(C);this.fadeInDelay=A||40;this.fadeOutDelay=D||this.fadeInDelay;this.startAlpha=B;this.stopAlpha=F;if(typeof (this.element.filters)=="object"){if(typeof (this.element.filters.alpha)=="undefined"){this.element.style.filter+="alpha(opacity=100)";}}this.offsetTime=(E||0)*1000;this.deltaAlpha=G||10;this.timer=null;this.paused=false;this.started=false;this.cycle=false;this.command=function(){};return this;}alphaAPI.prototype.repeat=function(A){this.cycle=A?true:false;};alphaAPI.prototype.setAlphaBy=function(A){this.setAlpha(this.getAlpha()+A);};alphaAPI.prototype.toggle=function(){if(!this.started){this.start();}else{if(this.paused){this.unpause();}else{this.pause();}}};alphaAPI.prototype.timeout=function(B,A){this.command=B;this.timer=setTimeout(B,A);};alphaAPI.prototype.setAlpha=function(A){if(typeof (this.element.filters)=="object"){this.element.filters.alpha.opacity=A;}else{if(this.element.style.setProperty){this.element.style.setProperty("opacity",A/100,"");this.element.style.setProperty("-moz-opacity",A/100,"");this.element.style.setProperty("-khtml-opacity",A/100,"");}}};alphaAPI.prototype.getAlpha=function(){if(typeof (this.element.filters)=="object"){return this.element.filters.alpha.opacity;}else{if(this.element.style.getPropertyValue){var A=this.element.style.getPropertyValue("opacity");if(A==""){A=this.element.style.getPropertyValue("-moz-opacity");}if(A==""){A=this.element.style.getPropertyValue("-khtml-opacity");}return A*100;}}return 100;};alphaAPI.prototype.start=function(){this.started=true;this.setAlpha(this.startAlpha);if(this.startAlpha>this.stopAlpha){var A=this;this.timeout(function(){A.fadeOut();},this.offsetTime);}else{var A=this;this.timeout(function(){A.fadeIn();},this.offsetTime);}};alphaAPI.prototype.stop=function(){this.started=false;this.setAlpha(this.stopAlpha);if(this.stopAlpha==0){this.element.style.display="none";}this.stopTimer();this.command=function(){};};alphaAPI.prototype.reset=function(){this.started=false;this.setAlpha(this.startAlpha);this.stopTimer();this.command=function(){};};alphaAPI.prototype.pause=function(){this.paused=true;this.stopTimer();};alphaAPI.prototype.unpause=function(){this.paused=false;if(!this.started){this.start();}else{this.command();}};alphaAPI.prototype.stopTimer=function(){clearTimeout(this.timer);this.timer=null;};alphaAPI.prototype.fadeOut=function(){this.stopTimer();if(this.getAlpha()>this.stopAlpha){this.setAlphaBy(-1*this.deltaAlpha);var A=this;this.timeout(function(){A.fadeOut();},this.fadeOutDelay);}else{if(this.cycle){var A=this;this.timeout(function(){A.fadeIn();},this.fadeInDelay);}else{if(this.stopAlpha==0){this.element.style.display="none";}this.started=false;}}};alphaAPI.prototype.fadeIn=function(){this.stopTimer();if(this.getAlpha()<this.startAlpha){this.setAlphaBy(this.deltaAlpha);var A=this;this.timeout(function(){A.fadeIn();},this.fadeInDelay);}else{if(this.cycle){var A=this;this.timeout(function(){A.fadeOut();},this.fadeOutDelay);}else{this.started=false;}}};