var theImages = new Array();
var whichImage;

function random() {

    theImages[0] = '/Portals/5/Banners/SP_moto_banner1.jpg';
    theImages[1] = '/Portals/5/Banners/SP_moto_banner2.jpg';
    theImages[2] = '/Portals/5/Banners/SP_moto_banner3.jpg';
    theImages[3] = '/Portals/5/Banners/SP_moto_banner4.jpg';
    theImages[4] = '/Portals/5/Banners/SP_moto_banner5.jpg';

    var j = 0;
    var p = theImages.length;
    var preBuffer = new Array();
    for (i = 0; i < p; i++) {
        preBuffer[i] = new Image();
        preBuffer[i].src = theImages[i];
    }
    whichImage = Math.round(Math.random() * (p - 1));

    showImage();

}

function showImage() {
    document.write('<img width="1000" height="304" src="' + theImages[whichImage] + '">');
}

