(function(n){n.cookieBar=function(t,i){var u,p,l,a,v,h,y;u=t=="cookies"?"cookies":t=="set"?"set":!1;var w={message:"We use cookies to track usage and preferences.",acceptButton:!0,acceptText:"I Understand",declineButton:!1,declineText:"Disable Cookies",policyButton:!1,policyText:"Privacy Policy",policyURL:"/privacy-policy/",autoEnable:!0,acceptOnContinue:!1,expireDays:365,forceShow:!1,effect:"slide",element:"body",append:!1,fixed:!1,bottom:!1,zindex:"",redirect:String(window.location.href),domain:String(window.location.hostname),referrer:String(document.referrer)},t=n.extend(w,t),o=new Date;o.setTime(o.getTime()+t.expireDays*864e5);o=o.toGMTString();for(var c="cb-enabled={value}; expires="+o+"; path=/",r="",e,s=document.cookie.split("; "),f=0;f<s.length;f++)e=s[f].split("="),e[0]=="cb-enabled"&&(r=e[1]);if(r==""&&t.autoEnable&&(r="enabled",document.cookie=c.replace("{value}","enabled")),t.acceptOnContinue&&t.referrer.indexOf(t.domain)>=0&&String(window.location.href).indexOf(t.policyURL)==-1&&u!="cookies"&&u!="set"&&r!="accepted"&&r!="declined"&&(u="set",i="accepted"),u=="cookies")return r=="enabled"||r=="accepted"?!0:!1;if(u=="set"&&(i=="accepted"||i=="declined"))return document.cookie=c.replace("{value}",i),i=="accepted"?!0:!1;p=t.message.replace("{policy_url}",t.policyURL);l=t.acceptButton?'<a href="" class="cb-enable">'+t.acceptText+"<\/a>":"";a=t.declineButton?'<a href="" class="cb-disable">'+t.declineText+"<\/a>":"";v=t.policyButton?'<a href="'+t.policyURL+'" class="cb-policy">'+t.policyText+"<\/a>":"";h=t.fixed?t.bottom?' class="fixed bottom"':' class="fixed"':"";y=t.zindex!=""?' style="z-index:'+t.zindex+';"':"";(t.forceShow||r=="enabled"||r=="")&&(t.append?n(t.element).append('<div id="cookie-bar"'+h+y+"><p>"+p+l+a+v+"<\/p><\/div>"):n(t.element).prepend('<div id="cookie-bar"'+h+y+"><p>"+p+l+a+v+"<\/p><\/div>"));n("#cookie-bar .cb-enable").click(function(){if(document.cookie=c.replace("{value}","accepted"),r!="enabled"&&r!="accepted")window.location=t.currentLocation;else return t.effect=="slide"?n("#cookie-bar").slideUp(300,function(){n("#cookie-bar").remove()}):t.effect=="fade"?n("#cookie-bar").fadeOut(300,function(){n("#cookie-bar").remove()}):n("#cookie-bar").hide(0,function(){n("#cookie-bar").remove()}),!1});n("#cookie-bar .cb-disable").click(function(){var i=new Date;for(i.setTime(i.getTime()-864e6),i=i.toGMTString(),s=document.cookie.split("; "),f=0;f<s.length;f++)e=s[f].split("="),document.cookie=e[0].indexOf("_")>=0?e[0]+"=0; expires="+i+"; domain="+t.domain.replace("www","")+"; path=/":e[0]+"=0; expires="+i+"; path=/";if(document.cookie=c.replace("{value}","declined"),r=="enabled"&&r!="accepted")window.location=t.currentLocation;else return t.effect=="slide"?n("#cookie-bar").slideUp(300,function(){n("#cookie-bar").remove()}):t.effect=="fade"?n("#cookie-bar").fadeOut(300,function(){n("#cookie-bar").remove()}):n("#cookie-bar").hide(0,function(){n("#cookie-bar").remove()}),!1})}})(jQuery)