Widget:Freetem reward

var freetemRewardDiv = null; var freetemRewardResultEl = null; function updateReward(catchRate, level) { return (20 + Math.ceil((level / catchRate) * 270)); } RLQ.push(['jquery', function {    if(document.getElementById('freetemReward')){        if (freetemRewardDiv = document.getElementById('freetemReward')) {            var catchRate = freetemRewardDiv.dataset.catchRate;            if (catchRate) {                if (catchRate == 0){                    catchRate = 200;                }                freetemRewardDiv.innerHTML = 'Level : ';                freetemRewardResultEl = document.getElementById('freetemRewardResult');                freetemRewardResultEl.innerHTML = updateReward(catchRate, 1);            }        }    } }]);