var PROJECT_LIST = [];


    PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "BMGF",
        project_collaborators : ["PSI","IPSOS"],
        project_name : "Test & Treat Men",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Rwanda",
        country_code : 'RW',
        country_id : "202",
        client : "Mastercard Foundation",
        project_collaborators : [],
        project_name : "Mastercard Foundation African Scholars Network",
        sector : "Purpose Led Cultures",
        challenge : "Leadership",
      }
    );
        PROJECT_LIST.push(
      {
        country : "United States",
        country_code : 'US',
        country_id : "20",
        client : "Medtronic Foundation",
        project_collaborators : [],
        project_name : "NCD's - The Next Decade",
        sector : "Health Systems Strengthening",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kazakhstan",
        country_code : 'KZ',
        country_id : "134",
        client : "USAID PEPFAR ",
        project_collaborators : [],
        project_name : "Central Asian HIV Assistance",
        sector : "Health Systems Strengthening",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Ethiopia",
        country_code : 'ET',
        country_id : "91",
        client : "USAID",
        project_collaborators : ["JSI"],
        project_name : "L10k",
        sector : "Health Systems Strengthening",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Congo, the Democratic Republic of the",
        country_code : 'CD',
        country_id : "72",
        client : "USAID",
        project_collaborators : ["Abt Associates"],
        project_name : "Integrated Health Project",
        sector : "Health Systems Strengthening",
        challenge : "Education, Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Mozambique",
        country_code : 'MZ',
        country_id : "170",
        client : "USAID",
        project_collaborators : ["Chemonics"],
        project_name : "RESILIM-O",
        sector : "Environment: Water & Solar ",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "USAID, PEPFAR, LEVI'S\u00ae",
        project_collaborators : ["John Hopkins","PSI","SABC"],
        project_name : "Red For Life, Scrutinize",
        sector : "Shared Value Marketing",
        challenge : "Education, Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "CIFF, Elton John Aids Foundation, UNITAID",
        project_collaborators : [],
        project_name : "HIVST For Last Mile Men",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "South Africa National Aids Council",
        project_collaborators : [],
        project_name : "I Am Responsible",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Swaziland",
        country_code : 'SZ',
        country_id : "231",
        client : "USAID",
        project_collaborators : ["Palladium"],
        project_name : "Accelerated Saturation Initative",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "USAID",
        project_collaborators : ["URC"],
        project_name : "We Beat TB",
        sector : "TB Prevention & Treatment",
        challenge : "Education",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "USAID",
        project_collaborators : ["Conrad","IDEO","Abt Associates"],
        project_name : "Project Emotion",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Desmond Tutu HIV Foundation",
        project_collaborators : ["U-Penn CHIBE","UCLA Global Health","Desmond Tutu HIV Foundation"],
        project_name : "U=U",
        sector : "HIV Prevention & Treatment",
        challenge : "Education, Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "C\u00f4te d'Ivoire",
        country_code : 'CI',
        country_id : "75",
        client : "USAID, Global Fund",
        project_collaborators : ["JSI","Palladium Group"],
        project_name : "MEASURE Evaluation",
        sector : "Health Systems Strengthening",
        challenge : "Data Capture and Usage",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Sierra Leone",
        country_code : 'SL',
        country_id : "217",
        client : "USAID",
        project_collaborators : ["JSI","FHI 360"],
        project_name : "APC (Advancing Partners & Communities)",
        sector : "Public Health Policy",
        challenge : "Health Policy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Uganda",
        country_code : 'UG',
        country_id : "249",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "Preferences: Contraceptive Injectables",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "India",
        country_code : 'IN',
        country_id : "122",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Catapult Design","PSI"],
        project_name : "Project ACTION",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Zimbabwe",
        country_code : 'ZW',
        country_id : "264",
        client : "USAID",
        project_collaborators : ["PATH"],
        project_name : "Engage HCD",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Senegal",
        country_code : 'SN',
        country_id : "214",
        client : "Open Society Foundation",
        project_collaborators : [],
        project_name : "Legal Empowerment",
        sector : "Purpose Led Cultures",
        challenge : "Strategy, Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Viet Nam",
        country_code : 'VN',
        country_id : "257",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "MAPS Potential User Design Insights",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Zimbabwe",
        country_code : 'ZW',
        country_id : "264",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "Lyndra Pill; User Design Insights",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Levi's\u00ae",
        project_collaborators : [],
        project_name : "Pioneer Nation",
        sector : "Entrepreneurship \/\u0003Small Enterprise Development",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Ethiopia",
        country_code : 'ET',
        country_id : "91",
        client : "USAID",
        project_collaborators : ["Abt Associates"],
        project_name : "SHOPS",
        sector : "Entrepreneurship \/\u0003Small Enterprise Development",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "CDC, Shout It Now",
        project_collaborators : [],
        project_name : "Tech Innovations in Community Mobile Testing",
        sector : "HIV Prevention & Treatment",
        challenge : "Education, Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Bayport MicroLending",
        project_collaborators : [],
        project_name : "Bettering",
        sector : "Purpose Led Cultures",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Tanzania",
        country_code : 'TZ',
        country_id : "237",
        client : "Devergy",
        project_collaborators : [],
        project_name : "User Interface & Communications",
        sector : "Environment: Water & Solar ",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "MTN",
        project_collaborators : [],
        project_name : "SA Music",
        sector : "Shared Value Marketing",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "United States",
        country_code : 'US',
        country_id : "20",
        client : "IAVI",
        project_collaborators : ["Routes2Results"],
        project_name : "A Walk in Ordinary Women's Shoes",
        sector : "HIV Prevention & Treatment",
        challenge : "Education",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Zambia",
        country_code : 'ZM',
        country_id : "263",
        client : "USAID",
        project_collaborators : ["JSI"],
        project_name : "APC (Advancing Partners & Communities) Sayana Press Demand Creation",
        sector : "Contraception & Family Planning",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "United States",
        country_code : 'US',
        country_id : "20",
        client : "Levi's\u00ae",
        project_collaborators : ["Levi Strauss & Co"],
        project_name : "Employee HIV Programme",
        sector : "HIV Prevention & Treatment",
        challenge : "Strategy, Education",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Swaziland",
        country_code : 'SZ',
        country_id : "231",
        client : "Wellcome Trust",
        project_collaborators : ["Quicksand Design"],
        project_name : "Clinical Trials: Epidemics & Snakebites",
        sector : "Public Health Policy",
        challenge : "Strategy, Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Wellcome Trust",
        project_collaborators : ["Quicksand Design"],
        project_name : "Youth Mental Health",
        sector : "Public Health Policy",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Zimbabwe",
        country_code : 'ZW',
        country_id : "264",
        client : "AVAC",
        project_collaborators : ["AVAC"],
        project_name : "Dual Protection Pill",
        sector : "Contraception & Family Planning",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Maverick Network",
        project_collaborators : ["PSI"],
        project_name : "PrEP for AGYW",
        sector : "HIV Prevention & Treatment",
        challenge : "Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Global",
        country_code : 'GLOBAL',
        country_id : "441",
        client : "Adidas",
        project_collaborators : [],
        project_name : "World Cup 2020",
        sector : "Shared Value Marketing",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Mastercard Foundation",
        project_collaborators : [],
        project_name : "Mastercard Foundation African Scholars Network",
        sector : "Purpose Led Cultures",
        challenge : "Leadership",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Botswana",
        country_code : 'BW',
        country_id : "51",
        client : "USAID",
        project_collaborators : ["Chemonics"],
        project_name : "RESILIM-O",
        sector : "Environment: Water & Solar ",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Brazil",
        country_code : 'BR',
        country_id : "53",
        client : "Medtronic Foundation",
        project_collaborators : [],
        project_name : "NCD's - The Next Decade",
        sector : "Health Systems Strengthening",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "United States",
        country_code : 'US',
        country_id : "20",
        client : "USAID, Global Fund",
        project_collaborators : ["JSI","Palladium Group"],
        project_name : "MEASURE Evaluation",
        sector : "Health Systems Strengthening",
        challenge : "Data Capture and Usage",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "Mastercard Foundation",
        project_collaborators : [],
        project_name : "Mastercard Foundation African Scholars Network",
        sector : "Purpose Led Cultures",
        challenge : "Leadership",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Tanzania",
        country_code : 'TZ',
        country_id : "237",
        client : "USAID",
        project_collaborators : ["JSI","FHI 360"],
        project_name : "APC (Advancing Partners & Communities)",
        sector : "Public Health Policy",
        challenge : "Health Policy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Zimbabwe",
        country_code : 'ZW',
        country_id : "264",
        client : "USAID",
        project_collaborators : ["Chemonics"],
        project_name : "RESILIM-O",
        sector : "Environment: Water & Solar ",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Medtronic Foundation",
        project_collaborators : [],
        project_name : "NCD's - The Next Decade",
        sector : "Health Systems Strengthening",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Liberia",
        country_code : 'LR',
        country_id : "145",
        client : "USAID, Global Fund",
        project_collaborators : ["JSI","Palladium Group"],
        project_name : "MEASURE Evaluation",
        sector : "Health Systems Strengthening",
        challenge : "Data Capture and Usage",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Ghana",
        country_code : 'GH',
        country_id : "104",
        client : "Mastercard Foundation",
        project_collaborators : [],
        project_name : "Mastercard Foundation African Scholars Network",
        sector : "Purpose Led Cultures",
        challenge : "Leadership",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Nigeria",
        country_code : 'NG',
        country_id : "180",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "Preferences: Contraceptive Injectables",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "USAID",
        project_collaborators : ["Chemonics"],
        project_name : "RESILIM-O",
        sector : "Environment: Water & Solar ",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "India",
        country_code : 'IN',
        country_id : "122",
        client : "Medtronic Foundation",
        project_collaborators : [],
        project_name : "NCD's - The Next Decade",
        sector : "Health Systems Strengthening",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Tanzania",
        country_code : 'TZ',
        country_id : "237",
        client : "USAID, Global Fund",
        project_collaborators : ["JSI","Palladium Group"],
        project_name : "MEASURE Evaluation",
        sector : "Health Systems Strengthening",
        challenge : "Data Capture and Usage",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Uganda",
        country_code : 'UG',
        country_id : "249",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Catapult Design","PSI"],
        project_name : "Project ACTION",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "Open Society Foundation",
        project_collaborators : [],
        project_name : "Legal Empowerment",
        sector : "Purpose Led Cultures",
        challenge : "Strategy, Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "USAID, Global Fund",
        project_collaborators : ["JSI","Palladium Group"],
        project_name : "MEASURE Evaluation",
        sector : "Health Systems Strengthening",
        challenge : "Data Capture and Usage",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Senegal",
        country_code : 'SN',
        country_id : "214",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "Lyndra Pill; User Design Insights",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Nigeria",
        country_code : 'NG',
        country_id : "180",
        client : "USAID",
        project_collaborators : ["Abt Associates"],
        project_name : "SHOPS",
        sector : "Entrepreneurship \/\u0003Small Enterprise Development",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Ghana",
        country_code : 'GH',
        country_id : "104",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Open Society Foundation",
        project_collaborators : [],
        project_name : "Legal Empowerment",
        sector : "Purpose Led Cultures",
        challenge : "Strategy, Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Uganda",
        country_code : 'UG',
        country_id : "249",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "USAID",
        project_collaborators : ["Abt Associates"],
        project_name : "SHOPS",
        sector : "Entrepreneurship \/\u0003Small Enterprise Development",
        challenge : "Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Nigeria",
        country_code : 'NG',
        country_id : "180",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Sierra Leone",
        country_code : 'SL',
        country_id : "217",
        client : "Open Society Foundation",
        project_collaborators : [],
        project_name : "Legal Empowerment",
        sector : "Purpose Led Cultures",
        challenge : "Strategy, Capacity Building",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Mozambique",
        country_code : 'MZ',
        country_id : "170",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "MAPS Potential User Design Insights",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "IAVI",
        project_collaborators : ["Routes2Results"],
        project_name : "A Walk in Ordinary Women's Shoes",
        sector : "HIV Prevention & Treatment",
        challenge : "Education",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Tanzania",
        country_code : 'TZ',
        country_id : "237",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Ghana",
        country_code : 'GH',
        country_id : "104",
        client : "Bill & Melinda Gates Foundation",
        project_collaborators : ["Routes2Results"],
        project_name : "MAPS Potential User Design Insights",
        sector : "Contraception & Family Planning",
        challenge : "User Design Preferences",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "IAVI",
        project_collaborators : ["Routes2Results"],
        project_name : "A Walk in Ordinary Women's Shoes",
        sector : "HIV Prevention & Treatment",
        challenge : "Education",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Botswana",
        country_code : 'BW',
        country_id : "51",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "South Africa",
        country_code : 'ZA',
        country_id : "18",
        client : "Wellcome Trust",
        project_collaborators : ["Quicksand Design"],
        project_name : "Clinical Trials: Epidemics & Snakebites",
        sector : "Public Health Policy",
        challenge : "Strategy, Demand Creation",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Kenya",
        country_code : 'KE',
        country_id : "135",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
        PROJECT_LIST.push(
      {
        country : "Zambia",
        country_code : 'ZM',
        country_id : "263",
        client : "Barclays Corporate Investment Bank",
        project_collaborators : [],
        project_name : "Clientcentricity",
        sector : "Purpose Led Cultures",
        challenge : "Strategy",
      }
    );
    
var COUNTRY_LIST = {
      "South Africa" : 'ZA',
      "Rwanda" : 'RW',
      "United States" : 'US',
      "Kazakhstan" : 'KZ',
      "Ethiopia" : 'ET',
      "Congo, the Democratic Republic of the" : 'CD',
      "Mozambique" : 'MZ',
      "Kenya" : 'KE',
      "Swaziland" : 'SZ',
      "C\u00f4te d'Ivoire" : 'CI',
      "Sierra Leone" : 'SL',
      "Uganda" : 'UG',
      "India" : 'IN',
      "Zimbabwe" : 'ZW',
      "Senegal" : 'SN',
      "Viet Nam" : 'VN',
      "Tanzania" : 'TZ',
      "Zambia" : 'ZM',
      "Global" : 'GLOBAL',
      "Botswana" : 'BW',
      "Brazil" : 'BR',
      "Liberia" : 'LR',
      "Ghana" : 'GH',
      "Nigeria" : 'NG',
  };


function cf_project_list__map_country_list(){

  var map_counts = {};
  map_counts['projects'] = {};
  map_counts['sectors'] = {};
  map_counts['clients'] = {};
  map_counts['collaborators'] = {};
  map_counts['challenges'] = {};
  for (var i = 0; i < PROJECT_LIST.length; i++) {
    var country_name = PROJECT_LIST[i]['country'];
    if (!(country_name in map_counts['challenges'])) {
      map_counts['projects'][country_name] = [];
      map_counts['sectors'][country_name] = [];
      map_counts['clients'][country_name] = [];
      map_counts['collaborators'][country_name] = [];
      map_counts['challenges'][country_name] = [];
    }

    if (PROJECT_LIST[i]['challenge']) {
      map_counts['challenges'][country_name].push(PROJECT_LIST[i]['challenge']);
    }

    if (PROJECT_LIST[i]['sector']) {
      map_counts['sectors'][country_name].push(PROJECT_LIST[i]['sector']);
    }

    if (PROJECT_LIST[i]['project_name']) {
      map_counts['projects'][country_name].push(PROJECT_LIST[i]['project_name']);
    }

    if (PROJECT_LIST[i]['project_collaborators']) {
      for (var key in PROJECT_LIST[i]['project_collaborators']) {
        if (PROJECT_LIST[i]['project_collaborators'].hasOwnProperty(key)) {
          var project_collaborator = PROJECT_LIST[i]['project_collaborators'][key];
          if (project_collaborator) {
            map_counts['collaborators'][country_name].push(project_collaborator);
          }
        }
      }
    }


    if (PROJECT_LIST[i]['client']) {
      map_counts['clients'][country_name].push(PROJECT_LIST[i]['client']);
    }

  }




  var s = Snap("#CFMAPSVG");
  for (var country_name in COUNTRY_LIST) {
    if (COUNTRY_LIST[country_name]!='OTHER'){
      var country = s.select('#'+COUNTRY_LIST[country_name]);
      if (country) {
        country.toggleClass('active',true);
        country.data('country_name',country_name);
        country.data('projects',map_counts['projects'][country_name].length);
        country.data('sectors',map_counts['sectors'][country_name].length);
        country.data('clients',map_counts['clients'][country_name].length);
        let collaborators_count = [...new Set(map_counts['collaborators'][country_name])].length;
        country.data('collaborators',collaborators_count);
        country.data('challenges',map_counts['challenges'][country_name].length);
        country.hover(function(){
          // console.log(this.node.getBoundingClientRect());
          var country_pos = this.node.getBoundingClientRect();
          // console.log(s.node.getBoundingClientRect());
          var map_pos = s.node.getBoundingClientRect();

          var x = Math.floor(((country_pos.x - map_pos.x + country_pos.width + 20) / map_pos.width )* 1000)/10 + '%';
          var y = Math.floor(((country_pos.y - map_pos.y + country_pos.height / 2 + 50 - 14 ) / ( map_pos.height + 100) )* 1000)/10 + '%';
          console.log(x,y,map_pos.width);

          cf_map__map_load_hover_box(x,y,this.data('country_name'),this.data('projects'),this.data('sectors'),this.data('clients'),this.data('collaborators'));
        },function(){
          cf_map__map_load_hover_box_out();
        });
      }
    }
  }

  let el = document.querySelector(".cf-map--map-container");
  let x = 0, y = 0, top = 0, left = 0;

  let draggingFunction = (e) => {
      document.addEventListener('mouseup', () => {
          document.removeEventListener("mousemove", draggingFunction);
      });

      el.scrollLeft = left - e.pageX + x;
      //el.scrollTop = top - e.pageY + y;
  };

  el.addEventListener('mousedown', (e) => {
      e.preventDefault();

      y = e.pageY;
      x = e.pageX;
      top = el.scrollTop;
      left = el.scrollLeft;

      document.addEventListener('mousemove', draggingFunction);
  });

}



function cf_project_list__add_connection($new_obj,connection_section,connection_value){
  var old_val = $new_obj.data(connection_section);
  var old_values = [];
  if (old_val) { old_values = JSON.parse(old_val); }
  old_values.push(connection_value);
  $new_obj.data(connection_section,JSON.stringify(old_values)).attr('data-'+connection_section,'"'+JSON.stringify(old_values)+'"');
}


function cf_project_list__check_selected(){

  jQuery('.cf-challenges--navigation-section-selected').each(function(){
    var $SECTION  = jQuery(this).find('.cf-challenges--navigation-section-list-item');
    if ($SECTION.length>0) {
      $SECTION.each(function(){
        var $item = jQuery(this);
        var item_id = $item.data('id');
        var section = jQuery(this).closest('.cf-challenges--navigation-section-selected').data('section');
        var $original_item = jQuery('.cf-challenges--navigation-section[data-section="'+section+'"] .cf-challenges--navigation-section-list-item[data-id="'+item_id+'"]');
        $original_item.toggleClass('selected',true);
        $item.remove();
        jQuery('.cf-challenges--navigation-section-selected[data-section="'+section+'"]').append($original_item.clone());
      });
    }
  });
}

function cf_project_list__counts_for_circles(){
  var count_countries = jQuery('.cf-challenges--navigation-section-list .cf-challenges--navigation-section-list-item.country').length - jQuery('.cf-challenges--navigation-section-list .cf-challenges--navigation-section-list-item.country[data-id="World"]').length;
  jQuery('.cf-circles--circle-number .count-countries').html(count_countries);
  var count_projects = jQuery('.cf-challenges--navigation-section-list .cf-challenges--navigation-section-list-item.project_name').length;
  jQuery('.cf-circles--circle-number .count-projects').html(count_projects);
  var count_clients = jQuery('.cf-challenges--navigation-section-list .cf-challenges--navigation-section-list-item.client').length;
  jQuery('.cf-circles--circle-number .count-clients').html(count_clients);
}


function cf_project_list__create(){
  var $COUNTRY  = jQuery('.cf-challenges--navigation-section[data-section="Country"]').find('.cf-challenges--navigation-section-list');
  var $CLIENT  = jQuery('.cf-challenges--navigation-section[data-section="Client"]').find('.cf-challenges--navigation-section-list');
  var $COLLABORATORS  = jQuery('.cf-challenges--navigation-section[data-section="Collaborators"]').find('.cf-challenges--navigation-section-list');
  var $PROJECTNAME  = jQuery('.cf-challenges--navigation-section[data-section="ProjectName"]').find('.cf-challenges--navigation-section-list');
  var $SECTOR  = jQuery('.cf-challenges--navigation-section[data-section="Sector"]').find('.cf-challenges--navigation-section-list');
  var $CHALLENGE  = jQuery('.cf-challenges--navigation-section[data-section="Challenge"]').find('.cf-challenges--navigation-section-list');


  $COUNTRY.html('');
  $CLIENT.html('');
  $COLLABORATORS.html('');
  $PROJECTNAME.html('');
  $SECTOR.html('');
  $CHALLENGE.html('');

  for (var country_name in COUNTRY_LIST) {
    if (COUNTRY_LIST.hasOwnProperty(country_name)) {
      $COUNTRY.append('<div class="cf-challenges--navigation-section-list-item country" data-id="'+country_name+'" data-cfid="'+COUNTRY_LIST[country_name]+'">'+country_name+'</div>');
    }
  }


  for (var i = 0; i < PROJECT_LIST.length; i++) {
    var $new_challenge = false;
    var $new_sector = false;
    var $new_projectname = false;
    var $new_collaborator = [];
    var $new_client = false;

    if (PROJECT_LIST[i]['challenge']) {
      if ($CHALLENGE.find('.cf-challenges--navigation-section-list-item.challenge[data-id="'+PROJECT_LIST[i]['challenge']+'"]').length>0) {
        $new_challenge = $CHALLENGE.find('.cf-challenges--navigation-section-list-item.challenge[data-id="'+PROJECT_LIST[i]['challenge']+'"]');
      } else {
        $new_challenge = jQuery('<div class="cf-challenges--navigation-section-list-item challenge" data-id="'+PROJECT_LIST[i]['challenge']+'">'+PROJECT_LIST[i]['challenge']+'</div>');
        $CHALLENGE.append($new_challenge);
      }
    }

    if (PROJECT_LIST[i]['sector']) {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'sector',PROJECT_LIST[i]['sector']); }
      if ($SECTOR.find('.cf-challenges--navigation-section-list-item.sector[data-id="'+PROJECT_LIST[i]['sector']+'"]').length>0) {
        $new_sector = $SECTOR.find('.cf-challenges--navigation-section-list-item.sector[data-id="'+PROJECT_LIST[i]['sector']+'"]');
      } else {
        $new_sector = jQuery('<div class="cf-challenges--navigation-section-list-item sector" data-id="'+PROJECT_LIST[i]['sector']+'">'+PROJECT_LIST[i]['sector']+'</div>');
        $SECTOR.append($new_sector);
      }
    } else {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'sector','NONE'); }
      if ($SECTOR.find('.cf-challenges--navigation-section-list-item.sector[data-id="'+'NONE'+'"]').length>0) {
        $new_sector = $SECTOR.find('.cf-challenges--navigation-section-list-item.sector[data-id="'+'NONE'+'"]');
      } else {
        $new_sector = jQuery('<div class="empty cf-challenges--navigation-section-list-item sector" data-id="'+'NONE'+'">'+'No Sector'+'</div>');
        $SECTOR.append($new_sector);
      }
    }


    if (PROJECT_LIST[i]['project_name']) {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'project_name',PROJECT_LIST[i]['project_name']); }
      if ($new_sector) { cf_project_list__add_connection($new_sector,'project_name',PROJECT_LIST[i]['project_name']); }
      if ($PROJECTNAME.find('.cf-challenges--navigation-section-list-item.project_name[data-id="'+PROJECT_LIST[i]['project_name']+'"]').length>0) {
        $new_projectname = $PROJECTNAME.find('.cf-challenges--navigation-section-list-item.project_name[data-id="'+PROJECT_LIST[i]['project_name']+'"]');
      } else {
        $new_projectname = jQuery('<div class="cf-challenges--navigation-section-list-item project_name" data-id="'+PROJECT_LIST[i]['project_name']+'">'+PROJECT_LIST[i]['project_name']+'</div>');
        $PROJECTNAME.append($new_projectname);
      }
    } else {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'project_name','NONE'); }
      if ($new_sector) { cf_project_list__add_connection($new_sector,'project_name','NONE'); }
      if ($PROJECTNAME.find('.cf-challenges--navigation-section-list-item.project_name[data-id="'+'NONE'+'"]').length>0) {
        $new_projectname = $PROJECTNAME.find('.cf-challenges--navigation-section-list-item.project_name[data-id="'+'NONE'+'"]');
      } else {
        $new_projectname = jQuery('<div class="empty cf-challenges--navigation-section-list-item project_name" data-id="'+'NONE'+'">'+'No Project Name'+'</div>');
        $PROJECTNAME.append($new_projectname);
      }
    }

    if (PROJECT_LIST[i]['project_collaborators']) {
      for (var key in PROJECT_LIST[i]['project_collaborators']) {
        if (PROJECT_LIST[i]['project_collaborators'].hasOwnProperty(key)) {
          var project_collaborator = PROJECT_LIST[i]['project_collaborators'][key];
          if ($new_challenge) { cf_project_list__add_connection($new_challenge,'collaborator',project_collaborator); }
          if ($new_sector) { cf_project_list__add_connection($new_sector,'collaborator',project_collaborator); }
          if ($new_projectname) { cf_project_list__add_connection($new_projectname,'collaborator',project_collaborator); }
          var $new_collab = false;
          if ($COLLABORATORS.find('.cf-challenges--navigation-section-list-item.collaborators[data-id="'+project_collaborator+'"]').length>0) {
            $new_collab = $COLLABORATORS.find('.cf-challenges--navigation-section-list-item.collaborators[data-id="'+project_collaborator+'"]');
            $new_collaborator.push($new_collab);
          } else {
            $new_collab = jQuery('<div class="cf-challenges--navigation-section-list-item collaborators" data-id="'+project_collaborator+'">'+project_collaborator+'</div>');
            $new_collaborator.push($new_collab);
          }
          $COLLABORATORS.append($new_collab);
        }
      }
    }
    if ($new_collaborator.length==0) {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'collaborator','NONE'); }
      if ($new_sector) { cf_project_list__add_connection($new_sector,'collaborator','NONE'); }
      if ($new_projectname) { cf_project_list__add_connection($new_projectname,'collaborator','NONE'); }
      var $new_collab = false;
      if ($COLLABORATORS.find('.cf-challenges--navigation-section-list-item.collaborators[data-id="NONE"]').length>0) {
        $new_collab = $COLLABORATORS.find('.cf-challenges--navigation-section-list-item.collaborators[data-id="NONE"]');
        $new_collaborator.push($new_collab);
      } else {
        $new_collab = jQuery('<div class="empty cf-challenges--navigation-section-list-item collaborators" data-id="NONE">No Collaborators</div>');
        $new_collaborator.push($new_collab);
      }
      $COLLABORATORS.append($new_collab);
    }


    if (PROJECT_LIST[i]['client']) {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'client',PROJECT_LIST[i]['client']); }
      if ($new_sector) { cf_project_list__add_connection($new_sector,'client',PROJECT_LIST[i]['client']); }
      if ($new_projectname) { cf_project_list__add_connection($new_projectname,'client',PROJECT_LIST[i]['client']); }
      if ($new_collaborator.length>0) {
        for (var j = 0; j < $new_collaborator.length; j++) {
          if ($new_collaborator[j]) { cf_project_list__add_connection($new_collaborator[j],'client',PROJECT_LIST[i]['client']); }
        }
      }
      if ($CLIENT.find('.cf-challenges--navigation-section-list-item.client[data-id="'+PROJECT_LIST[i]['client']+'"]').length>0) {
        $new_client = $CLIENT.find('.cf-challenges--navigation-section-list-item.client[data-id="'+PROJECT_LIST[i]['client']+'"]');
      } else {
        $new_client = jQuery('<div class="cf-challenges--navigation-section-list-item client" data-id="'+PROJECT_LIST[i]['client']+'">'+PROJECT_LIST[i]['client']+'</div>');
        $CLIENT.append($new_client);
      }
    } else {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'client','NONE'); }
      if ($new_sector) { cf_project_list__add_connection($new_sector,'client','NONE'); }
      if ($new_projectname) { cf_project_list__add_connection($new_projectname,'client','NONE'); }
      if ($new_collaborator.length>0) {
        for (var j = 0; j < $new_collaborator.length; j++) {
          if ($new_collaborator[j]) { cf_project_list__add_connection($new_collaborator[j],'client','NONE'); }
        }
      }
      if ($CLIENT.find('.cf-challenges--navigation-section-list-item.client[data-id="'+'NONE'+'"]').length>0) {
        $new_client = $CLIENT.find('.cf-challenges--navigation-section-list-item.client[data-id="'+'NONE'+'"]');
      } else {
        $new_client = jQuery('<div class="empty cf-challenges--navigation-section-list-item client" data-id="'+'NONE'+'">'+'No Client'+'</div>');
        $CLIENT.append($new_client);
      }
    }

    if (PROJECT_LIST[i]['country']) {
      if ($new_challenge) { cf_project_list__add_connection($new_challenge,'country',PROJECT_LIST[i]['country']); }
      if ($new_sector) { cf_project_list__add_connection($new_sector,'country',PROJECT_LIST[i]['country']); }
      if ($new_projectname) { cf_project_list__add_connection($new_projectname,'country',PROJECT_LIST[i]['country']); }
      if ($new_collaborator.length>0) {
        for (var j = 0; j < $new_collaborator.length; j++) {
          if ($new_collaborator[j]) { cf_project_list__add_connection($new_collaborator[j],'country',PROJECT_LIST[i]['country']); }
        }
      }
      if ($new_client) { cf_project_list__add_connection($new_client,'country',PROJECT_LIST[i]['country']); }
    }



  }

  jQuery('.cf-challenges--navigation-section-list-item.empty').each(function(){
    var $parent = jQuery(this).closest('.cf-challenges--navigation-section-list');
    $parent.append(jQuery(this));
  });

  cf_project_list__check_selected();
  cf_project_list__update_possibles();
  cf_project_list__counts_for_circles();
  cf_project_list__order_nav_list_items();
}

function cf_project_list__order_nav_list_items(){
  jQuery('.cf-challenges--navigation-section-list').each(function(){
    var $div_container = jQuery(this);
    var $divs = jQuery(this).find('.cf-challenges--navigation-section-list-item');
    $div_container.find('.cf-challenges--navigation-section-list-item').sort(function (a, b) {
      return jQuery(a).data('id').toLowerCase() > jQuery(b).data('id').toLowerCase() ? 1 : -1;
    }).appendTo($div_container);
  });
}


function cf_project_list__update_possibles(){
  var $COUNTRY  = jQuery('.cf-challenges--navigation-section[data-section="Country"],.cf-challenges--navigation-section-selected[data-section="Country"]').find('.cf-challenges--navigation-section-list-item');
  var $CLIENT  = jQuery('.cf-challenges--navigation-section[data-section="Client"],.cf-challenges--navigation-section-selected[data-section="Client"]').find('.cf-challenges--navigation-section-list-item');
  var $COLLABORATORS  = jQuery('.cf-challenges--navigation-section[data-section="Collaborators"],.cf-challenges--navigation-section-selected[data-section="Collaborators"]').find('.cf-challenges--navigation-section-list-item');
  var $PROJECTNAME  = jQuery('.cf-challenges--navigation-section[data-section="ProjectName"],.cf-challenges--navigation-section-selected[data-section="ProjectName"]').find('.cf-challenges--navigation-section-list-item');
  var $SECTOR  = jQuery('.cf-challenges--navigation-section[data-section="Sector"],.cf-challenges--navigation-section-selected[data-section="Sector"]').find('.cf-challenges--navigation-section-list-item');
  var $CHALLENGE  = jQuery('.cf-challenges--navigation-section[data-section="Challenge"],.cf-challenges--navigation-section-selected[data-section="Challenge"]').find('.cf-challenges--navigation-section-list-item');


  $CLIENT.toggleClass('unselectable',false);
  $COLLABORATORS.toggleClass('unselectable',false);
  $PROJECTNAME.toggleClass('unselectable',false);
  $SECTOR.toggleClass('unselectable',false);
  $CHALLENGE.toggleClass('unselectable',false);


  function check_if_unselectable(section_id,item_data_key,section_ids_to_filter){
    var $SELECTED = jQuery('.cf-challenges--navigation-section[data-section="'+section_id+'"]').find('.cf-challenges--navigation-section-list-item.selected');
    if ($SELECTED.length==0) {
      $SELECTED = jQuery('.cf-challenges--navigation-section[data-section="'+section_id+'"]').find('.cf-challenges--navigation-section-list-item:not(.unselectable)');
    }
    if ($SELECTED.length==0) {
      // no options available. // do nothing
    } else {
      for (var i = 0; i < section_ids_to_filter.length; i++) {
        var $ITEMS = jQuery('.cf-challenges--navigation-section[data-section="'+section_ids_to_filter[i]+'"],.cf-challenges--navigation-section-selected[data-section="'+section_ids_to_filter[i]+'"]').find('.cf-challenges--navigation-section-list-item');
        $ITEMS.each(function(){
          var $item_to_check = jQuery(this);
          var found = false;
          $SELECTED.each(function(){
            if ($item_to_check.data(item_data_key)) {
              var haystack = $item_to_check.data(item_data_key).split('"').join('&quot;');
              var needle = '"'+jQuery(this).data('id')+'"';
              needle = needle.split('"').join('&quot;');
              if (haystack.includes(needle)) {found=true;}
            }
          });
          if (!found) { $item_to_check.toggleClass('unselectable',true); }
        });
      }
    }
  }

  check_if_unselectable('Country','country',['Client','Collaborators','ProjectName','Sector','Challenge']);
  check_if_unselectable('Client','client',['Collaborators','ProjectName','Sector','Challenge']);
  check_if_unselectable('Collaborators','collaborator',['ProjectName','Sector','Challenge']);
  check_if_unselectable('ProjectName','project_name',['Sector','Challenge']);
  check_if_unselectable('Sector','sector',['Challenge']);


}











// END
