// JavaScript Document
// This set of functions will take array elements passed to it from a custom ColdFusion script and randomly rotate them.

function rotateElement(loopCount, theKey) {
	//what's being passed?
	//window.alert("loopCount = " + loopCount);
	//window.alert("theKey = " + theKey);
	
	//pick a random item from the array
	r = Math.round( ( Math.random() * loopCount ) );
	//alert ("random =" + r);
	if ( r <= 0 ) {
		r = 1;
	}
	
	return r;
}
