var towns = new Array();
var selected = new Array();

towns[0] = "Derbyshire";
towns[1] = "Buxton";
towns[2] = "Bakewell Stoke";
towns[3] = "Chatsworth";
towns[4] = "Churchill";
towns[5] = "Backwell";
towns[6] = "Peak District";
towns[7] = "Sheffield";
towns[8] = "Chesterfield";
towns[9] = "Derby";
towns[10] = "Mansfield";
towns[11] = "Ripley";
towns[12] = "Ashton";
towns[13] = "Alfreton";
towns[14] = "Ashbourne";


var townscount = towns.length;
var different = 10;
var output = "";

function getDifferent()
{
	for(var j=0; j<different; j++)
	{
		r = Math.round(Math.random()*townscount);
		if(selected[j]!=r)
		{
			selected[j] = towns[r];
		}
		else
		{
			j--;
		}
	}
	selected.sort();
}

getDifferent();

for(var k=0; k<selected.length-1; k++)
{
	output = output + selected[k] + ", ";
}
output = output + selected[different-1] + " and " + selected[different-1];

//output = output + selected.length + towns[randnum] + ", ";
