(function($){$.cookieBar = function(options,val){if(options=='cookies'){var doReturn = 'cookies';}else if(options=='set'){var doReturn = 'set';}else{var doReturn = false;}var defaults = {message: "En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies pour que nous puissions réaliser des statistiques de navigation, mais aussi vous proposer des publicités ciblées adaptées à vos centres d'intérêt.
",acceptButton: true, acceptText: 'Entendu', declineButton: false, declineText: 'Disable Cookies', policyButton: true, policyText: 'En savoir plus', policyURL: '/apropos/protection-de-vie-privee-cookies', autoEnable: true, acceptOnContinue: false, expireDays: 365, forceShow: false, effect: 'slide', element: 'body', append: false, fixed: false, bottom: false, zindex: '', redirect: String(window.location.href), domain: String(window.location.hostname), referrer: String(document.referrer) };var options = $.extend(defaults,options);var expireDate = new Date();expireDate.setTime(expireDate.getTime()+(options.expireDays*24*60*60*1000));expireDate = expireDate.toGMTString();var cookieEntry = 'cb-enabled={value}; expires='+expireDate+'; path=/';var i,cookieValue='',aCookie,aCookies=document.cookie.split('; ');for (i=0;i=0 && String(window.location.href).indexOf(options.policyURL)==-1 && doReturn!='cookies' && doReturn!='set' && cookieValue!='accepted' && cookieValue!='declined'){doReturn = 'set';val = 'accepted';}}if(doReturn=='cookies'){if(cookieValue=='enabled' || cookieValue=='accepted'){return true;}else{return false;}}else if(doReturn=='set' && (val=='accepted' || val=='declined')){document.cookie = cookieEntry.replace('{value}',val);if(val=='accepted'){return true;}else{return false;}}else{var message = options.message.replace('{policy_url}',options.policyURL);if(options.acceptButton){var acceptButton = ''+options.acceptText+'';}else{var acceptButton = '';}if(options.declineButton){var declineButton = ''+options.declineText+'';}else{var declineButton = '';}if(options.policyButton){var policyButton = ''+options.policyText+'';}else{var policyButton = '';}if(options.fixed){if(options.bottom){var fixed = ' class="fixed bottom"';}else{var fixed = ' class="fixed"';}}else{var fixed = '';}if(options.zindex!=''){var zindex = ' style="z-index:'+options.zindex+';"';}else{var zindex = '';}if(options.forceShow || cookieValue=='enabled' || cookieValue==''){if(options.append){$(options.element).append(' ');}else{$(options.element).prepend(' ');}}$('#cookie-bar .cb-enable').click(function(){document.cookie = cookieEntry.replace('{value}','accepted');if(cookieValue!='enabled' && cookieValue!='accepted'){window.location = options.redirect;}else{if(options.effect=='slide'){$('#cookie-bar').slideUp(300,function(){$('#cookie-bar').remove();});}else if(options.effect=='fade'){$('#cookie-bar').fadeOut(300,function(){$('#cookie-bar').remove();});}else{$('#cookie-bar').hide(0,function(){$('#cookie-bar').remove();});}return false;}});$('#cookie-bar .cb-disable').click(function(){var deleteDate = new Date();deleteDate.setTime(deleteDate.getTime()-(864000000));deleteDate = deleteDate.toGMTString();aCookies=document.cookie.split('; ');for (i=0;i=0){document.cookie = aCookie[0]+'=0; expires='+deleteDate+'; domain='+options.domain.replace('www','')+'; path=/';}else{document.cookie = aCookie[0]+'=0; expires='+deleteDate+'; path=/';}}document.cookie = cookieEntry.replace('{value}','declined');if(cookieValue=='enabled' && cookieValue!='accepted'){window.location = options.redirect;}else{if(options.effect=='slide'){$('#cookie-bar').slideUp(300,function(){$('#cookie-bar').remove();});}else if(options.effect=='fade'){$('#cookie-bar').fadeOut(300,function(){$('#cookie-bar').remove();});}else{$('#cookie-bar').hide(0,function(){$('#cookie-bar').remove();});}return false;}});$('#close_cookie_bar').click(function(){$('#cookie-bar').remove();});}};})(jQuery);