
  
// If all the images you wish to display are in the same location, you can specify the path here
rotateImgObj.imagesPath = "./ani/";

// no need to edit code below
/////////////////////////////////////////////////////////////////////
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 + "]";
}

var t

rotateImgObj.prototype = {
  addImages: function() { // preloads images
    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];
    }
  },
  
  
  rotate: function() {
    if (this.ctr < this.imgObj.imgs.length-1) this.ctr++;
	   else this.ctr = 0;
	    if (document.all){
	      this.imgObj.style.filter="blendTrans(duration=2)"
	      this.imgObj.style.filter="blendTrans(duration=2)"
	      this.imgObj.filters.blendTrans.Apply()
	}
	   this.imgObj.src = this.imgObj.imgs[this.ctr].src;
	   if (document.all){
		this.imgObj.filters.blendTrans.Play()
	}
	//t = setTimeout("rotate()", 7000)
  }

}

// sets up rotation for all defined rotateImgObjs
rotateImgObj.start = function() {
	  for (var i=0; i<rotateImgObjs.length; i++)
    rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);
	}
