// Define an object that maps states to their respective local governments
const parish = {
  "Agege Deanery": [
    "Catholic Church of The Presentation (CCP) Abulegba.",
    "Mary Mother of God Police Chaplaincy Elere Agege",
    "Our Lady Health of the Sick (OLHS) Mangoro.",
    "St. Catherine Alakuko.",
    "St. Charles Lwanga, Orile Agege.",
    "St. Christopher Ijaiye.",
    "St. Christopher Oke-odo.",
    "St. Cyprian's Catholic Church Oko - Oba",
    "St. Kizito Iju.",
    "St. Raphael Ajegunle.",
    "St. Rita Obadeyi.",
    "St. Sabina Idimangoro.",
    "St. Theresa Ifako.",
    "St. Thomas Onilekere."
  ],
  "Apapa Deanery": [
    "CKC Old Ojo Road",
    "Our Lady of Lourdes Coker",
    "Sacred Heart Apapa",
    "St Charles, Olodi Apapa",
    "St. Joseph Kirikiri Town",
    "St. Kizitos Alaba Oro",
    "St. Margaret Osho Drive Olodi",
    "St. Marys Ajengunle",
    "St. Matthew Amukoko",
    "St. Vincent Olodi Apapa"
  ],
  "Ajah Deanery": [
    "Good Shepherd Moba",
    "ICCC Ira Nla",
    "OLMPH Ajah",
    "OLMQ Badore",
    "OLMR Ogombo",
    "St Peter’s Langbasa",
    "St. Athanasius Okera Kekere"
  ],
  "Badagry Deanery": [
    "Holy Family Ajara",
    "Sacred Heart Badagry",
    "St. Joseph Aradagun",
    "St. Leos Ikoga Zogbe Badagry",
    "St Mark Catholic Church Age Muwo",
    "St. Francis Apa"
  ],
  "Epe Deanery": [
    "Catholic church of Annunciation, Abraham Adesanya.",
    "Catholic Church of the Assumption, Awoyaya",
    "Immaculate Conception, Ibowon",
    "Our Lady Mother of Mercy Abijo",
    "Our Lady of the holy rosary, Ibeju Agbe.",
    "Our Lady Queen of Apostles, Lakowe.",
    "Regina Caeli Bogije",
    "Regina pacis Catholic church, Sangotedo.",
    "St. Pio Ayeteju",
    "St. Theresa Catholic church, Epe."
  ],
  "Festac Deanery": [
    "Church of Annunciation",
    "Church of Nativity",
    "Church of Presentation",
    "Church of Visitation",
    "Holy Family Festac Town",
    "Our Lady of Perpetual Help Amuwo Odofin",
    "Our Lady Seat of Wisdom Okota",
    "St. Cyril Okota",
    "St. Joseph Abule Ado",
    "St. Monica Mazamaza",
    "St. Stephen Agboju",
    "CKC Canal Estate"
  ],
  "Iba Deanery": [
    "Church of Assumption Igbo Elerin",
    "Hilda Obadore",
    "Immaculate Heart Iba",
    "Madonna Catholic Church Egan Igando",
    "Our Lady Help of Christians, Iba.",
    "Ss. Joachim & Anne, Ijegun",
    "Ss. Timothy & Titus Isheri Oshun",
    "St. Augustine Iba",
    "St. John Igando",
    "St. Joseph Agodo Egbe",
    "St. Joseph Iba",
    "St. Maria Goretti Abaranje",
    "St. Rita Akesan",
    "St. Stephen Pacific Estate",
    "St. Stephen Whitesand",
    "St Margaret Mary Alacoque, Okerube"
  ],
  "Ijanikin Deanery": [
    "Blessed Tansi Magbon",
    "Holy Spirit Ayetoro",
    "Ss. Perpetual & Felicity Abule Era",
    "St. Anthony Era",
    "St. Augustine Morogbo",
    "St. Cecilia Ijanikin",
    "St. Lucy Ibiye",
    "St. Michael Ilogbo Eremi"
  ],
  "Ijede Deanery": [
    "Catholic Church of Blessed Virgin Mary Elepe",
    "CCCC Egbin",
    "Divine Mercy Ijede Road",
    "Holy Trinity Ewuowa",
    "Immaculate Heart Maya",
    "Our Lady of Fatima Adamo",
    "St. Andrews Itamope",
    "St. Catherine Offin",
    "St. Monica Igbogbo",
    "St. Peters Agbowa",
    "St. Timothy Bayeku",
    "St. Timothy Agura",
    "St Daniel, Isiu",
    "St. Jude, Agunfoye",
    "All Saints, Imota"
  ],
  "Ikeja Deanery": [
    "Catholic Church of the Holy Spirit Omole",
    "OLHR Ogba",
    "St. Francis Oregun",
    "St. Jude Mafoluku",
    "St. Leo Ikeja",
    "St. Peter Claver Ajao Estate",
    "St. Timothy Ojodu",
    "Church of Presentation, G.R.A",
    "St John The Evangelist, Ladipo Oshodi",
    "Church of Ascension, Airport Road",
    "St. Anthony Police Chaplaincy, Ikeja",
    "St. Augustine Chaplaincy, Air Force Base Ikeja",
    "St. Martin De Porres, NAFRC, Oshodi"
  ],
  "Ilemba Deanery": [
    "CKC Sabo",
    "Holy Redeemer, Shibiri",
    "Ss. Cosmas & Damian Ilogbo",
    "St. Andrews Ilemba",
    "St. Gerald Majella Jakande",
    "St. John Ilufe",
    "St. Joseph Ketu"
  ],
  "Ikorodu Deanery": [
    "Archangels Agbede",
    "Good Shepherd, Owode Onirin",
    "Our Lady Queen of Peace, Odonla Ikorodu",
    "Sacred Heart, Odogunyan",
    "St. Anne, Odokekere Ikorodu",
    "St. Augustine Ikorodu",
    "St. Joseph Ishawo",
    "St. Michael Ajaguro Ikorodu",
    "St. Patrick Owode Ibeshe Ikorodu",
    "St Jude Thaddeus Eruwen",
    "St Anthony Mary Claret",
    "St Anthony Igbo-Olomu",
    "St Paul Muti"
  ],
  "Ipaja Deanery": [
    "CCA, Ishefun",
    "CKC Akonwonjo",
    "Our Lady of Perpetual Help Shasha",
    "SS. Joachim & Ann, Meiran",
    "SS. Peter & Paul, Baruwa",
    "St. Alphonsus, Aboru",
    "St. Anthony Agbelekale",
    "St. Anthony, AIT Road, Alagbado",
    "St. Ferdinand, Boys' Town",
    "St. Joseph Gowon Estate",
    "St. Louis, Egbeda",
    "St. Patrick Igbogila",
    "St. Pius, Ayobo",
    "Church of Transfiguration, Ikola"
  ],
  "Isolo Deanery": [
    "Church of Annunciation Orioke",
    "Holy Rosary Arida",
    "Jesus the Savior Bucknor",
    "Ss. Peter & Paul Oke Afa",
    "St Francis Idimu",
    "St. Lawrence Isheri Olofin",
    "St. Lawrence Paiko Idimu",
    "St. Mary Isolo",
    "St. Peters Ejigbo"
  ],
  "Lagos Island Deanery": [
    "Church of Assumption Falomo",
    "Holy Cross Cathedral",
    "St. Charles Borromeo 1004 V. I.",
    "St. Joseph Elegbeta",
    "St. Michael Lafiaji",
    "St. Peters Obalende",
    "Our Lady of Perpetual Help Musa Yaradua",
    "St. Patrick Idumagbo"
  ],
  "Lekki Deanery": [
    "Ave Maria Catholic Church Ikate, Lekki",
    "Church of Epiphany Ologolo",
    "Divine Mercy Lekki",
    "Our Lady Star of the Sea Northern Foreshore",
    "Ss. Philips & James Lekki",
    "St. Theresa Ikota",
    "Stella Maris Catholic Church, Okun-Ajah",
    "The Church of Pentecost Ilasan, Lekki",
    "Transfiguration VGC"
  ],
  "Maryland Deanery": [
    "Catholic church of presentation Agiliti Mile 12.",
    "CCOR Magodo",
    "Church of Presentation Ketu",
    "OLQOP Ifako Gbagada",
    "Sacred Heart Ojota",
    "St. Agnes Maryland",
    "St. Benjamin Olowora",
    "St. Charles Lwanga Cantonment Ikeja",
    "St. Flavius Oworonshoki",
    "St. Gerald Soluyi",
    "St. Michael Ketu",
    "St. Raphael Anthony Village"
  ],
  "Satellite Deanery": [
    "Archangels Parish Satellite Town",
    "Holy Spirit Onireke",
    "Holy Trinity Isashi",
    "MOPH Ijegun",
    "CCOR Ijegun",
    "Queen of All Saints Adaloko",
    "Ss. Peter & Paul Tedi",
    "St. Alphonsus Ira Ojo",
    "St. Anne PPL",
    "St. Martin Agric",
    "St. Patrick Alaba",
    "St. Thomas Aquinas Okoko",
    "St Anthony Okoko"
  ],
  "Surulere Deanery": [
    "CKC Ilasamaja",
    "OLF Aguda",
    "OLQA Ilupeju",
    "QMHR Sanya",
    "Regina Mundi Mushin",
    "Ss. Mulumba & David Lawanson",
    "St. Anne Itire",
    "St. Anthony Gbaja",
    "St. Brigid Ijesha",
    "St. Pio Orile",
    "OLA Kilo"
  ],
  "Yaba Deanery": [
    "Queen of Nigeria Clegg Street",
    "Ss. Peter & Paul Shomolu",
    "St. Augustine Akoka",
    "St. Denis Bariga",
    "St. Dominic Yaba",
    "St. Paul Ebutte Meta",
    "St. Stephens Onike Iwaya",
    "St. Gabriel Ladi Lak, Bariga",
    "St. Mary's Marywood, Ebute-Meta"
  ]
};


// You can add more states and their local governments if needed

function populateparish() {
  const deanarySelect = document.getElementById("input_10");
  const parishSelect = document.getElementById("input_13");
  const selectedDeanary = deanarySelect.value;

  // Clear the current options in the local government select
  parishSelect.innerHTML =
    '<option value="">Select Parish</option>';

  // Check if a state is selected
  if (selectedDeanary) {
    // Get the local governments for the selected state
    const deaneryparish = parish[selectedDeanary];

    // Populate the local government select with options
    deaneryparish.forEach((parishname) => {
      const option = document.createElement("option");
      option.value = parishname;
      option.textContent = parishname;
      parishSelect.appendChild(option);
    });
  }
}