var fl_cookie_html =""; // Number of days before the cookie expires, and the banner reappears var fl_cookie_cookieDuration = 30; // Name of our cookie var fl_cookie_cookieName = 'complianceCookie'; var fl_cookie_cookieValue = 'Notice Given'; function fl_cookie_cookieLoad(func){ var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } function fl_cookie_initial(){ if (fl_cookie_checkCookie(fl_cookie_cookieName) != fl_cookie_cookieValue) { var elem = document.createElement('div'); elem.innerHTML =fl_cookie_html; /// shows warning once then not again document.body.appendChild(elem); document.getElementById('fl_banner').style.display = "block"; fl_cookie_createCookie(); } }; function fl_cookie_closeBanner() { document.getElementById('fl_banner').style.display = "none"; } function fl_cookie_createCookie() { var date = new Date(); date.setTime(date.getTime() + (fl_cookie_cookieDuration*24*60*60*1000)); var expires = "; expires=" + date.toGMTString(); document.cookie = fl_cookie_cookieName + "=" + fl_cookie_cookieValue + expires + "; path=/"; } function fl_cookie_checkCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } fl_cookie_cookieLoad(fl_cookie_initial);