(function () {
var head = document.head;
var link = document.createElement(‘link’)
link.type = ‘text/css’;
link.rel = ‘stylesheet’;
link.href = “http://halfstaff.org/widgets/us-half-staff-flags.css”;
head.appendChild(link);
if (typeof moment === “undefined”) {
var momentjs = document.createElement(‘script’);
momentjs.src = “https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js”;
document.head.appendChild(momentjs);
}
if (!window.goToHalfstaff) {
window.goToHalfstaff = function () {
window.open(“https://accurateqc.net”, “_blank”);
};
}
var widgetRendered = false;
function loadMomentAndProceed() {
if (typeof moment === “undefined”) {
setTimeout(loadMomentAndProceed, 500);
}
else {
if (!widgetRendered) {
var widgets = document.getElementsByClassName(“halfstaffwidget_container”);
var dt = moment().format(“MMM. D, YYYY”);
var tm = moment().format(“hh:mm a”);
for(var i = 0; i < widgets.length; i++) {
widgets[i].innerHTML = "
”
+ “
”
+ “
”
+ “
“;
}
widgetRendered = true;
}
}
}
document.write(“
“);
setTimeout(loadMomentAndProceed, 500);
})();