XML Random Image Display

I am trying to make a random image loader for xml importing images into flash.

I have been utilizing the photo gallery xml code found on this site. Thank you very much by the way for that.

The thing is, on one of the pages, I want the image displayed to be randomly selected and for there to be no thumbnails (my homepage).

I want to use this preloader code:

this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};

And then have a jpgrotator alternate between different images when you load the site in a consecutive session. I hope what I am after makes sense. I don’t have the first clue what to do with the actionscript for this.