var Slideshow = function() { this.index = null; this.init=function(container, effect) { this.container = document.getElementById(container); this.images = this.container.getElementsByTagName("img"); switch(effect) { case "slide": break; case "fade": setTimeout(function(){slideshow.fade(); }, 1000); break; default: setTimeout(function(){slideshow.swap(); }, 1000); break; } }; this.swap=function() { if(this.index==null) this.index=1; for(var i=0; i 0) setTimeout(function() { slideshow.fadeout(slideshow.images[slideshow.index]); }, 100); else { this.opacity=1; this.index = this.next(); this.fade(); } }; this.resetforfade=function() { for(var i=0; i