function setCookie(o,e,t){var c=new Date;c.setTime(c.getTime()+864e5*t),document.cookie=o+"="+e+";path=/;expires="+c.toGMTString()}function deleteCookie(o){setCookie(o,"",-1)}function getCookie(o){var e=document.cookie.match("(^|;) ?"+o+"=([^;]*)(;|$)");return e?e[2]:null}$(document).ready(function(){var o=$("html");$(".focus-search-advanced").on("click",function(){o.toggleClass("focus-search-menu-active")}),$(".focus-search-flex input").on("focus",function(){o.addClass("focus-search-menu-active")}),$(document).on("click",function(){o.removeClass("focus-search-menu-active")}),$(".focus-wrap-search").on("click",function(o){o.stopPropagation()}),$("[data-xenfocus-editor]").on("click",function(e){o.toggleClass("focus-editor-open"),e.preventDefault()}),$(document).keyup(function(e){27===e.keyCode&&o.removeClass("focus-editor-open")}),$(".focus-picker span").on("click",function(){var e=o.attr("data-style-id"),t=$(this).attr("data-focus-bg");o.attr("data-focus-bg",""+t),setCookie("xenfocusBackground-"+e,""+t,365)}),$(".focus-editor-panel").each(function(){var e=$(this).attr("data-toggle-class"),t=$(this).attr("data-default"),c=getCookie(e);"on"===c?($(this).find("#"+e+"-on").attr("checked",""),console.log("Cookie for "+e+": on")):"off"===c?($(this).find("#"+e+"-off").attr("checked",""),console.log("Cookie for "+e+": off")):"on"===t?($(this).find("#"+e+"-on").attr("checked",""),console.log("No cookie for "+e+", but it is on by default")):($(this).find("#"+e+"-off").attr("checked",""),console.log("No cookie for "+e+", but it is off by default")),$('.focus-editor-panel[data-toggle-class="'+e+'"] input').on("click",function(){$(this).attr("id")===e+"-on"?(o.addClass(e),setCookie(e,"on",365)):(o.removeClass(e),setCookie(e,"off",365))})})});