var Slideshow=function(d){var e=document.getElementById(d.boxId),a=e.getElementsByTagName("li"),c=0,b=d.interval,f=function(){var g=new Date().getTime();new Slideshow.effect({startTime:g,type:"fadeOut",target:a[c++],duration:d.outDuration}).start();if(c>=a.length){c=0}new Slideshow.effect({startTime:g,type:"fadeIn",target:a[c],duration:d.outDuration,callback:function(){setTimeout(function(){f()},b)}}).start()};return{start:function(){setTimeout(function(){f()},b)}}};Slideshow.update=(function(){var c=document.createElement("div");c.style.display="none";c.innerHTML='<a href="/a" style="color:red;float:left;opacity:.55;">a</a>';var b=c.getElementsByTagName("a")[0];if(/^0.55$/.test(b.style.opacity)){b=null;c=null;return function(a,d){a.style.opacity=d}}else{b=null;c=null;return function(d,e){var a=parseInt(e,10)+""==="NaN"?"":"alpha(opacity="+e*100+")";d.style.filter=a}}})();Slideshow.easing=function(c,d,a,b){return((-Math.cos(c*Math.PI)/2)+0.5)*b+a};Slideshow.effect=function(a){this.target=a.target;this.type=a.type;this.startTime=a.startTime;this.duration=a.duration;this.end=this.type==="fadeIn"?1:0;this.callback=a.callback;this.timer=null};Slideshow.effect.prototype={start:function(){if(this.type==="fadeIn"){Slideshow.update(this.target,0)}this.target.style.display="block";var a=this;this.timer=setInterval(function(){a.step()},13)},step:function(){var b=new Date().getTime(),e=b-this.startTime,c=e/this.duration,a;if(this.type==="fadeIn"){a=Slideshow.easing(c,e,0,1,this.duration)}else{if(this.type==="fadeOut"){a=1-Slideshow.easing(c,e,0,1,this.duration)}}if(b>=this.duration+this.startTime){Slideshow.update(this.target,this.end);this.stop()}else{Slideshow.update(this.target,a)}},stop:function(){clearInterval(this.timer);this.timer=null;if(this.type==="fadeOut"){this.target.style.display="none"}if(this.callback){this.callback()}}};
