window.addEventListener('load', () => {
 //  mobHamburger();
});


function mobHamburger(){

  
   var wys=   document.querySelector('.container-top .mod-custom:nth-child(2)').offsetHeight;
   var wys1=   document.querySelector('.container-top .custom').offsetHeight;
   console.log('wysokosc zdjęcia '+wys1)
    document.querySelector('[data-id="mobilemenuck-115"] .mobilemenuck-bar-button').addEventListener('click', () => {

  if(screen.width<420){

    document.querySelector('#mobilemenuck-115-mobile').style.setProperty('top','15%');

    document.querySelector(' .container-menu').style.setProperty('right','0');
    document.querySelector(' .container-menu').style.setProperty('top','0');
    document.querySelector(' .container-menu').style.setProperty('width','100%');
    document.querySelector(' .container-menu').style.setProperty('z-index','20');
    document.querySelector('  #mobilemenuck-115-wrap').style.setProperty('width','100%');
    document.querySelector(' #mobilemenuck-115-wrap').style.setProperty('position','absolute');
    document.querySelector(' #mobilemenuck-115-wrap').style.setProperty('height',wys+'px');
  
  }
  if(screen.width>420){

    document.querySelector('#mobilemenuck-115-mobile').style.setProperty('top','15%');

    document.querySelector(' .container-menu').style.setProperty('right','0');
    document.querySelector(' .container-menu').style.setProperty('top','0');
    document.querySelector(' .container-menu').style.setProperty('width','100%');
    document.querySelector(' .container-menu').style.setProperty('z-index','20');
    document.querySelector('  #mobilemenuck-115-wrap').style.setProperty('width','100%');
    document.querySelector(' #mobilemenuck-115-wrap').style.setProperty('position','absolute');
    document.querySelector(' #mobilemenuck-115-wrap').style.setProperty('height',wys1+'px');
  
  }



 document.querySelector('[data-id="mobilemenuck-115"] .mobilemenuck-button').addEventListener('click', () => {
    document.querySelector(' .container-menu').style.removeProperty('z-index');
    document.querySelector(' .container-menu').style.removeProperty('right');
    document.querySelector(' .container-menu').style.removeProperty('top');
    document.querySelector(' .container-menu').style.removeProperty('width');
    document.querySelector('  #mobilemenuck-115-wrap').style.removeProperty('width');
    document.querySelector('  #mobilemenuck-115-wrap').style.removeProperty('position');
    document.querySelector('  #mobilemenuck-115-wrap').style.removeProperty('height');
 })



    })
    document.querySelectorAll('#mobilemenuck-115-wrap .nav-item').forEach(icons => {
        if(icons.innerHTML.includes('togglericon')){
         icons.parentNode.firstChild.innerHTML=icons.parentNode.firstChild.innerHTML+'<div class="mobilemenuck-togglericon"><img class="mobilemenuck-togglericon" style="width:10px !important;height:10px !important;margin-left:4px;;" src="/images/stronaGlowna/Chevron_Right.png"/></div>';
        }
    })

    document.querySelectorAll('.mobilemenuck-togglericon').forEach(im => {
        im.addEventListener('click', () => {
            console.log('kliknięto iconkę' );
                    im.parentNode.classList.toggle('open');
                    im.parentNode.lastChild.classList.toggle('tras')
                    im.parentNode.parentNode.lastChild.classList.toggle('dblock');

        })
    })

   
 
}