function AutoFade(args){this.instance=args.instance;this.smallIcon=args.smallIcon;this.activeIconClass=args.activeIconClass;this.bigImage=args.bigImage;this.icons=document.getElementsByName(this.smallIcon);this.images=document.getElementsByName(this.bigImage);this.showedOne=0;this.size=this.icons.length;for(var i=0;i<this.icons.length;i++){this.icons[i].onmouseover=new Function(this.instance+".show("+i+",1)");this.icons[i].onmouseout=new Function(this.instance+".resume()");this.images[i].onmouseover=new Function(this.instance+".show("+this.instance+".showedOne)");this.images[i].onmouseout=new Function(this.instance+".resume()");if(this.showedOne!=i)this.images[i].display="none";else this.images[i].style.zIndex=parseInt(this.images[i].style.zIndex)+this.size}this.isPaused=false;this.start()}AutoFade.prototype.show=function(i){this.pause();this.icons[i].className=this.activeIconClass;if(this.showedOne==i){if(parseInt(this.images[(this.showedOne+1)%this.size].style.zIndex)>parseInt(this.images[this.showedOne].style.zIndex)){this.images[this.showedOne].style.zIndex=parseInt(this.images[this.showedOne].style.zIndex)+this.size;this.images[(this.showedOne+1)%this.size].style.zIndex=parseInt(this.images[i].style.zIndex)-this.size;this.images[(this.showedOne+1)%this.size].style.display="none";this.images[this.showedOne].style.display="block"}}else{this.images[this.showedOne].style.zIndex=parseInt(this.images[this.showedOne].style.zIndex)-this.size;this.images[i].style.zIndex=parseInt(this.images[i].style.zIndex)+this.size;this.images[this.showedOne].style.display="none";this.images[i].style.display="block";this.showedOne=i}this.setOpacity(this.images[this.showedOne],1)};AutoFade.prototype.pause=function(){this.isPaused=true};AutoFade.prototype.resume=function(){this.isPaused=false};AutoFade.prototype.magicShow=function(i,opacity){if(this.isPaused){window.setTimeout(this.instance+".magicShow(("+this.instance+".showedOne+1)%"+this.instance+".size"+","+1+")",3000);return};this.setOpacity(this.images[this.showedOne],opacity);if(opacity==0)this.images[this.showedOne].style.display="none";this.setOpacity(this.images[i],1-opacity);if(this.images[i].style.display=="none")this.images[i].style.display="block";if(Math.abs(opacity-0.5)<0.01){this.images[this.showedOne].style.zIndex=parseInt(this.images[this.showedOne].style.zIndex)-this.size;this.images[i].style.zIndex=parseInt(this.images[i].style.zIndex)+this.size}opacity=opacity-0.02;if(opacity>0)window.setTimeout(this.instance+".magicShow("+i+","+opacity+")",10);else{this.showedOne=i;window.setTimeout(this.instance+".magicShow(("+this.instance+".showedOne+1)%"+this.instance+".size"+","+1+")",3000)}};AutoFade.prototype.start=function(){window.setTimeout(this.instance+".magicShow("+(this.showedOne+1)%this.size+","+1+")",3000)};AutoFade.prototype.setOpacity=function(element,opacity){try{element.style.opacity=opacity;element.style.filter="alpha(opacity="+opacity*100+")"}catch(e){}};