// this script loads the images for the leftnav and rotates them.
// alt text and link text is also rotated

// preload images

theImages = new Array(5);
for (i=0, n=theImages.length; i<n; i++) {
	theImages[i] = new Image();
	theImages[i].src='../../images/logo0' + i + '.gif';
}

var CurrentImage = 0;
var Run = true;
var speed = 3500; // milliseconds so 3000 = 3 seconds

// this funcion should be called on the body's onload
function animate() {
   //alert( 1 );
   if (!Run) return;
   CurrentImage++;
   if (CurrentImage > theImages.length-1) CurrentImage=0;
   
   if( document.getElementById("earth") ) {
	   //alert( 2 );
	   document.getElementById("earth").src = theImages[CurrentImage].src;
	   document.getElementById("earth").alt = alts[CurrentImage];
	   
   }


   setTimeout("animate()",speed);
}


// array of links from images
links = new Array(
  "http://www.design-council.org.uk/",
  "http://www.dcf.org.uk",
  "http://www.eef.org.uk/",
  "http://www.wda.co.uk",
  "http://www.iod.com/"
);

// array of alt tags from images
alts = new Array(
  "Design Council",
  "DCF - Digitial Content Forum",
  "EEF - Manufacturers' Organisation ",
  "WDA - Welsh Development Agency",
  "IOD - Institute of Directors"
);

// called when an image is clicked

function go() {
   window.open(links[CurrentImage],"_blank");
}

