/* Javascript for clients.php */


var last = 0;
var which = 0;
var images = null;


function flashRandomClient () {
	
	while ((which==last) || (!images[which]))
		which = Math.floor(Math.random() * (images.length + 1));
	
	last = which;
	
	if (images[which]) {
		new Effect.Opacity($(images[which]),{
			from: 1.0, 
			to: 0, 
			duration: 1, 
			afterFinish: function () { 
					new Effect.Opacity($(images[which]),{from: 0, to: 1, duration: 1.5} ); 
				}
			});
	}

}

window.onload = function  () {
	images = $('clients').getElementsByTagName('img');
	setInterval('flashRandomClient();',2200);
	flashRandomClient();
}
