

function SelectSubCat(){
// ON selection of category this function will work
removeAllOptions(document.searching.location);
addOption(document.searching.location, "%", "- All Cities -","");

if(document.searching.region.value =='AB')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"AB-","All Cities in Alberta");
addOption(document.searching.location,"AB-Airdrie","Airdrie");
addOption(document.searching.location,"AB-Brooks","Brooks");
addOption(document.searching.location,"AB-Calgary","Calgary");
addOption(document.searching.location,"AB-Camrose","Camrose");
addOption(document.searching.location,"AB-Cold Lake","Cold Lake");
addOption(document.searching.location,"AB-Edmonton","Edmonton");
addOption(document.searching.location,"AB-Fort Saskatchewan","Fort Saskatchewan");
addOption(document.searching.location,"AB-Grande Prairie","Grande Prairie");
addOption(document.searching.location,"AB-Leduc","Leduc");
addOption(document.searching.location,"AB-Lethbridge","Lethbridge");
addOption(document.searching.location,"AB-Lloydminster","Lloydminster");
addOption(document.searching.location,"AB-Medicine Hat","Medicine Hat");
addOption(document.searching.location,"AB-Red Deer","Red Deer");
addOption(document.searching.location,"AB-Spruce Grove","Spruce Grove");
addOption(document.searching.location,"AB-St. Albert","St. Albert");
addOption(document.searching.location,"AB-Wetaskiwin","Wetaskiwin");
}

if(document.searching.region.value =='BC')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"BC-","All Cities in British Columbia");
addOption(document.searching.location,"BC-Burnaby","Burnaby");
addOption(document.searching.location,"BC-Dawson Creek","Dawson Creek");
addOption(document.searching.location,"BC-Kamloops","Kamloops");
addOption(document.searching.location,"BC-Kelowna","Kelowna");
addOption(document.searching.location,"BC-Kitimat","Kitimat");
addOption(document.searching.location,"BC-Prince George","Prince George");
addOption(document.searching.location,"BC-Vancouver","Vancouver");
addOption(document.searching.location,"BC-Victoria","Victoria");
}

if(document.searching.region.value =='MB')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"MB-","All Cities in Manitoba");
addOption(document.searching.location,"MB-Brandon","Brandon");
addOption(document.searching.location,"MB-Winnipeg","Winnipeg");
}

if(document.searching.region.value =='NB')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"NB-","All Cities in New Brunswick");
addOption(document.searching.location,"NB-Bathurst","Bathurst");
addOption(document.searching.location,"NB-Edmundson","Edmundston");
addOption(document.searching.location,"NB-Fredericton","Fredericton");
addOption(document.searching.location,"NB-Moncton","Moncton");
addOption(document.searching.location,"NB-Saint John","Saint John");
}

if(document.searching.region.value =='NL')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"NL-","All Cities in Newfoundland & Labrador");
addOption(document.searching.location,"NL-Clareville","Clareville");
addOption(document.searching.location,"NL-Corner Brook","Corner Brook");
addOption(document.searching.location,"NL-Labrador City","Labrador City");
addOption(document.searching.location,"NL-St. John's","St. John's");
}

if(document.searching.region.value =='NT')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"NT-","All Cities in Northwest Territories");
addOption(document.searching.location,"NT-Yellowknife","Yellowknife");
}

if(document.searching.region.value =='NS')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"NS-","All Cities in Nova Scotia");
addOption(document.searching.location,"NS-Dartmouth","Dartmouth");
addOption(document.searching.location,"NS-Halifax","Halifax");
addOption(document.searching.location,"NS-Liverpool","Liverpool");
addOption(document.searching.location,"NS-New Glasgow","New Glasgow");
addOption(document.searching.location,"NS-Shelborne","Shelborne");
addOption(document.searching.location,"NS-Sydney","Sydney");
addOption(document.searching.location,"NS-Yartmouth","Yartmouth");
}

if(document.searching.region.value =='NU')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"NU-","All Cities in Nunavut");
addOption(document.searching.location,"NU-Iqaluit","Iqaluit");
}

if(document.searching.region.value =='ON')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"ON-","All Cities in Ontario");
addOption(document.searching.location,"ON-Aurora","Aurora");
addOption(document.searching.location,"ON-Barrie","Barrie");
addOption(document.searching.location,"ON-Brampton","Brampton");
addOption(document.searching.location,"ON-Cambridge","Cambridge");
addOption(document.searching.location,"ON-Cornwall","Cornwall");
addOption(document.searching.location,"ON-Durham Region","Durham Region");
addOption(document.searching.location,"ON-Hamilton","Hamilton");
addOption(document.searching.location,"ON-Kingston","Kingston");
addOption(document.searching.location,"ON-Kitchener","Kitchener");
addOption(document.searching.location,"ON-London","London");
addOption(document.searching.location,"ON-Markham","Markham");
addOption(document.searching.location,"ON-Mississauga","Mississauga");
addOption(document.searching.location,"ON-Ottawa","Ottawa");
addOption(document.searching.location,"ON-Peterborough","Peterborough");
addOption(document.searching.location,"ON-Sudbury","Sudbury");
addOption(document.searching.location,"ON-Timmins","Timmins");
addOption(document.searching.location,"ON-Toronto/GTA","Toronto/GTA");
addOption(document.searching.location,"ON-Windsor","Windsor");
addOption(document.searching.location,"ON-Woodstock","Woodstock");
}

if(document.searching.region.value =='PE')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"PE-","All Cities in Prince Edward Island");
addOption(document.searching.location,"PE-Alberton","Alberton");
addOption(document.searching.location,"PE-Charlottetown","Charlottetown");
addOption(document.searching.location,"PE-Summerside","Summerside");
}

if(document.searching.region.value =='QC')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"QC-","All Cities in Quebec");
addOption(document.searching.location,"QC-Drummonville","Drummonville");
addOption(document.searching.location,"QC-Laval","Laval");
addOption(document.searching.location,"QC-Longueuil","Longueuil");
addOption(document.searching.location,"QC-Montreal","Montreal");
addOption(document.searching.location,"QC-Quebec City","Quebec City");
addOption(document.searching.location,"QC-Rimouski","Rimouski");
addOption(document.searching.location,"QC-Sherbrooke","Sherbrooke");
addOption(document.searching.location,"QC-Trois-Rivères","Trois-Rivères");
}

if(document.searching.region.value =='SK')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"SK-","All Cities in Saskatchewan");
addOption(document.searching.location,"SK-Moose Jaw","Moose Jaw");
addOption(document.searching.location,"SK-North Battleford","North Battleford");
addOption(document.searching.location,"SK-Prince Albert","Prince Albert");
addOption(document.searching.location,"SK-Regina","Regina");
addOption(document.searching.location,"SK-Saskatoon","Saskatoon");
}

if(document.searching.region.value =='YT')
{
removeAllOptions(document.searching.location);
addOption(document.searching.location,"YT-","All Cities in Yukon Territory");
addOption(document.searching.location,"YT-Whitehorse","Whitehorse");
}

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
}