<!--
var nMax = 12;

if (document.images)
{
	// load imageA first so it can be used while the other images are being loaded and testes
	var imageA = new Image(180,240); imageA.src = "images/rotate/ImageA.jpg";	

	// load and count backwards using the onerror function	
	var imageL = new Image(180,240); imageL.onerror=function(evt){nMax = 11;}; imageL.src = "images/rotate/ImageL.jpg"; 
	var imageK = new Image(180,240); imageK.onerror=function(evt){nMax = 10;}; imageK.src = "images/rotate/ImageK.jpg"; 
	var imageJ = new Image(180,240); imageJ.onerror=function(evt){nMax = 9;}; imageJ.src = "images/rotate/ImageJ.jpg"; 
	var imageI = new Image(180,240); imageI.onerror=function(evt){nMax = 8;}; imageI.src = "images/rotate/ImageI.jpg"; 
	var imageH = new Image(180,240); imageH.onerror=function(evt){nMax = 7;}; imageH.src = "images/rotate/ImageH.jpg"; 
	var imageG = new Image(180,240); imageG.onerror=function(evt){nMax = 6;}; imageG.src = "images/rotate/ImageG.jpg"; 
	var imageF = new Image(180,240); imageF.onerror=function(evt){nMax = 5;}; imageF.src = "images/rotate/ImageF.jpg"; 
	var imageE = new Image(180,240); imageE.onerror=function(evt){nMax = 4;}; imageE.src = "images/rotate/ImageE.jpg";
	var imageD = new Image(180,240); imageD.onerror=function(evt){nMax = 3;}; imageD.src = "images/rotate/ImageD.jpg";
	var imageC = new Image(180,240); imageC.onerror=function(evt){nMax = 2;}; imageC.src = "images/rotate/ImageC.jpg";
	var imageB = new Image(180,240); imageB.onerror=function(evt){nMax = 1;}; imageB.src = "images/rotate/ImageB.jpg";
}

function rotate_it(val) {
	if (val == 1 && document["animated"]) document["animated"].src = imageA.src;
	if (val == 2 && document["animated"]) document["animated"].src = imageB.src;
	if (val == 3 && document["animated"]) document["animated"].src = imageC.src;
	if (val == 4 && document["animated"]) document["animated"].src = imageD.src;
	if (val == 5 && document["animated"]) document["animated"].src = imageE.src;
	if (val == 6 && document["animated"]) document["animated"].src = imageF.src;
	if (val == 7 && document["animated"]) document["animated"].src = imageG.src;
	if (val == 8 && document["animated"]) document["animated"].src = imageH.src;	
	if (val == 9 && document["animated"]) document["animated"].src = imageI.src;
	if (val == 10 && document["animated"]) document["animated"].src = imageJ.src;
	if (val == 11 && document["animated"]) document["animated"].src = imageK.src;
	if (val == 12 && document["animated"]) document["animated"].src = imageL.src;
}

var n = 2;   		  // counter for the rotation (do not change)
var r = 0; var rMax = 4;  // number of allowed rotations - this can be changed
var milliseconds = 4000;  // milliseconds delay - this can be changed

function show_it() {
	if (n > nMax) {n = 1; r++;}
	if (r < rMax) rotate_it(n++);
}

// called from onload to give the images a chance to load first
function start_rotation(val) {
	if (typeof(val) == 'undefined' && val > 1) nMax = val;
	// nMax = 2;	// fail-safe option - set nMax manually (commented out)	
	setInterval ("show_it()", milliseconds);
}
//-->
