rotateme.restartDelay = 500; // delay onmouseout before call to rotate
rotateme.col = []; 
function rotateme(name, speed, path, tgt) {
    this.name = name; this.speed = speed || 4500; // default speed of rotation
    this.path = path || ""; this.tgt = tgt;
    this.ctr = 0; this.timer = 0; this.imgs = []; this.actions = [];
    this.index = rotateme.col.length; rotateme.col[this.index] = this;
    this.animString = "rotateme.col[" + this.index + "]";
}
rotateme.prototype.addImages = function() {
    var img;
    for (var i=0; arguments[i]; i++) {
        img = new Image();
        img.src = this.path + arguments[i];
        this.imgs[this.imgs.length] = img;
    }
}
rotateme.prototype.rotate = function() {
    clearTimeout(this.timer); this.timer = null;
    if (this.ctr < this.imgs.length-1) this.ctr++;
    else this.ctr = 0;
    var imgObj = document.images[this.name];    
    if (imgObj) {
        imgObj.src = this.imgs[this.ctr].src;
        this.timer = setTimeout( this.animString + ".rotate()", this.speed);
    }
}
// Start rotation for all instances 
rotateme.start = function() {
    var len = rotateme.col.length, obj;
    for (var i=0; i<len; i++) {
        obj = rotateme.col[i];
        if (obj && obj.name ) 
            obj.timer = setTimeout( obj.animString + ".rotate()", obj.speed);
    }
}
function fireupRotator(){
	var imagefolder = "images/";
	// change the 500 to 3000;
	var rotate = new rotateme("imageroller",3000,imagefolder);
	rotate.addImages("food1.jpg","food2.jpg","food3.jpg","manufacturing1.jpg","mining1.jpg","resources.jpg","agribusiness1.jpg","manufacturing2.jpg","agribusiness2.jpg");
	rotateme.start();
}

