function swapVisibility(detailsId, switchId, orderNum) { if (detailsId.style.display == "inline") { detailsId.style.display = "none"; switchId.innerText = "Show PO " + orderNum + " Details >>"; } else { detailsId.style.display = "inline"; switchId.innerText = ">> Hide PO " + orderNum + " Details"; } }