/* Background Image Transition Slide Show Version 1.0 October 25, 2010 Will Bontrager http://www.willmaster.com/ Copyright 2010 Bontrager Connection, LLC Bontrager Connection, LLC grants you a royalty free license to use or modify this software provided this notice appears on all copies. This software is provided "AS IS," without a warranty of any kind. */ var Images = new Array(); // leave line as is. var image_url = new Array(); for (x in image_url) { Images.push(image_url[x]); } // Customization info is in the "Background Image Transition // Slide Show" article in the Willmaster Library at // http://www.willmaster.com/library/ var ImageIDvalue = "rotate"; var TransitionIncrement = 1; var IncrementInterval = 25; var PauseBeforeNextImage = 3000; // End of customization section. // var opacity = 100; var currentImage = 0; var topImage = Images.length - 1; var timerthing; function FadeIn() { var image = document.getElementById(ImageIDvalue); var IE = (image.filters) ? true : false; console.log(image) opacity += TransitionIncrement; if( opacity >= 100 ) { opacity = 100; } if( IE ) { image.filters.alpha.opacity = opacity; } else { image.style.opacity = opacity/100; } if( opacity == 100 ) { clearInterval(timerthing); setTimeout("StartFadeOut()",PauseBeforeNextImage); } } function FadeOut() { var image = document.getElementById(ImageIDvalue); var IE = (image.filters) ? true : false; console.log(image) opacity -= TransitionIncrement; if( opacity <= 0 ) { opacity = 0; } if( IE ) { image.filters.alpha.opacity = opacity; } else { image.style.opacity = (opacity==0) ? 0 : opacity/100; } if( opacity == 0 ) { clearInterval(timerthing); currentImage++; if( currentImage > topImage ) { currentImage = 0; } image.src = Images[currentImage]; timerthing = setInterval("FadeIn()",IncrementInterval); } } function StartFadeOut() { timerthing = setInterval("FadeOut()",IncrementInterval); } function StartSlideShowTransition() { setTimeout("StartFadeOut()",PauseBeforeNextImage); } //StartSlideShowTransition(); dw_Event.add( window, 'load', StartSlideShowTransition);