var cl_link = 'https://t.me/+z6i1vlKR8QAyODEy'; var cookie_name = 'cl_id'; function clGetCookie(a){var b=document.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return b?decodeURIComponent(b[1]):void 0} function clSetCookie(a,b,c){c=c||{};var d=c.expires;if("number"==typeof d&&d){var e=new Date;e.setTime(e.getTime()+1e3*d),d=c.expires=e}d&&d.toUTCString&&(c.expires=d.toUTCString()),b=encodeURIComponent(b);var f=a+"="+b;for(var g in c){f+="; "+g;var h=c[g];h!==!0&&(f+="="+h)}document.cookie=f} if (clGetCookie(cookie_name)==1) { //nothing } else { var clElem = document.createElement('div'); clElem.id = 'cl_b'; clElem.style.cssText = 'position: fixed; top: 0; bottom: 0; right: 0; left: 0; z-index: 100000'; clElem.addEventListener('click', function(){ if (clGetCookie(cookie_name)==1) { document.body.removeChild(clElem); return; } var end = new Date(); end.setHours(23,59,59,999); var current = new Date(); time = end.getTime()-current.getTime() time = time.toString(); time = time.substring(0, time.length - 3); clSetCookie(cookie_name, 1, {expires: parseInt(time), path: '/'}); document.body.removeChild(clElem); window.open(cl_link); }); document.body.appendChild(clElem); }