function populateState(objName, countryVal)
{
	if(countryVal==0)
		return;
	var usStates = ["AK", "AL","AR", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "IA", "ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", 
					"MO", "MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", 
					"VT", "WA", "WI", "WV", "WY"];
	var canStates = ["AB", "BC", "MB", "NB", "NL", "NS", "ON", "PE", "QC", "SK"];
	var ukStates = ["Bedfordshire", "Bershire", "Birmingham", "Bristol", "Buckinghamshire", "Cambridgeshire", "Cheshire", "Cornwall", "Cumbria", "Derbyshire", 
					"Devon", "Dorset", "Dumbarton", "Durham", "East Sussex", "East Yorkshire", "Essex", "Gloucestershire", "Hampshire", "Herefordshire",
					"Hertfordshire", "Kent", "Isle of Wight", "Lancashire", "Leicestershire", "Lincolnshire", "London", "Manchester", "Norfolk", "North Yorkshire", 
					"Northamptonshire", "Northumberland", "Nottinghamshire", "Oxfordshire", "Plymouth", "Shropshire", "Essex", "Somerset", "South Devon", 
					"South Yorkshire", "Staffordshire", "Suffolk", "Surrey", "Tyne and Wear", "Warwickshire", "West Midlands", "West Sussex", "West Yorkshire", 
					"Wiltshire", "Worcestershire", "Yorkshire"];
	var irldnStates = ["Cavan", "Carlow", "Clare", "Donegal", "Dublin", "Galway", "Kerry", "Kildare", "Kilkenny", "Laois", "Leitrim", "Limerick", "Longford",
					   "Louth", "Mayo", "Meath", "Monaghan", "Offaly", "Roscommon", "Sligo", "S Tipperary", "Waterford", "Westmeath", "Wexford", "Wicklow"];
	var ausStates = ["ACT", "COC", "JB", "NSW", "NT", "QLD", "SA", "TAS", "VIC", "WA"];
	var scotStates = ["Aberdeenshire", "Angus", "Ayrshire", "Banffshire", "Berwickshire", "Bute", "Caithness", "Clackmannanshire", "Dumbartonshire", "Dumfrieshire", 
					  "Edinburgh", "Fife", "Glasgow", "Inverness-shire", "Kincardinshire", "Kinross-shire", "Kirkcudbrightshire", "Lanarkshire", "Lothian", 
					  "Nairnshire", "Morayshire", "Orkney Islands", "Perthshire", "Pebblesshire", "Renfrewshire", "Ross and Cromarty", "Rodburghshire", 
					  "Selkirkshire", "Stirlingshire", "Sutherland", "Wigtownshire", "Zetland"];
	var walStates = ["Cardiff", "Ceredigion", "Conwy", "Denbighshire", "Dyfed", "Flintshire", "Glamorgan", "Gwyneed", "North Wales", 
					 "Powys", "South Glamorgan", "Swansea", "West Glamorgan", "Wrexham"]; 
	stateObj = objName;
	clearStates();
	addOption(document.getElementById(stateObj), "#", "Choose Region");
	if(countryVal == 0 && countryVal !="")
	{
		for(x=0; x<usStates.length; x++)
		{
			addOption(document.getElementById(stateObj), usStates[x], usStates[x]);
		}
	}
	else if(countryVal == 1)
	{	
		for(x=0; x<canStates.length; x++)
		{
			addOption(document.getElementById(stateObj), canStates[x], canStates[x]);
		}
	}
	else if(countryVal == 2)
	{	
		for(x=0; x<ukStates.length; x++)
		{
			addOption(document.getElementById(stateObj), ukStates[x], ukStates[x]);
		}
	}
	else if(countryVal == 5)
	{	
		for(x=0; x<scotStates.length; x++)
		{
			addOption(document.getElementById(stateObj), scotStates[x], scotStates[x]);
		}
	}
	else if(countryVal == 7)
	{	
		for(x=0; x<walStates.length; x++)
		{
			addOption(document.getElementById(stateObj), walStates[x], walStates[x]);
		}
	}
}

function clearStates()
{
	for(x=document.getElementById(stateObj).options.length-1; x>=0; x--)
	{
		document.getElementById(stateObj).options[x] = null;
	}
}

function addOption(theSelect,inValue,inText){  
	option = document.createElement("OPTION");
	option.value= inValue;
	option.text  = inText;
	option.cleanText  = inText;
	theSelect.options.add(option);
}
