added global timer + moved vars to dom.js