//author: Eugene Sutula
// webhive.com.ua
// JavaScript Document

function ShowRegiones()
{
	var locations_eng = new Array("Bath and North East Somerset",
									"Blackburn with Darwen",
									"Bedfordshire",
									"Barking and Dagenham",
									"Brent",
									"Bexley",
									"Birmingham",
									"Buckinghamshire",
									"Bournemouth",
									"Barnet",
									"Brighton and Hove",
									"Barnsley",
									"Bolton",
									"Blackpool",
									"Bracknell Forest",
									"Bradford",
									"Bromley",
									"Bristol",
									"Bury",
									"Cambridgeshire",
									"Cheshire",
									"Calderdale",
									"Cumbria",
									"Camden",
									"Cornwall",
									"Coventry",
									"Croydon",
									"Darlington",
									"Derbyshire",
									"Derby",
									"Devon",
									"Doncaster",
									"Dorset",
									"Dudley",
									"Durham",
									"Ealing",
									"Enfield",
									"East Riding of Yorkshire",
									"Essex",
									"East Sussex",
									"Gateshead",
									"Gloucestershire",
									"Greenwich",
									"Halton",
									"Hampshire",
									"Havering",
									"Hackney",
									"Herefordshire, County of",
									"Hillingdon",
									"Hammersmith and Fulham",
									"Hounslow",
									"Hartlepool",
									"Hertfordshire",
									"Harrow",
									"Haringey",
									"Isles of Scilly",
									"Isle of Wight",
									"Islington",
									"Kensington and Chelsea",
									"Kent",
									"Kingston upon Hull",
									"Kirklees",
									"Kingston upon Thames",
									"Knowsley",
									"Lancashire",
									"Lambeth",
									"Leicester",
									"Leeds",
									"Leicestershire",
									"Lewisham",
									"Lincolnshire",
									"Liverpool",
									"London",
									"Luton",
									"Manchester",
									"Middlesbrough",
									"Medway",
									"Milton Keynes",
									"Merton",
									"Northumberland",
									"North East Lincolnshire",
									"Newcastle upon Tyne",
									"Norfolk",
									"Nottingham",
									"North Lincolnshire",
									"North Somerset",
									"Northamptonshire",
									"Nottinghamshire",
									"North Tyneside",
									"Newham",
									"North Yorkshire",
									"Oldham",
									"Oxfordshire",
									"Plymouth",
									"Poole",
									"Portsmouth",
									"Peterborough",
									"Redcar and Cleveland",
									"Rochdale",
									"Redbridge",
									"Reading",
									"Richmond upon Thames",
									"Rotherham",
									"Rutland",
									"Sandwell",
									"Suffolk",
									"Sefton",
									"South Gloucestershi",
									"Sheffield",
									"St Helens",
									"Shropshire",
									"Stockport",
									"Salford",
									"Slough",
									"Sunderland",
									"Solihull",
									"Somerset",
									"Southend-on-Sea",
									"Surrey",
									"Stoke-on-Trent",
									"Southampton",
									"Sutton",
									"Staffordshire",
									"Stockton-on-Tees",
									"South Tyneside",
									"Swindon",
									"Southwark",
									"Tameside",
									"Telford and Wrekin",
									"Thurrock",
									"Torbay",
									"Trafford",
									"Tower Hamlets",
									"Warwickshire",
									"West Berkshire",
									"Waltham Forest",
									"Wigan",
									"Wiltshire",
									"Wakefield",
									"Walsall",
									"Wolverhampton",
									"Wandsworth",
									"Windsor and Maidenhead",
									"Wokingham",
									"Worcestershire",
									"Wirral",
									"Warrington",
									"Westminster",
									"West Sussex",
									"York");

	var locations_wales = new Array("Bridgend",
								"Blaenau Gwent",
								"Caerphilly",
								"Ceredigion",
								"Carmarthenshire",
								"Cardiff",
								"Conwy",
								"Denbighshire",
								"Flintshire",
								"Gwynedd",
								"Monmouthshire",
								"Merthyr Tydfil",
								"Neath Port Talbot",
								"Newport",
								"Pembrokeshire",
								"Powys",
								"Rhondda Cynon Taf",
								"Swansea",
								"Torfaen",
								"Vale of Glamorgan",
								"Wrexham",
								"Isle of Anglesey");

	var locations_scotland = new Array("Aberdeenshire",
									"Aberdeen",
									"Argyll and Bute",
									"Angus",
									"Clackmannanshire",
									"Dumfries and Galloway",
									"Dundee",
									"East Ayrshire",
									"Edinburgh",
									"East Dunbartonshire",
									"East Lothian",
									"Eilean Siar",
									"East Renfrewshire",
									"Falkirk",
									"Fife",
									"Glasgow",
									"Highland",
									"Inverclyde",
									"Midlothian",
									"Moray",
									"North Ayrshire",
									"North Lanarkshire",
									"Orkney Islands",
									"Perth and Kinross",
									"Renfrewshire",
									"South Ayrshire",
									"Scottish Borders, The",
									"South Lanarkshire",
									"Stirling",
									"Shetland Islands",
									"West Dunbartonshire",
									"West Lothian");

	var locations_nireland = new Array("Antrim",
									"Ards",
									"Armagh",
									"Ballymena",
									"Ballymoney",
									"Banbridge",
									"Belfast",
									"Coleraine",
									"Carrickfergus",
									"Castlereagh",
									"Cookstown",
									"Craigavon",
									"Down",
									"Derry",
									"Dungannon and South Tyrone",
									"Fermanagh",
									"Larne",
									"Limavady",
									"Lisburn",
									"Magherafelt",
									"Moyle",
									"Newry and Mourne",
									"Newtownabbey",
									"North Down",
									"Omagh",
									"Strabane");

	var locations_channel = new Array("Guernsey", "Jersey");

	var form_countries = document.getElementById("PropertyCountry");
	var form_regiones = document.getElementById("PropertyRegion");
	var selected_country;

//	form_divisions.remove(0);
	form_regiones.options.length = 0;

 	for (i = form_countries.length - 1; i>=0; i--) {
    	if (form_countries.options[i].selected) {
    		selected_country = form_countries.value;
    	}
	}
	//alert(selected_division);

	switch(selected_country)
	{
		case "England":
		{
			for (i=0;i<locations_eng.length;i++) {
			   if (locations_eng[i] !='') {
				  form_regiones.options.length = (i+1); // make it one longer (ie prefers that)
				  form_regiones.options[form_regiones.options.length] = new Option(locations_eng[i]);
			   }
			}
			break;
		}
		case "Nothern Ireland":
		{
			for (i=0;i<locations_nireland.length;i++) {
			   if (locations_nireland[i] !='') {
				  form_regiones.options.length = (i+1); // make it one longer (ie prefers that)
				  form_regiones.options[form_regiones.options.length] = new Option(locations_nireland[i]);
			   }
			}
			break;
		}
		case "Wales":
		{
			for (i=0;i<locations_wales.length;i++) {
			   if (locations_wales[i] !='') {
				  form_regiones.options.length = (i+1); // make it one longer (ie prefers that)
				  form_regiones.options[form_regiones.options.length] = new Option(locations_wales[i]);
			   }
			}
			break;
		}
		case "Scotland":
		{
			for (i=0;i<locations_scotland.length;i++) {
			   if (locations_scotland[i] !='') {
				  form_regiones.options.length = (i+1); // make it one longer (ie prefers that)
				  form_regiones.options[form_regiones.options.length] = new Option(locations_scotland[i]);
			   }
			}
			break;
		}
		case "Channel Islands":
		{
			for (i=0;i<locations_channel.length;i++) {
			   if (locations_channel[i] !='') {
				  form_regiones.options.length = (i+1); // make it one longer (ie prefers that)
				  form_regiones.options[form_regiones.options.length] = new Option(locations_channel[i]);
			   }
			}
			break;
		}
		default:
		{
			var locations = new Array();
			locations.concat(locations_eng, locations_wales);
			var cur_i = 0;
			for (i=0;i<locations_eng.length;i++)
			{
				locations[cur_i]=locations_eng[i];
				++cur_i;
			}
			for (i=0;i<locations_wales.length;i++)
			{
				locations[cur_i]=locations_wales[i];
				++cur_i;
			}
			for (i=0;i<locations_nireland.length;i++)
			{
				locations[cur_i]=locations_nireland[i];
				++cur_i;
			}
			for (i=0;i<locations_scotland.length;i++)
			{
				locations[cur_i]=locations_scotland[i];
				++cur_i;
			}
			for (i=0;i<locations_channel.length;i++)
			{
				locations[cur_i]=locations_channel[i];
				++cur_i;
			}

			locations.sort();
			for (i=0;i<locations.length;i++) {
			   if (locations[i] !='') {
				  form_regiones.options.length = (i+1); // make it one longer (ie prefers that)
				  form_regiones.options[form_regiones.options.length] = new Option(locations[i]);
			   }
			}
			break;
		}
	}
}





