jQuery(function($) {
	// Gestion du dropdown
	$('.js-sous-menu ul').addClass('js-hidden');
	$('.js-sous-menu').on('click','a',function(e){
		e.stopPropagation();
		var $enfant = $(this).next();
		if ($enfant.length) {
			$($enfant).toggleClass('js-hidden');
			return false;
		}
	});

    /**!
     Navigation Button Toggle class
     */
    // old browser or not ?
    if (!('querySelector' in document && 'addEventListener' in window)) {
        return;
    }
    window.document.documentElement.className += ' js-enabled';

    function toggleNav() {
        // Define targets by their class or id
        var button = document.querySelector('.nav-button');
        var target = document.querySelector('#barnav');
        // click-touch event
        if (button) {
            button.addEventListener('click',
                function (e) {
                    button.classList.toggle('is-active');
                    target.classList.toggle('is-opened');
                    e.preventDefault();
                }, false);
        }
    } // end toggleNav()
	toggleNav();


});
