dw_Rotator.restartDelay = 500; // delay onmouseout before call to rotate
dw_Rotator.col = []; 

// arguments: image name, rotation speed, path to images (optional), 
// target, i.e. name of window to direct url's to onclick (optional)
function dw_Rotator(name, speed, totalElements) {
    this.name = name;
	this.speed = speed || 4500; // default speed of rotation
	this.totalElements = totalElements;
    this.index = dw_Rotator.col.length; dw_Rotator.col[this.index] = this;
    this.animString = "dw_Rotator.col[" + this.index + "]";
	this.elementNumber = 1;
}

dw_Rotator.prototype.rotate = function() {
    clearTimeout(this.timer); this.timer = null;
	

	theDiv = document.getElementById("rotator_"+this.elementNumber)
	theDiv.style.visibility = "hidden"
	this.elementNumber++
	if(this.elementNumber == this.totalElements){
		this.elementNumber = 1
	}
	theDiv = document.getElementById("rotator_"+this.elementNumber)
	theDiv.style.visibility = "visible"



	this.timer = setTimeout( this.animString + ".rotate()", this.speed);
}

// Start rotation for all instances 
dw_Rotator.start = function() {
    var len = dw_Rotator.col.length, obj;
    for (var i=0; i<len; i++) {
        obj = dw_Rotator.col[i];
        if (obj && obj.name ) // check for empty instance created by dw_random.js
            obj.timer = setTimeout( obj.animString + ".rotate()", obj.speed);
    }
}