(function(A){window.vBulletin=window.vBulletin||{};vBulletin.hv=vBulletin.hv||{};vBulletin.hv.reset=function(B){var C;if($(".humanverify.humanverify_image").length>0){$(".humanverify.humanverify_image .refresh_imagereg").click();C=$(".humanverify.humanverify_image .imageregt")}else{if($(".humanverify.humanverify_recaptcha").length>0&&Recaptcha&&typeof Recaptcha.reload=="function"){Recaptcha.reload()}else{if($(".humanverify.humanverify_question").length>0){$.ajax({url:pageData.baseurl+"/index.php/ajax/render/humanverify",type:"post",dataType:"json",success:function(D){$(".humanverify.humanverify_question").replaceWith(D);$(".humanverify.humanverify_question .answer").focus()}});C=$(".humanverify.humanverify_question .answer")}}}if(B&&C&&C.length>0){C.focus()}};vBulletin.hv.imagereg=vBulletin.hv.imagereg||{};vBulletin.hv.imagereg.init=function(){$(".humanverify_image").each(function(){var B=$(this);$(".refresh_imagereg",B).click(B,vBulletin.hv.imagereg.fetch_image);$(".imagereg",B).click($(B,vBulletin.hv.imagereg.fetch_image));$(".refresh_imagereg",B).removeClass("hide")})};vBulletin.hv.imagereg.fetch_image=function(C){var B=C.data;$(".progress_imagereg",B).removeClass("hide");$.ajax({url:pageData.baseurl+"/index.php/ajax/api/hv/generateToken",type:"post",dataType:"json",success:function(D){if(!D.errors){var E=D.hash;$("input.hash",B).val(E);$(".imagereg",B).attr("src",pageData.baseurl+"/hv/image?hash="+E);$(".imageregt",B).val("")}},complete:function(){$(".progress_imagereg",B).addClass("hide")}});return false};$(document).ready(function(){vBulletin.hv.imagereg.init()})})(jQuery);