var pageNotes = [ { "id": "Alcorn", "content": "The Alcorn County health department is undergoing renovations. Please visit nearby health department location in Tishomingo or Prentiss counties.", "expires" : "12/30/2024" }, { "id": "view/download", "content": " ", "expires" : "Text must be unique, and not occur in any resource title or file name!" }, { "id": "RSSCategory-CONWeekly", "content": "357", "expires" : "the index of the category RSS Agency" }, { "id": "RSSCategory-ILIReport", "content": "357", "expires" : "index of the category RSS-Agency, where ILI reports wil appear in our RSS feed." }, { "id": "RSSCategory-PositionAvailable", "content": "357", "expires" : "index of the category RSS Agency" }, { "id": "RSSCategory-StaffAnalysis", "content": "357", "expires" : "index of the category RSS Agency" }, {"id":0}]; // Process the set of notes that we found, and check for any that may be expired. function insertAfter(existingNode, newNode) { existingNode.parentNode.insertBefore (newNode, existingNode.nextSibling); } var i; // Check each note we retrieved and include it on the page if the ID of a placeholder is found in the document for (i=0; i < pageNotes.length; i++) { if (!isExpired (pageNotes [i].expires) && document.getElementById (pageNotes [i].id)) { var destination_element = document.getElementById (pageNotes [i].id); var destination_content = destination_element.innerHTML; // Now to be clever. If there is already content in the destination, don't overwrite it; instead, put the note in immediately following it if (destination_content == "") { destination_element.innerHTML = pageNotes [i].content; } else { var note_paragraph = document.createElement("p"); var note_content = document.createTextNode(pageNotes [i].content); note_paragraph.className = "dynamicNote"; note_paragraph.appendChild (note_content); insertAfter (destination_element, note_paragraph); } } }