// JavaScript Document
// rotate-index.js v2.0 (15.12.08)
// Script must come after image placeholder(s) in page flow

<!-- hide script from old browsers

// Part 1. Set up the array of image information:

var array1 = new Array();
array1[0] = '/images/jpeg/mainPics/polycarb-m1.jpg, Screen printed metalwork with undersurface-printed polycarbonate inserts, Screen printed metalwork with undersurface-printed polycarbonate inserts';
array1[1] = '/images/jpeg/mainPics/panels-m2.jpg, Screen printing direct to finished metalwork, Screen printing direct to finished metalwork';
array1[2] = '/images/jpeg/mainPics/panels-m3.jpg, Screen printing direct to component surface, Screen printing direct to component surface';
array1[3] = '/images/jpeg/mainPics/panels-m4.jpg, Two-colour screen printing to plastics surface, Two-colour screen printing to plastics surface';

// Part 2. Reorganize this into the three property category arrays:

	var arrayallsplit = new Array();

	for(i=0; i<array1.length; i++)
	{
	arrayallsplit[i] = array1[i].split(",");
	}
	 
	var srcArray = new Array();
	var altArray = new Array();
	var titleArray = new Array();
	
	for (i=0;i<arrayallsplit.length; i++)
	{
	srcArray[i] = (arrayallsplit[i])[0];
	altArray[i] = (arrayallsplit[i])[1];
	titleArray[i] = (arrayallsplit[i])[2];
	//srcString = srcArray.join(); // (not required)
	//altString = altArray.join(); // (not required)
	//titleString = titleArray.join(); // (not required)
	}

var ImageHolder1 = document.getElementById('Rotating1');

var RotateSpeed = 3000; // Rotate delay in milliseconds
  
  function RotateImages(whichHolder,Start) {
  
	if(Start>=srcArray.length)
  		Start=0;

	ImageHolder1.src = srcArray[Start];
	
	ImageHolder1.alt = altArray[Start];
	
	ImageHolder1.title = titleArray[Start];
	
  	window.setTimeout("RotateImages("+whichHolder+","+(Start+1)+")",RotateSpeed);
	
  }
  
  RotateImages(1,0);

// A multiple version of this is in rotate-index(multiple).js

// end hiding script from old browsers -->


