(function() { var temp = '[[218054,"www.max.com/",156085,101105873],[187101,"paramountplus.com/",156074,3065],[187146,"sling.com/",156074,14334],[196382,"elements.envato.com",156074,4662],[161439,"kobo.com",1,37217],[158514,"shop.scholastic.com",156052,8138],[212261,"www.diamondcbd.com/",24,212261],[235246,"www.chillclouds.com/",24,235246],[216108,"www.cbdmall.com/",24,216108]]'; if (temp.length != 0) { var text = temp.replace(/"/g, '\"'); text = text.replace(/\s/g, ''); text = JSON.parse(text); var flex_convert_domains = text; var flex_user_id = 1267437; var fcd_len = flex_convert_domains.length; var atags = document.getElementsByTagName("a"), len = atags.length; while (len--) { for (i = 0; i < fcd_len; i++) { var do_break = false; var domains = flex_convert_domains[i][1].split("|"); for ( j = 0; j < domains.length; j++ ) { var du = new URL("http://" + domains[j]); if ((atags[len].host == du.host || atags[len].host == 'www.' + du.host ) && (du.pathname.length <= 1 || atags[len].pathname.startsWith(du.pathname))) { atags[len]["href"] = "https://track.flexlinks.com/g.ashx?foid=" + flex_convert_domains[i][2]+ "." + flex_convert_domains[i][3] +"&trid="+flex_user_id+"."+flex_convert_domains[i][0] + "&foc=19&fot=9999&fos=6" + "&url=" + encodeURIComponent(atags[len]["href"]); do_break = true; break; } } if (do_break) { break; } } } } })();