var feedPath="https://www.fau.edu/_resources/alerts/website/";function xmlToJson(xml){var obj={};if(3==xml.nodeType&&(obj=xml.nodeValue),xml.hasChildNodes())for(var i=0;i'),$('
')):($alertContainer=$(''),$('
')),$alertIcon=$('
'),$alertTitle=$('
Florida Atlantic University Alert:
'),$alertBody=$('
'+data.item.description["#text"]+"
"),$alertLink=$(''),$alertContainer.append($alertIcon).append($alertTitle).append($alertBody).append($alertLink).append($alertToggle),$alertContainer};function displayAlert(data){return"no"!=data.item.active["#text"]}$(function(){$.ajax({type:"GET",url:feedPath,cache:!1,dataType:"xml",success:function(xml){displayAlert(data=xmlToJson(xml))&&($("#oualerts-container").replaceWith(_alertTemplate(data)),$(document).on("click",".fau-alert:not(.closed) .alert-toggle button, .fau-alert.closed",function(e){e.preventDefault(),$(".fau-alert").toggleClass("closed"),$("#alert-toggle").attr("aria-expanded",function(_,attr){return!("true"==attr)}),$(".fau-alert").hasClass("closed")?($("#alert-toggle").attr("aria-label","Expand Alert Notification"),localStorage.setItem("fau-alert","closed")):($("#alert-toggle").attr("aria-label","Collapse Alert Notification"),localStorage.setItem("fau-alert","open"))}))},error:function(err){console.log("Could not retrieve alert data:",err)}})});