
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Kategorija0, "Usluge", "Usluge", "");
addOption(document.drop_list.Kategorija0, "Proizvodnja", "Proizvodnja", "");
addOption(document.drop_list.Kategorija0, "Trgovina", "Trgovina", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Podgrupa", "");

if(document.drop_list.Kategorija0.value == 'Usluge'){
addOption(document.drop_list.SubCat,"Plasticne kese1", "Plasticne kese1");
addOption(document.drop_list.SubCat,"Football1", "Football1");
addOption(document.drop_list.SubCat,"Polo", "Polo", "");
}
if(document.drop_list.Kategorija0.value == 'Proizvodnja'){
addOption(document.drop_list.SubCat,"Plasticne kese", "Plasticne kese");
addOption(document.drop_list.SubCat,"Football", "Football");
addOption(document.drop_list.SubCat,"Polo", "Polo", "");
}
if(document.drop_list.Kategorija0.value == 'Trgovina'){
addOption(document.drop_list.SubCat,"PHP", "PHP");
addOption(document.drop_list.SubCat,"ASP", "ASP");
addOption(document.drop_list.SubCat,"Perl", "Perl");
}

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

