I have a script in (using wordpress) header.php which looks like this:

```
window.addEventListener("DOMContentLoaded", function(event) {
  fixedMenu.init("header-container", 0);
  fixedMenu.init("event-type-wrapper", 20);
  window.addEventListener('scroll', function(fid){
    fixedMenu.top("header-container");
    fixedMenu.top("event-type-wrapper");
  });
  var sessionvar = "<?php echo $_SESSION['lang'] ?>";
});

```

after this script I include a longer one script with the script scr="" tag.

In that script I have

```
window.addEventListener("DOMContentLoaded", function(event) {
    todays = document.getElementById("todays-events");
    upcomming = document.getElementById("upcomming-events");
    past = document.getElementById("past-events");
    texter = document.getElementById("event-type");

    changeMessage();
});

```

It works fine in any webkit browser, the code is launched, but firefox doesn't load second event listener (I do not know how to debug if it loads or not, but I don't see result in the webpage).

Any ideas?

**UPDATE**

If there is need, here is the full source for the script embedded through script src=

```
var todays;
var upcomming;
var past;
var texter;

window.addEventListener("DOMContentLoaded", function(event) {
    todays = document.getElementById("todays-events");
    upcomming = document.getElementById("upcomming-events");
    past = document.getElementById("past-events");
    texter = document.getElementById("event-type");

    changeMessage();
});

window.onscroll = function(){
  changeMessage();
}

function isElementInViewport (el) {
  var rect = el.getBoundingClientRect();

  return (
    rect.top >= 0 &&
    rect.left >= 0 &&
    rect.bottom <= document.body.scrollHeight &&
    rect.right <= (window.innerWidth || document.documentElement.clientWidth)
  );
}

function changeMessage(){
  if(texter && todays && isElementInViewport(todays)){
    texter.textContent = returnString("Šiandien", "Today", "Сегодня");
  }
  else {
    if(texter && upcomming && isElementInViewport(upcomming)){
        texter.textContent = returnString("Artėjantys","Upcomming","Предстоящие");
    }
    else{
        if(texter && past && isElementInViewport(past)){
            texter.textContent = returnString("Praėję", "Past", "Прошлое");
        }
    }
  }
}

function returnString(lt, en, ru){
  if (!(typeof sessionvar === 'undefined')) {
    if(sessionvar == 'en_EN'){
        return en;
    }
    else if(sessionvar == 'ru_RU'){
        return ru;
    }
  }
  return lt;
}

```