<!--
// **************************************************************** 
// Image rotation script
// Created: 24/07/06 - JMV
// Rotate images from pool of 2 for each of 6 locations
// Also change alt tags
// **************************************************************** 

// Attributes of images to be rotated
var mfPics = new Array;

// Image pairs, step 1

mfPics[0] = new imageData('1a',1,'Twelve stunning, luxurious long-stemmed roses. Available in four beautiful colours and finished with bear grass this is a stunning and truly romantic bouquet.','gif');
mfPics[1] = new imageData('1b',1,'Twelve stunning, luxurious long-stemmed roses.','gif');

mfPics[2] = new imageData('2a',1,'Celebrate the season with a beautiful selection of seasonal flowers in a wide range of colours. The best of what\'s fresh chosen especially by the florist to delight you.','gif');
mfPics[3] = new imageData('2b',1,'A beautiful selection of seasonal flowers','gif');

mfPics[4] = new imageData('3a',1,'Vibrant arrangement of flowers','gif');
mfPics[5] = new imageData('3b',1,'Make the most of the beautiful blooms around right now with this vibrant arrangement of flowers hand-picked by the florist for colour.','gif');

// Image pairs, step 2

mfPics[6] = new imageData('1a',2,'A beautiful selection of seasonal flowers','gif');
mfPics[7] = new imageData('1b',2,'Celebrate the season with a beautiful selection of seasonal flowers in a wide range of colours. The best of what\'s fresh chosen especially by the florist to delight you.','gif');

mfPics[8] = new imageData('2a',2,'Twelve stunning, luxurious long-stemmed roses','gif');
mfPics[9] = new imageData('2b',2,'Twelve stunning, luxurious long-stemmed roses. Available in four beautiful colours and finished with bear grass this is a stunning and truly romantic bouquet.','gif');

mfPics[10] = new imageData('3a',2,'Make the most of the beautiful blooms around right now with this vibrant arrangement of flowers hand-picked by the florist for colour.','gif');
mfPics[11] = new imageData('3b',2,'Vibrant arrangement of flowers','gif');

// Index of the current slide
var curSlide = 1;
var slideDelay = 10000; // ten seconds

//window.attachEvent("onload", changeSlides());

function changeSlides() {
	
	// Go through all images and change source and alt
	for (i = 0; i < mfPics.length; i++){
		if(mfPics[i].imgOrder == curSlide) {
			// If matching, change image attributes
			// like: /images/home/hp2b1.gif and alt tag
			o = eval('document.images["hp'+mfPics[i].imgPos+'"]' );
			//alert(o.src);
			if(o){
				eval('o.src = "/images/home/hp'+mfPics[i].imgPos+curSlide+'.'+mfPics[i].imgExt+'"');
				eval('o.alt = "'+mfPics[i].imgAlt+'"');
			}
		}
	}
	
	// Increase counter
	curSlide += 1;
	if(curSlide==3)  curSlide = 1; // Reset back to 1
	
	//curTimeout = setTimeout('changeSlides()', slideDelay);
}


// *** Build client data 
function imageData(imgPos,imgOrder,imgAlt,imgExt){
	this.imgPos = imgPos; // Position on layout
	this.imgOrder = imgOrder; // Order in rotation (1 or 2)
	this.imgAlt = imgAlt; //  Alt tag
	this.imgExt = imgExt; //  Image extension (gif or jpg)
}

//-->