var home_url = 'https://hitsbay.com'; var home_dir = ''; var hb316ReviewCsrf = ""; var hb317VoteCsrf = "14bdce2b7676f992ffc52922b004953757e858d08e9c1c70"; dochref = document.location.href.substr(document.location.href.search('/')+2, 1000); if(dochref.search('/') == -1){ $thisurl = document.location.href.substr(0,document.location.href.search('/')+2) + dochref; } else { $thisurl = document.location.href.substr(0,document.location.href.search('/')+2) + dochref.substr(0, dochref.search('/')); } $thisurl = $thisurl + ''; var xmlhttp /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } catch (E) { xmlhttp=false } } @else xmlhttp=false @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest (); } catch (e) { xmlhttp = false} } function myXMLHttpRequest () { var xmlhttplocal; try { xmlhttplocal = new ActiveXObject ("Msxml2.XMLHTTP")} catch (e) { try { xmlhttplocal = new ActiveXObject ("Microsoft.XMLHTTP")} catch (E) { xmlhttplocal = false; } } if (!xmlhttplocal && typeof XMLHttpRequest != 'undefined') { try { var xmlhttplocal = new XMLHttpRequest (); } catch (e) { var xmlhttplocal = false; } } return (xmlhttplocal); } var mnmxmlhttp = Array (); var xvotesString = Array (); var mnmPrevColor = Array (); var responsestring = Array (); var myxmlhttp = Array (); var responseString = new String; function ActionConfirm(url) { if (confirm('Are you sure you want to do this action?')) window.location.href= url; } function ApproveReview(id) { if (xmlhttp) { url = "/admin_comments.php"; content = "id=" + encodeURIComponent(id) + "&action=approve&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("adminlinks-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function RemoveReview(id) { if (!confirm("Permanently remove this review?")) return; if (xmlhttp) { url = "/admin_comments.php"; content = "id=" + encodeURIComponent(id) + "&action=remove&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("adminlinks-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function ApproveSite(id) { if (xmlhttp) { url = "/admin_sites.php"; content = "id=" + encodeURIComponent(id) + "&action=approve&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("siteapprove-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function RemoveSite(id) { if (confirm('Are you sure you want to remove this site?')) if (xmlhttp) { url = "/admin_sites.php"; content = "id=" + encodeURIComponent(id) + "&action=remove&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("siteremove-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function RemoveCoupon(id) { if (confirm('Are you sure you want to remove this coupon?')) if (xmlhttp) { url = "/admin_coupons.php"; content = "id=" + encodeURIComponent(id) + "&action=remove&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("adminlinks-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function RemoveExpiredCoupons() { if (confirm('Are you sure you want to remove all expired coupons?')) if (xmlhttp) { url = "/admin_coupons.php"; content = "action=removeexpired&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("removeexpired"); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function ApproveCoupon(id) { if (xmlhttp) { url = "/admin_coupons.php"; content = "id=" + encodeURIComponent(id) + "&action=approve&csrf=" + encodeURIComponent(hb316ReviewCsrf); target = document.getElementById("adminlinks-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; target.textContent = mnmxmlhttp[0].status === 200 ? result : ("Action failed: " + result); } } } } } function RateCoupon(id, value) { if (xmlhttp) { url = "/rate_coupon.php"; content = "id=" + encodeURIComponent(id) + "&value=" + encodeURIComponent(value) + "&csrf=" + encodeURIComponent(hb317VoteCsrf); target = document.getElementById("ratecoupon-"+id); target.innerHTML = "wait..."; mnmxmlhttp[0] = new myXMLHttpRequest (); if (mnmxmlhttp) { mnmxmlhttp[0].open ("POST", url, true); mnmxmlhttp[0].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded'); mnmxmlhttp[0].send(content); mnmxmlhttp[0].onreadystatechange = function () { if (mnmxmlhttp[0].readyState == 4) { result = mnmxmlhttp[0].responseText; try { var data = JSON.parse(result.trim()); if (!data || typeof data.yes === 'undefined' || typeof data.no === 'undefined') throw new Error('Invalid vote response'); var summary = document.getElementById('coupon-vote-summary-'+id); var bar = document.querySelector('#coupon-'+id+' .coupon-vote-bar span'); if (summary) summary.innerHTML = '👍 Yes '+data.yes+'%👎 No '+data.no+'%'+data.total+' vote'+(data.total==1?'':'s')+''; if (bar) bar.style.width = data.yes+'%'; target.innerHTML = 'Thanks for voting!'; } catch(e) { target.textContent = (result || 'Unable to record your vote.'); } } } } } }