function getCookie2024(name) { let cookieArr = document.cookie.split(";"); for (let i = 0; i < cookieArr.length; i++) { let cookiePair = cookieArr[i].split("="); if (name === cookiePair[0].trim()) { return decodeURIComponent(cookiePair[1]); } } return null; } function checkCookie2024(name) { let cookieValue = getCookie2024(name); if (cookieValue) { return true; } else { return false; } } // setting scale function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;} function pageHeight() {return window.innerHeight != null? window.innerHeight: document.documentElement != null? document.documentElement.clientHeight: document.body.clientHeight;} pagewidth = pageWidth(); pageheight = pageHeight(); if ((pagewidth>1150) && (pageheight>630)) { js_selectedscale=6; selectedscale=6; } if (!checkCookie2024("js_hiscoresss25jun")) { set_cookie2("js_hiscoresss","17382081013455"); set_cookie2("js_hiscoresss25jun","17382081013455"); } if (!checkCookie2024("js_hiscoresss")) { set_cookie2("js_hiscoresss","17382081013455"); } // others set_cookie2("js_selectedscale","6"); set_cookie2("js_competemode","1"); js_selectedscale="6"; js_competemode="1"; selectedscale=js_selectedscale; competemode=js_competemode; js_islogin="0"; js_username=""; function set_cookie2(cookieName,cookieValue) { var today = new Date(); var expire = new Date(); expire.setTime(today.getTime() + 3600000*24*14); document.cookie = cookieName+"="+encodeURI(cookieValue) + ";expires="+expire.toGMTString()+";domain=;path=/"; } if (!checkCookie2024("js_cf_country")) { set_cookie2("js_cf_country","US"); } if (!checkCookie2024("js_cf_ip")) { set_cookie2("js_cf_ip","3.129.211.156"); } js_islogin=getCookie2024("js_islogin"); if (js_islogin==100) { document.getElementById('navbar_logged_out').style.display="none"; // document.getElementById('navbar_logged_out_mobile').style.display="none"; document.getElementById('navbar_logged_in').style.display="block"; } else // no user { // console.log("js_islogin=false"); document.getElementById('navbar_logged_out').style.display="block"; // document.getElementById('navbar_logged_out_mobile').style.display="block"; document.getElementById('navbar_logged_in').style.display="none"; } // js_username=String(get_cookie("js_username")); if (js_username) { js_username=js_username.replace("+"," "); js_username=js_username.replace("%20"," "); document.getElementById('js_username').innerHTML=js_username; } // 2022 august script to detect user // js_islogin=get_cookie("js_islogin"); // js_username=String(get_cookie("js_username")); if ((js_islogin==100) && (js_username=="foigjfoigjdfoigj" || js_username=="Hagai") ) { if (document.getElementById('can_create_category')) { document.getElementById('can_create_category').style.display="block"; } if (document.getElementById('can_delete_puzzle')) { document.getElementById('can_delete_puzzle').style.display="block"; } }