function generate_rotation_images (product_name, folder_name, numImages)
{
	
	// product_name - name of the product such as "refrigrator", "ice machine". This is to be used in the alt text for the image
	// folder_name - such as "comme_refrig" - folder where the images are. All these folders are found here \ia\products\fap\images\
	// numImages - number of images to be used in the roation. The must be the same number as numItems specified in the carousel script
	
	document.write('<ol>');
	// Set up the image files to be used.
	var theImages = new Array() 
	
	// Add images to the array, as many as there are in the folder
	for (i=1; i <= numImages; i++) {
		theImages[i] = folder_name+i+'.jpg';		
	}

	// this is needed to duplicate the last image in the image list for the isCircular fix.
	var first_image = "";
	
	// this aray is needed to ensure random and unique items are entered in the list of images
	var imageNumUsed = new Array(numImages);
	var Count = 0;
	var found = false;
	for (i = 1; Count < numImages; Count++) {		
		var whichImage = Math.ceil(Math.random()*(numImages));
		// make sure we don't get 0 for random number; this is a very unlikely event but just in case
		// assign an aribitrary image number, just to avoid adding image0.jpg
		if (whichImage == 0)
			whichImage = 1;
		
		// store the first image to duplicate it at the end of the list for isCircular fix
		// this statement must be executed just once
		if (i == 1)
				first_image = theImages[whichImage];
				
		// check if this image number has already been used for the list
		for (j = 0; j < numImages; j++) {
			if (imageNumUsed[j] == whichImage)
       		{
          		found=true;
          		break;
       		}
		}
		if (found)
     	{
       		Count--;
			found=false;
      	} 
		else {
			//alert (theImages[whichImage]);
        	imageNumUsed[Count]=whichImage;		
			document.write('<li><img src="ia/products/fap/images/'+folder_name+'/'+theImages[whichImage]+'" width="200" alt="Commercial '+ product_name +' graphic" /></li>');	
		}
		i++;
	}
	// now that the list is created, duplicate the first image in to last position (for isCircular fix)
	document.write('<li><img src="ia/products/fap/images/'+folder_name+'/'+first_image+'" width="200" alt="Commercial '+ product_name +' graphic" /></li></ol>');
}
