var countriesArray = new Array("England",
                               "Scotland",
                               "Wales",
                               "Northern Ireland");

var englandArray =  new Array("",
"Avon",
"Bedfordshire",
"Berkshire",
"Bristol",
"Buckinghamshire",
"Cambridgeshire",
"Channel Islands",
"Cheshire",
"Cleveland",
"Cornwall",
"County Durham",
"Cumbria",
"Derbyshire",
"Devon",
"Dorset",
"East Riding of Yorkshire",
"East Sussex",
"Essex",
"Glouchestershire",
"Greater London",
"Greater Manchester",
"Hampshire",
"Herefordshire",
"Hertfordshire",
"Isle of Man",
"Isle of Wight",
"Isles of Scilly",
"Kent",
"Lancashire",
"Leicestershire",
"Lincolnshire",
"Merseyside",
"Norfolk",
"North Yorkshire",
"Northamptonshire",
"Northumberland",
"Nottinghamshire",
"Oxfordshire",
"Rutland",
"Shropshire",
"Somerset",
"South Yorkshire",
"Staffordshire",
"Suffolk",
"Surrey",
"Tyne & Wear",
"Warwickshire",
"West Midlands",
"West Sussex",
"West Yorkshire",
"Wiltshire",
"Worcestershire");

var scotlandArray =  new Array("",
"Aberdeenshire and Moray",
"Angus",
"Argyll & Bute",
"Clackmannanshire",
"Dumfries & Galloway",
"East Ayrshire",
"East Lothian",
"Edinburgh",
"Fife",
"Glasgow",
"Highland",
"Inverclyde",
"Midlothian",
"North Ayrshire",
"North Lanarkshire",
"Orkney Islands",
"Perth & Kinross",
"Scottish Borders",
"Shetland Isles",
"South Ayrshire",
"South Lanarkshire",
"Stirling",
"West Lothian",
"Western Isles");

var walesArray =  new Array("",
"Anglesey",
"Carmarthenshire",
"Ceredigon",
"Denbigh & Flint",
"North West Wales",
"Pembrokeshire",
"Powys",
"The Glamorgans");

var northernirelandArray =  new Array("",
"Annalong",
"Antrim",
"Armagh",
"Augher",
"Ballintoy",
"Ballycastle",
"Ballymena",
"Ballymoney",
"Ballynahinch",
"Banbridge",
"Bangor",
"Belcoo",
"Belfast",
"Brookeborough",
"Bushmills",
"Carrickfergus",
"Castlederg",
"Castlewellan",
"Coleraine",
"Comber Newtownards",
"Cookstown",
"County Antrim",
"County Down",
"Crumlin",
"Donaghadee",
"Downpatrick",
"Dungannon",
"Dungiven",
"Enniskillen",
"Irvinestown",
"Kesh",
"Kilkeel",
"Larne",
"Limavady",
"Lisburn",
"Lisnaskea",
"Londonderry",
"Magherafelt",
"Maguiresbridge",
"Newry",
"Newtownabbey",
"Newtownards",
"Omagh",
"Portadown",
"Portrush",
"Strabane");

function populateCounties(comboBox,country)
{
	for(i=comboBox.options.length-1;i>=0;i--)
	{
		comboBox.remove(i);
	}
	
	if (country == 'England')
		countyArray = englandArray;
	else if (country == 'Scotland')
		countyArray = scotlandArray;
	else if (country == 'Wales')
		countyArray = walesArray;
	else if (country == 'Northern Ireland')
		countyArray = northernirelandArray;
	else
		countyArray = new Array("");
		
	for (i = 0; i < countyArray.length; i++)
	{
		comboBox.options.add(new Option(countyArray[i]));
	}
}

