(function allSites() { function addElement(link) { if (window.location.href.indexOf(link.href) === 0) { return; } var collection; var a; collection = document.createElement('div'); a = document.createElement('a'); collection.className = "collection"; a.href = link.href; a.innerText = link.text; a.target = "_blank"; subnav.appendChild(collection); collection.appendChild(a); } var nav = document.getElementById('mainNavigation'); var folder = document.createElement('div'); var toggle = document.createElement('div'); var subnav = document.createElement('div'); folder.className = "folder"; toggle.setAttribute('data-href', '#'); toggle.innerText = 'More GoBK'; toggle.className = "folder-toggle"; subnav.className = "subnav"; var links = [{ "href": "https://www.getorganizedbk.org/", "text": "GOBK" },{ "href": "https://indivisiblenationbk.org/", "text": "Indivisible Nation BK" },{ "href": "https://www.wharr.com/", "text": "Women's Health" }]; nav.insertBefore(folder, nav.children[nav.children.length-1]); folder.appendChild(toggle); folder.appendChild(subnav); for (var x=0;x