var jaaulde=window.jaaulde||{};jaaulde.utils=jaaulde.utils||{};jaaulde.utils.cookies=function(){var g="undefined",h="function",d=true,c="string",b="object",a=null,i,k,j,e,f={expiresAt:a,path:"/",domain:a,secure:false};i=function(e){var g,h;if(typeof e!==b||e===a)g=f;else{g={expiresAt:f.expiresAt,path:f.path,domain:f.domain,secure:f.secure};if(typeof e.expiresAt===b&&e.expiresAt instanceof Date)g.expiresAt=e.expiresAt;else if(typeof e.hoursToLive==="number"&&e.hoursToLive!==0){h=new Date;h.setTime(h.getTime()+e.hoursToLive*36e5);g.expiresAt=h}if(typeof e.path===c&&e.path!=="")g.path=e.path;if(typeof e.domain===c&&e.domain!=="")g.domain=e.domain;if(e.secure===d)g.secure=e.secure}return g};k=function(a){a=i(a);return(typeof a.expiresAt===b&&a.expiresAt instanceof Date?"; expires="+a.expiresAt.toGMTString():"")+"; path="+a.path+(typeof a.domain===c?"; domain="+a.domain:"")+(a.secure===d?"; secure":"")};j=function(){for(var i={},d,j,c,g=document.cookie.split(";"),f,e=0;e<g.length;e=e+1){d=g[e].split("=");j=d[0].replace(/^\s*/,"").replace(/\s*$/,"");try{c=decodeURIComponent(d[1])}catch(k){c=d[1]}if(typeof JSON===b&&JSON!==a&&typeof JSON.parse===h)try{f=c;c=JSON.parse(c)}catch(l){c=f}i[j]=c}return i};e=function(){};e.prototype.get=function(d){var e,h,f=j();if(typeof d===c)e=typeof f[d]!==g?f[d]:a;else if(typeof d===b&&d!==a){e={};for(h in d)if(typeof f[d[h]]!==g)e[d[h]]=f[d[h]];else e[d[h]]=a}else e=f;return e};e.prototype.filter=function(a){var b,d={},e=j();if(typeof a===c)a=new RegExp(a);for(b in e)if(b.match(a))d[b]=e[b];return d};e.prototype.set=function(i,d,e){if(typeof e!==b||e===a)e={};if(typeof d===g||d===a){d="";e.hoursToLive=-8760}else if(typeof d!==c)if(typeof JSON===b&&JSON!==a&&typeof JSON.stringify===h)d=JSON.stringify(d);else throw new Error("cookies.set() received non-string value and could not serialize.");var f=k(e);document.cookie=i+"="+encodeURIComponent(d)+f};e.prototype.del=function(e,f){var h={},g;if(typeof f!==b||f===a)f={};if(typeof e==="boolean"&&e===d)h=this.get();else if(typeof e===c)h[e]=d;for(g in h)typeof g===c&&g!==""&&this.set(g,a,f)};e.prototype.test=function(){var b=false,a="cT",c="data";this.set(a,c);if(this.get(a)===c){this.del(a);b=d}return b};e.prototype.setOptions=function(c){if(typeof c!==b)c=a;f=i(c)};return new e}();(function(){window.jQuery&&(function(d){var a="checked",c=":checkbox, :radio",b="string";d.cookies=jaaulde.utils.cookies;var e={cookify:function(e){return this.each(function(){var i,j=["name","id"],h,f=d(this),g;for(i in j)if(!isNaN(i)){h=f.attr(j[i]);if(typeof h===b&&h!==""){if(f.is(c)){if(f.attr(a))g=f.val()}else if(f.is(":input"))g=f.val();else g=f.html();if(typeof g!==b||g==="")g=null;d.cookies.set(h,g,e);break}}})},cookieFill:function(){return this.each(function(){var h,i,j=["name","id"],g,e=d(this),f;i=function(){h=j.pop();return!!h};while(i()){g=e.attr(h);if(typeof g===b&&g!==""){f=d.cookies.get(g);if(f!==null)if(e.is(c))if(e.val()===f)e.attr(a,a);else e.removeAttr(a);else if(e.is(":input"))e.val(f);else e.html(f);break}}})},cookieBind:function(a){return this.each(function(){var b=d(this);b.cookieFill().change(function(){b.cookify(a)})})}};d.each(e,function(a){d.fn[a]=this})})(window.jQuery)})();
