window.onload = function () { var api_url = "https://captcheck.netsyms.com/api.php"; /* Add custom styles */ var styles = document.createElement('style'); /* Remove newlines/comments from captcheck.css and put it here */ styles.innerHTML = ".captcheck_box,.captcheck_label_message,.captcheck_label_message b{color:#000;font-family:Ubuntu,Arial,sans-serif}.captcheck_box{border:1px solid #e0e0e0;border-radius:3px;display:inline-block;padding:3px;margin:5px 2px 5px 1px;background-color:#f5f5f5}.captcheck_answer_label>input{visibility:hidden;position:absolute}.captcheck_answer_label>input+img{cursor:pointer;border:2px solid transparent;border-radius:3px;min-width:32px;width:18%;max-width:64px}.captcheck_answer_label>input:checked+img{cursor:pointer;border:2px solid #424242;border-radius:3px}.captcheck_error_message{color:red}.captcheck_question_image{display:initial}.captcheck_question_access{display:none}.captcheck_alt_question_button{float:right;font-size:80%;cursor:pointer;color:inherit;text-decoration:inherit}.captcheck_answer_images{display:initial}.captcheck_answer_access{display:none}"; document.body.appendChild(styles); /* Loop over all the CAPTCHA containers on the page, setting up a different CAPTCHA in each */ Array.prototype.forEach.call(document.getElementsByClassName("captcheck_container"), function (container) { var xhr = new XMLHttpRequest(); xhr.open('GET', api_url + "?action=new", true); xhr.onreadystatechange = function () { if (this.readyState == 4) { var status = this.status; var json = this.responseText; /* Create captcha div */ var captcha = document.createElement("div"); captcha.setAttribute("class", "captcheck_box"); container.appendChild(captcha); if (status == 200) { var data = JSON.parse(json); // ID prefix to use for this instance var idp = data.id_prefix; /* Create answer buttons */ var answers = "