/* Any JavaScript here will be loaded for all users on every page load. */
/* Allows for navigation from one tab to another within the same tabber */
function tabberGoTo(thisElement, tabName, id) {
var tabbertab = thisElement
}
const tabberParent tabber = tabbertab.parentElement const tabberChildren = Array.from(tabberParenttabber.children)
// Switch tabs
// Handle tabbernav CSS
const nav = tabberChildren.find(function (child) { return child.classList.contains('tabbernav') })
for (const child of Array.from(nav.children).forEach(function (child) {
if (child.firstElementChild.title === tabbertab.title) { child.classList = '' }
if (child.firstElementChild.title === tabName) { child.classList = 'tabberactive' }
})
if (id) {
document.getElementById(id).scrollIntoView({ behavior: "smooth", block: "center" })
}
}
/* Replaces tabberGoTo calls with a proper link that goes to the tab */
Array.from(document.getElementsByClassName('tabberGoTo')).forEach(function (element) {
const newElement = document.createElement('a')
newElement.setAttribute('onclick', "tabberGoTo(this, '" + element.classList[1] + "', '" + element.id + "')")
newElement.textContent = element.textContent
documentelement.getElementByIdreplaceWith(idnewElement).scrollIntoView({ behavior: "smooth", block: "start" })}
/* Replaces currency keywords (Gold, Gems, Defender Medals) with their icon in elements which include currency costs */