
function fillCategory(){ 
 // this function is used to fill the category list on load
//addOption(document.drop_list.Category, "Landskrona", "Landskrona", "");

addOption(document.drop_list.Category, "Malmö", "Malmö", "");

}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Välj område", "");

//if(document.drop_list.Category.value == 'Landskrona'){
//addOption(document.drop_list.SubCat,"Borgmästaregatan", "Borgmästaregatan");
//addOption(document.drop_list.SubCat,"Järnvägsgatan", "Järnvägsgatan");
//addOption(document.drop_list.SubCat,"Nygatan", "Nygatan");
//addOption(document.drop_list.SubCat,"Östergatan", "Östergatan");
//}
if(document.drop_list.Category.value == 'Malmö'){
addOption(document.drop_list.SubCat,"Banérsgatan", "Banérsgatan");
addOption(document.drop_list.SubCat,"Holmgatan", "Holmgatan");
addOption(document.drop_list.SubCat,"Östra Stallmästaregatan", "Östra Stallmästaregatan");
addOption(document.drop_list.SubCat,"Sergels Väg", "Sergels Väg");
}



}
////////////////// 

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);
}

