function ClientsBlitter() {
	this.images = new Array();
	this.elementIds = new Array();
	
	ClientsBlitter.prototype.setImages = function() {
    	this.images = this.setImages.arguments;
	}
	
	ClientsBlitter.prototype.setElementIdList = function() {
		this.elementIds = this.setElementIdList.arguments;
	}
	
	ClientsBlitter.prototype.doSwitch = function(id) {
		var el = document.getElementById(id);
		var proposal, use = null;
		var sanity = 0;
		
		if (el && this.elementIds.length < this.images.length) {
			do{
				proposal = this.getRandomImage();
			} while (++sanity < 100 && this.isBeingDisplayed(proposal) != null);
			use = proposal;
			
			if (sanity >= 100) { console.log('couldnt find a random image')}
		}
		
		if (use) {
			document.getElementById(id).src = use;
		} else {
			console.log('oh dear - doSwitch is returning null (looped '+sanity+' times, proposal="'+proposal+'")')
		}
		return use;
	}
	
	ClientsBlitter.prototype.switchRandomElement = function() {
		var id=this.getRandomElement();
		this.doSwitch(id);
	}
	
	ClientsBlitter.prototype.getRandomImage = function() {
		var candidate = Math.floor(Math.random() * this.images.length, 10);
//console.log('getRandomImage: '+this.images.length+' images available, candidate index='+candidate)
		return this.images[candidate];
	}
	
	ClientsBlitter.prototype.getRandomElement = function() {
		var candidate = Math.floor(Math.random() * this.elementIds.length, 10);
//console.log('getRandomElement: '+this.elementIds.length+' elements available, candidate index='+candidate)
		return this.elementIds[candidate];
	}
	
	ClientsBlitter.prototype.isBeingDisplayed = function(image) {
		var i, id;
		for (i=0; i<this.elementIds.length; ++i) {
			id=this.elementIds[i];
			if (document.getElementById(id).src.match(image)) {
				return(id);
			}
		}
		return null;
	}
}