Fadomatic.INTERVAL_MILLIS=50;function Fadomatic(B,C,A,F,E){this._element=B;this._intervalId=null;this._rate=C;this._isFadeOut=true;this._minOpacity=0;this._maxOpacity=99;this._opacity=99;if(typeof F!="undefined"){if(F<0){this._minOpacity=0;}else{if(F>99){this._minOpacity=99;}else{this._minOpacity=F;}}}if(typeof E!="undefined"){if(E<0){this._maxOpacity=0;}else{if(E>99){this._maxOpacity=99;}else{this._maxOpacity=E;}}if(this._maxOpacity<this._minOpacity){this._maxOpacity=this._minOpacity;}}if(typeof A!="undefined"){if(A>this._maxOpacity){this._opacity=this._maxOpacity;}else{if(A<this._minOpacity){this._opacity=this._minOpacity;}else{this._opacity=A;}}}if(typeof B.style.opacity!="undefined"){this._updateOpacity=this._updateOpacityW3c;}else{if(typeof B.style.filter!="undefined"){if(B.style.filter.indexOf("alpha")==-1){var D="";if(B.style.filter){D=B.style.filter+" ";}B.style.filter=D+"alpha(opacity="+this._opacity+")";}this._updateOpacity=this._updateOpacityMSIE;}else{this._updateOpacity=this._updateVisibility;}}this._updateOpacity();}Fadomatic.prototype.fadeOut=function(){this._isFadeOut=true;this._beginFade();};Fadomatic.prototype.fadeIn=function(){this._isFadeOut=false;this._beginFade();};Fadomatic.prototype.show=function(){this.haltFade();this._opacity=this._maxOpacity;this._updateOpacity();};Fadomatic.prototype.hide=function(){this.haltFade();this._opacity=0;this._updateOpacity();};Fadomatic.prototype.haltFade=function(){clearInterval(this._intervalId);};Fadomatic.prototype.resumeFade=function(){this._beginFade();};Fadomatic.prototype._beginFade=function(){this.haltFade();var A=this;this._intervalId=setInterval(function(){A._tickFade();},Fadomatic.INTERVAL_MILLIS);};Fadomatic.prototype._tickFade=function(){if(this._isFadeOut){this._opacity-=this._rate;if(this._opacity<this._minOpacity){this._opacity=this._minOpacity;this.haltFade();}}else{this._opacity+=this._rate;if(this._opacity>this._maxOpacity){this._opacity=this._maxOpacity;this.haltFade();}}this._updateOpacity();};Fadomatic.prototype._updateVisibility=function(){if(this._opacity>0){this._element.style.visibility="visible";}else{this._element.style.visibility="hidden";}};Fadomatic.prototype._updateOpacityW3c=function(){this._element.style.opacity=this._opacity/100;this._updateVisibility();};Fadomatic.prototype._updateOpacityMSIE=function(){this._element.filters.alpha.opacity=this._opacity;this._updateVisibility();};Fadomatic.prototype._updateOpacity=null;