function poClick(p){ var pot = 'https://polarjs.net/apiJS.php?l=int&'+p+'&ts='+ new Date().getTime(); processPo(pot); } function poClickDL(p){ var pot = 'https://polarjs.net/apiJS.php?l=int&t=download&'+p+'&ts='+ new Date().getTime(); processPo(pot); } function poClickDLEnf(p){ var pot = 'https://polarjs.net/apiJS.php?l=int&t=downloadEnf&'+p+'&ts='+ new Date().getTime(); processPo(pot); } function processPo(pot) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var pit = xmlhttp.responseText; var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime); if (pit.substring(0, 4) === 'http') if (typeof window.chrome !== 'undefined') window.open(pit); else window.location.href = pit; else alert(pit); } }; xmlhttp.open('GET', pot, true); xmlhttp.send(); }