<!--

window.onload=initImgRotation;

/*************************************************************************
  This code is from Dynamic Web Coding 
  at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  Permission granted to use this code 
  as long as this entire notice is included.
*************************************************************************/
function initImgRotation() {
  // create rotating image objects here 
  // arguments: image name, rotation speed
  var rotator1 = new rotateImgObj('img1',6000);
  // add the images to rotate into that image object  
  rotator1.addImages("partner1.jpg","partner3.jpg","partner5.jpg","partner7.jpg","partner9.jpg");
  
  var rotator2 = new rotateImgObj('img2',5000);
  rotator2.addImages("partner2.jpg","partner4.jpg","partner6.jpg","partner8.jpg");
  
  // starts rotation for all defined rotateImgObjs
  for (var i=0; i<rotateImgObjs.length; i++) 
    rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);
}

// If all the images you wish to display are in the same location, you can specify the path here 
rotateImgObj.imagesPath = "/rotating_images/";

rotateImgObjs = []; // holds all rotating image objects defined
// constructor 
function rotateImgObj(nm,s) {
  this.speed = s; this.ctr=0; this.timer=0;  
  this.imgObj = document.images[nm]; // get reference to the image object
  this.index = rotateImgObjs.length; rotateImgObjs[this.index] = this;
  this.animString = "rotateImgObjs[" + this.index + "]";
  
  this.addImages = addRotatingImages;
  this.rotate = rotateImg;
}
// preloads images
function addRotatingImages() {
  this.imgObj.imgs = [];
  for (var i=0; i<arguments.length; i++) {
    this.imgObj.imgs[i] = new Image();
    this.imgObj.imgs[i].src = rotateImgObj.imagesPath + arguments[i];
  }
}

// controls rotation
function rotateImg() {
  if (this.ctr < this.imgObj.imgs.length-1) this.ctr++;
  else this.ctr = 0;
  this.imgObj.src = this.imgObj.imgs[this.ctr].src;
}


-->
