// (c)'03 J. Zander 
  
activeSlot = 0, slotNum = 0;
slotList  = new Array();
imageList = new Array();

function rndInterval() {
	return( 3000 ); // 3s
}
  
function Process() {
	if( slotNum ) {
		do
			rnd = Math.floor( slotNum*Math.random());
		while( rnd==slotNum );
		activeSlot = rnd;
		if( imageList[activeSlot].length > 1 ) {
			var max = imageList[activeSlot].length-1;
			do
				rnd = Math.floor( max*Math.random()) - Math.floor( max*Math.random());
			while( rnd<0 || rnd==max );
			
			var select = imageList[activeSlot][rnd];
			for( var i=rnd; i<max; ++i )
				imageList[activeSlot][i] = imageList[activeSlot][i+1];
			imageList[activeSlot][max] = select;
			eval( 'document.' + slotList[activeSlot] + '.src = select.src' );
		}
	}
	window.setTimeout( 'Process()', rndInterval());
}
  
function AddList(slotName) {
	if (AddList.arguments.length) {
		slotList[slotNum]  = slotName;
		imageList[slotNum] = new Array();
		for (var i=1; i<AddList.arguments.length; i++) {
			imageList[slotNum][i-1]     = new Image();
			imageList[slotNum][i-1].src = AddList.arguments[i];
		}  
		slotNum++;
	}    
}
  
function Init( switchTime ) {
	window.setTimeout( 'Process()', rndInterval());
}

