function populateInput(netwerkId,filter,filterId,inputId,inputText){ //Speciaal voor het maken van een input
  container     = document.getElementById('fc_zoekFilter'+filterId);
  
  if(checkFilterStatus(filterId) == true){  
  
  nieuwSubContainer = document.createElement('li');
  nieuwsubText      = document.createTextNode(inputText);
  
  nieuwSubContainer.appendChild(nieuwsubText);
  container.appendChild(nieuwSubContainer);                                                                                                                  
  aantalFilterValues  = selectedValuesNaam.length;
  nieuwSubContainer   = document.createElement('li');
  nieuwsubInput       = document.createElement('input');
    nieuwsubInput.type= "text";
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesNaam[0] != ""){ 
            nieuwsubInput.value = selectedValuesNaam[0];                    
          }
    }
    nieuwsubInput.onkeyup = requestNaam();
    nieuwsubInput.id = "fc_filterOpNaam";
        
        locatieId = filterId;
        filterUitklap = filterId;
  
  nieuwSubContainer.appendChild(nieuwsubInput);
  container.appendChild(nieuwSubContainer);
  }
}
function populateLeiding(netwerkId,filter,filterId){//--------------------Maken van de leiding
  container     = document.getElementById('fc_zoekFilter'+filterId);
  
  if(checkFilterStatus(filterId) == true){;  
  
  aantalFilterValues = selectedValuesLeiding.length;
  nieuwSubContainer = document.createElement('li');
  
  nieuwInput      = document.createElement("input");    
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesLeiding[c] == "- 5"){ 
            nieuwInput.checked = "checked";                    
          }
    }    
    filterTextValuesLeiding["- 5"]= "- 5";
    nieuwInput.type="checkbox";
    nieuwInput.id = "fc_filterOpleiding0";
    nieuwInput.value = "- 5";
    nieuwInput.onchange = requestSpecifiekResultLeiding();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("- 5");
    nieuwSubContainer.appendChild(nieuwsubText);
  
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesLeiding[c] == "5 - 15"){ 
            nieuwInput.checked = "checked";                     
          }
    }
    filterTextValuesLeiding["5 - 15"]= "5 - 15";
    nieuwInput.type="checkbox";
    nieuwInput.id = "fc_filterLeidingOp1";
    nieuwInput.value = "5 - 15";
    nieuwInput.onchange = requestSpecifiekResultLeiding();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("5 - 15");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesLeiding[c] == "15 - 30"){ 
            nieuwInput.checked = "checked";                    
          }
    }
    filterTextValuesLeiding["15 - 30"]= "15 - 30";
    nieuwInput.type="checkbox";
    nieuwInput.id = "fc_filterLeidingOp2";
    nieuwInput.value = "15 - 30";
    nieuwInput.onchange = requestSpecifiekResultLeiding();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("15 - 30");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesLeiding[c] == "30 - 60"){ 
            nieuwInput.checked = "checked";                    
          }
    }
    filterTextValuesLeiding["30 - 60"]= "30 - 60";
    nieuwInput.type="checkbox";
    nieuwInput.id = "fc_filterLeidingOp3";
    nieuwInput.value = "30 - 60";
    nieuwInput.onchange = requestSpecifiekResultLeiding();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("30 -60");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesLeiding[c] == "60 - 100"){ 
            nieuwInput.checked = "checked";                    
          }
    }
    filterTextValuesLeiding["60 - 100"]= "60 - 100";
    nieuwInput.type="checkbox";
    nieuwInput.id = "fc_filterLeidingOp4";
    nieuwInput.value = "60 - 100";
    nieuwInput.onchange = requestSpecifiekResultLeiding();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("60 - 100");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesLeiding[c] == "100 +"){ 
            nieuwInput.setAttribute("checked","checked");                    
          }
    }
    filterTextValuesLeiding["100 +"]= "100 +";    
    nieuwInput.type="checkbox";
    nieuwInput.id = "fc_filterLeidingOp5";
    nieuwInput.value = "100 +";
    nieuwInput.onchange = requestSpecifiekResultLeiding();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("100 +");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);    
    
        locatieId     = filterId;
        filterUitklap = filterId;
  }
}
function populateBeschikbaarheid(netwerkId,filter,filterId, zoekVelden, zoekTabel, zoekOrder){ //--Beschikbaarheid
  container     = document.getElementById('fc_zoekFilter'+filterId);
  
  if(checkFilterStatus(filterId) == true){  
  
  nieuwSubContainer = document.createElement('li');
  
  nieuwSelect = document.createElement("select");
    nieuwSelect.id = "fc_filterBeschikbaarheid0";

  nieuwOption = document.createElement("option");
  nieuwText   = document.createTextNode("Lokaal");
  i = selectedValuesBeschikbaarheid.length;
  for(a=0; a<i; ++a){  
    if(selectedValuesBeschikbaarheid[a] == "Lokaal"){
      nieuwOption.selected = true;
    }    
  } 
    filterTextValuesBeschikbaarheid["Lokaal"]= "Lokaal";
    nieuwOption.appendChild(nieuwText);
    nieuwSelect.appendChild(nieuwOption);
    
  nieuwOption = document.createElement("option");
  nieuwText   = document.createTextNode("Regionaal");
  for(a=0; a<i; ++a){  
    if(selectedValuesBeschikbaarheid[a] == "Regionaal"){
      nieuwOption.selected = true;
    }    
  }
    filterTextValuesBeschikbaarheid["Regionaal"]= "Regionaal";  
    nieuwOption.appendChild(nieuwText);
    nieuwSelect.appendChild(nieuwOption);
    
  nieuwOption = document.createElement("option");
  nieuwText   = document.createTextNode("Landelijk");
  for(a=0; a<i; ++a){  
    if(selectedValuesBeschikbaarheid[a] == "Landelijk"){
      nieuwOption.selected = true;
    }    
  }
    filterTextValuesBeschikbaarheid["Landelijk"]= "Landelijk";
    nieuwOption.appendChild(nieuwText);
    nieuwSelect.appendChild(nieuwOption)
    
    nieuwSelect.onchange = requestSpecifiekResultbeschikbaarheid();
  
  
    nieuwSubContainer.appendChild(nieuwSelect);
    container.appendChild(nieuwSubContainer);
    
        
  reuquestFilters(netwerkId,filter,filterId,zoekVelden,zoekTabel,zoekOrder);
    }

}
function populateCoach(netwerkId,filter,filterId){
  container           = document.getElementById('fc_zoekFilter'+filterId);
  aantalFilterValues  = selectedValuesCoach.length;

  if(checkFilterStatus(filterId) == true){;    
  nieuwSubContainer = document.createElement('li');  
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesCoach[c] == "alleenCoachesWeergeven"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesCoach["alleenCoachesWeergeven"]= "Alleen coaches weergeven";  
    nieuwInput.id = "fc_filterCoach0";
    nieuwInput.value = "alleenCoachesWeergeven";
    nieuwInput.onchange = requestSpecifiekResultcoach();
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Alleen coaches weergeven");
    nieuwSubContainer.appendChild(nieuwsubText);
  
    container.appendChild(nieuwSubContainer);

        locatieId     = filterId;
        filterUitklap = filterId;
  }
}
function PopulateProvincie(netwerkId,filter,filterId){
  container     = document.getElementById('fc_zoekFilter'+filterId);
  aantalFilterValues = selectedValuesProvincie.length;
  if(checkFilterStatus(filterId) == true){;  
  
  nieuwSubContainer = document.createElement('li');
  
  nieuwInput      = document.createElement("input");
  nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Noord-Brabant"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Noord-Brabant"] = "Noord-Brabant";  
    nieuwInput.id = "fc_filterProvincie1";
    nieuwInput.value = "Noord-Brabant";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Noord-Brabant");
    nieuwSubContainer.appendChild(nieuwsubText);
  
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Drenthe"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Drenthe"] = "Drenthe";
    nieuwInput.id = "fc_filterProvincie2";
    nieuwInput.value = "Drenthe";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Drenthe");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Friesland"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Friesland"] = "Friesland";
    nieuwInput.id = "fc_filterProvincie3";
    nieuwInput.value = "Friesland";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Friesland");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Gelderland"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Gelderland"] = "Gelderland";  
    nieuwInput.id = "fc_filterProvincie4";
    nieuwInput.value = "Gelderland";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Gelderland");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Zuid-Holland"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Zuid-Holland"] = "Zuid-Holland";
    nieuwInput.id = "fc_filterProvincie5";
    nieuwInput.value = "Zuid-Holland";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Zuid-Holland");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Limburg"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Limburg"] = "Limburg";
    nieuwInput.id = "fc_filterProvincie6";
    nieuwInput.value = "Limburg";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
    nieuwsubText      = document.createTextNode("Limburg");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);
  
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Noord-Holland"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Noord-Holland"] = "Noord-Holland";  
    nieuwInput.id       = "fc_filterProvincie7";
    nieuwInput.value    = "Noord-Holland";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
    nieuwsubText      = document.createTextNode("Noord-Holland");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);  

  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Overijssel"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Overijssel"] = "Overijssel";  
    nieuwInput.id = "fc_filterProvincie8";
    nieuwInput.value = "Overijssel";    
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
    nieuwsubText      = document.createTextNode("Overijssel");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);  

  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Groningen"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Groningen"] = "Groningen";
    nieuwInput.id = "fc_filterProvincie9";
    nieuwInput.value = "Groningen";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
    nieuwsubText      = document.createTextNode("Groningen");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);      
    
  nieuwSubContainer = document.createElement('li');
  nieuwInput        = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Utrecht"){ 
            nieuwInput.checked = "checked";                    
          }
  }
    filterTextValuesProvincie["Utrecht"] = "Utrecht";  
    nieuwInput.id = "fc_filterProvincie10";
    nieuwInput.value = "Utrecht";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
    nieuwsubText      = document.createTextNode("Utrecht");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);  

  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
  nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
    if(selectedValuesProvincie[c] == "Flevoland"){ 
      nieuwInput.checked = "true";                    
    }
  }
    filterTextValuesProvincie["Flevoland"] = "Flevoland";  
    nieuwInput.id = "fc_filterProvincie11";
    nieuwInput.value = "Flevoland";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    nieuwSubContainer.appendChild(nieuwInput);
  nieuwsubText      = document.createTextNode("Flevoland");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);  
    
  nieuwSubContainer = document.createElement('li');
  nieuwInput      = document.createElement("input");
    nieuwInput.type="checkbox";
  for(c=0; c<aantalFilterValues; ++c){
          if(selectedValuesProvincie[c] == "Zeeland"){ 
            nieuwInput.checked = "true";                    
          }
  }
    filterTextValuesProvincie["Zeeland"] = "Zeeland";  
    nieuwInput.id       = "fc_filterProvincie12";
    nieuwInput.value    = "Zeeland";
    nieuwInput.onchange = requestSpecifiekResultprovincie();  
    
    nieuwSubContainer.appendChild(nieuwInput);
    nieuwsubText      = document.createTextNode("Zeeland");  
    nieuwSubContainer.appendChild(nieuwsubText);
    container.appendChild(nieuwSubContainer);      
        locatieId     = filterId;
        filterUitklap = filterId;
  }
}
//--------------------------Results
//------------Functie
window.selectedValuesFunction = new Array();
function requestSpecifiekResultfunctie(){
  functieSelects = this;
  filterMenuLi = document.getElementById('fc_liFilterMenu1');
    filterMenuLi.style.bgcolor="red";
  i = selectedValuesFunction.length;
  b = i + 1;
  
  if(functieSelects.checked == false){ 
    removeFromArray(selectedValuesFunction,functieSelects.value); //Verwijder item van de array  
  } 
  else{
    for(a=i; a<b; ++a){
      selectedValuesFunction[a] = functieSelects.value;
    }
  }  
  requestResult();              
}

//-----------Geeft leiding
window.selectedValuesLeiding = new Array();

function requestSpecifiekResultLeiding(functieId){
  functieSelects = document.getElementById(functieId);
  i = selectedValuesLeiding.length;
  b = i + 1;
  
  if(functieSelects.checked == false){ 
    removeFromArray(selectedValuesLeiding,functieSelects.value); //Verwijder item van de array  
  } 
  else{
    for(a=i; a<b; ++a){
      selectedValuesLeiding[a] = functieSelects.value;
    } 
  }  
  requestResult();              
}

//------------Werkveld
window.selectedValuesWerkveld = new Array();
function requestSpecifiekResultwerkveld(functieId){
  werkveldSelects = document.getElementById(functieId);
  i = selectedValuesWerkveld.length;
  b = i + 1;
  
  if(werkveldSelects.checked == false){ 
    removeFromArray(selectedValuesWerkveld,werkveldSelects.value); //Verwijder item van de array  
  } 
  else{
    for(a=i; a<b; ++a){
      selectedValuesWerkveld[a] = werkveldSelects.value;
    }
  }  
  requestResult();              
}

//------------Beschikbaarheid
window.selectedValuesBeschikbaarheid = new Array();
function requestSpecifiekResultbeschikbaarheid(functieId){
  beschikbaarheidSelects = document.getElementById(functieId);

  if(beschikbaarheidSelects.id == "fc_filterBeschikbaarheid0"){
    i = selectedValuesBeschikbaarheid.length;
    for(a=0; a<i; ++a){
      if(     selectedValuesBeschikbaarheid[a] == "Lokaal"){          removeFromArray(selectedValuesBeschikbaarheid,"Lokaal"); }
      else if(selectedValuesBeschikbaarheid[a] == "Regionaal"){       removeFromArray(selectedValuesBeschikbaarheid,"Regionaal"); }
      else if(selectedValuesBeschikbaarheid[a] == "Landelijk"){       removeFromArray(selectedValuesBeschikbaarheid,"Landelijk"); }
      else if(selectedValuesBeschikbaarheid[a] == "Maakt niet uit"){  removeFromArray(selectedValuesBeschikbaarheid,"Maakt niet uit"); }
    }
  }
  i = selectedValuesBeschikbaarheid.length;
  b = i + 1;
   
  if(beschikbaarheidSelects.checked == false){   
    removeFromArray(selectedValuesBeschikbaarheid,beschikbaarheidSelects.value); //Verwijder item van de array  
  } 
  else{
    for(a=i; a<b; ++a){      
      selectedValuesBeschikbaarheid[a] = beschikbaarheidSelects.value;
      
    }
  }
  requestResult();              
}

//------------Coach
window.selectedValuesCoach = new Array();
function requestSpecifiekResultcoach(functieId){
  coachSelects = document.getElementById(functieId);
  i = selectedValuesCoach.length;
  b = i + 1;

  if(coachSelects.checked == false){ 
    removeFromArray(selectedValuesCoach,coachSelects.value); //Verwijder item van de array  
  } 
  else{
    for(a=i; a<b; ++a){
      selectedValuesCoach[a] = coachSelects.value;
    }
  }  
  requestResult();              
}

//------------Provincie
window.selectedValuesProvincie = new Array();
function requestSpecifiekResultprovincie(){
  provincieSelects = this;
  i = selectedValuesProvincie.length;
  b = i + 1;
  if(provincieSelects.checked == false){ 
    removeFromArray(selectedValuesProvincie,provincieSelects.value); //Verwijder item van de array  
  } 
  else{
    for(a=i; a<b; ++a){
      selectedValuesProvincie[a] = provincieSelects.value;
    }
  }  
  requestResult();              
}
//---------Haal de waarde van de input veld op. (naam)
window.selectedValuesNaam = new Array();
function requestNaam(){
  naamSelects  = document.getElementById('fc_filterOpNaam');  
  i           = selectedValuesNaam.length;
  b           = i + 1;
  if(naamSelects.value.length > 0){
    selectedValuesNaam[0] = naamSelects.value;

  }
  else{
    for(a=0; a<i; ++a){
      removeFromArray(selectedValuesNaam,selectedValuesNaam[a]);
    }


  }
      requestResult();          
}
