function randomizePictures(usedValues,picType)
	{

	var max288 = 18;
	var max144 = 10;
	var max144_telecom = 9;
	var max144_tigerlilly = 7;

	//picType is an integer of value either 144 or 288, 
	//which determines what size of picture is swapped out.

	var chosenNumber=0;
	var multiplier=0;
	var checked=0;

	switch(picType)
	{
		case 144:
			multiplier=max144;
			break;
		case 288:	
			multiplier=max288;
			break;
		case 145:
			multiplier=max144_telecom;
			break;
		case 146:
			multiplier=max144_tigerlilly;
			break;

	}

	arrValues = usedValues.split(',');

	//arrValues is an array built from the csv string passed into the function
	//This is a list of pic #s already being used on the page so that duplicates don't occur.

	while(checked==0)
		{	
		chosenNumber=Math.floor(Math.random()*multiplier)+1;
		checked=1;
		for(i=0;i<arrValues.length;i++)
			{
			if (arrValues[i]==chosenNumber){
				checked=0;}
			}
		}
	
	return chosenNumber;

	}