Random XML Slideshow

It’s that time again - I pretend I know what I’m doing when it comes to Actionscript.

Here’s a mod to the MM XML slideshow that Mediachrome on were-here came up with:

stop();
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load(“slides.xml”);
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}

//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePath, targetClip);
}
//
//AutoPlay code
myImg = setInterval(test, 5*1000);
function test() {
if (currentIndex>=totalSlides or nextSlideNode == totalSlides+1) {
currentIndex = 1;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
updateSlide(firstSlideNode);
} else {
nextSlideNode = currentSlideNode.nextSibling;
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
Can anyone help me to add a fade effect between each image? Please bear in mind I’m a designer and am more at home with pretty colours and interesting typography.

For some extra points I’d be for ever indebted to the person who could tell me how bring the slides out in a random order. That would blow my mind! I know I need to use Math.random but I don’t know how to apply it.

Thanks all.