
function fillCategory(){ 
     // this function is used to fill the category list on load
    addOption(document.drop_list.Category, "Antwerpen", "Antwerpen", "");
    addOption(document.drop_list.Category, "Brussel", "Brussel", "");
    addOption(document.drop_list.Category, "Henegouwen", "Henegouwen", "");
    addOption(document.drop_list.Category, "Luik", "Luik", "");
    addOption(document.drop_list.Category, "Limburg", "Limburg", "");
    addOption(document.drop_list.Category, "Luxemburg", "Luxemburg", "");
    addOption(document.drop_list.Category, "Namen", "Namen", "");
    addOption(document.drop_list.Category, "Oost Vlaanderen", "Oost Vlaanderen", "");
		addOption(document.drop_list.Category, "Vlaams Brabant", "Vlaams Brabant", "");
    addOption(document.drop_list.Category, "Waals Brabant", "Waals Brabant", "");
		addOption(document.drop_list.Category, "West Vlaanderen", "West Vlaanderen", "");
}
    
function SelectSubCat(){
    // ON selection of category this function will work
    
    removeAllOptions(document.drop_list.SubCat);
    addOption(document.drop_list.SubCat, "", "Zoom in op:", "");
    
		
    if(document.drop_list.Category.value == 'Antwerpen'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.189, 4.427,9)","Provincie");
    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.213, 4.419,12)","Antwerpen");
    shiftmap(51.189, 4.427,9);
    importXML(0);
    }

	  if(document.drop_list.Category.value == 'Brussel'){
  
	  addOption(document.drop_list.SubCat,"javascript:shiftmap(50.849,4.356,11)","Provincie");
	  addOption(document.drop_list.SubCat,"javascript:shiftmap(50.849,4.356,12)","Brussel");
    shiftmap(50.849,4.356,11);
    importXML(1);
    }

    if(document.drop_list.Category.value == 'Henegouwen'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.454, 3.9688,9)","Provincie");
    shiftmap(50.454, 3.9688,9);
    importXML(2);
    }

    if(document.drop_list.Category.value == 'Luik'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.534, 5.578,9)","Provincie");
    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.632, 5.568,12)","Luik");
    shiftmap(50.534, 5.578,9);
    importXML(3);
    }

    if(document.drop_list.Category.value == 'Limburg'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.003, 5.364,9)","Provincie");
    shiftmap(51.003, 5.364,9);
    importXML(4);
    }
		
    if(document.drop_list.Category.value == 'Luxemburg'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.007, 5.375,9)","Provincie");
    shiftmap(50.007, 5.375,9);
    importXML(5);
    }

    if(document.drop_list.Category.value == 'Namen'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.263, 4.913,9)","Provincie");
    shiftmap(50.263, 4.913,9);
    importXML(6);
    }
		if(document.drop_list.Category.value == 'Oost Vlaanderen'){

    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.077, 3.738,10)","Provincie");
    shiftmap(51.077, 3.738,10);
    importXML(7);
    }

		if(document.drop_list.Category.value == 'Vlaams Brabant'){

    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.996, 4.82,9)","Provincie");
    shiftmap(50.996, 4.82,9);
    importXML(8);
    }
		
		if(document.drop_list.Category.value == 'Waals Brabant'){
    
    addOption(document.drop_list.SubCat,"javascript:shiftmap(50.708, 4.617,10)","Provincie");
    shiftmap(50.708, 4.617,10);
    importXML(9);
    }
				
		if(document.drop_list.Category.value == 'West Vlaanderen'){

    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.219, 2.922,10)","Provincie");
    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.344, 3.266,13)","Knokke-Heist");
    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.221, 2.924,13)","Oostende");
    addOption(document.drop_list.SubCat,"javascript:shiftmap(51.135, 2.75,13)","Nieuwpoort");
		 addOption(document.drop_list.SubCat,"javascript:shiftmap(51.114, 2.645,13)","Koksijde");
    shiftmap(51.219, 2.922,10);
    importXML(10);
    }
		
}
 

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

