function formEvents (event, e) { if (event == 'click') { if (e.target == elFormWrapper || e.target == elFormContainer) { formClose (); } } } function formShow (name) { if (name == 'registration') { elFormTitle.innerHTML = 'FREE $5 SIGN-UP BONUS'; elFormBody.innerHTML = 'bonus'; } else if (name == 'double-reward') { elFormTitle.innerHTML = 'DOUBLE REWARD!'; elFormBody.innerHTML = `Congratulations! You win ${reward} points. Watch an advertisement to double reward.
Double reward
No, thanks
`; } else if (name == 'paramining') { elFormTitle.innerHTML = 'EARN PASSIVELY 600 POINTS PER HOUR'; elFormBody.innerHTML = 'paramining'; } else if (name == 'achievements') { elFormTitle.innerHTML = 'EARN 193,000 ACHIEVEMENT POINTS'; elFormBody.innerHTML = 'bonus'; } else if (name == 'not-enough-points') { elFormTitle.innerHTML = 'NOT ENOUGH POINTS'; elFormBody.innerHTML = 'bonus'; } else if (name == 'too-fast') { elFormTitle.innerHTML = 'Oops! Too fast'; elFormBody.innerHTML = `Sorry, you are clicking too fast. You can only click once every 60 seconds. Please wait ${waitTimeout} seconds and try again.
Close
`; } else if (name == 'not-available') { elFormTitle.innerHTML = 'Not available'; elFormBody.innerHTML = `Sorry, there are no offers in your region at this time.
Close
`; } document.body.className = 'overflow-hidden'; elFormShadow.className = 'display-block'; elForm.className = 'display-block'; return false; } function formClose () { document.body.className = 'overflow-auto'; elFormShadow.className = 'display-none'; elForm.className = 'display-none'; } function formInit () { elForm = document.querySelector ('#form'); elFormShadow = document.querySelector ('#shadow'); elFormWrapper = document.querySelector ('#form .wrapper'); elFormContainer = document.querySelector ('#form .wrapper .container'); elFormTitle = document.querySelector ('#form .header .title'); elFormBody = document.querySelector ('#form .body'); window.addEventListener ('click', function (e) { formEvents ('click', e); }, false); if (localStorage.getItem ('registration') != 'true') { setTimeout (function () { formShow ('registration'); localStorage.setItem ('registration', 'true'); }, 5000); } } window.addEventListener ('load', function (event) { formInit (); }, false);