// Randomly display research spotlight 
// Spotlight data resides in template/feature.spotlight.shtml 
// Class names should be given as spotlight0, spotlight1, etc.
// Change the value of 'range' to change the number of items
// getResearchSpotlight() is called from init() in index.html
// Juho Kim juhokim@stanford.edu, Mar. 4, 2009

// returns a random number between 1 and 'range'
function getRandomNumber(range)
{
	var result;
	if (Math.random) 
		result = Math.round(Math.random() * (range-1));
	else
	{
		var now = new Date();
		result (now.getTime() / 1000) % range;
	}
	return result + 1;	// to make it 1, 2, 3
}

function getResearchSpotlight()
{
	var range = 3;	// number of spotlight items
	var choice = getRandomNumber(range);
	$('.spotlight1').hide();
	$('.spotlight2').hide();
	$('.spotlight3').hide();
	if (choice == 1)
		$('.spotlight1').show();
	else if (choice == 2)
		$('.spotlight2').show();
	else
		$('.spotlight3').show();
}
