NumberOfImagesToRotate = 3;

// Specify the first and last part of the image tag.

FirstPart = '<img src="images/certAd';
LastPart = '.jpg" height="89" width="250">';

function displayImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}