var cookieValue = getCookie('suppressreviews'); if(cookieValue!=1) { var numb1 = 0; var timeout = 14000; var action = function() { numb1 = numb1 + 1; if(numb1>20) { numb1 = 1; } $('.review-olay'+numb1).fadeIn(2000).delay(10000).fadeOut(1000); setTimeout(action, timeout); }; action(); function hidereviews() { $('.reviewolay').remove(); setCookie('suppressreviews', '1'); } } function setCookie(key, value) { var expires = new Date(); expires.setTime(expires.getTime() + (.025 * 24 * 60 * 60 * 1000)); document.cookie = key + '=' + value + ';expires=' + expires.toUTCString(); } function getCookie(key) { var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)'); return keyValue ? keyValue[2] : null; }