
        function runSlideShow(imagearray,show,showpos) {

                // If no position then set one.
                if (!show) var show = 0;
                if (!showpos) var showpos = Array();
                if (!showpos[show]) showpos[show] = 0;

                nextPic = showpos[show] + 1; if (nextPic >= imagearray[show].length) nextPic = 0;

                fadelength = 2000;
                steps = 100;

                // Set Background Image to Match Foreground
                document.getElementById('slideshow'+show+'back').src = document.getElementById('slideshow'+show+'front').src;

                // Set Foreground Opacity to Transparent
                setTimeout('setOpacity("slideshow'+show+'front",0)',50);

                // Set Foreground to the next Picture
                setTimeout('document.getElementById(\'slideshow'+show+'front\').src = \''+imagearray[show][nextPic].src+'\'',100);

                // Loop through changing the Opacity
                for(i = 0; i <= steps; i++) {
                        opacity = i/steps * 100;
                        setTimeout('setOpacity("slideshow'+show+'front",'+opacity+')',((i*(fadelength/steps))+150));
                }

                showpos[show] = nextPic;
                show = show + 1; if (show >= imagearray.length) show = 0;

                setTimeout( function () { runSlideShow(imagearray,show,showpos) } ,3000);

        }

        function setOpacity(id,value) {
                document.getElementById(id).style.opacity = (value / 100);
                document.getElementById(id).style.MozOpacity = (value / 100);
                document.getElementById(id).style.KhtmlOpacity = (value / 100);
                document.getElementById(id).style.filter = "alpha(opacity=" + value + ")";
        }


