Javascript olarak;

var isActive;

window.function () {
isActive = true;
};

window.function () {
isActive = false;
};

// test
setInterval(function () {
console.log(window.isActive ? 'active' : 'inactive');
}, 1000);