window.cpaoffer = function cpaoffer(hash) { var $lf_container = document.querySelector("[data-offers='" + hash + "']");offerList = [{"offerlink":"https://filetrkr.com/show.php?l=0&u=31502&id=11653&tracking_id=7fa7470beb761bf024ebbc52e42ef389","title":"What Is Your Favorite Energy Drink?"},{"offerlink":"https://filetrkr.com/show.php?l=0&u=31502&id=9746&tracking_id=7fa7470beb761bf024ebbc52e42ef389","title":"Get a $1000 Visa Gift Card!"},{"offerlink":"https://filetrkr.com/show.php?l=0&u=31502&id=9793&tracking_id=7fa7470beb761bf024ebbc52e42ef389","title":"Get $100 Visa Gift Card!"},{"offerlink":"https://filetrkr.com/show.php?l=0&u=31502&id=8913&tracking_id=7fa7470beb761bf024ebbc52e42ef389","title":"Get 14,500 Pokecoins for Pokemon Go!"},{"offerlink":"https://filetrkr.com/show.php?l=0&u=31502&id=7689&tracking_id=7fa7470beb761bf024ebbc52e42ef389","title":"Get the Brand New Apple Watch!"}, ];var cpa_html = '##OFFERS##'; var cpa_offer_html = '##NAME##'; var offer_html = ''; oid_array = []; if (!$lf_container) { return false; } check_credit_lf(hash); check = setInterval(function() { check_credit_lf(hash); }, 30000); var run = function() { if (Object.keys(offerList).length == 0) { $lf_container.innerHTML += ''; } else { offerList.forEach(function(offer) { offer_html += cpa_offer_html.stri_replace(['##LINK##', '##NAME##'], [offer['offerlink'], offer['title']]); oid_array.push(offer.id); }); $lf_container.innerHTML += cpa_html.stri_replace(['##OFFERS##'], [offer_html]); if (typeof lfInit === 'function') { lfInit(); } } } run(); return true; }; (function(hash){ var timer = 0; function load() { if (document.readyState==='complete' || document.readyState === 'interactive') { clearInterval(timer); cpaoffer(hash); } } timer = setInterval(load, 200); })('7fa7470beb761bf024ebbc52e42ef389'); if (typeof check_credit_lf === 'undefined') { function check_credit_lf(hash) { var r = new XMLHttpRequest(); r.open("POST", "check_lead.php", true); r.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); r.onreadystatechange = function () { if (r.readyState != 4 || r.status != 200) return true; var response = JSON.parse(r.responseText); if (response['credited'] == true) { if (response['finishing_action'] == 'redirect_url') { window.location = response['redirect_url']; } else if (response['finishing_action'] == 'show_text') { console.log('Not yet'); } else if (response['finishing_action'] == 'custom_func') { eval(response['custom_func']); } clearInterval(check); } else if (response['credits'] > 0) { console.log('Not enough convs'); } }; r.send('hash=' + hash); } } String.prototype.stri_replace = function(find, replace) { var replaceString = this; var regex; for (var i = 0; i < find.length; i++) { regex = new RegExp(find[i], "gi"); replaceString = replaceString.replace(regex, replace[i]); } return replaceString; }