// Specify the total number of images to be rotated
NumberOfImagesToRotate = 16;

// Specify the first and last part of the image tag.
FirstPart = '<img src="../galleries/main/maingal';
LastPart = '.jpg" height="255px" />';

function printImage() {
	var r = Math.floor(Math.random() * NumberOfImagesToRotate);
	document.write(FirstPart + r + LastPart);
}

