
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Vietnam", "Vietnam", "");
addOption(document.drop_list.Category, "Cambodia", "Cambodia", "");
addOption(document.drop_list.Category, "Thailand", "Thailand", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Places", "");

if(document.drop_list.Category.value == 'Vietnam'){
addOption(document.drop_list.SubCat,"Saigon", "Saigon");
addOption(document.drop_list.SubCat,"Central", "Central");
addOption(document.drop_list.SubCat,"Hanoi", "Hanoi");
addOption(document.drop_list.SubCat,"Ho Chi Minh", "Ho Chi Minh");

}
if(document.drop_list.Category.value == 'Cambodia'){
addOption(document.drop_list.SubCat,"Siem Reap", "Siem Reap");
addOption(document.drop_list.SubCat,"Phnom Penh", "Phnom Penh");
}
if(document.drop_list.Category.value == 'Thailand'){
addOption(document.drop_list.SubCat,"Chiang Mai", "Chiang Mai");
}

}
////////////////// 

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);
}
