
function fillProvince(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Province, "Eastern Cape", "Eastern Cape", "");
addOption(document.drop_list.Province, "Free State", "Free State", "");
addOption(document.drop_list.Province, "Gauteng", "Gauteng", "");
addOption(document.drop_list.Province, "Kwazulu-Natal", "Kwazulu-Natal", "");
addOption(document.drop_list.Province, "Limpopo", "Limpopo", "");
addOption(document.drop_list.Province, "Mpumalanga", "Mpumalanga", "");
addOption(document.drop_list.Province, "Northern Cape", "Northern Cape", "");
addOption(document.drop_list.Province, "North West", "North West", "");
addOption(document.drop_list.Province, "Western Cape", "Western Cape", "");
}

function SelectArea(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.Area);
addOption(document.drop_list.Area, "", "Area", "");

if(document.drop_list.Province.value == 'Eastern Cape'){
addOption(document.drop_list.Area,"East London", "East London");
addOption(document.drop_list.Area,"Graaff-Reinet", "Graaff-Reinet");
addOption(document.drop_list.Area,"Mthatha", "Mthatha");
addOption(document.drop_list.Area,"Port Elizabeth", "Port Elizabeth");
addOption(document.drop_list.Area,"Queenstown", "Queenstown");
}

if(document.drop_list.Province.value == 'Free State'){
addOption(document.drop_list.Area,"Bloemfontein", "Bloemfontein");
addOption(document.drop_list.Area,"Bethlehem", "Bethlehem");
addOption(document.drop_list.Area,"Harrismith", "Harrismith");
addOption(document.drop_list.Area,"Kroonstad", "Kroonstad");
addOption(document.drop_list.Area,"Sasolburg", "Sasolburg");
addOption(document.drop_list.Area,"Welkom", "Welkom");
}

if(document.drop_list.Province.value == 'Gauteng'){
addOption(document.drop_list.Area,"JHB - Central", "JHB - Central");
addOption(document.drop_list.Area,"JHB - North", "JHB - North");
addOption(document.drop_list.Area,"JHB - South", "JHB - South");
addOption(document.drop_list.Area,"JHB - East", "JHB - East");
addOption(document.drop_list.Area,"JHB - West", "JHB - West");
addOption(document.drop_list.Area,"Pretoria", "Pretoria");
addOption(document.drop_list.Area,"Vaal Triangle", "Vaal Triangle");
}

if(document.drop_list.Province.value == 'Kwazulu-Natal'){
addOption(document.drop_list.Area,"Durban Central", "Durban Central");
addOption(document.drop_list.Area,"Durban North", "Durban North");
addOption(document.drop_list.Area,"Durban South", "Durban South");
addOption(document.drop_list.Area,"Durban West", "Durban West");
addOption(document.drop_list.Area,"Empangeni", "Empangeni");
addOption(document.drop_list.Area,"Ladysmith", "Ladysmith");
addOption(document.drop_list.Area,"Newcastle", "Newcastle");
addOption(document.drop_list.Area,"Pietermaritzburg", "Pietermaritzburg");
addOption(document.drop_list.Area,"Port Shepstone", "Port Shepstone");
addOption(document.drop_list.Area,"Richardsbay", "Richardsbay");
addOption(document.drop_list.Area,"St.Lucia", "St.Lucia");
}

if(document.drop_list.Province.value == 'Limpopo'){
addOption(document.drop_list.Area,"Bela-Bela", "Bela-Bela");
addOption(document.drop_list.Area,"Lephalale", "Lephalale");
addOption(document.drop_list.Area,"Mokopane", "Mokopane");
addOption(document.drop_list.Area,"Musina", "Musina");
addOption(document.drop_list.Area,"Phalaborwa", "Phalaborwa");
addOption(document.drop_list.Area,"Polokwane", "Polokwane");
addOption(document.drop_list.Area,"Thabazimbi", "Thabazimbi");
addOption(document.drop_list.Area,"Tzaneen", "Tzaneen");
}

if(document.drop_list.Province.value == 'Mpumalanga'){
addOption(document.drop_list.Area,"Baberton", "Baberton");
addOption(document.drop_list.Area,"Bethal", "Bethal");
addOption(document.drop_list.Area,"Ermelo", "Ermelo");
addOption(document.drop_list.Area,"Middelburg", "Middelburg");
addOption(document.drop_list.Area,"Nelspruit", "Nelspruit");
addOption(document.drop_list.Area,"Piet Retief", "Piet Retief");
addOption(document.drop_list.Area,"Sabie", "Sabie");
addOption(document.drop_list.Area,"Secunda", "Secundag");
addOption(document.drop_list.Area,"Skukuza", "Skukuza");
addOption(document.drop_list.Area,"Witbank", "Witbank");
}

if(document.drop_list.Province.value == 'Northern Cape'){
addOption(document.drop_list.Area,"Calvinia", "Calvinia");
addOption(document.drop_list.Area,"De Aar", "De Aar");
addOption(document.drop_list.Area,"Kimberley", "Kimberley");
addOption(document.drop_list.Area,"Kuruman", "Kuruman");
addOption(document.drop_list.Area,"Springbok", "Springbok");
addOption(document.drop_list.Area,"Upington", "Upington");
}

if(document.drop_list.Province.value == 'North West'){
addOption(document.drop_list.Area,"Brits", "Brits");
addOption(document.drop_list.Area,"Rustenburg", "Rustenburg");
addOption(document.drop_list.Area,"Hartebeespoort Dam", "Hartebeespoort Dam");
addOption(document.drop_list.Area,"Klerksdorp", "Klerksdorp");
addOption(document.drop_list.Area,"Potchefstroom", "Potchefstroom");
addOption(document.drop_list.Area,"Lichtenburg", "Lichtenburg");
addOption(document.drop_list.Area,"Vryburg", "Vryburg");
}

if(document.drop_list.Province.value == 'Western Cape'){
addOption(document.drop_list.Area,"CBD / City Bowl", "CBD / City Bowl");
addOption(document.drop_list.Area,"Atlantic Seaboard", "Atlantic Seaboard");
addOption(document.drop_list.Area,"Milnerton/Tableview/Parklands", "Milnerton/Tableview/Parklands");
addOption(document.drop_list.Area,"Northern Suburbs", "Northern Suburbs");
addOption(document.drop_list.Area,"Southern Suburbs", "Southern Suburbs");
addOption(document.drop_list.Area,"Helderberg & Surrounds", "Helderberg & Surrounds");
addOption(document.drop_list.Area,"Boland", "Boland");
addOption(document.drop_list.Area,"Overberg", "Overberg");
addOption(document.drop_list.Area,"Garden Route", "Garden Route");
addOption(document.drop_list.Area,"West Coast", "West Coast");
}




}
////////////////// 

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);
}


