// Slide show 01-Jun-06 -- Tim

// Specify the image files
var Pic = new Array();

// the pattern, adding to the array below
Pic[0] = 'graphics/homepage/main_img01.jpg';
Pic[1] = 'graphics/homepage/main_img02.jpg';
Pic[2] = 'graphics/homepage/main_img03.jpg';
Pic[3] = 'graphics/homepage/main_img04.jpg';
Pic[4] = 'graphics/homepage/main_img05.jpg';

var PicLink = new Array();

PicLink[0] = 'products_apps_product_labelling.jsp';
PicLink[1] = 'products_apps_property.jsp';
PicLink[2] = 'products_apps_attracting.jsp';
PicLink[3] = 'products_apps_addressing.jsp';
PicLink[4] = 'products_apps_organising.jsp';


var MapLink = new Array();

MapLink[0] = '';
MapLink[1] = '';
MapLink[2] = '#anim01Map';
MapLink[3] = '';
MapLink[4] = '#anim02Map';

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 2;
// Whether images are shown randomly (otherwise sequential)
var randomDisplay = false;

// do not edit anything below this line
var z;
var t;
var c;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}

function runSlideShow(l) {

if (document.all) {
document.images.anim01.style.filter="blendTrans(duration=2)";
document.images.anim01.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.anim01.filters.blendTrans.Apply();
}

if (randomDisplay == true) {
	c = Math.floor(Math.random()*p);
	if (z = c) {
		c = Math.floor(Math.random()*p);
	}
	document.images.anim01.src = preLoad[c].src;
	document.images.anim01.useMap = MapLink[c]
	document.all.animlink.href = PicLink[c];
	z = c;
} else {
	document.images.anim01.src = preLoad[l].src;
	document.images.anim01.useMap = MapLink[l];
	document.all.animlink.href = PicLink[l];
}
if (document.all) {
document.images.anim01.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow(' + j + ')', slideShowSpeed);
}

