
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Centre, "appointments@tivertondentalcentre.co.uk", "Tiverton");
addOption(document.drop_list.Centre, "appointments@cullomptondentalcentre.co.uk", "Cullompton");
}

function Selectdentist(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.Dentist);
addOption(document.drop_list.Dentist, "", "Any (Select)", "");

if(document.drop_list.Centre.value == 'appointments@tivertondentalcentre.co.uk'){
addOption(document.drop_list.Dentist,"Bruce Pearson", "Bruce Pearson");
addOption(document.drop_list.Dentist,"Fred Leach", "Fred Leach");
addOption(document.drop_list.Dentist,"Trish Hobson", "Trish Hobson");
addOption(document.drop_list.Dentist,"Dapo Oloto", "Dapo Oloto");
}
if(document.drop_list.Centre.value == 'appointments@cullomptondentalcentre.co.uk'){
addOption(document.drop_list.Dentist,"Bruce Pearson", "Bruce Pearson");
addOption(document.drop_list.Dentist,"Nat Chambers", "Nat Chambers");
addOption(document.drop_list.Dentist,"Sahar Dadbakhsh", "Sahar Dadbakhsh");
addOption(document.drop_list.Dentist,"Devin Vaghela", "Devin Vaghela");
addOption(document.drop_list.Dentist,"Trish Hobson", "Trish Hobson");
}

}
////////////////// 

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);
}
