
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Location", "Location", "");
addOption(document.drop_list.Category, "Price", "Price", "");
addOption(document.drop_list.Category, "Type", "Type", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "SubCat", "");

if(document.drop_list.Category.value == 'Location'){
addOption(document.drop_list.SubCat,"Bugolobi", "Bugolobi");
addOption(document.drop_list.SubCat,"Naalya", "Naalya");
addOption(document.drop_list.SubCat,"Lubowa", "Lubowa");
addOption(document.drop_list.SubCat,"Namungoona", "Namungoona");
addOption(document.drop_list.SubCat,"Kiwatule", "Kiwatule");
addOption(document.drop_list.SubCat," Mbuya", " Mbuya");
addOption(document.drop_list.SubCat,"Rubaga", "Rubaga");
}
if(document.drop_list.Category.value == 'Price'){
addOption(document.drop_list.SubCat,"30-50M", "30-50M");
addOption(document.drop_list.SubCat,"50-100M", "50-100M");
addOption(document.drop_list.SubCat,"100-300M", "100-300M", "");
addOption(document.drop_list.SubCat,"Over 300M", "Over 300M", "");
}
if(document.drop_list.Category.value == 'Type'){
addOption(document.drop_list.SubCat,"Flat", "Flat");
addOption(document.drop_list.SubCat,"Bungalow", "Bungalow");
}

}
////////////////// 

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);
}
